Repository navigation
Re-enabling Origami for all ROCm versions and updating rocm_origami version pin to 0.0.3 - #201122
umechand-amd wants to merge 8 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/201122
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4096fde with merge base 109544c ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
|
|
The following ciflow label(s) have been added but CI has not been triggered yet because the workflows are awaiting approval:
Once a maintainer approves the workflows (scroll to the bottom of the PR page), the corresponding CI jobs will be triggered automatically. Please ping one of the reviewers if you do not have access to approve and run workflows. |
b1b1bb2 to
f7a2111
Compare
…ersion pin to 0.0.3
f7a2111 to
d4953a6
Compare
|
@claude Analyze CI failures, check if the failures are related to the code changes in the PR, be thorough. |
|
Claude finished @jithunnair-amd's task in 2m 5s —— View job None of the CI failures are related to this PR. It only changes Python code under Per-job analysisWhat the PR changes
All of this only runs on ROCm, and only when Failures
|
…rmance against max-autotuning.
|
@claude Analyze CI failures |
|
Claude finished @jithunnair-amd's task in 46s —— View job The new head ( DetailsCI status for
|
| Workflow | Conclusion |
|---|---|
pull |
action_required (awaiting approval) |
Lint |
action_required |
BC Lint |
action_required |
docs-build |
action_required |
None of these ran, so there are no failures to analyze. The failures in the earlier analysis were on the previous head (d4953a6c) and were all unrelated to this PR: XPU linker, aarch64 clang21 -Werror, the SVD test from the merge base, and torchtitan's pyarrow/NumPy mismatch. Someone with write access needs to approve the workflows, along with the ciflow/* labels, before there's anything new to triage.
Bug in the new commit: the perf-test skip moved to the wrong method
In test/inductor/test_origami.py:228-248, the new _benchmark_median helper was inserted between the @unittest.skipIf(not DO_PERF_TEST, ...) decorator and test_origami_runtime_matches_regular_max_autotune. As a result:
- The decorator now wraps
_benchmark_median, and the test method has noDO_PERF_TESTguard at all. - When
DO_PERF_TESTis unset but the class is enabled (TORCHINDUCTOR_MAX_AUTOTUNE=1 TORCHINDUCTOR_ORIGAMI=1, origami installed), the test runs. It does the full origami and max-autotune compiles for all 12 cases (mm/addmm/bmm × 8192/16384 × topk 5/10). Only then does the first_benchmark_mediancall raiseSkipTest. The test is reported as "skipped", but only after the expensive autotuning work, which can cause timeouts on the inductor-rocm shards. - The log message at lines 21-25 says the test "will be skipped", which is now misleading.
Fix: move the decorator back onto test_origami_runtime_matches_regular_max_autotune and leave _benchmark_median undecorated. Placing the helper above the decorator is enough:
def _benchmark_median(self, compiled, args):
...
@unittest.skipIf(
not DO_PERF_TEST,
"Perf test not enabled; set DO_PERF_TEST=1 to enable runtime perf benchmarks",
)
def test_origami_runtime_matches_regular_max_autotune(self):Nits
- The
_benchmark_mediandocstring contains a non-ASCII±. The repo asks for ASCII only in new comments, so use+/-. - Move
import statisticsto the top of the module. - The commit also removes
ORIGAMI_ROCM_SUPPORTEDand itsskipIf, which addresses the cleanup suggested in the earlier analysis. It leaves two blank lines afterIS_ROCM =that lint may flag.
Still open from the earlier analysis
Default CI shards don't set TORCHINDUCTOR_MAX_AUTOTUNE=1 TORCHINDUCTOR_ORIGAMI=1, so TestOrigami is skipped there. Once CI runs, check that the rebuilt ROCm image has rocm-origami==0.0.3 installed and that the TestOrigami cases actually executed in some job (for example inductor-rocm or the perf-nightly jobs) rather than being skipped.
jeffdaily
left a comment
There was a problem hiding this comment.
My agent came up with this analysis, but I've read and approved it.
test/inductor/test_origami.py:_benchmark_medianwas inserted between the@unittest.skipIf(not DO_PERF_TEST, ...)decorator andtest_origami_runtime_matches_regular_max_autotune, so the decorator now guards the helper and the test has no guard..ci/pytorch/test.shrunstest_origamion ROCm shard 1 withTORCHINDUCTOR_MAX_AUTOTUNE=1 TORCHINDUCTOR_ORIGAMI=1, so every ROCm inductor run will do all 12 origami and full max-autotune compiles at 8192/16384 before the first_benchmark_mediancall raisesSkipTest. Move the helper above the decorator, and moveimport statisticsto module level.- Removing the ROCm version gate outright reopens the failure #193843 guarded against.
config.rocm.origamidefaults to on, the selection calls (origami.OrigamiMatmulSelector,select_topk_configs,select_grid_size) have no fallback, androcm-origami==0.0.2is still on PyPI, so anyone on ROCm 10+ with 0.0.2 installed hits the API mismatch undermax_autotune. Please gate on the installed package instead: on ROCm >= 10.0 requireimportlib.metadata.version("rocm-origami") >= 0.0.3, otherwise warn once and leaveorigami = None. Also say in the description which ROCm versions 0.0.3 was tested with; CI only covers ROCm 10.1, and the title says all versions.- The
config.rocm.origamicomment intorch/_inductor/config.pystill says toggling viaconfig.patchhas no effect, but the new_origami_enabled()checks makeconfig.patch({"rocm.origami": False})disable origami at call time. Update the comment to say patching to False works and patching to True does not.
|
@claude Analyze CI failures, see if the failures are related to the code changes in the PR, be thorough |
|
Claude finished @jithunnair-amd's task in 1m 34s —— View job No, none of the remaining CI failures on Per-job analysisPytest reporting crash in the rebuilt images (indirect, not origami code)Affected jobs:
All of these fail the same way. Across the three amx logs there are 1786 The runner reports Why it shows up on this PR:
Unrelated, already on trunk or infra
ConclusionNothing in this PR's code needs to change. The pytest 9 |
pushed a commit to address all three of these. |
The ROCm >= 10.0 gate parsed the rocm-origami version with int() per component, so a pre-release such as 0.0.4rc1 raised ValueError, which neither except clause caught, and importing the template heuristics failed whenever ROCm, max_autotune and origami were all on. Move the check into _origami_package_supported(), compare with the vendored packaging Version (an unparsable version disables origami), take the ROCm version from _rocm_version_tuple(), and unit test the helper. Test Plan: ``` python test/inductor/test_origami.py -k TestOrigamiPackageVersionGate ``` Authored with Claude.
|
Before this merges: the |
TestOrigami was gated on `import origami` succeeding, so with an installed rocm-origami that the ROCm >= 10.0 gate rejects (0.0.2 on ROCm 10.1), the heuristic ran with origami off and six subtests failed instead of skipping. Skip the class when the heuristics module has origami set to None even though the package imports and both config flags are on. Test Plan: on MI300X with ROCm 10.1, rocm-origami 0.0.2 (TestOrigami skips) and 0.0.3 (TestOrigami runs and passes). ``` TORCHINDUCTOR_MAX_AUTOTUNE=1 TORCHINDUCTOR_ORIGAMI=1 python test/inductor/test_origami.py -v ``` Authored with Claude.
jeffdaily
left a comment
There was a problem hiding this comment.
Approving with my two commits on top: the package-version gate now parses with packaging and has a unit test, and TestOrigami skips when the gate disables origami (validated on MI300X with ROCm 10.1 and rocm-origami 0.0.2 and 0.0.3). I updated the description to match. Please hold the merge until #202390 lands.
|
@pytorchbot merge -i |
|
@pytorchbot merge -f "docker-build jobs from the ROCm fork build every image but cannot push to the CI image registry, so downstream tests cannot run; last full CI run on this PR was green on ROCm/origami, and the follow-up commits only touch the package-version gate and its test (validated on MI300X)" |
Merge startedYour change will be merged immediately since you used the force (-f) flag, bypassing any CI checks (ETA: 1-5 minutes). Please use Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
Merge failedReason: This PR changes files under .ci/docker/, so the Details for Dev Infra teamRaised by workflow job |
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
…ersion pin to 0.0.3 (pytorch#201122) This PR re-enables origami for all Rocm versions and pins rocm-origami pypi package version to 0.0.3 Before submitting, please review: - [PR lifecycle](https://github.com/pytorch/pytorch/blob/main/CONTRIBUTING.md#pr-lifecycle) in the contributing guide - [AI-Assisted Development](https://github.com/pytorch/pytorch/blob/main/AI_POLICY.md) policy Go through the following checklist - [x] Passes lint (`spin fixlint`) - [x] Added/updated tests - [ ] Updated documentation (if applicable) - [x] Included benchmark results (for PRs impacting perf) --- ## Linked issue or supporting maintainer <!-- Keep the one line that applies and delete the others. Link an issue labeled "actionable", or name the maintainer who agreed to this change beforehand. PRs with neither will be automatically closed, unless the author has write access to the repo. --> Supported by @jeffdaily <!-- If this change breaks backward compatibility, describe the impact and migration path. Otherwise, write "No". --> ## Summary (human written only) rocm-origami 0.0.2 does not match the origami library API in ROCm 10.0+, so pytorch#193843 disabled origami on ROCm >= 10.0. This PR pins rocm-origami to 0.0.3, which matches it, and replaces the ROCm version cutoff with a package-version gate: on ROCm >= 10.0, origami is used only when the installed rocm-origami is >= 0.0.3 (an older or unparsable version logs a warning and disables origami). `TestOrigamiPackageVersionGate` covers the gate, and `TestOrigami` skips when the gate has disabled origami. Validated on MI300X (ROCm 10.1) with rocm-origami 0.0.3 (origami active, all tests pass) and 0.0.2 (gate disables origami, `TestOrigami` skips). Note that `.ci/docker/ci_commit_pins/rocm-origami.txt` rebuilds the CI images, so this should merge only after pytorch#202390. ## Tests and Benchmarks. After re-enabling origami, gemm kernel latency was within the 5% tolerance compared to max-autotune for all shapes in the unit test and compilation time was <img width="655" height="668" alt="image" src="https://github.com/user-attachments/assets/89b6310b-b22d-46b5-ad23-f2fd2d16df4c" /> <img width="638" height="262" alt="image" src="https://github.com/user-attachments/assets/6e2677a6-27f6-42ff-9646-4f4474f07650" /> Pull Request resolved: pytorch#201122 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
…ersion pin to 0.0.3 (pytorch#201122) This PR re-enables origami for all Rocm versions and pins rocm-origami pypi package version to 0.0.3 Before submitting, please review: - [PR lifecycle](https://github.com/pytorch/pytorch/blob/main/CONTRIBUTING.md#pr-lifecycle) in the contributing guide - [AI-Assisted Development](https://github.com/pytorch/pytorch/blob/main/AI_POLICY.md) policy Go through the following checklist - [x] Passes lint (`spin fixlint`) - [x] Added/updated tests - [ ] Updated documentation (if applicable) - [x] Included benchmark results (for PRs impacting perf) --- ## Linked issue or supporting maintainer <!-- Keep the one line that applies and delete the others. Link an issue labeled "actionable", or name the maintainer who agreed to this change beforehand. PRs with neither will be automatically closed, unless the author has write access to the repo. --> Supported by @jeffdaily <!-- If this change breaks backward compatibility, describe the impact and migration path. Otherwise, write "No". --> ## Summary (human written only) rocm-origami 0.0.2 does not match the origami library API in ROCm 10.0+, so pytorch#193843 disabled origami on ROCm >= 10.0. This PR pins rocm-origami to 0.0.3, which matches it, and replaces the ROCm version cutoff with a package-version gate: on ROCm >= 10.0, origami is used only when the installed rocm-origami is >= 0.0.3 (an older or unparsable version logs a warning and disables origami). `TestOrigamiPackageVersionGate` covers the gate, and `TestOrigami` skips when the gate has disabled origami. Validated on MI300X (ROCm 10.1) with rocm-origami 0.0.3 (origami active, all tests pass) and 0.0.2 (gate disables origami, `TestOrigami` skips). Note that `.ci/docker/ci_commit_pins/rocm-origami.txt` rebuilds the CI images, so this should merge only after pytorch#202390. ## Tests and Benchmarks. After re-enabling origami, gemm kernel latency was within the 5% tolerance compared to max-autotune for all shapes in the unit test and compilation time was <img width="655" height="668" alt="image" src="https://github.com/user-attachments/assets/89b6310b-b22d-46b5-ad23-f2fd2d16df4c" /> <img width="638" height="262" alt="image" src="https://github.com/user-attachments/assets/6e2677a6-27f6-42ff-9646-4f4474f07650" /> Pull Request resolved: pytorch#201122 Approved by: https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
This PR re-enables origami for all Rocm versions and pins rocm-origami pypi package version to 0.0.3
Before submitting, please review:
Go through the following checklist
spin fixlint)Linked issue or supporting maintainer
Supported by @jeffdaily
Summary (human written only)
rocm-origami 0.0.2 does not match the origami library API in ROCm 10.0+, so #193843 disabled origami on ROCm >= 10.0. This PR pins rocm-origami to 0.0.3, which matches it, and replaces the ROCm version cutoff with a package-version gate: on ROCm >= 10.0, origami is used only when the installed rocm-origami is >= 0.0.3 (an older or unparsable version logs a warning and disables origami).
TestOrigamiPackageVersionGatecovers the gate, andTestOrigamiskips when the gate has disabled origami.Validated on MI300X (ROCm 10.1) with rocm-origami 0.0.3 (origami active, all tests pass) and 0.0.2 (gate disables origami,
TestOrigamiskips). Note that.ci/docker/ci_commit_pins/rocm-origami.txtrebuilds the CI images, so this should merge only after #202390.Tests and Benchmarks.
After re-enabling origami, gemm kernel latency was within the 5% tolerance compared to max-autotune for all shapes in the unit test and compilation time was

cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben