-
Notifications
You must be signed in to change notification settings - Fork 128
Update rocMLIR integration API to version 5 (perfConfig, cluster size) #4761
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
base: develop
Are you sure you want to change the base?
Changes from 6 commits
fa6ce8a
487d134
a991bd2
3033ef0
9f30552
84b877e
817ab6b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -36,6 +36,7 @@ | |||||
| #include <mlir-c/Dialect/RockEnums.h> | ||||||
| #include <numeric> | ||||||
| #include <ostream> | ||||||
| #include <tuple> | ||||||
|
|
||||||
| #ifdef MIGRAPHX_MLIR | ||||||
| #include <mlir-c/IR.h> | ||||||
|
|
@@ -48,8 +49,8 @@ | |||||
| #include <mlir-c/Pass.h> | ||||||
| #include <mlir-c/Support.h> | ||||||
| #include <mutex> | ||||||
| #if !defined(MLIR_MIGRAPHX_DIALECT_API_VERSION) || MLIR_MIGRAPHX_DIALECT_API_VERSION != 4 | ||||||
| #if !defined(MLIR_MIGRAPHX_DIALECT_API_VERSION) || MLIR_MIGRAPHX_DIALECT_API_VERSION != 5 | ||||||
| #warning "Incompatible version of rocMLIR library used, disabling" | ||||||
|
Check warning on line 53 in src/targets/gpu/mlir.cpp
|
||||||
| // Only undefine when not using cppcheck | ||||||
| #ifndef CPPCHECK | ||||||
| #undef MIGRAPHX_MLIR | ||||||
|
|
@@ -639,13 +640,13 @@ | |||||
| auto ops = create_operation_state("func.func"); | ||||||
| ops.add_attributes({{"function_type", make_function_type(input_shapes, outputs)}, | ||||||
| {"sym_name", sym_name}, | ||||||
| {"kernel", std::string("mixr")}, | ||||||
| {"arch", target_arch}, | ||||||
| {"num_cu", num_cu}, | ||||||
| {"num_chiplets", num_chiplets}}); | ||||||
| {"rock.kernel", std::string("mixr")}, | ||||||
| {"rock.arch", target_arch}, | ||||||
| {"rock.num_cu", num_cu}, | ||||||
| {"rock.num_chiplets", num_chiplets}}); | ||||||
| if(enabled(MIGRAPHX_MLIR_ENABLE_SPLITK{})) | ||||||
| { | ||||||
| ops.add_attributes({{"enable_splitk_for_tuning", mlirUnitAttrGet(ctx.get())}}); | ||||||
| ops.add_attributes({{"rock.enable_splitk_for_tuning", mlirUnitAttrGet(ctx.get())}}); | ||||||
| } | ||||||
| ops.add_region(std::move(region)); | ||||||
| insert(body, std::move(ops)); | ||||||
|
|
@@ -912,10 +913,14 @@ | |||||
| } | ||||||
| } | ||||||
|
|
||||||
| void run_backend_pipeline() | ||||||
| void run_backend_pipeline(const std::string& solution) | ||||||
| { | ||||||
| mlir_pass_manager pm_back{mlirPassManagerCreate(ctx.get())}; | ||||||
| mlirMIGraphXAddBackendPipeline(pm_back.get(), target_arch.c_str()); | ||||||
| MlirMIGraphXBackendOptions opts{}; | ||||||
| opts.arch = target_arch.c_str(); | ||||||
| opts.perfConfig = solution.c_str(); | ||||||
|
||||||
| opts.perfConfig = solution.c_str(); | |
| opts.perfConfig = solution.empty() ? nullptr : solution.c_str(); |
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.
added this because it could be useful for debugging on your side as well. It's often the case that LLVM bugs go away if you pass optLevel=0.
Copilot
AI
Apr 9, 2026
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.
opts.optLevel is hard-coded to 3 without explanation or configuration. If MIGraphX supports varying optimization levels elsewhere, consider threading that setting through (env var / compile option) or at least defining a named constant to avoid an unexplained magic number here.
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.
PR metadata indicates this change should be included in
CHANGELOG.md(category marked "Added"), but this PR does not include a changelog entry. Please add an appropriateCHANGELOG.mdentry (or update the PR category to "Not Applicable" if that was intended).