-
Notifications
You must be signed in to change notification settings - Fork 50
GEMM+GEMM and CONV+GEMM support in script for handling new configs #2053
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?
Conversation
| help="Path to the file containing existing convolution configurations") | ||
| parser.add_argument("--gemm", type=str, default=None, | ||
| help="Path to the file containing existing GEMM configurations") | ||
| parser.add_argument("--gemmgemm", type=str, default=None, |
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.
let's keep it consistent with rocmlir-gen, gemm_gemm
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.
do we want to change tier1-gemmgemm-configs to tier1-gemm_gemm-configs as well (same for conv_gemm file)? @dhernandez0
| help="Path to the file containing existing GEMM configurations") | ||
| parser.add_argument("--gemmgemm", type=str, default=None, | ||
| help="Path to the file containing existing GEMM_GEMM configurations") | ||
| parser.add_argument("--convgemm", type=str, default=None, |
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.
conv_gemm
|
|
||
| return configs | ||
|
|
||
| def detectConfigType(config) -> Optional[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.
can we return Operation here? (perfCommonUtils.py)
| return configs | ||
|
|
||
| def detectConfigType(config) -> Optional[str]: | ||
| """Detect config type: returns 'conv', 'gemm', or 'attention'.""" |
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.
update or just don't specify conv, gemm, ...
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.
Pull Request Overview
This PR extends the configuration handling script to support GEMM+GEMM and CONV+GEMM configurations, and simplifies the deduplication logic by removing canonical form conversions that required complete configurations.
Key changes:
- Added detection and handling for GEMM+GEMM and CONV+GEMM configuration types
- Removed canonicalization logic that depended on
fromCommandLine, enabling support for incomplete configurations - Switched from error to warning when encountering unrecognized config types
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| existing_conv = load_existing_configs(conv_configs) | ||
| existing_gemm = load_existing_configs(gemm_configs) | ||
| existing_gemm_gemm = load_existing_configs(gemm_gemm_configs) | ||
| existing_conv_gemm = load_existing_configs(conv_gemm_configs) |
Copilot
AI
Oct 29, 2025
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.
Variable name mismatch: the function receives 'conv_gemm_config' (singular) from resolve_paths on line 172, but attempts to use 'conv_gemm_configs' (plural) here. This will cause a NameError at runtime.
| _append_configs(conv_configs, new_conv) | ||
| _append_configs(gemm_configs, new_gemm) | ||
| _append_configs(gemm_gemm_configs, new_gemm_gemm) | ||
| _append_configs(conv_gemm_configs, new_conv_gemm) |
Copilot
AI
Oct 29, 2025
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.
Variable name mismatch: attempting to use 'conv_gemm_configs' (plural), but the variable defined on line 172 is 'conv_gemm_config' (singular). This will cause a NameError at runtime.
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.
Pull Request Overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 2 comments.
Comments suppressed due to low confidence (2)
mlir/utils/performance/handleNewConfigs.py:39
- These global variables ARCH, CHIP, and NUM_CU are defined but no longer used after removing the canonicalization functions. Consider removing these unused global variables and their corresponding imports if they serve no other purpose in the module.
ARCH = get_arch()
CHIP = get_chip()
NUM_CU = get_num_cu(CHIP)
mlir/utils/performance/handleNewConfigs.py:49
- The function
read_non_empty_linesis no longer called anywhere in the code after refactoring the main loop to directly read from the file. Consider removing this unused function.
def read_non_empty_lines(path: str) -> list[str]:
if not os.path.exists(path):
print(f"Error: {path} does not exist")
sys.exit(-1)
with open(path, "r") as f:
return [line.strip() for line in f if line.strip() and not line.strip().startswith("#")]
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| new_conv_gemm.append(config) | ||
| existing_conv_gemm.add(config) | ||
| else: | ||
| print(f"Warning: Could not determine config type for: {config}") |
Copilot
AI
Oct 29, 2025
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.
The message severity changed from 'Error' to 'Warning', but the handling remains the same (just logs and continues). The previous version would print an error and continue, which was effectively a warning. While 'Warning' is more accurate, consider whether unrecognized configs should cause the script to fail (return non-zero exit code) or at least be tracked and reported in the final summary to ensure visibility of potential issues.
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.
@copilot open a new pull request to apply changes based on this feedback
|
@dorde-antic I've opened a new pull request, #2075, to work on those changes. Once the pull request is ready, I'll request review from you. |
* Initial plan * Track and report unrecognized configs with non-zero exit code Co-authored-by: dorde-antic <[email protected]> --------- Co-authored-by: copilot-swe-agent[bot] <[email protected]> Co-authored-by: dorde-antic <[email protected]>
Motivation
Last version of the script didn't support GEMM+GEMM and CONV+GEMM configs and didn't support incomplete configs.
Resolves https://github.com/ROCm/rocMLIR-internal/issues/2084
Technical Details
Test Plan
Locally
Test Result
✅
Submission Checklist