Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[AIROCMLIR-426] rocMLIR - MIOpen layout translation #2298
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?
[AIROCMLIR-426] rocMLIR - MIOpen layout translation #2298
Changes from all commits
518d88ffc3e55cea1b9d1d27c5d1File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading. Please reload this page.
Jump to
Uh oh!
There was an error while loading. Please reload this page.
There are no files selected for viewing
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 worth adding a comment (or an assert /
logging.warning) for the fall-through case. Right now.get(layout, layout)silently passes through any unrecognised layout unchanged — which means a new rocMLIR layout name that's missing from this table will produce an 'Invalid Layout' error in MIOpenDriver that is hard to trace back here.A lightweight safeguard:
Alternatively, document that
ROCMLIR_TO_MIOPEN_LAYOUTis expected to be exhaustive and add a regression test covering any new layout names that arise.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 three
if/elifbranches are identical except for the flag name. You can collapse them into a single check with a set, which also makes it easy to add more layout flags in the future:Also note that iterating
range(len(result) - 1)removes the need for the repeatedi + 1 < len(result)guard.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 print still shows
commandline(the original rocMLIR layout names) while the actual MIOpenDriver call usesmiopen_commandline(with translated names). If a benchmark fails and someone tries to reproduce it by copy-pasting this line, they'll get the untranslated command and hit the same 'Invalid Layout' error all over again. Consider printingmiopen_commandlineinstead, or at least the fullmiopen_driver_cmd: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
yapfformatter requires thisraise RuntimeError(...)to have the first argument on the same line as the opening parenthesis, with continuation lines aligned beneath it. The original multi-line style (opening paren on its own line) fails theyapf --diffcheck in CI.Fixed format:
Uh oh!
There was an error while loading. Please reload this page.