Skip to content

[None][perf] Precompile PrimTS sparse MLA in decoder warmup and reuse decode views - #22274

Merged
yuxianq merged 25 commits into
NVIDIA:mainfrom
yuxianq:cute-dsl-precompile-api--trtllm
Nov 24, 2026
Merged

yuxianq merged 25 commits into
NVIDIA:mainfrom
yuxianq:cute-dsl-precompile-api--trtllm

Conversation

@yuxianq

@yuxianq yuxianq commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Silent warmup fallback: run_precompile_workers now returns None instead of bool. In non-strict mode, worker errors log a warning and return. Warmup continues with uncompiled kernels, and the caller cannot detect this. The first forward may still compile.
  • Prepared-launch path: The vendor patch adds a bounded prepared-launch cache for eligible native BF16/E4M3 cases. run(validate=False) skips per-call validation. The caller must meet trusted-input conditions. The code does not check violations at runtime. The cache bound is not stated.
  • Vendor pin: 3rdparty/vendor_sources.lock.yaml tracks branch cute-dsl-precompile-api--prims-ts-vendor at commit be630d2bef243b7475ff352bfdc6974512ef57f9. The objectives name the same commit. The source work is not merged upstream, so promotion depends on the source PR merging.
  • Worker lifecycle: Each rank starts a fresh process pool. The pool exits before KV-cache sizing. Timeouts and parent exit kill the worker process group. Cleanup correctness depends on this process-group handling.
  • Cache checks: With parallel compilation enabled, each warmup pass checks disk-cache membership for each distinct kernel. Repeated-pass cost is not measured.
  • Scope: The diff changes 21 files (+1532/-1936). The supplied material describes 15 of them.
  • CI: Pipelines #71066, #71185, and #71286 reported failures. Failing tests are not identified. Pipeline #86382 was aborted. Current-head CI status is not available.
  • Timings: Full-model timings were measured on pre-rebase revisions. Post-rebase timings are not available.

QA Engineer Review

  • Test files changed:
    • test_prims_ts_sparse_mla_fmha.py (+396/-464): workspace-size cache reset, warmup profile selection, row-count coverage, largest-workspace-first ordering, cache-miss-only worker dispatch, strict and non-strict worker failures, timeout cleanup. Two prepared-launch tests were removed.
    • test_phase_selective_forward.py (+4): checks that the "prims_ts" event follows the FMHA prewarm event.
    • test_warmup.py (+58): CPU-only test of _prewarm_prims_ts_sparse_mla ordering, skip conditions, and barriers.
    • test_dspark_model_engine_runtime.py (+8/-5): passes max_total_draft_tokens=5 and checks metadata construction.
  • Named tests (author-reported): Commit c7b6964da9 added a process-group timeout-cleanup test and a warmup test for a distinct exact-row plan that reuses the compiled kernel. The author reports both passed on B200.
  • Test-db or QA list membership: Not established from supplied material.
  • Coverage gap: No supplied test covers the validate=False prepared-launch path.
  • Author-reported checks: B200 and B300 cold-cache compilation, JIT-disabled loading, worker cleanup, and full-model output and graph-replay checks. These are not independently verified.
  • Coverage verdict: needs follow-up. Add prepared-launch coverage, confirm test-list membership, and identify the failing pipeline tests.

Per-File QA Perspective

  • 3rdparty/vendor_patches/flashinfer-prims-ts.patch: Adds precompile_only, probe_cached, KernelBusy, and KernelNotCached. Verify that warm-up fails when JIT or the CuTe DSL cache is disabled.
  • 3rdparty/vendor_sources.lock.yaml: Points the entry to the new branch and commit. Verify the digests match the intended pin.
  • _prims_ts_worker.py (new): Standalone worker that imports PrimTS from a supplied sys.path. Verify process-group cleanup when the parent exits.
  • prims_ts_precompile.py: Starts workers only for two or more misses. Verify timeout cleanup and non-strict warning behavior.
  • prims_ts_sparse_mla.py: Adds warmup_prims_ts_sparse_mla and removes the per-forward variant scan. Verify warmup duration and plan loading in the serving process.
  • prims_ts_dsa_sparse_mla.py: Marks a profile warmed only when variants exist. Verify that empty candidate sets leave profiles unwarmed.
  • sparse/deepseek_v4/module.py: Moves epilogue-fusion checks into supports_dsv4_epilogue_fusion. Verify fusion selection is unchanged.
  • pyexecutor/engine/runners/decoder/warmup.py: Adds a PrimTS prewarm phase with TP or TP×CP synchronization. Verify it skips context-only and SWA-limited caches.
  • _cute_dsl_compat.py (new): Adds JitSpecCuteDsl and build_and_load_cute_dsl_kernel. Verify fallback to the in-memory kernel when disk persistence fails.
  • pyexecutor/engine/metadata.py and runners/decoder/metadata.py: Pass max_total_draft_tokens only to TrtllmAttentionMetadata subclasses. Verify other backends are unaffected.
  • Test files: See QA Engineer Review.

Description

Move DeepSeek-V4 PrimTS sparse MLA compilation from the first eligible forward into decoder warmup. Each pass scans every reachable row count. plan(compile=False) obtains the finalized compile spec and workspace size without allocating launch buffers. With parallel compilation enabled, is_kernel_cached() checks each distinct kernel on disk.

  • Two or more missing variants go to a fresh per-rank process pool. The serving rank handles a single miss locally. A complete disk cache starts zero workers.
  • The standalone worker imports the vendored kernels under their canonical module names, so the serving rank can reload their exports. The pool exits before KV-cache sizing during the profiling pass.
  • The serving rank prepares its own plans and shared workspace for each pass under inference mode. Forward uses the public run(validate=False) path with independent input-view caches.
  • The immutable FlashInfer vendor pin is d81912f0b125722e40ea4a4e66cd6fc71aee2614 on the fork branch cute-dsl-precompile-api--prims-ts-vendor-20261124. It includes the current TensorRT-LLM vendor baseline 69527ce04 and the reviewed PrimTS changes. Upstream tracks compile caching and deferred planning in FlashInfer #9395 and sparse MLA run-time view reuse in FlashInfer #9767. With the pinned FlashInfer 0.7.3 runtime, TensorRT-LLM supplies the per-kernel JIT locking in its local compatibility module. FlashInfer cache PR · Original TRT-LLM implementation

The vendor topic includes the VC attention fixes from #22494, promoted to the canonical source by #22819, alongside the dense MLA and Helix changes from #19395. All ten commits that touch vendored files match the declared upstream PRs by normalized edits. The local cache adapter can be removed once the pinned FlashInfer release includes #9395's cache API and locking. #22659 also updates this pin. Whichever integration lands second should replay its source changes on the promoted tip and retain deferred planning, membership probing, and the dense CP launch ABI.

Sparse warmup prepares all eligible local PrimTS profiles whenever the library is enabled, regardless of its position in the FMHA list. Dispatch uses the actual forward inputs. With JIT disabled, prewarm loads available artifacts and defers each missing variant to a forward that selects it. The pinned FlashInfer 0.7.3 compatibility loader performs that lookup without requesting a build lock, so a read-only cache can contain a subset of the deployment’s variants. Eager generation derives its kernel profile through the same library method. The supervisor reports worker output on failure and terminates surviving descendants on both timeout and abnormal exit. Positive infinity allows an unlimited worker wait. DSA gets its top-k from runtime indices and attempts its optional scan on the first eligible eager forward. In non-strict mode a failed representative leaves subsequent batches free to plan their own rows.

The configured draft limit is applied before the first forward. Workers check that their artifact was published and the supervisor terminates its process group if the rank dies. On B300, two cold workers published both variants in 48.14 s. A separate JIT-disabled process loaded both in 0.49 s with zero workers. In a separate rank-kill check, the supervisor and pool descendants stopped within 0.70 s.

schema_version: 1
vendors:
  flashinfer-prims-ts:
    upstream_prs:
      - https://github.com/flashinfer-ai/flashinfer/pull/9395
      - https://github.com/flashinfer-ai/flashinfer/pull/9767
      - https://github.com/flashinfer-ai/flashinfer/pull/9087
      - https://github.com/flashinfer-ai/flashinfer/pull/9446

Downstream performance

DeepSeek-V4-Flash ran on four B200s with TP4/EP4, attention data parallelism, and 256 input and output tokens. Warmup times below are rank-0 wall time. The measurements predate the rebase. Each row group compares revisions from the same allocation.

PrimTS cache and comparison Mode First warmup First PrimTS phase
Cold, main-base c9c07e04 → standalone pool e9e140d7 Eager 418.2 → 195.1 s Included in attention warmup on main
Warm, main-base c9c07e04 → cache check 715858bac0 Eager 42.50 → 42.95 s 5.10 s with the cache check
Same warm comparison CUDA graph 48.00 → 47.30 s 5.15 s with the cache check

On a cold PrimTS cache, grouping all 12 specializations in one pool saved 223.1 s in the first warmup (one process per version). In the warm comparison, the earlier standalone pool without the cache check took 20.2 s eager / 20.0 s graph in its first PrimTS phase on the same node (one reference process per mode). Querying disk membership saved about 15 s in that phase. Main and the cache-check version each ran in two fresh processes per mode.

The final implementation checks the cache again when the executor binds its serving resources. We isolated this change on a separate exclusive four-B200 node with the same FlashInfer code, comparing 715858bac0 against its flag-removal patch, subsequently committed as 3fcfb3f572.

Final pass, warm disk cache First-pass-only policy Check every pass (this PR)
Eager PrimTS phase / total final warmup 0.85 / 5.65 s 3.15 / 6.45 s
CUDA-graph PrimTS phase / total final warmup 2.60 / 16.35 s 3.55 / 16.65 s

Both versions launched zero workers with all 12 exports available and four workers enabled per rank. The additional 12 checks took 1.35 s in a separate two-pass probe. The full PrimTS phase also includes local planning and rank synchronization. If two new variants first appear on the final pass, the new policy can compile them in parallel.

Steady-state time per output token
Execution Main-base → cache check, ms/token First-pass-only → every pass, ms/token
Eager C8 116.728 → 117.878 113.246 → 113.072
Eager C128 121.362 → 121.814 117.265 → 117.218
CUDA graph C8 7.755 → 7.842 7.346 → 7.345
CUDA graph C128 11.913 → 12.454 11.685 → 11.697

Columns are separate experiments. Each used before/after/after/before process order, two warmup batches and three measured batches per concurrency in each process. In the main-base comparison, eager paired differences changed sign with run order. Graph C128 averaged 4.5% slower and included one 14.33 ms/token candidate batch. In the isolated flag comparison the largest absolute difference was 0.174 ms/token. Outputs, graph replay and KV capacity matched within each mode. Weight-file page cache and weight-loading times varied across fresh processes.

Sparse MLA wrapper microbenchmark

The earlier public run() comparison used TRT-LLM main-base c9c07e04 and feature revision 9d8394d2 with FlashInfer 81f96025f. It included the warmed prepared dispatch on main. The benchmark used BF16, 64 heads, fixed KV pools, and one process per source.

Local rows Extra Persistent inputs Replaced inputs, prior tensors alive One-use inputs, prior tensors released
2 0 16.120 → 13.152 16.314 → 17.212 16.513 → 15.278
2 32 15.960 → 14.125 16.451 → 18.342 16.853 → 16.659
2 512 18.112 → 16.101 18.532 → 20.605 18.939 → 18.621
32 0 16.314 → 13.243 16.772 → 17.667 16.913 → 15.559
32 32 16.152 → 14.117 17.408 → 19.555 17.265 → 17.029
32 512 18.071 → 15.999 18.888 → 20.628 19.280 → 18.711

Values are host microseconds per call. Persistent inputs improved 11.1–18.8% and one-use inputs improved 1.1–8.0%. Replacing inputs while keeping the prior tensors alive cost 0.90–2.15 µs more per call (5.3–12.3%). Output/LSE hashes and native arguments matched in all 18 cases. The fixture used 768 physical cache rows and fixed per-profile pools.

In a separate B200 wrapper experiment on FlashInfer #9767 (5880ee354), bypassing only the query, index and output view caches saved 0.956 µs per host call on average with ephemeral adapter inputs. It cost 0.082–0.356 µs per call with persistent inputs across six profiles. Two fresh processes exercised both orders. Numerical results and all 17 launch arguments matched. We retained the general cache. These timings isolate the wrapper and exclude model-level TPOT.

Test Coverage

On dbf148f14d, after rebasing onto the #22819 merge (86967b879a), 33 targeted tests passed on B200 with zero skips. The run used stock FlashInfer 0.7.3 and a CI wheel with the same C++ tree as the rebased branch. Coverage included cold worker-to-parent handoff, sparse MLA reload, speculative rows, the launch ABI, and the promoted VC attention grouped-token and FP8 numerical cases.

Separate 512-row D512 and D576 discovery scans on this head each made zero PyTorch CUDA allocation requests. All 1,024 finalized compile identities and workspace sizes, and every representative row, matched the pre-rebase result. In a fresh unprivileged process with a genuinely read-only partial cache, prewarm deferred the missing kernel and loaded the cached sibling, which produced bitwise-identical output.

On 0bd35f8ad5, the B200 worker-to-parent regression passed with stock FlashInfer 0.7.3. The test forbids requesting the lock directory for both a missing kernel and cached siblings.

On 002a9767e9, four targeted B200 regression cases and two cold-cache dispatch checks passed. With JIT disabled and an empty PrimTS cache, prewarm completed in both orders. The fallback-first forward matched its reference, and the PrimTS-first forward raised MissingJITCacheError for the requested kernel. A mixed-cache case verified that warmup continued loading available variants after a miss.

On 29257e701d after rebasing onto 4af2d530, all 64 targeted B200 tests passed with zero skips. The run used stock FlashInfer 0.7.3, CuTe DSL 4.8.0 and a TensorRT-LLM CI wheel built from the same C++ tree. Coverage includes the vendored-import regression, all ten sampler cases that failed in Jenkins #71596, four public trusted-launch ABI configurations, dense MLA graph replay, sparse warmup followed by zero new kernel compilations, worker cleanup, TP/CP failure propagation, and DSA exact-row fallback.

Two additional single-B200 Helix tests passed against the vendored provider. The page-boundary case exercised logical CP ranks 0, 1 and 2 and compared merged output and LSE with the reference. The CP8 case exercised nonzero-rank CUDA graph replay. This validates the launch ABI on one device. A third additional test passed for packed sparse partial-head BF16 graph replay. Total on the rebased revision: 67 passed, zero skipped.

The vendor tree verifies against its published SHA. The cumulative pre-commit checks passed. The advisory type checker reported the existing gen_offset warning in the unchanged FP8 path.

  • Fresh B200 processes verified full hits, two misses, one miss, stale source metadata and fresh reload with JIT disabled. Queries did no building or loading. The serving process loaded all 12 variants, and only missing variants went to workers.
  • The final eight full-model processes passed output, graph replay, zero-worker and capacity checks. Separate two-pass tests exercised newly encountered final-pass variants and preserved native arguments and numerical results.
  • On vendor revision d346fb95e1, the packed dense launch-bounds and sparse caller-workspace/cache-membership tests both passed on B200. Six B200 cases passed on the separate FlashInfer PR tree, including the latest upstream KV-bounds ABI.
  • After rebasing onto e466dcb2, both affected Qwen3.8-Flash-Next FP8 test files collected on B300 (120 cases). Four snapshot and cached-replay cases passed, including graph replay.
  • Post-rebase checks include the vendor lock against the published source, changed-file hooks, and comparison with the three-way merge of the benchmarked patch. The full-model timings above were taken on the listed pre-rebase revisions.

PR Checklist

Please review the following before submitting your PR:

  • PR description clearly explains what and why. If using CodeRabbit's summary, please make sure it makes sense.

  • PR Follows TRT-LLM CODING GUIDELINES to the best of your knowledge.

  • Test cases are provided for new code paths (see test instructions)

  • If PR introduces API changes, an appropriate PR label is added - either api-compatible or api-breaking. For api-breaking, include BREAKING in the PR title.

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • Update tava architecture diagram if there is a significant design change in PR.

  • The reviewers assigned automatically/manually are appropriate for the PR.

  • Please check this after reviewing the above items as appropriate for this PR.

GitHub Bot Help

To see a list of available CI bot commands, please comment /bot help.

@yuxianq

yuxianq commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs maintainer action:

The base lock now uses refresh branch trtllm-prims-ts-dev-20261107, but this monitor still publishes to trtllm-prims-ts-dev-20261012.

Fix: A maintainer must stop this monitor and migrate its workdir with --canonical-branch trtllm-prims-ts-dev-20261107 --migrate-canonical-branch-from trtllm-prims-ts-dev-20261012. Verify a dry run before resuming publication. Do not promote back to the old branch or change contributor metadata to bypass this cutover.

The bot will recheck automatically on a later poll.

Checked PR revision: 8309df42328a. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

@yuxianq

yuxianq commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs author action:

Upstream attribution is unresolved for these source commits:

Fix: In the PR description, add missing PRs to vendors.flashinfer-prims-ts.upstream_prs, remove incorrectly listed PRs, or correct/rebase the source pin and update the vendored snapshot. For an intentional adaptation or ambiguous ownership, merge a targeted resolutions entry into the existing vendor metadata as shown below. Replace the SHA and URL and give a specific reason; preserve other entries. No complete commit_map is required. A resolution records an author assertion, not verified equivalence; it is retained during refresh until separately verified.

vendors:
  flashinfer-prims-ts:
    upstream_prs:
      - https://github.com/flashinfer-ai/flashinfer/pull/123
    resolutions:
      FULL_40_CHARACTER_SOURCE_SHA:
        upstream_pr: https://github.com/flashinfer-ai/flashinfer/pull/123
        reason: Explain the downstream adaptation or why this PR owns the change.

The bot will recheck automatically on a later poll.

Checked PR revision: 17ec695e32a6. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-upstream, pin 62372666f04cad0156b6c30321597c287d49512a.

Supersedes previous vendor validation.

@yuxianq

yuxianq commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs author action:

Upstream attribution is unresolved for these source commits:

Fix: In the PR description, add missing PRs to vendors.flashinfer-prims-ts.upstream_prs, remove incorrectly listed PRs, or correct/rebase the source pin and update the vendored snapshot. For an intentional adaptation or ambiguous ownership, merge a targeted resolutions entry into the existing vendor metadata as shown below. Replace the SHA and URL and give a specific reason; preserve other entries. No complete commit_map is required. A resolution records an author assertion, not verified equivalence; it is retained during refresh until separately verified.

vendors:
  flashinfer-prims-ts:
    upstream_prs:
      - https://github.com/flashinfer-ai/flashinfer/pull/123
    resolutions:
      FULL_40_CHARACTER_SOURCE_SHA:
        upstream_pr: https://github.com/flashinfer-ai/flashinfer/pull/123
        reason: Explain the downstream adaptation or why this PR owns the change.

The bot will recheck automatically on a later poll.

Checked PR revision: 9d8394d2e673. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-upstream, pin 81f96025f4659da1c2ce42a9fa51d4d282453963.

Supersedes previous vendor validation.

@yuxianq

yuxianq commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs maintainer action:

Waiting for the preceding vendor promotion: the base lock still points to repository https://github.com/yuxianq/flashinfer.git, branch flashinfer-9222-prims-ts--source.

Fix: A maintainer must finish the preceding lock-only promotion back to yuxianq/flashinfer / trtllm-prims-ts-dev-20261107. After it merges, the author should rebase this consumer PR onto the latest base branch and rebase its temporary source branch onto the new canonical pin, then update the lock/vendor snapshot. No metadata edit can unblock the preceding promotion.

The bot will recheck automatically on a later poll.

Checked PR revision: 9d8394d2e673. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Supersedes previous vendor validation.

@yuxianq

yuxianq commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs author action:

Source update is not a fast-forward.

Fix: Fetch canonical repository https://github.com/yuxianq/flashinfer.git, branch trtllm-prims-ts-dev-20261107, and rebase the temporary source branch cute-dsl-precompile-api--prims-ts-upstream onto its latest tip without merge commits, not just the consumer lock's pin 2ffd3f8b2c2d163237c95bdf40e7a065a99cd544. Then use scripts/vendor/manage.py to update 3rdparty/vendor_sources.lock.yaml and the vendored snapshot to the rebased SHA, and push the source branch and consumer PR. Editing metadata alone will not fix this.

The bot will recheck automatically on a later poll.

Checked PR revision: 9d8394d2e673. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-upstream, pin 81f96025f4659da1c2ce42a9fa51d4d282453963.

Supersedes previous vendor validation.

@yuxianq
yuxianq force-pushed the cute-dsl-precompile-api--trtllm branch from 9d8394d to 562d15e Compare November 18, 2026 19:09
@yuxianq yuxianq changed the title [None][refactor] Move PrimTS sparse MLA precompilation into warmup [None][perf] Precompile missing PrimTS sparse MLA kernels during decoder warmup Nov 18, 2026
@yuxianq

yuxianq commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@yuxianq

yuxianq commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs author action:

Upstream attribution is unresolved for these source commits:

No exact match was found for the following commits; similarity matching accepted them:

  • d346fb95e145a37cc5f3cc24711ee8e81b147d33: upstream PR #9395, similarity 97.09% — accepted (threshold 90.00%; similar-edits).

Scores compare normalized patch lines in lock-selected files, not semantic equivalence. These changes retain retain-until-verified refresh policy.

Fix: In the PR description, add missing PRs to vendors.flashinfer-prims-ts.upstream_prs, remove incorrectly listed PRs, or correct/rebase the source pin and update the vendored snapshot. For an intentional adaptation or ambiguous ownership, merge a targeted resolutions entry into the existing vendor metadata as shown below. Replace the SHA and URL and give a specific reason; preserve other entries. No complete commit_map is required. A resolution records an author assertion, not verified equivalence; it is retained during refresh until separately verified.

vendors:
  flashinfer-prims-ts:
    upstream_prs:
      - https://github.com/flashinfer-ai/flashinfer/pull/123
    resolutions:
      FULL_40_CHARACTER_SOURCE_SHA:
        upstream_pr: https://github.com/flashinfer-ai/flashinfer/pull/123
        reason: Explain the downstream adaptation or why this PR owns the change.

The bot will recheck automatically on a later poll.

Checked PR revision: 562d15e7aa0f. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-vendor, pin d346fb95e145a37cc5f3cc24711ee8e81b147d33.

Supersedes previous vendor validation.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #85822 [ run ] triggered by Bot. Commit: 562d15e Link to invocation

@yuxianq

yuxianq commented Nov 18, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion metadata and source attribution are valid. This is not a code-review approval. Promotion still requires the source PR to merge.

No exact match was found for the following commits; similarity matching accepted them:

  • d346fb95e145a37cc5f3cc24711ee8e81b147d33: upstream PR #9395, similarity 97.09% — accepted (threshold 90.00%; similar-edits).

Scores compare normalized patch lines in lock-selected files, not semantic equivalence. These changes retain retain-until-verified refresh policy.

Checked PR revision: 562d15e7aa0f. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-vendor, pin d346fb95e145a37cc5f3cc24711ee8e81b147d33.

Supersedes previous vendor validation.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #85822 [ run ] completed with state SUCCESS. Commit: 562d15e
/LLM/main/L0_MergeRequest_PR pipeline #71066 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@yuxianq

yuxianq commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs maintainer action:

Waiting for the preceding vendor promotion: the base lock still points to repository https://github.com/yuxianq/flashinfer.git, branch nvbug-6959297-cutlass-dsl-compat--flashinfer.

Fix: A maintainer must finish the preceding lock-only promotion back to yuxianq/flashinfer / trtllm-prims-ts-dev-20261107. After it merges, the author should rebase this consumer PR onto the latest base branch and rebase its temporary source branch onto the new canonical pin, then update the lock/vendor snapshot. No metadata edit can unblock the preceding promotion.

The bot will recheck automatically on a later poll.

Checked PR revision: 562d15e7aa0f. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Supersedes previous vendor validation.

@yuxianq

yuxianq commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs author action:

Source update is not a fast-forward.

Fix: Fetch canonical repository https://github.com/yuxianq/flashinfer.git, branch trtllm-prims-ts-dev-20261107, and rebase the temporary source branch cute-dsl-precompile-api--prims-ts-vendor onto its latest tip without merge commits, not just the consumer lock's pin 31fe2dbd6b65cca758c1318f177b315be0c33778. Then use scripts/vendor/manage.py to update 3rdparty/vendor_sources.lock.yaml and the vendored snapshot to the rebased SHA, and push the source branch and consumer PR. Editing metadata alone will not fix this.

The bot will recheck automatically on a later poll.

Checked PR revision: 562d15e7aa0f. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-vendor, pin d346fb95e145a37cc5f3cc24711ee8e81b147d33.

Supersedes previous vendor validation.

@yuxianq
yuxianq force-pushed the cute-dsl-precompile-api--trtllm branch from 562d15e to 632b0b9 Compare November 19, 2026 03:25
@yuxianq

yuxianq commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion metadata and source attribution are valid. This is not a code-review approval. Promotion still requires the source PR to merge.

No exact match was found for the following commits; similarity matching accepted them:

  • b116138c9c1da75f5520cd8b4b5a7ebe1ca4551b: upstream PR #9395, similarity 97.09% — accepted (threshold 90.00%; similar-edits).

