Skip to content

[Perf] attention: Capture translated FA4 verify metadata for DSPARK - #44973

Merged
ch-wan merged 2 commits into
mainfrom
cheng/dev/fa4-unified-verify-metadata
Oct 18, 2026
Merged

ch-wan merged 2 commits into
mainfrom
cheng/dev/fa4-unified-verify-metadata

Conversation

@ch-wan

@ch-wan ch-wan commented Oct 18, 2026 •

Copy link
Copy Markdown
Collaborator

This PR is part of a stack (oldest at bottom):

Current head 32ca1aeab5, based on main 2e9b2cacda. Stack predecessor: #44972. The Files changed tab isolates this PR from its predecessor.

Motivation

DSPARK with FA4 and unified memory needs physical FULL/SWA page tables refreshed from live allocator mappings on graph replay. Building translated verify metadata outside capture adds scheduler work and launches.

Modifications

Replayed onto the corrected prerequisites; the launch-size comment reflects the translated gather path.

  • Build translated verify tables and sequence metadata in captured work using explicit FULL/SWA virtual-to-physical tensors.
  • Make tail clearing an explicit metadata contract and keep lengths-only callers separate.
  • Add graph-replay, mapping, strided-storage, and fused-placement tests.
  • Admit FA4 for DSPARK with unified memory while preserving the existing EAGLE/DFLASH restrictions.

CI registration updates

Updated est_time in 4 affected test files from observed file-level CI timings, including process/import cost and margin. Existing estimates with sufficient margin are retained. The expanded weekly configurator test also passed all 11 cases in a 30.1-second CPU measurement.

The CI registry check validated 2,960 registrations before landing. An AST comparison confirmed that this follow-up changes registration metadata only. Runtime test measurements elsewhere in this description refer to their stated earlier revisions.

Accuracy Tests

Earlier combined stack b550cacde6 adds a test-fixture correction in #43326: the Gemma4 read-stream fixture declares its FULL address space, and the HiSparse registry test uses real CacheInitParams for the retained-window calculation. Both complete test files pass locally with GPUs hidden: 4 Gemma4 tests and 26 registry tests. Pre-commit passed. The five descendant patches are unchanged (git range-diff); this follow-up changes no production code. The earlier 455-test run did not cover these two files; GitHub CI has not yet been revalidated for this head.

Validation before the test-fixture follow-up, on combined stack 4cf27a551c: 455 tests and 921 subtests passed on B300, plus the two widened-history regressions against Rust TreeCore. The new FULL-fallback metadata cases cover eager execution and CUDA graph replay. New allocation-reclaim, explicit-prefill and JIT-reuse regressions fail on the previous code and pass with the fixes. These are combined-stack checks, not independent model reruns of each PR.

81 tests and 40 subtests passed on B300 at the previous head fe3202b894, covering decode metadata, graph replay, fused placement, unified speculative admission, and page-major backend policy.

Speed Tests and Profiling

The following throughput and exact-output measurements are from the previous stack revision, before the review fixes.

Prior combined-stack validation at fe3202b894ef1cb045e2ff6b816558927bbdc055, based on main 3671503e44:

Inkling-Small-NVFP4 (revision b6a99534467840620d411e4cd4ad5819b2610d9c) with Inkling-Small-DSpark (revision 736501c3901cfc6bbb53ba382781eb0e5d9ad66a), 4x B300 / TP4, FA4 target and draft, CUDA graphs, page size 128, greedy decoding, 48 requests with fixed synthetic 512-token inputs and 2048 output tokens. Default and unified runs used identical inputs and model revisions. The test flushed the prefix cache between cases, performed a 128-token warmup, then an exact-output run with logprobs and two throughput runs without logprobs.

  • Exact output token IDs: 48/48 requests match.
  • Per-request verify counts: 48/48 match.
  • Aggregate accept length (completion tokens / verify count): default 4.43470023, unified 4.43470023.
  • Output throughput, two runs: default 8486.2 / 8484.6 tok/s; unified 8548.8 / 8552.7 tok/s.

This validates the combined stack on one controlled workload; it is not an isolated before/after benchmark of any individual optimization or a task-accuracy evaluation. PyTorch 2.14.1+cu130, Triton 3.8, FlashInfer 0.7.1. Main arguments: --tp 4 --attention-backend fa4 --speculative-algorithm DSPARK --speculative-draft-attention-backend fa4 --page-size 128 --mem-fraction-static 0.8 --max-running-requests 48 --mamba-radix-cache-strategy extra_buffer --swa-full-tokens-ratio 0.1 --mamba-full-memory-ratio 0.1 --random-seed 1234; SGLANG_RAGGED_VERIFY_MODE=static. Only the unified arm adds --enable-unified-memory.

Checklist

  • Commit pre-commit hooks passed.
  • Regression tests passed on the combined stack; earlier individual-head results are labeled above.
  • Followed SGLang code style.
  • Upstream CI pending.

CI States

Latest PR Test (Base): 🚫 Run #39128369844
Latest PR Test (Extra): 🚫 Run #39128369818
Latest PR Test (AMD ROCm 10): 🚫 Run #39128369836

@ch-wan ch-wan added bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) parallel-stages CI: stages dispatch together instead of waiting on each other run-ci-extra CI: also run the extra suite (requires run-ci) run-ci CI: run the baseline test suite on this PR labels Oct 18, 2026
@ch-wan
ch-wan force-pushed the cheng/dev/speculative-write-location-fusion branch from e9d09e3 to 5d4099c Compare October 18, 2026 08:13
@ch-wan
ch-wan requested a review from hzh0425 as a code owner October 18, 2026 08:13
@ch-wan
ch-wan force-pushed the cheng/dev/fa4-unified-verify-metadata branch from fe3202b to 4cf27a5 Compare October 18, 2026 08:14
@ch-wan
ch-wan force-pushed the cheng/dev/speculative-write-location-fusion branch from 5d4099c to f64aab0 Compare October 18, 2026 09:02
@ch-wan
ch-wan force-pushed the cheng/dev/fa4-unified-verify-metadata branch from 4cf27a5 to b550cac Compare October 18, 2026 09:02
@ch-wan
ch-wan force-pushed the cheng/dev/speculative-write-location-fusion branch from f64aab0 to d2e166d Compare October 18, 2026 12:41
@ch-wan
ch-wan requested a review from Jialin as a code owner October 18, 2026 12:41
Base automatically changed from cheng/dev/speculative-write-location-fusion to main October 18, 2026 12:41
@ch-wan
ch-wan force-pushed the cheng/dev/fa4-unified-verify-metadata branch from b550cac to 32ca1ae Compare October 18, 2026 12:41
@ch-wan
ch-wan merged commit 57db508 into main Oct 18, 2026
56 of 73 checks passed
@ch-wan
ch-wan deleted the cheng/dev/fa4-unified-verify-metadata branch October 18, 2026 12:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bypass-fail-fast CI: a failing job no longer aborts its siblings (lint still gates) jit-kernel parallel-stages CI: stages dispatch together instead of waiting on each other run-ci CI: run the baseline test suite on this PR run-ci-extra CI: also run the extra suite (requires run-ci)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant