Skip to content

Give the single-row cached attention harness CPU stand-ins for the fused decode RoPE kernels - #14632

Merged
danielhanchen merged 1 commit into
mainfrom
fix-single-row-attention-harness
Oct 22, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
fix-single-row-attention-harness

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

tests/utils/test_single_row_cached_attention.py fails all 64 cases on main, in the Core jobs' "generation correctness guards (HARD GATE)" step (e.g. #14606, job 119685454271; reproduced on main 0ae76cc9f7):

NameError: name 'decode_rope_inplace' is not defined

The test rebuilds LlamaAttention_fast_forward_inference and Qwen3Attention_fast_forward_inference from source inside a hand-written namespace. #14599 made them call the fused decode kernels decode_rope_inplace (llama) and decode_qk_norm_rope (qwen3), which that namespace did not have. The product is fine: both are imported in the real modules.

Change

  • Both names are added with their CPU behaviour: the real functions return False / None (nothing written) as soon as the tensors are not on CUDA, and the unfused path runs. That is the path this test has always exercised.
  • The fixture now lists the decode function's free names and fails with one clear message if any is not supplied, instead of a NameError in every parametrized case the next time a dependency is added:
Qwen3Attention_fast_forward_inference now reads ['decode_qk_norm_rope']; give the harness a CPU stand-in for each

The test's rotary stub is the identity (cos 1, sin 0), so it checks masking and the KV cache rather than RoPE. The fused kernels' own correctness is covered by tests/test_decode_fused_rope.py on CUDA.

Testing

  • CPU torch 2.10: main 64 failed; this branch 64 passed.
  • Removing the qwen3 stand-in fails the fixture with the message above.

@danielhanchen

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-22T08:42:51.274480Z 4d916d2 Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. You're on a roll.

Reviewed commit: 4d916d2ec7

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@danielhanchen
danielhanchen merged commit d7fe9f2 into main Oct 22, 2026
@danielhanchen
danielhanchen deleted the fix-single-row-attention-harness branch October 22, 2026 08:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant