-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bench] enable mlir benchmark #106
Conversation
Co-authored-by: Petr Kurapov <petr.a.kurapov@intel.com>
Co-authored-by: Petr Kurapov <petr.a.kurapov@intel.com>
linalgx bindings code was removed now |
@kurapov-peter @Menooker @ZhennanQin @ciyongch hi, could you help to review the changes since last time? @WangJialei-A 's validation PR #161 is blocked now, let's get this merged first. |
python/config.py.in
Outdated
@@ -0,0 +1,2 @@ | |||
MLIR_C_RUNNER_UTILS = "@MLIR_DIR@/../../libmlir_c_runner_utils.so" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not a good solution for Windows platform. Please try platform platform-independent solution.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @ZhennanQin . Actually there are some examples in our repo for python binding .py.in
to generate file names with OS-specific extension names. Also @MLIR_DIR@/../../
seems fragile. I think we have already exposed this directory somewhere in .py.in
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
my laptop has a problem now, I will fix this as soon as it returns to normal. I am trying to change it with os.path
to implement platform-independent.
@Menooker we do have that exposed but it was in the test dir for lit config, I can not use that from here.
I also noticed that we have something like the following in other .py.in
, should change it to the solution with os.path
?
lit_config.load_config(config, "@PROJECT_SOURCE_DIR@/test/mlir/test/lit.cfg.py")
...
config.substitutions.append(("%gclibdir", config.gc_obj_root + "/lib/"))
...
@@ -0,0 +1,8 @@ | |||
import os | |||
|
|||
MLIR_C_RUNNER_UTILS = os.path.normpath( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be better to just register a folder path here, maybe MLIR_SHARED_LIB_PATH
, and then in the graph_compiler.py file
, you can search the lib name in an OS independent way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed this with similar way in lit.site.cfg.py
, but we can not get the SHLIBEXT
value which defined in configure_lit_site_cfg
, according to the source code we can use LTDL_SHLIB_EXT
https://github.com/llvm/llvm-project/blob/109b50808f72c228518766c3b384dd14e0dcf4ee/llvm/cmake/modules/AddLLVM.cmake#L1841-L1854
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can set mlir_runner_utils_dir to @MLIR_RUNNER_UTILS_DIR@
for our lit.site.cfg.py.in
. Can we use that cmake variable too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tried and we can not get the @MLIR_RUNNER_UTILS_DIR@
from here, not in the same scope.
Enable benchmark and tuning from python
trace: #57
There are still some features that will be implemented when integrated into the PR of benchgc #161 ,such as data filling, customize pass pipeline.
Please read this if you need to use this benchmark and tuner tools.
https://github.com/intel/graph-compiler/blob/xurui/add_benchmark/tools/README.md