Skip to content

[TRTLLM-14808][fix] MNNVL partial-allocation cleanup and warmup compile fix - #17077

Merged
brnguyen2 merged 2 commits into
NVIDIA:mainfrom
brnguyen2:trtllm-14808-mnnvl-warmup-fix
Aug 3, 2026
Merged

brnguyen2 merged 2 commits into
NVIDIA:mainfrom
brnguyen2:trtllm-14808-mnnvl-warmup-fix

Conversation

@brnguyen2

@brnguyen2 brnguyen2 commented Jul 30, 2026 •

Copy link
Copy Markdown
Collaborator

Dev Engineer Review

  • Tightened MNNVL partial-allocation cleanup during cross-rank handle import/mapping: cleanup now catches only expected RuntimeError failures, logs cleanup errors without masking the original exception, and restores the prior address state.
  • Added a 257-token pure-prefill warmup for kimi_k3 / kimi_linear models to compile the optimized K123 variant, gated by can_run_general_warmup.
  • No configuration or public API changes.

QA Engineer Review

No test changes.

Description

Ports commit 46289149ba from feat/kimi_k3 to main (JIRA: TRTLLM-14808). Two fixes found during Kimi K3 bring-up; this is part of the feat/kimi_k3 -> main staging plan (Wave A).

1. MNNVL partial-allocation cleanup (tensorrt_llm/_mnnvl_utils.py)

MnnvlMemory.open_mnnvl_memory previously leaked resources if the import/map/set-access loop failed partway (e.g. cuMemImportFromShareableHandle failing for one remote rank): already-mapped ranges stayed mapped, the local and previously-imported handles were never released, and a freshly reserved VA range was leaked while the class address state pointed at the poisoned range. The loop is now wrapped so that on failure we:

  • unmap every range mapped so far (in reverse order),
  • release the local allocation handle and all successfully imported handles,
  • if a new VA range was reserved for this allocation, free it and roll current_start_address/current_rank_stride/current_mem_offset back to the previous state,
  • then re-raise the original exception. Cleanup steps are best-effort (logged warnings) so they cannot mask the original error.

2. Warmup compile fix (tensorrt_llm/_torch/pyexecutor/model_engine.py)

For Kimi KDA models (model_type in kimi_k3/kimi_linear), a one-token context warmup takes the NT < 4 FLA fallback and never compiles the optimized single-sequence K123 torch.compile variant, causing a pathological recompilation at the start of long evaluations. Warmup now adds a 257-token pure-prefill request (non-chunk-aligned, five chunks) that enters the pure K123 path. This hunk is guarded by model_type and is inert on main until the Kimi K3 model definition lands (later wave of the staging plan).

Test Coverage

Multi-node hardware validation (run after the initial review, closing the gap noted below): two nodes in a single NVLink domain, 8 ranks, FABRIC handle path. Failure was injected into cuMemImportFromShareableHandle partway through the import/map loop — after at least one range is already mapped, and after all allgather collectives, so ranks stay in step. Each scenario then requires that a subsequent allocation still succeeds and that every rank's slice is readable from every other rank.

Scenario With this change Without it (control)
Failing allocation reserved a new VA range Exception propagates; address state rolled back to the pre-call values; retry allocates 512 MB; all 8 ranks' data verifies Address state left pointing at the poisoned range (stride 512 MB, offset 0); retry fails with CUDA_ERROR_INVALID_VALUE
Failing allocation reused an existing VA range Exception propagates; address state untouched; retry allocates 128 MB; all 8 ranks' data verifies Retry fails with CUDA_ERROR_INVALID_VALUE — the partial mappings survive and the next cuMemMap hits already-mapped addresses

The control is the pre-change file from this PR's merge base, run on the same hardware in the same job, and it reproduces the leak in both scenarios — so the passing cases are attributable to this change rather than to the environment.

Success path on the same setup: unaligned 4 MB, 30 MB, then 768 MB allocations, with offset bookkeeping asserted after each, rank_stride == 1 GiB after the large allocation, and cross-rank reads verified for all three.

Other validation:

  • Mock-harness unit test of MnnvlMemory.open_mnnvl_memory (cuda driver / MPI comm / torch stubbed, FABRIC handle path, 4 ranks): success path bookkeeping, mid-loop import failure with fresh VA reservation (verifies reverse-order unmap, release of local + imported handles, VA free + address-state rollback), failure on a reused VA range (verifies the range is NOT freed and offset is untouched), and cleanup-failure-does-not-mask-original-error. All 4 pass on this branch; as a control, the 3 failure-path tests fail on unpatched main.
  • pre-commit run (isort, yapf, ruff, ruff-format, codespell, etc.) passes on both files; py_compile clean.
  • Still not validated here: the Kimi warmup path, which is inert on main (no kimi_k3/kimi_linear model type exists on main yet). It was exercised on multi-node hardware during Kimi K3 bring-up on feat/kimi_k3.

Correction to an earlier claim in this description, and a finding worth flagging separately: I previously wrote that tests/unittest/_torch/multi_gpu/test_mnnvl_memory.py covers the success path on MNNVL-capable runners. That is not currently true, for a reason unrelated to this PR. The test builds Mapping(world_size, rank, gpus_per_node, tp_size=world_size), leaving moe_tp_size at its -1 default, which resolves to world_size. MnnvlMemory.get_comm splits on (pp_rank * cp_size + cp_rank) * moe_tp_size + moe_tp_rank, so that color reduces to the global rank and every rank ends up in a singleton communicator; the strided tensor then has one segment and the test raises IndexError at line 68 for every rank > 0. I confirmed this on the hardware above — it fails identically with and without this PR's change, before reaching any of the modified code. The file is not referenced by any list under tests/integration/test_lists/test-db/, which is consistent with it not being exercised. This PR does not modify it and does not add it to any list; flagging it for whoever owns that test.

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.

…le fix

Fix MNNVL memory cleanup when an allocation fails partway (unmap mapped
ranges, release imported/local handles, and free/restore a newly
reserved VA range instead of leaking the partially-created mapping), and
add a Kimi KDA pure-prefill warmup request so the optimized
single-sequence K123 torch.compile variant is compiled during warmup
instead of recompiling pathologically at evaluation start.

Found during Kimi K3 bring-up; part of the feat/kimi_k3 -> main staging
plan (Wave A).

Co-authored-by: Pengbo Wang <[email protected]>
Co-authored-by: Brian Nguyen (TensorRT) <[email protected]>
Signed-off-by: Brian Nguyen <[email protected]>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62831 [ run ] triggered by Bot. Commit: 1c0efbf Link to invocation

@coderabbitai

coderabbitai Bot commented Jul 30, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The changes improve MNNVL memory failure recovery and gate a 257-token Kimi attention warmup on general warmup availability.

Changes

MNNVL memory recovery

Layer / File(s) Summary
Address reservation and mapping recovery
tensorrt_llm/_mnnvl_utils.py
open_mnnvl_memory preserves prior address state, cleans up mapped regions, handles, and newly reserved addresses on failure, and catches only RuntimeError during cleanup.

Kimi attention warmup

Layer / File(s) Summary
Kimi pure-context warmup
tensorrt_llm/_torch/pyexecutor/model_engine.py
_run_attention_warmup adds a 257-token pure-context request for kimi_k3 and kimi_linear only when can_run_general_warmup is true.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Suggested reviewers: bowenfu

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title clearly summarizes both main fixes: MNNVL partial-allocation cleanup and the Kimi warmup compile fix.
Description check ✅ Passed The description explains the issues, solutions, test coverage, limitations, and checklist status in the required sections.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tensorrt_llm/_mnnvl_utils.py (1)

