Skip to content

[inductor][test] Fix stale "high" precision key in cutlass sparse semi-structured test - #199248

Closed
aorenste wants to merge 1 commit into
gh/aorenste/408/basefrom
gh/aorenste/408/head
Closed

aorenste wants to merge 1 commit into
gh/aorenste/408/basefrom
gh/aorenste/408/head

Conversation

@aorenste

@aorenste aorenste commented Oct 1, 2026 •

Copy link
Copy Markdown
Contributor

Stack from ghstack (oldest at bottom):

  • (to be filled)

test_max_autotune_cutlass_backend_sparse_semi_structured_mm fails with
KeyError: 'high' because it reads the autotune local cache with the legacy
precision string. #189955 changed PersistentCache to key timings by
fp32_matmul_precision_key(), so with the module's
torch.set_float32_matmul_precision("high") the bucket is now
"cuda:tf32,mkldnn:tf32". That PR updated test_codecache.py but missed
this lookup. The test now indexes the cache with the same helper the cache
writes with.

OSS CI did not catch this because nothing runs the test on hardware where it
executes. It is gated to sm_8x exactly; the only OSS job that runs
test_cutlass_backend.py is h100-cutlass-backend, where it skips, and the
A10G inductor jobs exclude the file. It fails in fbcode, where the file runs
on A100.

Test Plan:
On an A100 (sm_80), with CUDA 13.0 nvcc on PATH:

python test/inductor/test_cutlass_backend.py -k test_max_autotune_cutlass_backend_sparse_semi_structured_mm

Fails with KeyError: 'high' before this change and passes after.

This PR was authored with the assistance of an AI coding assistant (Claude).

cc @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @ipiszy @kadeng @muchulee8 @amjames @chauhang @aakhundov @coconutruben @jataylo

[ghstack-poisoned]
@pytorch-bot

pytorch-bot Bot commented Oct 1, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/199248

Note: Links to docs will display an error until the docs builds have been completed.

⏳ 1 Pending, 2 Unrelated Failures

As of commit 65b5c7c with merge base 67148e2 (image):

🟢 GREEN LIGHT - PR approved to be merged without human review:

  • Triviality
    • Single-cause bugfix: the test read the autotune cache with the literal key "high" instead of the key the writer uses
    • PersistentCache.lookup in torch/_inductor/codecache.py writes timings under fp32_matmul_precision_key(), which the test now indexes with
  • Scope
    • Test-only: one import and one lookup key in test/inductor/test_cutlass_backend.py, plus a local rename from high to timings
    • No production file, fixture, or conftest.py touched, and the cutlass_kernels_count assertion is unchanged
  • Socialization
    • fp32_matmul_precision_key already exists in torch/_inductor/utils.py, and no public API, default, or message changes

reason: clean
Reviewed commit: 65b5c7c

Inference job

🐛 Report a wrong verdict

UNSTABLE - The following jobs are marked as unstable, possibly due to flakiness on trunk:

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@aorenste

aorenste commented Oct 1, 2026

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@pytorch-bot pytorch-bot Bot added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 1, 2026
@pytorchmergebot

Copy link
Copy Markdown
Collaborator

Merge started

Your 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

Advanced Debugging
Check the merge workflow status
here

cyyever pushed a commit to BakeLab/pytorch that referenced this pull request Oct 11, 2026
…i-structured test (pytorch#199248)

`test_max_autotune_cutlass_backend_sparse_semi_structured_mm` fails with
`KeyError: 'high'` because it reads the autotune local cache with the legacy
precision string. pytorch#189955 changed `PersistentCache` to key timings by
`fp32_matmul_precision_key()`, so with the module's
`torch.set_float32_matmul_precision("high")` the bucket is now
`"cuda:tf32,mkldnn:tf32"`. That PR updated `test_codecache.py` but missed
this lookup. The test now indexes the cache with the same helper the cache
writes with.

OSS CI did not catch this because nothing runs the test on hardware where it
executes. It is gated to sm_8x exactly; the only OSS job that runs
`test_cutlass_backend.py` is `h100-cutlass-backend`, where it skips, and the
A10G inductor jobs exclude the file. It fails in fbcode, where the file runs
on A100.

Test Plan:
On an A100 (sm_80), with CUDA 13.0 `nvcc` on PATH:

```
python test/inductor/test_cutlass_backend.py -k test_max_autotune_cutlass_backend_sparse_semi_structured_mm
```

Fails with `KeyError: 'high'` before this change and passes after.

This PR was authored with the assistance of an AI coding assistant (Claude).

Pull Request resolved: pytorch#199248
Approved by: https://github.com/pytorchgreenlight
pytorchmergebot pushed a commit that referenced this pull request Oct 14, 2026
…ed test (#200861)

`test_max_autotune_cutlass_backend_sparse_semi_structured_mm` fails with a
`KeyError` on its inputs key because it reads the autotune local cache with a
key the cache no longer writes. #194649 made `PersistentCache` store timings
under `create_benchmark_cache_key(inputs_key, ...)`, which appends the
benchmark policy (`:benchmark_policy=eager` by default), but this lookup
still uses the bare inputs key. The test now builds the key with the same
helper, inside the `config.patch` block because the policy depends on
`max_autotune`.

This is the only test that reads `LocalCache` directly. OSS CI did not catch
it for the same reason it missed #199248: the test is gated to sm_8x exactly,
and no OSS job runs `test_cutlass_backend.py` on that hardware. It fails in
fbcode, where the file runs on A100.

Test Plan:
On an A100 (sm_80), with CUDA 13.0 `nvcc` on PATH:

```
python test/inductor/test_cutlass_backend.py -k test_max_autotune_cutlass_backend_sparse_semi_structured_mm
```

Fails with `KeyError: "[('cuda', 'torch.float16', 32, 32, 32, 1, 0), ...]"`
before this change and passes after, including with an empty
`TORCHINDUCTOR_CACHE_DIR`.

This PR was authored with the assistance of an AI coding assistant (Claude).

Pull Request resolved: #200861
Approved by: https://github.com/pytorchgreenlight
@github-actions
github-actions Bot deleted the gh/aorenste/408/head branch December 3, 2026 02:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants