Repository navigation
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/193602
Note: Links to docs will display an error until the docs builds have been completed. ❌ 1 New Failure, 1 Unrelated FailureAs of commit e218e63 with merge base d81cb17 ( NEW FAILURE - The following job has failed:
BROKEN TRUNK - The following job failed but were present on the merge base:👉 Rebase onto the `viable/strict` branch to avoid these failures
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
jithunnair-amd
left a comment
There was a problem hiding this comment.
Agree with the general intent of this PR, we need to differentiate ROCm from HIP versions, and start using torch.version.rocm where applicable.
|
|
|
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. |
jeffdaily
left a comment
There was a problem hiding this comment.
The direction is right and matches where the toolchain is going; thanks for wiring it through everywhere rather than just collect_env. Main asks: fix the verify_dynamo comparison so both sides use the SDK version (inline comment), the collect_env "Could not collect" fallback for older wheels, and the TEST_WITH_ROCM narrowing in test_sparse. The rest are smaller: full-tuple getRocmVersion, test placement, and two behavior changes that should at least be documented in the PR description. Minor style: the str(...) wraps in mm_grouped.py and cpp_extension.py are redundant (both operands are already strings), and for in-tree modules torch.version.rocm always exists so plain torch.version.rocm or torch.version.hip reads better than the getattr form; getattr defensiveness is only needed in collect_env and verify_dynamo, which run against arbitrary installed torch versions.
Portions of this review were drafted with an AI assistant; findings verified by the author.
|
|
||
| def _get_torch_rocm_version(): | ||
| if not TEST_WITH_ROCM or torch.version.hip is None: | ||
| rocm_version = getattr(torch.version, "rocm", None) or torch.version.hip |
There was a problem hiding this comment.
Two behavior changes here are worth calling out in the PR description. First, dropping the TEST_WITH_ROCM guard means callers that gate only on torch.version.hip (e.g. test_matmul_cuda.py) now see the real version on local ROCm runs without PYTORCH_TEST_WITH_ROCM, where they previously saw (0, 0); probably the right direction, but note it points the opposite way from the test_sparse.py change in this PR, which adds a TEST_WITH_ROCM dependency. Second, switching to SDK versions makes existing 3-component thresholds meaningful: _get_torch_rocm_version() < (7, 2, 1) in test_matmul_cuda.py could never trigger on a 7.2 build before (the third component was a HIP build number in the tens of thousands), but ROCm SDK 7.2.0 will now trip it. Worth confirming the hipblas/hipblaslt fix that threshold references actually landed in 7.2.1.
There was a problem hiding this comment.
Both behavior changes are called out in the PR description now. The contradiction you noted is also gone: the test_sparse.py hunk is back to ROCM_VERSION >= (6, 0) per your other comment, so nothing in this PR adds a TEST_WITH_ROCM dependency.
On confirming 7.2.1: the threshold came from #175868 (landed as 9f2c038), which unskipped these 64 cases on the basis that they pass on ROCm 7.2.1; #186098 later added the MI200 arm. So 7.2.1 is the validated-good version, but 7.2.0 was never validated either way.
Worth flagging which way this PR moves it. Under HIP comparison < (7, 2, 1) effectively meant < 7.2, since any 7.2.x HIP build number beat 1, so 7.2.0 builds ran these tests. Literal SDK comparison makes 7.2.0 skip them instead. No CI config is affected, since we build 7.14 and 10.1, and it errs toward skipping rather than failing. Happy to change it to < (7, 2, 0) to preserve the old coverage exactly if you prefer.
25392cc to
494868c
Compare
|
@pytorchbot label ciflow/trunk ciflow/inductor ciflow/torchtitan |
|
@ethanwee1 please address lint failure, looks legit |
Merge startedYour change will be merged while ignoring the following 1 checks: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@pytorchbot revert -m 'Sorry for the churn, I need to revert this to cleanly revert #193927' -c weird Please help rebase and reland this later |
|
@pytorchbot successfully started a revert job. Check the current status here. |
This reverts commit c9b4d84. Reverted #193602 on behalf of https://github.com/huydhn due to Sorry for the churn, I need to revert this to cleanly revert #193927 ([comment](#193602 (comment)))
|
@ethanwee1 your PR has been successfully reverted. |
This PR was reopened (likely due to being reverted), so your approval was removed. Please request another review.
|
@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 |
Merge failedReason: 1 jobs have failed, first few of them are: trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (distributed, 2, 10, mt-l-x86iavx512-45-172-t4-4) Details for Dev Infra teamRaised by workflow job |
JIRA ID: AIPYTORCH-1074 ## Problem ROCm SDK version and HIP runtime version are diverging. Test gates, `collect_env`, `verify_dynamo`, and extension cache keys still treated `torch.version.hip` as the SDK version, so patch thresholds and toolchain identity are wrong once SDK and HIP majors split. ## Changes Rebased onto main including Meta's pytorch#194985 reland (`_derive_rocm_version`, `ROCM_VERSION` as major.minor, `getattr` for missing `torch.version.rocm`). Dropped the overlapping hunks. This PR keeps the SDK vs HIP split that the reland does not cover. - `getRocmVersion()` returns the full `_get_torch_rocm_version()` tuple (`tuple[int, ...]`). `ROCM_VERSION` stays major.minor; the `TEST_WITH_ROCM` guard in `_get_torch_rocm_version` is unchanged. - Skip helpers (`test_cuda`, `test_linalg`, `test_sparse`) and inductor FP8 gating (`mm_grouped`) use the SDK parser. `mm_grouped` uses `getattr(torch.version, "rocm", None) or torch.version.hip`. - `collect_env` replaced `ROCM used to build PyTorch:` with separate `ROCm SDK used to build PyTorch:` and `HIP used to build PyTorch:` lines. Older wheels without `torch.version.rocm` print `N/A`. The old `ROCM used to build PyTorch:` string is gone on purpose: external bug-report tooling that greps for it will not match after this ships in nightlies. `rocm_compiled_version` is appended at the end of `SystemEnv` so positional construction of the original fields still lines up. - `verify_dynamo` compares SDK to SDK from `rocm-core/rocm_version.h` at major.minor (so 7.14.0 vs 7.14.1 does not warn), and falls back to HIP-to-HIP when the header or `torch.version.rocm` is missing. - `cpp_extension` default cache key includes both SDK and HIP identities, strips dots and `-<gitsha>`, and uses `getattr` when `rocm` is absent. - Tests: `TestFrameworkUtils` covers SDK vs HIP selection; `TestVerifyDynamoRocm` covers `_parse_version`, header parsing, SDK patch-ignore, minor mismatch, and HIP fallback. ## Validation `python3 -m py_compile` on the edited files passed. `ruff check --select F821,F401,F811,S101` and `ruff format --check` passed on `test/test_utils.py`. Isolated `verify_dynamo` unit tests previously passed against a stubbed `torch`. Full lintrunner and device tests were not run locally (this worktree has no built torch). Pull Request resolved: pytorch#193602 Approved by: https://github.com/jithunnair-amd, https://github.com/jeffdaily Co-authored-by: Jeff Daily <[email protected]>
This reverts commit c9b4d84. Reverted pytorch#193602 on behalf of https://github.com/huydhn due to Sorry for the churn, I need to revert this to cleanly revert pytorch#193927 ([comment](pytorch#193602 (comment)))
|
@pytorchbot merge -i The two failures are unrelated: the Gloo |
Merge startedYour change will be merged while ignoring the following 2 checks: torchtitan-test / torchtitan-x-pytorch-test / test (torchtitan_models_integration, 1, 1, mt-l-x86aavx2-189-704-a10g-8), trunk / linux-jammy-cuda13.0-py3.10-gcc11 / test (distributed, 2, 10, mt-l-x86iavx512-45-172-t4-4) Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
JIRA ID: AIPYTORCH-1074
Problem
ROCm SDK version and HIP runtime version are diverging. Test gates,
collect_env,verify_dynamo, and extension cache keys still treatedtorch.version.hipas the SDK version, so patch thresholds and toolchain identity are wrong once SDK and HIP majors split.Changes
Rebased onto main including Meta's #194985 reland (
_derive_rocm_version,ROCM_VERSIONas major.minor,getattrfor missingtorch.version.rocm). Dropped the overlapping hunks. This PR keeps the SDK vs HIP split that the reland does not cover.getRocmVersion()returns the full_get_torch_rocm_version()tuple (tuple[int, ...]).ROCM_VERSIONstays major.minor; theTEST_WITH_ROCMguard in_get_torch_rocm_versionis unchanged.test_cuda,test_linalg,test_sparse) and inductor FP8 gating (mm_grouped) use the SDK parser.mm_groupedusesgetattr(torch.version, "rocm", None) or torch.version.hip.collect_envreplacedROCM used to build PyTorch:with separateROCm SDK used to build PyTorch:andHIP used to build PyTorch:lines. Older wheels withouttorch.version.rocmprintN/A. The oldROCM used to build PyTorch:string is gone on purpose: external bug-report tooling that greps for it will not match after this ships in nightlies.rocm_compiled_versionis appended at the end ofSystemEnvso positional construction of the original fields still lines up.verify_dynamocompares SDK to SDK fromrocm-core/rocm_version.hat major.minor (so 7.14.0 vs 7.14.1 does not warn), and falls back to HIP-to-HIP when the header ortorch.version.rocmis missing.cpp_extensiondefault cache key includes both SDK and HIP identities, strips dots and-<gitsha>, and usesgetattrwhenrocmis absent.TestFrameworkUtilscovers SDK vs HIP selection;TestVerifyDynamoRocmcovers_parse_version, header parsing, SDK patch-ignore, minor mismatch, and HIP fallback.Validation
python3 -m py_compileon the edited files passed.ruff check --select F821,F401,F811,S101andruff format --checkpassed ontest/test_utils.py. Isolatedverify_dynamounit tests previously passed against a stubbedtorch. Full lintrunner and device tests were not run locally (this worktree has no built torch).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