216-292: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Address-reservation rollback isn't covered for failures before the mapping loop.

reserved_new_address/previous_address_state are computed at lines 205-211 specifically to let this function free a newly reserved VA range and restore prior state on failure. That rollback is only implemented in the mapping-loop except at lines 335-348. If cuMemCreate/cuMemExportToShareableHandle (lines 216-224) raise — there's no try/except around them at all — or if the handle-exchange step fails (existing except at lines 265-292), a freshly reserved VA range is leaked and cls.current_start_address/current_rank_stride/current_mem_offset are left dangling on the orphaned reservation, which is exactly the leak class this PR is meant to close.

🔧 Suggested approach

Factor the address-rollback logic into a small helper and invoke it from every failure path once a new address may have been reserved, e.g.:

+def _rollback_reserved_address():
+    if reserved_new_address:
+        try:
+            device_ptr = cuda.CUdeviceptr(cls.current_start_address)
+            _check_cu_result(
+                cuda.cuMemAddressFree(device_ptr, comm_size * cls.current_rank_stride)
+            )
+        except RuntimeError as e:
+            logger.warning("cuMemAddressFree failed during error cleanup: %s", e)
+        else:
+            (
+                cls.current_start_address,
+                cls.current_rank_stride,
+                cls.current_mem_offset,
+            ) = previous_address_state
+
+try:
+    allocated_mem_handle = _check_cu_result(...)
+    exported_fabric_handle = _check_cu_result(...)
+except RuntimeError:
+    _rollback_reserved_address()
+    raise

and call _rollback_reserved_address() from the existing except Exception: block at line 265 as well.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_mnnvl_utils.py` around lines 216 - 292, Factor the
reserved-address cleanup for reserved_new_address and previous_address_state
into a helper, such as _rollback_reserved_address, that restores
cls.current_start_address, current_rank_stride, and current_mem_offset and
releases the newly reserved VA range. Invoke this helper for failures from
cuMemCreate/cuMemExportToShareableHandle and from the existing handle-exchange
except block, while preserving the original exception and existing resource
cleanup; reuse the same helper in the mapping-loop failure path.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@tensorrt_llm/_mnnvl_utils.py`:
- Around line 320-349: Replace the three cleanup-block `except Exception`
clauses in the `mapped_rank_ptrs`, `mem_handles`, and `reserved_new_address`
cleanup sections with `except RuntimeError`, preserving their existing warning
messages and cleanup flow.

In `@tensorrt_llm/_torch/pyexecutor/model_engine.py`:
- Around line 1484-1493: Gate the Kimi-specific warmup addition in the
surrounding warmup setup with can_run_general_warmup so it is skipped when
general context warmups are unsupported, including Helix CP. Preserve the
existing model_type check, token count, logging, and warmup request behavior
when the capability is available.

---

Outside diff comments:
In `@tensorrt_llm/_mnnvl_utils.py`:
- Around line 216-292: Factor the reserved-address cleanup for
reserved_new_address and previous_address_state into a helper, such as
_rollback_reserved_address, that restores cls.current_start_address,
current_rank_stride, and current_mem_offset and releases the newly reserved VA
range. Invoke this helper for failures from
cuMemCreate/cuMemExportToShareableHandle and from the existing handle-exchange
except block, while preserving the original exception and existing resource
cleanup; reuse the same helper in the mapping-loop failure path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 7d8ac90a-5754-4883-a27c-0a3a312102e6

📥 Commits

Reviewing files that changed from the base of the PR and between 353a4ee and 1c0efbf.

📒 Files selected for processing (2)
  • tensorrt_llm/_mnnvl_utils.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py

Comment thread tensorrt_llm/_mnnvl_utils.py Resolved
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62831 [ run ] completed with state FAILURE. Commit: 1c0efbf
/LLM/main/L0_MergeRequest_PR pipeline #50955 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

…w cleanup exception handling