Scores compare normalized patch lines in lock-selected files, not semantic equivalence. These changes retain retain-until-verified refresh policy.

Checked PR revision: 632b0b95239a. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-vendor, pin b116138c9c1da75f5520cd8b4b5a7ebe1ca4551b.

Supersedes previous vendor validation.

@yuxianq

yuxianq commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #85959 [ run ] triggered by Bot. Commit: 632b0b9 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #85959 [ run ] completed with state SUCCESS. Commit: 632b0b9
/LLM/main/L0_MergeRequest_PR pipeline #71185 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@yuxianq

yuxianq commented Nov 19, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #86073 [ run ] triggered by Bot. Commit: 2bda8f1 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #86073 [ run ] completed with state SUCCESS. Commit: 2bda8f1
/LLM/main/L0_MergeRequest_PR pipeline #71286 completed with status: 'FAILURE'

CI Report

⚠️ Action Required:

  • Please check the failed tests and fix your PR
  • If you cannot view the failures, ask the CI triggerer to share details
  • Once fixed, request an NVIDIA team member to trigger CI again

CI Agent Failure Analysis

Link to invocation

@yuxianq
yuxianq marked this pull request as ready for review November 20, 2026 01:09
@yuxianq
yuxianq requested review from a team as code owners November 20, 2026 01:09
Start a fresh per-rank process pool on the first eligible decoder warmup. Load the vendored kernels under their canonical module names so workers share the serving cache without initializing TensorRT-LLM or MPI. Join the pool before KV-cache sizing and prepare subsequent plans locally.

Signed-off-by: Yuxian Qiu <[email protected]>
Check the on-disk export of each distinct sparse MLA specialization during the first eligible warmup. Dispatch only misses that can compile in parallel, and load all plans on the serving rank.

Signed-off-by: Yuxian Qiu <[email protected]>
Determine worker dispatch from the current specialization inventory on every eligible pass. This also lets a later warmup compile newly required variants in parallel.

Signed-off-by: Yuxian Qiu <[email protected]>
@yuxianq

yuxianq commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion needs author action:

Source update is not a fast-forward.

Fix: Fetch canonical repository https://github.com/yuxianq/flashinfer.git, branch trtllm-prims-ts-dev-20261107, and rebase the temporary source branch cute-dsl-precompile-api--prims-ts-vendor-20261121 onto its latest tip without merge commits, not just the consumer lock's pin 69527ce04c4ca765f9f46ff0aa55b50ac776ba29. Then use scripts/vendor/manage.py to update 3rdparty/vendor_sources.lock.yaml and the vendored snapshot to the rebased SHA, and push the source branch and consumer PR. Editing metadata alone will not fix this.

The bot will recheck automatically on a later poll.

Checked PR revision: 0bd35f8ad562. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-vendor-20261121, pin c4a601c01341c0a2b6f5623e9f64adb917c27be8.

Supersedes previous vendor validation.

@yuxianq
yuxianq force-pushed the cute-dsl-precompile-api--trtllm branch from 0bd35f8 to dbf148f Compare November 24, 2026 03:07
@yuxianq

yuxianq commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

/bot run --disable-fail-fast

@yuxianq

yuxianq commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator Author

Vendor validation: flashinfer-prims-ts

@yuxianq — Vendor promotion metadata and source attribution are valid. This is not a code-review approval. Promotion still requires the source PR to merge.

Checked PR revision: dbf148f14d88. This is a snapshot; newer results are posted as new comments. Observed dev/upstream tip SHAs may be stale: tip movement alone does not post a new comment when the result is unchanged. Fetch the live branch before rebasing or choosing a new pin.

Checked source: https://github.com/yuxianq/flashinfer.git / cute-dsl-precompile-api--prims-ts-vendor-20261124, pin d81912f0b125722e40ea4a4e66cd6fc71aee2614.

Supersedes previous vendor validation.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #86865 [ run ] triggered by Bot. Commit: dbf148f Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #86865 [ run ] completed with state SUCCESS. Commit: dbf148f
/LLM/main/L0_MergeRequest_PR pipeline #72028 completed with status: 'SUCCESS'

CI Report

Link to invocation

