fix(rocke): Remove silent GFX950 fallback in fusion lowering#9245
Open
ecamartins wants to merge 5 commits into
Open
fix(rocke): Remove silent GFX950 fallback in fusion lowering#9245ecamartins wants to merge 5 commits into
ecamartins wants to merge 5 commits into
Conversation
✅ All Checks Passed — Ready for Review
📖 Need help? See the Policy FAQ for details on every check and how to fix failures. |
|
🎉 All checks passed! This PR is ready for review. |
In rocKE's fusion_lowering.py, the architecture silently falls back to gfx950, which can mask configuration or environment issues. This change removes the silent fallback and throws an error instead via the new validate_arch function. Unit tests for validate_arch were added. Additional test cases were added in test_rocke.py's TestLoweringRegistryBuild to test cases where validate_arch throws. Reliance on the GPU was removed from this test class via mocks to functions that call the hip runtime api. A follow-up ticket will address a full sweep to remove all cases of the silent gfx950 fallback.
d6e233c to
114b99c
Compare
yraparti
reviewed
Jul 9, 2026
yraparti
reviewed
Jul 9, 2026
Contributor
|
Critical:
Nits:
|
yraparti
requested changes
Jul 9, 2026
The following changes were made: - Update validate_arch's parameter type hint to Optional[str] since None is a valid argument. - Update documentation wording for more clarity - Update AGENTS.md file to indicate that fusion_lowering.py no longer falls back to gfx950 for better agentic workflows
Contributor
Author
I've updated AGENTS.md to indicate that fusion_lowering.py does not fall back to gfx950.
All required nits have been addressed. |
Since calls to hipModuleLoad are now mocked, tests in test_rocke.py no longer require a GPU. So, the _requires_gpu guard can be removed.
dfd4fce to
d6d03ea
Compare
yraparti
reviewed
Jul 10, 2026
Comment on lines
+189
to
+192
| *Note*: We are transitioning away from the `gfx950` fallback. Currently, | ||
| `rocke/platform/python/rocke/helpers/fusion_lowering.py` does not fall back to | ||
| `gfx950`; an exception is raised if a known device can't be detected. Future | ||
| work will remove remaining `gfx950` fallbacks. |
Contributor
There was a problem hiding this comment.
maybe we can remove this and just add a line saying pass target_architecture for non-gfx950 targets and beware of the silent fallbacks on non-gpus?
Contributor
Author
There was a problem hiding this comment.
Sounds good. Done.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Motivation
In rocKE's
fusion_lowering.py, the GPU architecture silently falls back to gfx950, which can mask configuration or environment issues. Hence, this change removes the silent fallback and throws a descriptive error message instead.Note: This gfx950 fallback exists throughout rocKE. A follow-up ticket will work to remove the remaining fallbacks.
Technical Details
In
fusion_lowering.py, there were several cases of the following forms:In the above case, if
get_device_arch()returnsNone(e.g., due to no GPU) or if the given architecture is not in the set of known architectures, then there is a silent fallback to gfx950. This can mask environment or configuration issues.Instead of using the silent fallback, we throw a descriptive error message through the addition of the function
validate_arch. This will inform the user of how to properly configure their environments.Test Plan
Addition of the following tests:
test_rocke_multiarch.pyto testvalidate_archtest_rocke.py'sTestLoweringRegistryBuildto validate cases wherevalidate_archthrows.test_rocke.pydoes not require a GPU, I discovered that tests that call a lowerer'sbuildmethod require a GPU (i.e., thebuildmethod creates aKernelLauncherobject whose constructor callshipModuleLoad). So, I refactored theTestLoweringRegistryBuildclass to mock the calls to the hip functions to remove the GPU dependency.Test Result
All tests in
test_rocke.pyandtest_rocke_multiarch.pypass.Submission Checklist
JIRA ID : AICK-1541