Address review feedback: the Kimi KDA prefill warmup request is a pure-context
request and must respect the can_run_general_warmup gate; the MNNVL cleanup
handlers only need to catch the RuntimeError raised by _check_cu_result.

Signed-off-by: Brian Nguyen <[email protected]>
@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
tensorrt_llm/_mnnvl_utils.py (1)

205-211: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Extend rollback to allocation and export failures.

The new VA reservation occurs before cuMemCreate, cuMemExportToShareableHandle, and the PID/FD exchange, but address rollback exists only in the later mapping-phase handler at Lines 335-348. If any earlier operation fails, the reservation is not freed and cls.current_* remains advanced; export failure also leaves the allocated CUDA handle live. Put all post-reservation work under a common rollback path, restoring the previous state only after cuMemAddressFree succeeds.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_mnnvl_utils.py` around lines 205 - 211, Extend the rollback
scope in the allocation flow around previous_address_state and
reserved_new_address to cover cuMemCreate, cuMemExportToShareableHandle, PID/FD
exchange, and subsequent mapping work. On any post-reservation failure, release
the reserved VA first, restore cls.current_start_address,
cls.current_rank_stride, and cls.current_mem_offset only after cuMemAddressFree
succeeds, and destroy any allocated CUDA memory handle when export or later
operations fail.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tensorrt_llm/_mnnvl_utils.py`:
- Around line 205-211: Extend the rollback scope in the allocation flow around
previous_address_state and reserved_new_address to cover cuMemCreate,
cuMemExportToShareableHandle, PID/FD exchange, and subsequent mapping work. On
any post-reservation failure, release the reserved VA first, restore
cls.current_start_address, cls.current_rank_stride, and cls.current_mem_offset
only after cuMemAddressFree succeeds, and destroy any allocated CUDA memory
handle when export or later operations fail.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: 596bb193-a604-49d6-8bd1-62ee296db0ce

📥 Commits

Reviewing files that changed from the base of the PR and between 1c0efbf and 22b5415.

📒 Files selected for processing (2)
  • tensorrt_llm/_mnnvl_utils.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62856 [ run ] triggered by Bot. Commit: 22b5415 Link to invocation

@brnguyen2
brnguyen2 force-pushed the trtllm-14808-mnnvl-warmup-fix branch from 22b5415 to f8a4a5d Compare July 30, 2026 23:13

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
tensorrt_llm/_mnnvl_utils.py (2)

320-334: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Close temporary pidfds after descriptor import.

The POSIX path opens pidfds at Lines 241-247, but mapping/access failures enter this cleanup without closing them. Repeated setup failures can therefore exhaust process file descriptors; close each pidfd once pidfd_getfd completes, using an idempotent cleanup path.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_mnnvl_utils.py` around lines 320 - 334, Update the POSIX
descriptor-import flow around pidfd_getfd to close every temporary pidfd after
descriptor import completes, including when mapping or access setup fails. Use
an idempotent cleanup path so each pidfd is closed at most once, and integrate
it with the existing exception cleanup around mapped_rank_ptrs and mem_handles.

205-211: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Make address rollback complete across every failure window.

The new reservation mutates class state before allocation and mapping finish, but rollback is split across incomplete paths:

  • tensorrt_llm/_mnnvl_utils.py#L205-L211: include cuMemCreate and handle-export failures in the same VA cleanup scope.
  • tensorrt_llm/_mnnvl_utils.py#L335-L348: restore or invalidate the snapshot even when cuMemAddressFree fails, and track any unreleased reservation.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tensorrt_llm/_mnnvl_utils.py` around lines 205 - 211, Update the reservation
flow around the class state snapshot at lines 205-211 in
tensorrt_llm/_mnnvl_utils.py so cuMemCreate and handle-export failures share the
same VA cleanup and rollback scope. In the failure cleanup around lines 335-348,
ensure the saved address state is restored or invalidated even if
cuMemAddressFree fails, and record any reservation that remains unreleased so
subsequent allocations cannot reuse it incorrectly.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In `@tensorrt_llm/_mnnvl_utils.py`:
- Around line 320-334: Update the POSIX descriptor-import flow around
pidfd_getfd to close every temporary pidfd after descriptor import completes,
including when mapping or access setup fails. Use an idempotent cleanup path so
each pidfd is closed at most once, and integrate it with the existing exception
cleanup around mapped_rank_ptrs and mem_handles.
- Around line 205-211: Update the reservation flow around the class state
snapshot at lines 205-211 in tensorrt_llm/_mnnvl_utils.py so cuMemCreate and
handle-export failures share the same VA cleanup and rollback scope. In the
failure cleanup around lines 335-348, ensure the saved address state is restored
or invalidated even if cuMemAddressFree fails, and record any reservation that
remains unreleased so subsequent allocations cannot reuse it incorrectly.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c42cc125-4011-4b1b-8a6d-ff2e8b708419

📥 Commits

Reviewing files that changed from the base of the PR and between 22b5415 and f8a4a5d.

📒 Files selected for processing (2)
  • tensorrt_llm/_mnnvl_utils.py
  • tensorrt_llm/_torch/pyexecutor/model_engine.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • tensorrt_llm/_torch/pyexecutor/model_engine.py

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

Author notes (preserving context from the original PR description):

  • The warmup hunk is currently inert on this branch. The added warmup request is guarded by model_type in ("kimi_k3", "kimi_linear"); neither model type exists on main yet, so that code path does not execute until the model lands. It is included here to keep the later model-enablement change smaller.
  • Validation caveat. The real MNNVL allocation path needs multi-node NVLink hardware and was not exercised locally. Instead, the cleanup logic in open_mnnvl_memory was covered by a behavioral harness with stubbed CUDA-driver/MPI/torch layers: success bookkeeping, mid-loop import failure (reverse-order unmap, handle release, address-state rollback), failure on a reused virtual address (range not freed), and cleanup errors not masking the original exception. As a control, the same harness run against the unpatched code fails the three failure-path cases, so the tests do detect the leak this PR fixes.
  • Review feedback addressed in the latest commit: the Kimi warmup append now respects the can_run_general_warmup gate, and the three cleanup handlers catch RuntimeError (what _check_cu_result raises) rather than a blind Exception.

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62875 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62856 [ run ] completed with state ABORTED. Commit: 22b5415

Link to invocation

@BowenFu BowenFu left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Verified on the regression axis and it holds. The success path of open_mnnvl_memory is unchanged — every rank still maps the same range with cuMemSetAccess following each cuMemMap, and the mem_handles handed to the caller are identical; the only reordering is assigning the local/remote handles before the map call. cuMemAddressFree(ptr, comm_size * current_rank_stride) matches the address_size that new_mnnvl_memory_address reserved exactly, and the rollback is safe precisely because nothing is published into allocated_map / address_refcnt until the loop completes. The warmup hunk is genuinely inert here — neither kimi_k3 nor kimi_linear exists as a model_type on main today, so nothing currently supported changes.

Two things I'm explicitly not blocking on:

The three cleanup logs use %s interpolation — logger.warning("cuMemUnmap failed during error cleanup: %s", e). tensorrt_llm.logger is warning(*msg) and joins str() of each argument with spaces (logger.py:267-281), so it doesn't substitute; those lines will print a literal %s followed by the error. Worth an f-string since they're the only diagnostic on that path.

More substantively: the description says the mock harness for open_mnnvl_memory (4 cases, including the VA-free-plus-rollback and the cleanup-failure-doesn't-mask-original one) passes, but it isn't in the diff. That's 53 lines of error-recovery that no existing test reaches and that a real failure will only exercise on multi-node NVLink. You've already written it and it's CPU-only by construction — please commit it.

One note for when the K3 model lands: the KDA warmup sits inside _run_attention_warmup, which returns early unless the metadata is TrtllmAttentionMetadata, and the forward runs under trtllm_gen_fmha_jit_warmup(). That couples an FLA/K123 compile warmup to the TRTLLM-Gen FMHA backend, so on any other attention backend it silently won't happen.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62875 [ run ] completed with state FAILURE. Commit: f8a4a5d
/LLM/main/L0_MergeRequest_PR pipeline #50997 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62906 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #62906 [ run ] completed with state FAILURE. Commit: f8a4a5d
/LLM/main/L0_MergeRequest_PR pipeline #51028 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

Closed the multi-node validation gap this description originally called out — no code changes, description updated with the details.

Ran on two nodes in a single NVLink domain (8 ranks, FABRIC handle path), injecting a failure into cuMemImportFromShareableHandle partway through the import/map loop and then requiring a subsequent allocation to succeed:

  • New VA range reserved by the failing allocation — with this change, the address state rolls back and the retry allocates 512 MB with all 8 ranks' data verified. With the pre-change file, the state is left pointing at the poisoned range and the retry fails with CUDA_ERROR_INVALID_VALUE.
  • Existing VA range reused — with this change, the retry allocates 128 MB and verifies. Without it, the retry fails with CUDA_ERROR_INVALID_VALUE, because the partial mappings survive and the next cuMemMap hits already-mapped addresses.
  • Success path — unaligned 4 MB, 30 MB and 768 MB allocations, offset bookkeeping asserted at each step, rank_stride == 1 GiB after the large one, cross-rank reads verified.

The control is the pre-change file from this PR's merge base, run on the same hardware in the same job, so the passing cases are attributable to the change and not the environment.

Two corrections while I'm here:

  1. I had claimed in the description that tests/unittest/_torch/multi_gpu/test_mnnvl_memory.py covers this success path on MNNVL-capable runners. It does not currently pass, for a reason unrelated to this PR: the test builds Mapping(world_size, rank, gpus_per_node, tp_size=world_size), leaving moe_tp_size at its -1 default, which resolves to world_size. MnnvlMemory.get_comm splits on (pp_rank * cp_size + cp_rank) * moe_tp_size + moe_tp_rank, so the color reduces to the global rank, every rank gets a singleton communicator, and the test raises IndexError at line 68 for every rank > 0. It fails identically with and without this change, before reaching any modified code. Passing moe_tp_size=1, moe_ep_size=world_size fixes it. I have not touched the file here, and it is not referenced by any list under tests/integration/test_lists/test-db/ — flagging it for whoever owns it.

  2. The warmup hunk is still unvalidated on this branch, as noted: it is inert on main until the Kimi model definition lands.

The current red CI on this PR is a B300 unittest/_torch/thop/parallel timeout with no overlap with the changed files.

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63071 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63071 [ run ] completed with state ABORTED. Commit: f8a4a5d

Link to invocation

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63287 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63287 [ run ] completed with state FAILURE. Commit: f8a4a5d
/LLM/main/L0_MergeRequest_PR pipeline #51282 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63295 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63295 [ run ] completed with state FAILURE. Commit: f8a4a5d
/LLM/main/L0_MergeRequest_PR pipeline #51290 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63308 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63308 [ run ] completed with state SUCCESS. Commit: f8a4a5d
/LLM/main/L0_MergeRequest_PR pipeline #51303 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

@brnguyen2

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63313 [ run ] triggered by Bot. Commit: f8a4a5d Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #63313 [ run ] completed with state SUCCESS. Commit: f8a4a5d
/LLM/main/L0_MergeRequest_PR pipeline #51308 completed with status: 'SUCCESS'

CI Report

Link to invocation

@brnguyen2
brnguyen2 merged commit bbadfb7 into NVIDIA:main Aug 3, 2026
13 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.

5 participants