@yuxianq
yuxianq merged commit 7099075 into NVIDIA:main Nov 24, 2026
14 checks passed
yuxianq added a commit that referenced this pull request Nov 24, 2026
----- BEGIN VENDOR PROMOTION V1 -----
{
  "attribution": {
    "46f062fd522eb0306050905bd9c209c9827cd01f": {
      "method": "same-edits",
      "upstream_base": "b8ef7f2312fd80d719ee2c62184cd936de0f0161",
      "upstream_head": "32922a2d93b78d5f447a5899906011fd245abbcd"
    },
    "4c8cbed57690b325a1d9b7b062f56ab4667ae420": {
      "method": "outside-vendor-scope",
      "refresh_policy": "retain"
    },
    "8411b090e4ef93e25373643a42a47049212241b0": {
      "method": "outside-vendor-scope",
      "refresh_policy": "retain"
    },
    "a25e87e0350bc7334d400c5d9b2993ef6ecbaa76": {
      "method": "same-edits",
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a"
    },
    "a49f1bcbb3bd20fc3d951cfedde06359be989d3c": {
      "method": "same-edits",
      "upstream_base": "7eae60fb4f9ee437df67ba9891f7b6691a12fee0",
      "upstream_head": "654211d0d884935d15c50287483e9da371a7726e"
    },
    "a6c6a379df3807413e90dccfa3bde548361a27f5": {
      "method": "same-edits",
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a"
    },
    "b4a09ed0dd46631784d286781c074bb24bc8f332": {
      "method": "same-edits",
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a"
    },
    "c6a60294d9c594a8ac941189d905c88c87fc1aca": {
      "method": "same-edits",
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a"
    },
    "d81912f0b125722e40ea4a4e66cd6fc71aee2614": {
      "method": "same-edits",
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a"
    },
    "f601f0b683d25fdfd341547e51726be53607496f": {
      "method": "same-edits",
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a"
    },
    "faa2c77be8a00c2be46846601228c0f7417e7ec6": {
      "method": "same-edits",
      "upstream_base": "b966a5b24c6c942247000abd335c9a3cff83db6a",
      "upstream_head": "5880ee354be10310b589865e92f91987bfb65167"
    },
    "fddc8c0d75b46049bd49b48ec81cdbc2a36d33f8": {
      "method": "same-edits",
      "upstream_base": "b966a5b24c6c942247000abd335c9a3cff83db6a",
      "upstream_head": "5880ee354be10310b589865e92f91987bfb65167"
    }
  },
  "attribution_scope": {
    "include": [
      "**/*.py"
    ],
    "source": "flashinfer/attention/prims_ts"
  },
  "canonical_branch": "trtllm-prims-ts-dev-20261107",
  "canonical_url": "https://github.com/yuxianq/flashinfer.git",
  "changes": [
    {
      "commits": [
        "4c8cbed57690b325a1d9b7b062f56ab4667ae420",
        "8411b090e4ef93e25373643a42a47049212241b0"
      ],
      "refresh_policy": "retain",
      "unpaired_reason": "No changes to files selected by the vendor lock source/include. No whole-commit upstream equivalence is claimed.",
      "upstream_base": null,
      "upstream_head": null,
      "upstream_merge": null,
      "upstream_pr": null
    },
    {
      "commits": [
        "46f062fd522eb0306050905bd9c209c9827cd01f"
      ],
      "upstream_base": "b8ef7f2312fd80d719ee2c62184cd936de0f0161",
      "upstream_head": "32922a2d93b78d5f447a5899906011fd245abbcd",
      "upstream_merge": "504035ddab474b0b90c8ee48f0347963d4619dc6",
      "upstream_pr": "flashinfer-ai/flashinfer#9087"
    },
    {
      "commits": [
        "c6a60294d9c594a8ac941189d905c88c87fc1aca",
        "a25e87e0350bc7334d400c5d9b2993ef6ecbaa76",
        "f601f0b683d25fdfd341547e51726be53607496f",
        "a6c6a379df3807413e90dccfa3bde548361a27f5",
        "b4a09ed0dd46631784d286781c074bb24bc8f332",
        "d81912f0b125722e40ea4a4e66cd6fc71aee2614"
      ],
      "upstream_base": "db2373490172a31dbbdc489ef82fe174e6d88f06",
      "upstream_head": "a2ba1d5c16954460f05857db63a10c3f5c028d5a",
      "upstream_merge": null,
      "upstream_pr": "flashinfer-ai/flashinfer#9395"
    },
    {
      "commits": [
        "a49f1bcbb3bd20fc3d951cfedde06359be989d3c"
      ],
      "upstream_base": "7eae60fb4f9ee437df67ba9891f7b6691a12fee0",
      "upstream_head": "654211d0d884935d15c50287483e9da371a7726e",
      "upstream_merge": "4433ef48d1eabaab82c7cdd33244aabedd810aa8",
      "upstream_pr": "flashinfer-ai/flashinfer#9446"
    },
    {
      "commits": [
        "faa2c77be8a00c2be46846601228c0f7417e7ec6",
        "fddc8c0d75b46049bd49b48ec81cdbc2a36d33f8"
      ],
      "upstream_base": "b966a5b24c6c942247000abd335c9a3cff83db6a",
      "upstream_head": "5880ee354be10310b589865e92f91987bfb65167",
      "upstream_merge": null,
      "upstream_pr": "flashinfer-ai/flashinfer#9767"
    }
  ],
  "consumer_base": "main",
  "consumer_merge": "7099075c4d2d1ffdef402a9d83d89e10d3f8b0ea",
  "consumer_pr": "#22274",
  "contributor_metadata": {
    "metadata_digest": "3727b5d5e03b7cbc61edfde45ae1f1be7185d601b3648303f5c1a9208883d710",
    "pr_author": "yuxianq",
    "source_head": "dbf148f14d8851f69cc8e5253218cbec0f45fc3c"
  },
  "kind": "promotion",
  "previous": "69527ce04c4ca765f9f46ff0aa55b50ac776ba29",
  "promoted": "d81912f0b125722e40ea4a4e66cd6fc71aee2614",
  "source_branch": "cute-dsl-precompile-api--prims-ts-vendor-20261124",
  "source_url": "https://github.com/yuxianq/flashinfer.git",
  "upstream_base": "911d6a9d62308b6c8a5249e8dc4aabc7518020f1",
  "upstream_branch": "main",
  "upstream_observed_main": "4d5a6ce322587d247fb192f97a0d23eeba9e3412",
  "upstream_repository": "flashinfer-ai/flashinfer",
  "vendor": "flashinfer-prims-ts",
  "version": 1
}
----- END VENDOR PROMOTION V1 -----

Signed-off-by: Yuxian Qiu <[email protected]>
qsang-nv pushed a commit to flashinfer-ai/flashinfer that referenced this pull request Nov 25, 2026
…9395)

<!-- .github/pull_request_template.md -->

## 📌 Description

Separate processes can compile different CuTe DSL kernels concurrently.
Within a process, CuTe compiler entry is serialized to protect shared
compiler options. A per-kernel file lock deduplicates builds, and a
module lock protects invalidation and export. Cache hits verify the
identity of the published metadata marker across the object read,
including on read-only filesystems. Cache-filling workers use
`compile_and_persist(force=False)` to reuse a specialization published
by another worker while they wait. The default still forces a rebuild.
MoE callers that need an executable use `build_and_load()`. If a sibling
invalidates an export during a load, the caller can use its retained
kernel. A spec that previously exported without an engine can rebuild an
executable when JIT is enabled.

`BatchSparseMLADecodePagedTSWrapper.plan(compile=False)` resolves the
finalized specialization and workspace size, leaves `compiled=None`, and
allocates no launch tensors. A caller-provided workspace is still
validated. After planning, `is_kernel_cached()` checks the on-disk
object and metadata without loading or compiling it. Call `plan()` with
its default `compile=True` before `run()`.

With the persistent disk cache enabled, cacheable PrimTS MoE GEMMs honor
`FLASHINFER_DISABLE_JIT=1`. A warm hit loads normally. A cold miss
raises `MissingJITCacheError`, so deployments using that flag must
populate the cache first. The MoE autotuner can defer a missing-kernel
error until the first forward requiring that tactic.

PrimTS attention probes and executable plans share one source digest per
process and strict-key setting. Each probe still checks the on-disk
object and metadata, so it sees kernels published by other workers. On
`2b2da3572`, 176 targeted CPU tests and two B200 tests passed, including
a cold wrapper probe, compile and reload.

## 🔍 Related Issues

