Skip to content

[https://nvbugs/6208457][fix] Pass IPC HMAC key through file descriptor#15654

Merged
JunyiXu-nv merged 6 commits into
NVIDIA:mainfrom
yibinl-nvidia:dev-yibinl-remove-hmac-key-env-variable
Jul 3, 2026
Merged

[https://nvbugs/6208457][fix] Pass IPC HMAC key through file descriptor#15654
JunyiXu-nv merged 6 commits into
NVIDIA:mainfrom
yibinl-nvidia:dev-yibinl-remove-hmac-key-env-variable

Conversation

@yibinl-nvidia

@yibinl-nvidia yibinl-nvidia commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary by CodeRabbit

  • New Features

    • Improved process startup handling for server and launcher workflows, with more reliable passing of connection credentials between components.
  • Bug Fixes

    • Strengthened validation so required security credentials can’t be skipped.
    • Prevented file descriptor leaks during child process setup.
    • Made credential loading more reliable by supporting file-descriptor-based փոխանցion and caching.
  • Tests

    • Added coverage for credential loading, caching, delayed reads, and missing-configuration errors.

Description

This is a successor of #14378 after fixing the issue mentioned in https://nvbugspro.nvidia.com/bug/6244695 for post-merge pipeline. The original code changes have been reviewed.

Test Coverage

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.

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot help

@github-actions

Copy link
Copy Markdown

GitHub Bot Help

/bot [-h] ['run', 'kill', 'skip', 'reuse-pipeline'] ...

Provide a user friendly way for developers to interact with a Jenkins server.

Run /bot [-h|--help] to print this help message.

See details below for each supported subcommand.

Details

run [--reuse-test (optional)pipeline-id --disable-fail-fast --skip-test --stage-list "A10-PyTorch-1, xxx" --gpu-type "A30, H100_PCIe" --test-backend "pytorch, cpp" --add-multi-gpu-test --only-multi-gpu-test --disable-multi-gpu-test --post-merge --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" --detailed-log --debug(experimental) --high-priority]

Launch build/test pipelines. All previously running jobs will be killed.

--reuse-test (optional)pipeline-id (OPTIONAL) : Allow the new pipeline to reuse build artifacts and skip successful test stages from a specified pipeline or the last pipeline if no pipeline-id is indicated. If the Git commit ID has changed, this option will be always ignored. The DEFAULT behavior of the bot is to reuse build artifacts and successful test results from the last pipeline.

--disable-reuse-test (OPTIONAL) : Explicitly prevent the pipeline from reusing build artifacts and skipping successful test stages from a previous pipeline. Ensure that all builds and tests are run regardless of previous successes.

--disable-fail-fast (OPTIONAL) : Disable fail fast on build/tests/infra failures.

--skip-test (OPTIONAL) : Skip all test stages, but still run build stages, package stages and sanity check stages. Note: Does NOT update GitHub check status.

--stage-list "A10-PyTorch-1, xxx" (OPTIONAL) : Only run the specified test stages. Supports wildcard * for pattern matching (e.g., "*PerfSanity*" matches all stages containing PerfSanity). Examples: "A10-PyTorch-1, xxx", "PerfSanity". Note: Does NOT update GitHub check status.

--gpu-type "A30, H100_PCIe" (OPTIONAL) : Only run the test stages on the specified GPU types. Examples: "A30, H100_PCIe". Note: Does NOT update GitHub check status.

--test-backend "pytorch, cpp" (OPTIONAL) : Skip test stages which don't match the specified backends. Only support [pytorch, cpp, tensorrt, triton]. Examples: "pytorch, cpp" (does not run test stages with tensorrt or triton backend). Note: Does NOT update GitHub pipeline status.

--only-multi-gpu-test (OPTIONAL) : Only run the multi-GPU tests. Note: Does NOT update GitHub check status.

--disable-multi-gpu-test (OPTIONAL) : Disable the multi-GPU tests. Note: Does NOT update GitHub check status.

--add-multi-gpu-test (OPTIONAL) : Force run the multi-GPU tests in addition to running L0 pre-merge pipeline.

--post-merge (OPTIONAL) : Run the L0 post-merge pipeline instead of the ordinary L0 pre-merge pipeline.

--extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx" (OPTIONAL) : Run the ordinary L0 pre-merge pipeline and specified test stages. Supports wildcard * for pattern matching. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx", --extra-stage "Post-Merge".

--detailed-log (OPTIONAL) : Enable flushing out all logs to the Jenkins console. This will significantly increase the log volume and may slow down the job.

--debug (OPTIONAL) : Experimental feature. Enable access to the CI container for debugging purpose. Note: Specify exactly one stage in the stage-list parameter to access the appropriate container environment. Note: Does NOT update GitHub check status.

--high-priority (OPTIONAL) : Run the pipeline with high priority. This option is restricted to authorized users only and will route the job to a high-priority queue.

kill

kill

Kill all running builds associated with pull request.

skip

skip --comment COMMENT

Skip testing for latest commit on pull request. --comment "Reason for skipping build/test" is required. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

reuse-pipeline

reuse-pipeline

Reuse a previous pipeline to validate current commit. This action will also kill all currently running builds associated with the pull request. IMPORTANT NOTE: This is dangerous since lack of user care and validation can cause top of tree to break.

@yibinl-nvidia yibinl-nvidia force-pushed the dev-yibinl-remove-hmac-key-env-variable branch from 05e7f7e to a49a94e Compare June 26, 2026 05:23
@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56000 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56092 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56097 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56099 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56111 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56126 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

Link to invocation

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56150 [ run ] triggered by Bot. Commit: a49a94e Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

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

@yibinl-nvidia yibinl-nvidia force-pushed the dev-yibinl-remove-hmac-key-env-variable branch from b6d0fcc to 1176c37 Compare June 27, 2026 13:36
@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56177 [ run ] triggered by Bot. Commit: 1176c37 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56177 [ run ] completed with state SUCCESS. Commit: 1176c37
/LLM/main/L0_MergeRequest_PR pipeline #45040 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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge

Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia yibinl-nvidia force-pushed the dev-yibinl-remove-hmac-key-env-variable branch from 1176c37 to a2909be Compare July 1, 2026 00:58
@coderabbitai

coderabbitai Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This PR changes how the spawn-proxy-process IPC HMAC key is delivered to child processes, replacing environment-variable hex-string export with a file-descriptor based transfer. Affected areas include serve.py's disaggregated leader spawn logic, executor utils' key caching/normalization helpers, the trtllm-llmapi-launch script's new run_with_ipc_hmac_key wrapper, and stricter validation (ValueError instead of assert) in ZeroMqQueue and GenerationExecutorWorker. New unit tests cover FD-based key retrieval and validation failures.

Changes

IPC HMAC Key FD-Based Delivery

Layer / File(s) Summary
Core key normalization and FD-read helpers
tensorrt_llm/executor/utils.py
Replaces the hex-string env var constant with an FD-based constant, adds key normalization to 32 bytes, a cached setter, an FD-blocking reader, and reworks the getter to read from cache or FD env var, raising RuntimeError if missing.
serve.py disaggregated leader spawn wiring
tensorrt_llm/commands/serve.py
Generates the HMAC key, calls the new setter, removes the prior direct env export/assertion, creates a pipe to pass the key via FD to the spawned child, and closes FDs in a finally block.
trtllm-llmapi-launch FD wrapper
tensorrt_llm/llmapi/trtllm-llmapi-launch
Adds run_with_ipc_hmac_key to write the key to an FD and set the FD env var per invocation, replacing direct export; applies it to rank-0 task execution, MGMN leader stop, and leader node invocation.
HMAC requirement enforcement
tensorrt_llm/executor/ipc.py, tensorrt_llm/executor/worker.py, tests/unittest/executor/test_ipc.py
Replaces assert checks with explicit ValueError raises when HMAC encryption is disabled or hmac_key is missing with rpc_addr set; adds a test validating the new error.
FD-based key retrieval tests
tests/unittest/executor/test_launcher_envs.py
New test module validating FD-based key retrieval, caching behavior, non-blocking FD reads, and RuntimeError when the FD env var is absent.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 36.84% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title follows the required ticket/type format and accurately describes the main change.
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.
Description check ✅ Passed The PR description follows the template structure and explains the change, with only the Test Coverage section left empty.
✨ 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: 3

🧹 Nitpick comments (4)
tests/unittest/executor/test_ipc.py (1)

260-271: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Coverage is insufficient for the worker-side HMAC guard.

This adds the right regression test for ZeroMqQueue(..., use_hmac_encryption=False), but the PR also hardens GenerationExecutorWorker.__init__ in tensorrt_llm/executor/worker.py. Please add a companion negative test in tests/unittest/executor/test_rpc_proxy.py or a focused tests/unittest/executor/test_worker.py that passes rpc_addr with an empty hmac_key and asserts the new ValueError("hmac_key is required when rpc_addr is set"). Based on path instructions, test feedback for tests/** should state whether coverage is sufficient and name follow-up files.

🤖 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 `@tests/unittest/executor/test_ipc.py` around lines 260 - 271, The new coverage
only exercises ZeroMqQueue and does not cover the worker-side HMAC guard in
GenerationExecutorWorker.__init__. Add a negative test in
tests/unittest/executor/test_rpc_proxy.py or
tests/unittest/executor/test_worker.py that constructs GenerationExecutorWorker
with rpc_addr set and an empty hmac_key, then asserts the ValueError message
"hmac_key is required when rpc_addr is set". Keep the existing ZeroMqQueue
regression test, but update the tests/** coverage note to indicate the
worker-side case is now covered and name the follow-up test file explicitly.

Source: Path instructions

tests/unittest/executor/test_launcher_envs.py (2)

24-79: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Coverage is insufficient for malformed key validation.

The happy-path FD/cache cases are covered, but tests/unittest/executor/test_launcher_envs.py should also include negative cases for malformed FD payloads, such as short hex, non-hex ASCII, and the direct set_spawn_proxy_process_ipc_hmac_key() cache path used by serve.py.

As per path instructions, coverage for this test change is currently insufficient and should be extended in tests/unittest/executor/test_launcher_envs.py.

🤖 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 `@tests/unittest/executor/test_launcher_envs.py` around lines 24 - 79, Coverage
in executor_utils.get_spawn_proxy_process_ipc_hmac_key_env is missing
malformed-input and cache-path validation. Extend the tests in
test_launcher_envs to add negative cases for an FD containing short hex and
non-hex ASCII, and also cover the direct set_spawn_proxy_process_ipc_hmac_key
cache path used by serve.py. Reuse the existing helpers like
_reset_ipc_hmac_key_env and the
LlmLauncherEnvs.TLLM_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY_FD setup to locate the
affected flow.

Source: Path instructions


10-79: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Add return annotations to the new test functions.

Use -> None for helpers/tests that do not return, including the nested write_key().

Proposed refactor
-def _reset_ipc_hmac_key_env(monkeypatch):
+def _reset_ipc_hmac_key_env(monkeypatch) -> None:
...
-def test_get_spawn_proxy_process_ipc_hmac_key_from_fd(monkeypatch):
+def test_get_spawn_proxy_process_ipc_hmac_key_from_fd(monkeypatch) -> None:
...
-def test_get_spawn_proxy_process_ipc_hmac_key_caches_fd_key(monkeypatch):
+def test_get_spawn_proxy_process_ipc_hmac_key_caches_fd_key(monkeypatch) -> None:
...
-def test_get_spawn_proxy_process_ipc_hmac_key_from_nonblocking_fd(monkeypatch):
+def test_get_spawn_proxy_process_ipc_hmac_key_from_nonblocking_fd(monkeypatch) -> None:
...
-    def write_key():
+    def write_key() -> None:
...
-def test_get_spawn_proxy_process_ipc_hmac_key_missing(monkeypatch):
+def test_get_spawn_proxy_process_ipc_hmac_key_missing(monkeypatch) -> None:

As per coding guidelines, “Always annotate functions. Make the return type None if the function does not return anything.”

🤖 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 `@tests/unittest/executor/test_launcher_envs.py` around lines 10 - 79, The new
test helpers and test cases in test_launcher_envs.py are missing return type
annotations. Add explicit return annotations to _reset_ipc_hmac_key_env,
_write_key_fd, test_get_spawn_proxy_process_ipc_hmac_key_from_fd,
test_get_spawn_proxy_process_ipc_hmac_key_caches_fd_key,
test_get_spawn_proxy_process_ipc_hmac_key_from_nonblocking_fd, and
test_get_spawn_proxy_process_ipc_hmac_key_missing, and use -> None for
helpers/tests that do not return values. Also annotate the nested write_key()
helper inside test_get_spawn_proxy_process_ipc_hmac_key_from_nonblocking_fd with
-> None.

Source: Coding guidelines

tensorrt_llm/executor/utils.py (1)

33-33: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use snake_case for the mutable cache.

_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY is reassigned by the setter/getter, so it is mutable module state rather than a constant. Rename it to snake_case to match the Python naming guideline.

Proposed refactor
-_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY: bytes | None = None
+_spawn_proxy_process_ipc_hmac_key: bytes | None = None

As per coding guidelines, “Local Variables or Mutable Global Variables” should use snake_case, while constants use UPPER_SNAKE_CASE.

🤖 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/executor/utils.py` at line 33, The module-level cache currently
uses UPPER_SNAKE_CASE even though it is reassigned by the getter/setter, so
rename `_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY` to snake_case and update every
reference in `utils.py` that reads or writes it. Make sure the change stays
consistent in the related getter/setter logic so the mutable global state
follows the Python naming guideline.

Source: Coding guidelines

🤖 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/commands/serve.py`:
- Around line 1550-1551: The environment cleanup in serve.py only removes
TLLM_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY_FD before split_mpi_env(), but the legacy
raw HMAC-key variable can still leak into the child via non_mpi_env. Update the
cleanup around the spawn setup to also pop TLLM_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY
alongside the FD env var, using the same env-handling block in the serve() flow
so both secrets are stripped before forwarding.

In `@tensorrt_llm/executor/utils.py`:
- Around line 54-67: The FD payload reader in
_read_spawn_proxy_process_ipc_hmac_key_fd is treating the collected bytes as raw
key material instead of ASCII hex, which can let malformed FD input slip
through. Update this helper to decode the assembled FD payload as ASCII/hex
first, then pass the decoded key into
_normalize_spawn_proxy_process_ipc_hmac_key so invalid non-hex or truncated FD
data is rejected. Keep the change localized to the FD read/normalize flow in
_read_spawn_proxy_process_ipc_hmac_key_fd and the normalization call it feeds.

In `@tensorrt_llm/llmapi/trtllm-llmapi-launch`:
- Line 43: The launch wrapper currently clears only
TLLM_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY_FD, so the legacy raw HMAC key can still
leak into child processes. Update the environment cleanup in
trtllm-llmapi-launch to also unset TLLM_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY
alongside the existing unset, keeping the same wrapper behavior for wrapped
commands.

---

Nitpick comments:
In `@tensorrt_llm/executor/utils.py`:
- Line 33: The module-level cache currently uses UPPER_SNAKE_CASE even though it
is reassigned by the getter/setter, so rename
`_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY` to snake_case and update every reference in
`utils.py` that reads or writes it. Make sure the change stays consistent in the
related getter/setter logic so the mutable global state follows the Python
naming guideline.

In `@tests/unittest/executor/test_ipc.py`:
- Around line 260-271: The new coverage only exercises ZeroMqQueue and does not
cover the worker-side HMAC guard in GenerationExecutorWorker.__init__. Add a
negative test in tests/unittest/executor/test_rpc_proxy.py or
tests/unittest/executor/test_worker.py that constructs GenerationExecutorWorker
with rpc_addr set and an empty hmac_key, then asserts the ValueError message
"hmac_key is required when rpc_addr is set". Keep the existing ZeroMqQueue
regression test, but update the tests/** coverage note to indicate the
worker-side case is now covered and name the follow-up test file explicitly.

In `@tests/unittest/executor/test_launcher_envs.py`:
- Around line 24-79: Coverage in
executor_utils.get_spawn_proxy_process_ipc_hmac_key_env is missing
malformed-input and cache-path validation. Extend the tests in
test_launcher_envs to add negative cases for an FD containing short hex and
non-hex ASCII, and also cover the direct set_spawn_proxy_process_ipc_hmac_key
cache path used by serve.py. Reuse the existing helpers like
_reset_ipc_hmac_key_env and the
LlmLauncherEnvs.TLLM_SPAWN_PROXY_PROCESS_IPC_HMAC_KEY_FD setup to locate the
affected flow.
- Around line 10-79: The new test helpers and test cases in
test_launcher_envs.py are missing return type annotations. Add explicit return
annotations to _reset_ipc_hmac_key_env, _write_key_fd,
test_get_spawn_proxy_process_ipc_hmac_key_from_fd,
test_get_spawn_proxy_process_ipc_hmac_key_caches_fd_key,
test_get_spawn_proxy_process_ipc_hmac_key_from_nonblocking_fd, and
test_get_spawn_proxy_process_ipc_hmac_key_missing, and use -> None for
helpers/tests that do not return values. Also annotate the nested write_key()
helper inside test_get_spawn_proxy_process_ipc_hmac_key_from_nonblocking_fd with
-> None.
🪄 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: 610becb8-566e-4569-bbf1-2eff69b88f43

📥 Commits

Reviewing files that changed from the base of the PR and between a721a08 and a2909be.

📒 Files selected for processing (7)
  • tensorrt_llm/commands/serve.py
  • tensorrt_llm/executor/ipc.py
  • tensorrt_llm/executor/utils.py
  • tensorrt_llm/executor/worker.py
  • tensorrt_llm/llmapi/trtllm-llmapi-launch
  • tests/unittest/executor/test_ipc.py
  • tests/unittest/executor/test_launcher_envs.py

Comment thread tensorrt_llm/commands/serve.py
Comment thread tensorrt_llm/executor/utils.py Outdated
Comment thread tensorrt_llm/llmapi/trtllm-llmapi-launch
Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56786 [ run ] triggered by Bot. Commit: 279ea54 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56786 [ run ] completed with state SUCCESS. Commit: 279ea54
/LLM/main/L0_MergeRequest_PR pipeline #45604 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

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56895 [ run ] triggered by Bot. Commit: 279ea54 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56895 [ run ] completed with state ABORTED. Commit: 279ea54

Link to invocation

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56936 [ run ] triggered by Bot. Commit: 279ea54 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56936 [ run ] completed with state SUCCESS. Commit: 279ea54
/LLM/main/L0_MergeRequest_PR pipeline #45740 completed with status: 'ABORTED'

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

Link to invocation

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run --post-merge --disable-fail-fast

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56975 [ run ] triggered by Bot. Commit: 279ea54 Link to invocation

@yibinl-nvidia

Copy link
Copy Markdown
Collaborator Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57113 [ run ] triggered by Bot. Commit: 279ea54 Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #56975 [ run ] completed with state ABORTED. Commit: 279ea54

Link to invocation

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #57113 [ run ] completed with state SUCCESS. Commit: 279ea54
/LLM/main/L0_MergeRequest_PR pipeline #45900 completed with status: 'SUCCESS'

CI Report

Link to invocation

@JunyiXu-nv JunyiXu-nv left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@JunyiXu-nv JunyiXu-nv merged commit 48fc753 into NVIDIA:main Jul 3, 2026
16 checks passed
chenfeiz0326 added a commit to chenfeiz0326/TensorRT-LLM that referenced this pull request Jul 6, 2026
…escriptor (NVIDIA#15654)

Reverts NVIDIA#15654 (48fc753).

PR NVIDIA#15654 passes the IPC HMAC key from the parent process to the LLM-API
proxy child via a file descriptor. In the QA-pytest Slurm/MPI launch
path used by trtllm-bench and trtllm-serve, the fd handshake between
Rank0's forked subshell (spawning internal mpirun) and the
mgmn_leader_node RemoteMpiCommSessionServer deadlocks silently:

  - trtllm-bench (nvbugs/6388787): after "start MpiSession with N
    workers" the bench process emits no further stdout for ~30 min,
    workers stay alive at 0% GPU / 4 MiB VRAM, no exception, no MPI
    abort. Perf harness SIGKILLs at _STALL_TIMEOUT=1800s.

  - trtllm-serve (nvbugs/6405747): serve mode's /health endpoint never
    binds, and pytest fails with
    "Server http://localhost:<port>/health did not become ready within
    3600s" on both baseline and candidate wheels.

This is the third time the "Pass IPC HMAC key via fd" idea has broken
bench/serve (previously PR NVIDIA#14378 was reverted by PR NVIDIA#14782 for the
same class of failure: BlockingIOError in _read_spawn_proxy_process_
ipc_hmac_key_fd). Reverting until the fd inheritance across fork+exec
into the mpirun child is verified end-to-end for both bench and serve
launch paths.

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
chenfeiz0326 added a commit to chenfeiz0326/TensorRT-LLM that referenced this pull request Jul 6, 2026
…escriptor (NVIDIA#15654)

Reverts NVIDIA#15654 (48fc753).

PR NVIDIA#15654 passes the IPC HMAC key from the parent process to the LLM-API
proxy child via a file descriptor. In the QA-pytest Slurm/MPI launch
path used by trtllm-bench and trtllm-serve, the fd handshake between
Rank0's forked subshell (spawning internal mpirun) and the
mgmn_leader_node RemoteMpiCommSessionServer deadlocks silently:

  - trtllm-bench (nvbugs/6388787): after "start MpiSession with N
    workers" the bench process emits no further stdout for ~30 min,
    workers stay alive at 0% GPU / 4 MiB VRAM, no exception, no MPI
    abort. Perf harness SIGKILLs at _STALL_TIMEOUT=1800s.

  - trtllm-serve (nvbugs/6405747): serve mode's /health endpoint never
    binds, and pytest fails with
    "Server http://localhost:<port>/health did not become ready within
    3600s" on both baseline and candidate wheels.

This is the third time the "Pass IPC HMAC key via fd" idea has broken
bench/serve (previously PR NVIDIA#14378 was reverted by PR NVIDIA#14782 for the
same class of failure: BlockingIOError in _read_spawn_proxy_process_
ipc_hmac_key_fd). Reverting until the fd inheritance across fork+exec
into the mpirun child is verified end-to-end for both bench and serve
launch paths.

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
chenfeiz0326 added a commit to chenfeiz0326/TensorRT-LLM that referenced this pull request Jul 6, 2026
…escriptor (NVIDIA#15654)

Reverts NVIDIA#15654 (48fc753).

PR NVIDIA#15654 passes the IPC HMAC key from the parent process to the LLM-API
proxy child via a file descriptor. In the QA-pytest Slurm/MPI launch
path used by trtllm-bench and trtllm-serve, the fd handshake between
Rank0's forked subshell (spawning internal mpirun) and the
mgmn_leader_node RemoteMpiCommSessionServer deadlocks silently:

  - trtllm-bench (nvbugs/6388787): after "start MpiSession with N
    workers" the bench process emits no further stdout for ~30 min,
    workers stay alive at 0% GPU / 4 MiB VRAM, no exception, no MPI
    abort. Perf harness SIGKILLs at _STALL_TIMEOUT=1800s.

  - trtllm-serve (nvbugs/6405747): serve mode's /health endpoint never
    binds, and pytest fails with
    "Server http://localhost:<port>/health did not become ready within
    3600s" on both baseline and candidate wheels.

This is the third time the "Pass IPC HMAC key via fd" idea has broken
bench/serve (previously PR NVIDIA#14378 was reverted by PR NVIDIA#14782 for the
same class of failure: BlockingIOError in _read_spawn_proxy_process_
ipc_hmac_key_fd). Reverting until the fd inheritance across fork+exec
into the mpirun child is verified end-to-end for both bench and serve
launch paths.

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
chenfeiz0326 added a commit that referenced this pull request Jul 6, 2026
…escriptor (#15654) (#15961)

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
BrianLi23 pushed a commit to BrianLi23/TensorRT-LLM that referenced this pull request Jul 9, 2026
…or (NVIDIA#15654)

Signed-off-by: Yibin Li <109242046+yibinl-nvidia@users.noreply.github.com>
BrianLi23 pushed a commit to BrianLi23/TensorRT-LLM that referenced this pull request Jul 9, 2026
…escriptor (NVIDIA#15654) (NVIDIA#15961)

Signed-off-by: Chenfei Zhang <chenfeiz@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants