Skip to content

[inductor][test] Fix stale inputs key in cutlass sparse semi-structured test - #200861

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

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

Conversation

@aorenste

@aorenste aorenste commented Oct 13, 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 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).

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 13, 2026 •

Copy link
Copy Markdown

🔗 Helpful Links

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

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

✅ No Failures

As of commit faf77e5 with merge base 41ee7bb (image):
💚 Looks good so far! There are no failures yet. 💚

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

  • Triviality
    • Single-cause bugfix: test read LocalCache with the bare inputs key, but the cache now stores timings under create_benchmark_cache_key(...)
    • Only test/inductor/test_cutlass_backend.py changes; no production file touched
  • Correctness
    • select_algorithm.py builds benchmark_inputs_key via create_benchmark_cache_key and PersistentCache.lookup keys on it
    • mm.py calls autotune_select_algorithm for sparse_semi_structured_mm without benchmark_with_cudagraphs, so False in the test matches
    • Key is built inside config.patch, so the max_autotune-dependent policy matches the write path
  • Test strength
    • Same cutlass kernel-count assertion on the same timings; nothing skipped or loosened

reason: clean
Reviewed commit: faf77e5

Inference job

🐛 Report a wrong verdict

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

@aorenste aorenste added the ciflow/trunk Trigger trunk jobs on your pull request label Oct 13, 2026
@aorenste
aorenste requested a review from mlazos October 13, 2026 22:50
@aorenste

Copy link
Copy Markdown
Contributor Author

@pytorchbot merge

@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

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