Skip to content

[None][feat] add Rubin topology and prototype locality-domain sharding to GVR V2 decode - #18763

Draft
longcheng-nv wants to merge 14 commits into
NVIDIA:mainfrom
longcheng-nv:feat/gvr-v2-rubin-decode
Draft

[None][feat] add Rubin topology and prototype locality-domain sharding to GVR V2 decode#18763
longcheng-nv wants to merge 14 commits into
NVIDIA:mainfrom
longcheng-nv:feat/gvr-v2-rubin-decode

Conversation

@longcheng-nv

@longcheng-nv longcheng-nv commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

Dependency

Built on #18446. Keep this PR in Draft and rebase after #18446 lands. Companion prefill work is in #18764.

Summary

  • Extend GVR V2 self-sampling decode to SM107 using runtime SM topology instead of B200-specific constants.
  • Add a default-off use_gvr_locality_domain prototype that splits eligible decode requests across two Rubin locality domains.
  • Keep each request and its next_n rows together, with proportional partitioning based on the reported domain SM counts.
  • Preserve the existing full-device path for BS=1, small workloads, unsupported configurations, and whenever the prototype is disabled.
  • Fail closed on cold CUDA Graph capture, device/topology mismatch, silent partition-context failure, or invalid unsplit tensor geometry.

Current scope

This is topology enablement plus an experimental GVR-only compute-sharding path, not a completed maximum-performance Rubin implementation.

  • The indexer logits producer still runs on the full device.
  • The produced logits remain ordinary global allocations; they are not domain-local.
  • TMA, PDL, domain-local logits/K-cache allocation, producer-side locality, and BS=1 column sharding/merge are not implemented here.
  • Dispatch thresholds are provisional and must be derived from R200 measurements before any default-on or whitelist decision.
  • The prototype supports one in-flight model execution per CUDA device. Concurrent GraphExec replay or multiple engines sharing a device are not supported yet because the execution-domain workspaces/events are shared.
  • Each eligible graph shape must run eagerly once through the same TopK instance before capture.
  • The new public prototype field requires the normal telemetry/privacy CODEOWNER review.

Validation

Passed locally:

  • GVR host router tests: 11/11.
  • Locality planner/orchestration tests: 17/17 through a dependency-stub harness.
  • Planner property sweeps over BS=1-1024, compressed N=4K-256K, K={512,1024,2048}, supported next_n, and symmetric/asymmetric topologies; all eligible plans were request-aligned, disjoint, and exhaustive.
  • Existing B200 route parity: 21,504 route cases and 43,008 streaming comparisons.
  • Relevant pre-commit formatting/lint, Python compilation, DCO, and whitespace checks.

R200 kernel validation has not been completed. Full package/DSA pytest collection is blocked in the current environment by an external bindings.so mismatch (global_steady_clock_now), and the installed CuTe DSL does not provide the Rubin helper needed to compile the SM107 path. The stub tests are not a substitute for SM107 execution.

Draft exit criteria

Before marking Ready, run correctness, stability, and performance A/B on R200 for:

  • Every integer BS from 1 through 1024 for route/correctness coverage, with performance focus around domain-SM and routing boundaries.
  • Compressed N={4K,8K,16K,32K,64K,128K,256K} (V4 ISL/4).
  • K={512,1024,2048}, compression ratios {1,4}, and supported next_n values.
  • Full-device versus strict/balanced locality-domain execution.
  • Eager execution, warmup/capture, and at least 1,000 alternating CUDA Graph replays.
  • GVR-only latency and indexer-producer + GVR end-to-end latency with CUDA Graph/PDL settings recorded.
  • Random and real indexer logits, variable/short rows, ties, denormals, and +/-inf; keep the existing NaN contract separate.

The results must justify or retune the provisional dispatch gate and confirm that SM100/SM103 code generation and all fallbacks remain unchanged.

longcheng-nv and others added 13 commits September 3, 2026 19:35
…ntion config

