Repository navigation
[None][test] Migrate attention fixtures and prims-ts validation to KV cache V2 - #20097
Conversation
b973870 to
9c728ac
Compare
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com> (cherry picked from commit c04ac3e6922e91b3303ea025afde6df16332b49d) Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com> (cherry picked from commit 62e59023fe1535268c8bfd494f372df67be71691) Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com> (cherry picked from commit aff86e179aaa62dc23e2b8ae620c98cf015498a3) Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com> (cherry picked from commit 4f50b6261c5d288fdc5bd253f1874d939b44ee4a) Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com> (cherry picked from commit 2fa226131fa34cc2975e38c6f17e590e60eef46d) Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
Signed-off-by: Yi Zhang <187001205+yizhang-nv@users.noreply.github.com>
f644b4d to
2df6982
Compare
|
/bot run --disable-fail-fast |
|
PR_Github #77490 [ run ] triggered by Bot. Commit: |
|
PR_Github #77490 [ run ] completed with state
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
WalkthroughAttention tests and performance harnesses migrate to ChangesKV Cache Manager V2 Test Migration
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Other Possibly related PRs
Merge Risk: ⚪ Minimal · up to
|
|
@yihwang-nv, could you help to review this PR as trt-llm-torch-attention-devs? Thanks~ Assignment explanation
Affinity and workload are snapshots at selection, not live counters. Existing reservations on this PR are counted once. |
|
Automatically added "ci: full pre-merge approved" because this PR has satisfied the required GitHub review approvals. Unresolved review conversations and other required checks remain independent merge requirements. |
|
/bot run --disable-fail-fast |
|
PR_Github #77764 [ run ] triggered by Bot. Commit: |
|
PR_Github #77764 [ run ] completed with state |
Dev Engineer Review
The inspected checkout contains only three modified files, and all changes reformat imports. No behavior or API changes are visible. The supplied change summary describes additional files and functional changes that are not present in the inspected diff.
QA Engineer Review
The three modified files are attention unit tests. Their test logic is unchanged; only imports were reformatted. No matching entries were found by filename search in
tests/integration/test_lists/test-db/ortests/integration/test_lists/qa/. Test execution was not established. Coverage verdict: needs follow-up because the supplied broader change summary does not match the inspected checkout.Per-File QA Perspective
tests/unittest/_torch/attention/test_attention.py: Covers attention backends and KV-cache paths. Only import formatting changed; no matching CI or manual-QA list entry was found by filename search.tests/unittest/_torch/attention/test_flashinfer_attention.py: Covers FlashInfer attention. Only import formatting changed; no matching CI or manual-QA list entry was found by filename search.tests/unittest/_torch/attention/test_vanilla_attention.py: Covers vanilla attention. Only import formatting changed; no matching CI or manual-QA list entry was found by filename search.Description
Migrate attention/kernel fixtures and the local performance harness to
KVCacheManagerV2while preserving workloads, parameter sets, numerical assertions, and performance/accuracy gates. The fixtures handle physical page allocation, shared per-layer views, global HELIX capacity, and the current DSA interface. Sparse request histories remain identical across page layouts. GPU-only HELIX fixtures disable host cache to avoid an unmatched host-sizing collective in the rank-zero reference.DeepSeek prims-ts removes the explicit V1 override to use the default manager. The original post-warmup delegated-backend-call assertion and GSM8K accuracy gate are retained. Temporary manager-type assertions and JUnit diagnostic properties have been removed after validation. This branch was rebased with
git pull --rebase origin mainontofced9ff9849c317a031e13b1e403e1fe61927dc4, where V2 is enabled by default. Candidate2df698293c7c656ad4e3b7021287950771a4c1d8contains eight T2-only commits, 19 files, +174/-135. Parent #17495 and sibling commits are not part of the PR increment. The previous frozen-parent validation is historical evidence and is not counted as a pass on this baseline.Low-level HELIX/K3 helper callers remain in scope. DeepSeek/Qwen HELIX model E2E and Kimi model E2E are unchanged. Explicit V1/V2 comparison parameters remain as controls. Selectors and original assertions/decorators were audited against the GPU-validated
afc1fa27baseline; no CI/QA selector, waiver, golden, or runtime product change is included.Test Coverage
The latest rebase preserves main's modeling_v2 infrastructure update: three owned MLA tests now live under
tests/unittest/_torch/modeling_v2/models/deepseek_v3/r1_0528_nvfp4__sm_103__dep4/attention/. All T2-added/deleted lines are identical after mapping those upstream renames; main's other test and operator changes remain intact. Syntax, signed-commit verification, diff checks and repository pre-commit hooks passed. GPU tests were not rerun after this rebase. All GPU results below remain evidence for the statedafc1fa27baseline and original run SHAs, not a pass claim for the new main baseline. Rebase evidence is intmp/t2-rebase-20261013/.The scoped matrix on
afc1fa27has finished execution, with three unchanged-gate failures still unresolved. All runs use task-owned containers, caches and GPU allocations throughtekit-run; these local runs preceded the CI request recorded below. Skips are not passes. Scoped local execution does not claim that complete CI stages passed.l0_h100l0_b200l0_b300l0_gb300_multi_gpus9fae1e00, configured/usr/bin/python, and exited 0.l0_b200and QA selectorKVCacheManagerV2,NoneTypetransceiver, 12,120 post-warmup delegated MLA generation calls. No explicit V2 override.test_generation_page_sparse_mha[float16_h256_fp8_kv_fp8_output], 1/2048 elements at (0, 980); absolute/relative error 0.125 exceeds 0.08/0.04. Byte-identical original-main V1 fixture on the same GPU reproduces the identical failure.trtllm_fp8_rubinbenchmark, local onlyNVIDIA VR NVL72 ES, 1 GPUl0_dgx_b300Each attention row covers 1173 unique GPU cases. The original 419 explicit V1 control cases are retained and counted separately in the matrix: H100 has 411 passing controls and eight architecture skips; each Blackwell platform has 419 passing controls. These are not V2 route evidence. The four remaining Blackwell skips are the existing CuTe DSL FP4 reference-mismatch skips; all 180 H100 skips are existing architecture gates. No skipped case is reported as a pass.
The empty
Custom topk not availableskips were traced to the DSA mock omitting the radix scratch tensors required by the production metadata contract. Both original selectors catch the resulting bareAssertionErroratindexer.py:1987; the omission also exists in the tested main baseline. The mock now initializes the row capacity and calls the production radix allocator. No assertion, reference calculation, or runtime code changed. All pre-fix skips remain separately recorded.The same-GPU original-main sparse/performance controls show that the T2 migration is not required to reproduce those failures. They do not establish a root cause or waive the unchanged gates. Existing explicit V1 control parameters are also reported separately from V2 route evidence.
Runtime: NGC 26.09, PyTorch
2.14.0a0+b2c75dd062.nv26.09, CUDA 13.4, NCCL 2.31.2. Initial full suites ran at clean9c728acc; the subsequently validated9fae1e00adds only the two DSA fixture initialization lines. The affected file was rerun in full: GB300 and B300 NVLink at clean9fae1e00; H100, B200 and B300 PCIe using final fixture bytes (SHA2560c35bc2aafdc49467010f07522df151e563f61ea03f8d989db300c6e5e40b541) against the unchanged clean product checkout. Native artifacts come from official build 63637, source5fe59f05c14642dd77e23e12c8363b52ec618fd3; native/build inputs were verified identical to the candidate. x86 wheel SHA256b530cc62c1cb5baad8ec78c43c63f59cc806ecbf47f2d238a64f9d9f45bfc8c3; ARM wheel66222bd7bc8c1aeb431a7c53b4b06b4f18d841cf2fd3dfbc8c6bbed83505451d. These are not the old frozen-parent artifacts. The earlier NGC26.08 local compile is not used by these runs; the redundant NGC26.09 compile was stopped after artifact equivalence was established.The final diagnostic cleanup at
f644b4ddremoves three JUnit properties, the temporary manager-type assertion and its unused import/fixture argument. Syntax, repository commit hooks, and an AST comparison against the preceding commit passed. Model configuration, workload, GSM8K accuracy gate and the original delegated-backend-call assertion are unchanged. GPU validation was not repeated for this cleanup; the results and observed route properties above retain their original validated source SHAs.prims-cleanup-verification.jsonrecords the final delta and GitHub comparison.The canonical x86 runs use the configured
/usr/bin/pythonruntime. Old build-venv attempts are retained as history. Twelve MSA cases skipped in incomplete runtime environments were rerun after restoring the official wheel'sfmha_sm100package; package provenance and unchanged native hashes were checked, and all twelve now pass on B200, B300 PCIe, B300 NVLink and GB300.B300 NVLink HELIX used NVLink P2P; the runtime reported that NVLS multicast was unavailable because the node's IMEX fabric was not provisioned. The startup PMIx output-descriptor epoll errors are retained in stderr; all 53 cases, JUnit, pytest and the outer runner completed successfully. This is correctness evidence for the observed topology, not an NVLS performance claim.
Full nodeid/parameter/registration matrix, source and native manifests, route properties, JUnit outcomes, and execution notes are retained under
/home/scratch.yizhan_sw_1/tekit-kvcm-v2-attention/tmp/t2-main-20261012/;final-validation.jsonis the canonical deduplicated result andexecuted-matrix.jsonmaps runs to CI/QA registrations at validation time. Complete stdout/stderr logs are separate under/home/scratch.yizhan_sw_1/logs/2026-10-12/<node>/t2_*. The draft remains open for review and disposition of the sparse numerical failure, two performance gate failures, and remaining original skip/missing-golden limits. No assertion or golden is relaxed.PR Checklist
afc1fa27matrix and preserve complete results and control comparisons.GitHub Bot Help
On 2026-10-13, the user requested that local diagnosis stop at the current state and CI check the candidate. Posted
/bot run --disable-fail-fastfor head2df698293c7c656ad4e3b7021287950771a4c1d8, using the standard CBTS-selected scope. The PR remains draft and the three local failures remain unresolved; no gate, golden, or waiver changed. The two local performance cases are not registered in CI, so a CI pass will not resolve those failures. Actual stage selection and results must be checked before claiming coverage of the sparse case or any GPU combination.