TensorRT-LLM uses these APIs to schedule missing warmup variants.
Steady-state sparse tensor-view reuse is tracked separately in #9767.
Both PRs target `main` and can be reviewed independently. [TensorRT-LLM
integration](NVIDIA/TensorRT-LLM#22274)

## 🚀 Pull Request Checklist

Thank you for contributing to FlashInfer! Before we review your pull
request, please make sure the following items are complete.

### ✅ Pre-commit Checks

- [x] I have installed `pre-commit` by running `pip install pre-commit`
(or used your preferred method).
- [ ] I have installed the hooks with `pre-commit install`.
- [ ] I have run the hooks manually with `pre-commit run --all-files`
and fixed any reported issues.

> If you are unsure about how to set up `pre-commit`, see [the
pre-commit documentation](https://pre-commit.com/).

## 🧪 Tests

On `a2ba1d5c1`, the eight CPU files from the maintainer’s scoped run
passed locally on Python 3.10.22 (223 tests). The two changed test files
also passed on Python 3.12 (109 tests). The three previously failing
cases were reproduced before the fix. The MXFP8 worker test now verifies
`compile_and_persist(force=False)`, and the thread-isolation test
catches `concurrent.futures.TimeoutError`.

On `72c8bbfab`, 164 targeted CPU tests passed, along with the targeted
B200 deferred-plan, executable launch, and D576 checks. With JIT
disabled, the shared build/load path tries the existing artifact and
raises `MissingJITCacheError` on a miss before requesting a build lock.
In a fresh unprivileged process on B200, a missing artifact in a
read-only CuTe cache produced that error and its cached sibling loaded
and ran with bitwise-correct output.

On `a1d5a1715`, 110 targeted CPU tests passed. The B200 sparse MLA
caller-workspace/eager test and the batch-invariant GEMM shared-object
launch test both passed.

Cold MoE tactic precompilation on one B200 with CuTe DSL 4.8.0 took a
median **20.889 s** on the merge base (`db2373490`) and **20.208 s** on
this change. Each revision ran in three fresh processes with empty
caches. The BF16 SwiGLU case used 64 tokens, hidden size 1024,
intermediate size 512, eight experts and top-2 routing. Four distinct
tactic pairs compiled and published eight FC1/FC2 kernels per run. All
outputs matched across revisions and passed the PyTorch reference. The
measurement covers tactic fan-out, compilation, publication and reload.
Input setup, tactic selection and routing are outside the timing.

On review-fix head `91225f625`, 106 CPU tests passed covering CuTe cache
concurrency, consistent generations, read-only hits, engine-less export,
and the batch-invariant JIT cache. The B200 sparse MLA workspace and
batch-invariant GEMM shared-object launch tests both passed.

All 86 CPU JIT cache tests passed, including concurrent compilation for
different kernels and single publication for duplicate requests. The
B200 caller-workspace test covered deferred planning, rejection of an
uncompiled run, and disk-cache misses and hits. The B200 dense CP graph
smoke test passed after the compile-path refactor. Changed-file
pre-commit checks passed.

- [x] Tests have been added or updated as needed.
- [ ] All tests are passing (`unittest`, etc.).
- [ ] This PR requires **full-scope** CI, not targeted tests (expensive;
justify below).
Reason: <!-- e.g. cross-cutting change to shared infrastructure -->

Targeted CI paths: `tests/cpu/jit/test_cute_dsl_cache.py`
`tests/attention/test_attention_ts_sparse_mla.py`
`tests/attention/test_attention_ts_mla_cp.py`

## 🔬 Experimental Track

<!-- Only for PRs submitted under the experimental policy
(CONTRIBUTING.md → "Experimental APIs and Backends").
     Leave this section untouched for normal PRs. -->

- [ ] This PR is **experimental**: it adds or changes code under
`flashinfer/experimental/` and/or an `@flashinfer_experimental_api`.
Tracking issue: #
- [ ] The tracking issue names an owner, the reason for the experimental
path, and a graduation plan with a target release.
- [ ] Core changes are limited to a thin entry point (signature, shared
validation, feature-gate check, backend selection, handoff).
- [ ] Tests live in `tests/experimental/` and were validated on the
intended hardware; a runnable example is included.
- [ ] Nothing is registered in `flashinfer/aot.py`, and no experimental
backend is reachable from `backend="auto"` without
`FLASHINFER_ALLOW_EXPERIMENTAL_AUTO_BACKENDS=1`. (Calling an
`@flashinfer_experimental_api` or naming a backend explicitly is itself
the opt-in and needs no environment variable.)
- [ ] **Test scope declared below.** The experimental CI lane runs
exactly these targets, so keep them as narrow as the change allows.

<!-- Required for experimental PRs. Replace the commented lines below
with your targets.
Do not delete the fence or change its `experimental-tests` tag — the
experimental-track
watcher reads it verbatim to decide which targets to ask CI for. -->

```experimental-tests
# One target per line: a directory or a file. (A pytest ::selector is not
# supported -- the sharding runner cannot consume one.) Must be under
# tests/experimental/ and must exist. Delete these comment lines and add yours, e.g.
#
#   tests/experimental/test_my_backend.py
#   tests/experimental/my_backend/
#
# Declaring the whole tree (tests/experimental/) is allowed but means every
# experimental PR pays for every other feature's tests, in every matrix cell.
```

## Downstream measurements of the combined integration

DeepSeek-V4-Flash ran on four B200s with TP4/EP4, attention data
parallelism, and 256 input and output tokens. Warmup times below are
rank-0 wall time. These historical runs include the TensorRT-LLM
worker-pool changes and the combined FlashInfer feature series. They
predate this PR split. Each row group compares revisions from the same
allocation.

| PrimTS cache and comparison | Mode | First warmup | First PrimTS phase
|
|---|---|---:|---:|
| Cold, main-base `c9c07e04` → standalone pool `e9e140d7` | Eager |
418.2 → 195.1 s | Included in attention warmup on main |
| Warm, main-base `c9c07e04` → cache check `715858bac0` | Eager | 42.50
→ 42.95 s | 5.10 s with the cache check |
| Same warm comparison | CUDA graph | 48.00 → 47.30 s | 5.15 s with the
cache check |

On a cold PrimTS cache, grouping all 12 specializations in one pool
saved **223.1 s** in the first warmup (one process per version). In the
warm comparison, the earlier standalone pool without the cache check
took **20.2 s eager / 20.0 s graph** in its first PrimTS phase on the
same node (one reference process per mode). Querying disk membership
saved about **15 s** in that phase. Main and the cache-check version
each ran in two fresh processes per mode.

The final implementation checks the cache again when the executor binds
its serving resources. We isolated this change on a separate exclusive
four-B200 node with the same FlashInfer code, comparing `715858bac0`
against its flag-removal patch, subsequently committed as `3fcfb3f572`.

| Final pass, warm disk cache | First-pass-only policy | Check every
pass (TRT-LLM) |
|---|---:|---:|
| Eager PrimTS phase / total final warmup | 0.85 / 5.65 s | 3.15 / 6.45
s |
| CUDA-graph PrimTS phase / total final warmup | 2.60 / 16.35 s | 3.55 /
16.65 s |

Both versions launched **zero workers** with all 12 exports available
and four workers enabled per rank. The additional 12 checks took **1.35
s** in a separate two-pass probe. The full PrimTS phase also includes
local planning and rank synchronization. If two new variants first
appear on the final pass, the new policy can compile them in parallel.

<details>
<summary>Steady-state time per output token</summary>

| Execution | Main-base → cache check, ms/token | First-pass-only →
every pass, ms/token |
|---|---:|---:|
| Eager C8 | 116.728 → 117.878 | 113.246 → 113.072 |
| Eager C128 | 121.362 → 121.814 | 117.265 → 117.218 |
| CUDA graph C8 | 7.755 → 7.842 | 7.346 → 7.345 |
| CUDA graph C128 | 11.913 → 12.454 | 11.685 → 11.697 |

Columns are separate experiments. Each used before/after/after/before
process order, two warmup batches and three measured batches per
concurrency in each process. In the main-base comparison, eager paired
differences changed sign with run order. Graph C128 averaged 4.5% slower
and included one 14.33 ms/token candidate batch. In the isolated flag
comparison the largest absolute difference was 0.174 ms/token. Outputs,
graph replay and KV capacity matched within each mode. Weight-file page
cache and weight-loading times varied across fresh processes.

</details>

## Reviewer Notes

Please check lock ordering, the cache recheck before compilation, and
whether the disk probe and executable plan identify the same artifact.

Prepared with AI assistance.


<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
<!-- coderabbit-ai-generated:v1 -->

## Summary by CodeRabbit

* **New Features**
* Sparse MLA planning can defer compilation, check whether a planned
kernel is cached, and compile it later. Running a deferred plan before
compilation now raises an error.
* Added a check for whether an attention kernel is available in the
compilation cache.
* **Improvements**
* Builds for different kernels can proceed concurrently, while builds
for the same kernel remain serialized.
* Valid cached artifacts are preferred, with compiled kernels available
as a fallback when no valid artifact can be loaded.
* Cache loading validates artifacts and accounts for the current device.
Unsupported cache keys can still proceed with compilation.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->

---------

Signed-off-by: Yuxian Qiu <[email protected]>
kris1025 added a commit to kris1025/TensorRT-LLM that referenced this pull request Nov 26, 2026
…llow-up on the dev tip

Pin tensorrt_llm/_torch/attention/backends/prims_ts to kris1025/flashinfer
linquanh/trtllm-prims-ts-dev-ds41-followup-r3 at d8c40b52f9. That branch is the PrimTS dev
branch main pins (yuxianq/flashinfer trtllm-prims-ts-dev-20261107 at d81912f0b, NVIDIA#22274)
plus:
- the FlashInfer main PrimTS changes the dev branch lacks, in order:
  flashinfer-ai/flashinfer#6988, NVIDIA#9315, NVIDIA#9375 and NVIDIA#9224 (NVIDIA#9087, NVIDIA#9222, NVIDIA#5489 and NVIDIA#8549 are
  already on it). Where they meet the dev branch's CUTLASS DSL 4.9 task-API changes
  (runtime_domain_end, consumer_work_stage, _resolve_domain, ContextTask), the conflict
  resolutions keep the upstream logic in the dev branch's form;
- the DeepSeek-V4.1 sparse MLA decode commits of flashinfer-ai/flashinfer#9701: the
  FP8+NVFP4 one-CTA Keep-AB decode, PDL after the prologue, FP8 tiles TMA-gathered into
  the retained K/V tile, the TMA-staged Q slot released after the last QK, and their tests;
- one commit that puts the loops and stage reads NVIDIA#9315 and NVIDIA#9375 added in that same form; on
  the CuTe DSL 4.7/4.8 task API it changes nothing.

The compatibility patch is main's, regenerated for the new pin, plus one adaptation:
_hardware.py's SM107 check imports flashinfer.cute_dsl.availability absolutely, since its
relative import would leave the vendored package. The vendored tree differs from main's
only in the 29 files the follow-up commits change, and main's PrimTS users run on it
unchanged.

Signed-off-by: linquanh <[email protected]>
kris1025 added a commit to kris1025/TensorRT-LLM that referenced this pull request Nov 26, 2026
…llow-up on the dev tip

Pin tensorrt_llm/_torch/attention/backends/prims_ts to kris1025/flashinfer
linquanh/trtllm-prims-ts-dev-ds41-followup-r3 at d8c40b52f9. That branch is the PrimTS dev
branch main pins (yuxianq/flashinfer trtllm-prims-ts-dev-20261107 at d81912f0b, NVIDIA#22274)
plus:
- the FlashInfer main PrimTS changes the dev branch lacks, in order:
  flashinfer-ai/flashinfer#6988, NVIDIA#9315, NVIDIA#9375 and NVIDIA#9224 (NVIDIA#9087, NVIDIA#9222, NVIDIA#5489 and NVIDIA#8549 are
  already on it). Where they meet the dev branch's CUTLASS DSL 4.9 task-API changes
  (runtime_domain_end, consumer_work_stage, _resolve_domain, ContextTask), the conflict
  resolutions keep the upstream logic in the dev branch's form;
- the DeepSeek-V4.1 sparse MLA decode commits of flashinfer-ai/flashinfer#9701: the
  FP8+NVFP4 one-CTA Keep-AB decode, PDL after the prologue, FP8 tiles TMA-gathered into
  the retained K/V tile, the TMA-staged Q slot released after the last QK, and their tests;
- one commit that puts the loops and stage reads NVIDIA#9315 and NVIDIA#9375 added in that same form; on
  the CuTe DSL 4.7/4.8 task API it changes nothing.

The compatibility patch is main's, regenerated for the new pin, plus one adaptation:
_hardware.py's SM107 check imports flashinfer.cute_dsl.availability absolutely, since its
relative import would leave the vendored package. The vendored tree differs from main's
only in the 29 files the follow-up commits change, and main's PrimTS users run on it
unchanged.

Signed-off-by: linquanh <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

10 participants