test: skip int8/bf16 integration tests on pre-Ampere GPUs#4528
Open
Suchitra-idu wants to merge 1 commit into
Open
test: skip int8/bf16 integration tests on pre-Ampere GPUs#4528Suchitra-idu wants to merge 1 commit into
Suchitra-idu wants to merge 1 commit into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/4528
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: This comment was automatically generated by Dr. CI and updates every 15 minutes. |
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.
What
Adds two
SM80OrLaterskip decorators to tests intest/integration/test_integration.pythat fail on pre-Ampere CUDA hardware:test__int_mm_eager_and_torch_compile_numerics— usestorch._int_mm, which requires int8 tensor cores (Ampere+).test_benchmark_model_cuda— compiles a bfloat16 model withtorch.compile, but bf16 compilation requires Ampere+ (Inductor itself emitsSkipFrame: BF16 is not supportedand warns explicitly).Uses the existing
SM80OrLaterhelper fromtorch.testing._internal.common_cudafor consistency with how the rest of the PyTorch test suite gates Ampere-only features.Why
Both tests have always required Ampere features, but the existing skip guards only check
torch.cuda.is_available()— they don't check compute capability. As a result, on pre-Ampere CUDA hardware (Turing, Volta, Pascal) they hard-fail instead of skipping cleanly.Reproduction
Running on a GTX 1650 (Turing, SM 7.5) without these skips:
test__int_mm_eager_and_torch_compile_numerics:Root cause:
_int_mm(int8 × int8 → int32) requires tensor cores, which the GTX 16-series lacks.test_benchmark_model_cuda:Root cause: bf16 compilation requires SM 8.0+.
Bonus: also transitively fixes downstream test pollution
Skipping
test__int_mm_eager_and_torch_compile_numericsalso fixestest_int8_weight_only_quant_subclass_api_3and_4, which were previously failing with:These tests are not actually broken on pre-Ampere hardware. Verified empirically by running them in isolation:
Reviewer note: I did not add explicit skips on
_3and_4because they do pass on pre-Ampere hardware when not poisoned by an earlier failure.Test plan
pytest test/integration -vlocally on a GTX 1650 — all four previously-failing tests now either skip cleanly or pass._3and_4pass in isolation (proving they're not actually broken on Turing)._0_cpu,_1_cpu,_2_cpu) continue to pass unaffected.No behavior change on supported hardware; this is a test-only change.