Skip to content

[WS2][PR7][Attention] Add FlashInfer RoPE-fused paged attention scaffold - #279

Merged
Flink-ddd merged 33 commits into
testfrom
codex/ws2-pr7-flashinfer-rope-fused-submit
Aug 24, 2026
Merged

[WS2][PR7][Attention] Add FlashInfer RoPE-fused paged attention scaffold#279
Flink-ddd merged 33 commits into
testfrom
codex/ws2-pr7-flashinfer-rope-fused-submit

Conversation

@inaniloquentee

@inaniloquentee inaniloquentee commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

Scope

PR7 is the CUDA paged-KV adapter and strict production Attention entry point for #235. FlashInfer remains the cache-layout adapter; strict Attention arithmetic now reuses the qualified FA4 CuTe core instead of the RL-Kernel reference core.

Boundary Production path Fixed strict control
Paged KV FlashInfer layout adapter Logical K/V and position order materialized before arithmetic
Attention core flash_attn.cute.interface.flash_attn_func Same FA4 core on training and rollout
Split-K FA4 num_splits=1 Contract-level Split-KV disabled; no auto split
Backward FA4 deterministic=true Dropout 0; deterministic backward required
GQA / LSE pack_gqa fixed from head layout; return_lse=true FP32 attention-domain LSE with exact shape checks
Batch execution One logical batch row per core call Stable batch-composition behavior
RoPE RL-Kernel SM90 deterministic RoPE Same post-RoPE boundary on both sides
CP communication Self-owned cuda_ag_rs Q/K/V/positions AG, FA4 core, Out/LSE RS
Reference RL-Kernel deterministic Attention core Reference/debug oracle only; rejected as production provenance

The loader inspects the installed FA4 CuTe signature and fails closed when num_splits, deterministic backward, GQA packing, or LSE export controls are absent. There is no silent fallback to another Attention kernel.

Q/K RMSNorm and projection policy are supplied by #230: TE Q/K RMSNorm is reused after an exact probe; QKV/O projection stays on RL-Kernel deterministic GEMM because expanded vendor GEMM probes drifted.

Validation

Current head: 044f5b1.

Gate Result
Attention regression without optional Triton file 172 passed, 741 skipped
Focused PR7 + correctness suite 58 passed, 129 skipped
FA4 API and provenance tests Fixed num_splits=1, deterministic backward, FP32 LSE, production/reference identity checks
H100 current-head FA4 matrix Pending: the H100 host is currently unreachable

Previous H100 results for the RL-Kernel deterministic core remain reference evidence only. They are not presented as FA4 current-head acceptance. Production bitwise status requires rerunning prefill/decode, B=1/B>1, representative sequence lengths, and 2/4/8-rank CUDA AG+RS on this exact head.

Reproduce

python -m pytest -q   tests/test_attention_correctness.py   tests/test_flashinfer_pr7_attention.py

python scripts/ws2_pr7_flashinfer_attention_check.py   --strict --device cuda --no-dry-run   --mode decode --batch-size 2 --query-len 1   --kv-seq-len 128 --page-size 16   --output results/cuda-attention/strict-decode-b2-kv128.json

torchrun --standalone --nproc-per-node=4   scripts/ws2_p2p_nccl_attention_reference_check.py   --transport cuda_ag_rs --strict-shared-core   --output results/cuda-attention/cuda-ag-rs-4r.json

Related to #235 and #294.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 96419c29-bf9c-4862-9261-7e5cd75dc8a7

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Signed-off-by: inaniloquentee <3051000145@qq.com>
@inaniloquentee
inaniloquentee marked this pull request as ready for review August 12, 2026 15:21
@inaniloquentee
inaniloquentee changed the base branch from feat/ws2-attention-single-gpu-harness-pr2 to test August 12, 2026 16:13
@inaniloquentee
inaniloquentee force-pushed the codex/ws2-pr7-flashinfer-rope-fused-submit branch from aa74b78 to 6f4aeed Compare August 17, 2026 12:58
Signed-off-by: lamentropetion <3051000145@qq.com>
@maxiaosong1124
maxiaosong1124 self-requested a review August 24, 2026 16:11

@Flink-ddd Flink-ddd left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Flink-ddd
Flink-ddd merged commit 64fe25a into test Aug 24, 2026
4 of 6 checks passed
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.

3 participants