enable_heuristic_topk keeps selecting the GVR family over the exact radix
path; a new use_self_sampling_topk config field (default True) selects the
hint-free self-sampling engine over the temporal-hint engines. The
CUTE_DSL_GVR_V2 enum folds into CUTE_DSL_GVR behind a gvr_self_sampling
module flag, TopK.needs_gvr_prior follows the two-level decision, and the
retired TRTLLM_GVR_SELF_SAMPLING env only warns. The field threads
llm_args -> model_config -> DSAParams/DSAMetadataParams -> indexer and the
warmup mirror (whose top_k source also moves off a dead index_topk getattr
to sparse_mla_topk).

Made-with: Claude Code (Fable 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Nothing selects the CUDA heuristic once the unified DSL GVR router is
in: delete heuristicTopKDecode.{cu,h} / heuristic_topk.cuh, the
canUseHeuristic dispatch and the GVR SchemeX bounds in indexerTopK.cu
(radix keeps a cached SM-count helper), shrink the indexer_topk_decode
thop schema and its register_fake (pre_idx / heuristic_scratch gone),
drop the CUDA_GVR enum plus module branch, and retire the
heuristic-only distribution / hostile-hint / tie-plateau test arms.
The radix insertion / histogram / split-work tiers are untouched.

C++ changes are not compiled yet: build + CI plus the 886x11 CUDA-v1
vs DSL-v1 paired A/B sign-off gate this draft.

Made-with: Claude Code (Fable 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
The self-sampling engine keeps no cross-step state, so the framework no
longer allocates it any: the per-layer gvr_prior_indices arena, the LJF
row-reorder buffer, prefill seeding, the aux-stream write-back, and the
indexer-side prior slice all key on needs_gvr_prior = two-level dispatch
selecting the temporal engine. A shared use_self_sampling_gvr() predicate
in dsa/params.py keeps the indexer's per-layer TopK construction and the
metadata's allocation decision in agreement (live indexers only exist on
cr in {1, 4} layers, matching the metadata's representative ratio). With
the CUDA heuristic gone, the temporal engine requires the CuTe DSL on
SM100/103; enable_heuristic_topk without it falls back to exact radix
with a one-time warning.

Made-with: Claude Code (Fable 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
… param

Promote the emission-assisted block-skip optimization from the
TRTLLM_GVR_EMISSION env var to a `use_gvr_emission` sparse-attention
config field (default False). It only takes effect on the temporal-hint
(V1) GVR path with FP4 paged-MQA logits; the self-sampling (V2) engine
derives its bracket from the current row and never uses emission.

Threads the field through llm_args -> model_config (V4 + V3.2 rebuilds)
-> DSAParams / DSAMetadataParams -> the indexer gate, and adds
config-threading unit tests.

Made-with: Claude Code (Fable 5)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
…e GVR dispatch fields

Adds the two new sparse-attention config fields (use_self_sampling_topk,
use_gvr_emission; both bool, captured by value) via
scripts/generate_llm_args_golden_manifest.py so
test_build_capture_manifest_matches_committed_golden passes again.

Made-with: Claude Code (Fable 5.1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Picks up the main-side waive of unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py (NVIDIA#18685) that failed the CPU lanes in the previous CI round.

Made-with: Claude Code (Fable 5.1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Picks up the main-side waive of unittest/_torch/visual_gen/test_trtllm_serve_e2e.py TestFlux1/Flux2TextToImage (nvbugs/6720944) that failed the DGX_B200 lane in the previous CI round.

Made-with: Claude Code (Fable 5.1)
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Resolve tests/unittest/_torch/modules/test_top_k.py: keep the new
CUTE_DSL_RADIX prefill-dispatch test, drop the removed CUDA_GVR workspace
test, and drop the HEAD unsupported-impl test that now targets the
main-supported CUTE_DSL_RADIX; keep the CUTE_DSL_GVR unsupported-prefill
guard test (this branch has no GVR prefill form).

Made-with: Claude Code (Opus 4.8)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
Stale-base artifact from the merge-from-main baseline, not a Rubin/GVR change;
restore so the PR does not drop authorized users.

Signed-off-by: longcheng-nv <243710427+longcheng-nv@users.noreply.github.com>
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