Skip to content

[https://nvbugs/5569754][fix] trtllm-llmapi-launch port conflict - #8497

Closed
Superjomn wants to merge 1 commit into
NVIDIA:mainfrom
Superjomn:launch-uniq-addr2
Closed

Superjomn wants to merge 1 commit into
NVIDIA:mainfrom
Superjomn:launch-uniq-addr2

Conversation

@Superjomn

@Superjomn Superjomn commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Refactor
    • Improved inter-process communication infrastructure for distributed multi-process execution. Address generation now uses optimized IPC pathways instead of TCP-based approaches. Configuration is applied exclusively on the primary process rank, reducing resource overhead and improving efficiency in multi-rank deployment scenarios.

Description

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)

  • Any new dependencies have been scanned for license and vulnerabilities

  • CODEOWNERS updated if ownership changes

  • Documentation updated as needed

  • 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

/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)]

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. Examples: "A10-PyTorch-1, xxx". 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. Examples: --extra-stage "H100_PCIe-TensorRT-Post-Merge-1, xxx".

--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.

For guidance on mapping tests to stage names, see docs/source/reference/ci-overview.md
and the scripts/test_to_stage_mapping.py helper.

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.

@Superjomn
Superjomn requested review from a team as code owners October 20, 2025 08:23
@Superjomn
Superjomn requested a review from syuoni October 20, 2025 08:23
@coderabbitai

coderabbitai Bot commented Oct 20, 2025 •

Copy link
Copy Markdown
Contributor
📝 Walkthrough

Walkthrough

The export_free_tcp_addr_for_spawn_proxy_process function is refactored to generate unique IPC addresses using Python's uuid and tempfile instead of binding free TCP ports. Execution is now conditional on MPI rank 0, affecting proxy process initialization and MPI environment handling.

Changes

Cohort / File(s) Summary
IPC Address Generation & Rank-Conditional Execution
tensorrt_llm/llmapi/trtllm-llmapi-launch
Modified address generation from TCP-based (tcp://127.0.0.1:port) to IPC-based (ipc://<tempfile-uuid>); wrapped function invocation in rank 0 condition; updated export variable to TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR; affected subsequent MPI background task and environment cleanup flow.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Description Check ⚠️ Warning The PR description is largely incomplete. While the PR title is properly formatted with a valid ticket reference [https://nvbugs/5569754][fix] and a descriptive summary about the port conflict fix, the critical sections required by the template have not been filled in. The "Description" section (which should explain the issue and solution) is entirely empty beyond the template placeholder comment, and the "Test Coverage" section (which should list relevant tests) is also completely blank. Although the author checked the final checklist item, the absence of explanation and test information means the PR lacks essential context for reviewers to understand what is being fixed and how it is validated. The author should fill in the "Description" section with a clear explanation of the port conflict issue and how the IPC address solution resolves it. Additionally, the "Test Coverage" section should be populated with the relevant tests that validate the change from TCP-based to IPC-based address generation and the rank 0-only execution logic. These sections are essential for reviewers to understand the rationale and verification of the changes.
✅ Passed checks (2 passed)
Check name Status Explanation
Title Check ✅ Passed The PR title "[https://nvbugs/5569754][fix] trtllm-llmapi-launch port conflict" follows the required format with a valid NVBugs ID and [fix] type designation. The title clearly relates to the main objective of this changeset—replacing TCP-based addressing (which can cause port conflicts) with IPC-based addressing in the spawn proxy process logic. The title is concise, specific, and a developer scanning the history would understand that this PR addresses a port conflict issue by switching addressing mechanisms.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@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: 0

🧹 Nitpick comments (1)
tensorrt_llm/llmapi/trtllm-llmapi-launch (1)

28-28: Rename variable for clarity.

The variable free_port is misleading since it now holds an IPC path rather than a TCP port number.

Apply this diff to improve clarity:

-    local free_port=$(python3 -c "import uuid, tempfile, os; print(f'ipc://{os.path.join(tempfile.gettempdir(), \"rpc_test_\" + str(uuid.uuid4()))}')")
-    export TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR=$free_port
+    local ipc_addr=$(python3 -c "import uuid, tempfile, os; print(f'ipc://{os.path.join(tempfile.gettempdir(), \"rpc_test_\" + str(uuid.uuid4()))}')")
+    export TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR=$ipc_addr
📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d05079b and f1c1322.

📒 Files selected for processing (1)
  • tensorrt_llm/llmapi/trtllm-llmapi-launch (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: Pre-commit Check
🔇 Additional comments (2)
tensorrt_llm/llmapi/trtllm-llmapi-launch (2)

26-33: Verify IPC socket cleanup and rename function from TCP to IPC.

The switch to IPC addresses creates filesystem socket entries that require explicit cleanup. The codebase has proper cleanup patterns elsewhere (e.g., tensorrt_llm/bench/benchmark/utils/processes.py uses os.remove(f"{self._socket_path}") in __del__), but this pattern is missing from the spawned proxy process code. While ZMQ's socket.close() and context.term() close the socket connection, they do not automatically remove the filesystem socket file.

Additionally:

  1. Function naming: Rename export_free_tcp_addr_for_spawn_proxy_process to export_free_ipc_addr_for_spawn_proxy_process — the function generates IPC addresses, not TCP.

  2. Inconsistency: The shell script generates ipc:// format, but tensorrt_llm/commands/serve.py (line 637-638) sets the same env var to tcp:// format. Verify which format is intended and ensure consistency.


40-43: No issues found; code change is verified as correct.

The IPC address setup is appropriately restricted to rank 0. Verification confirms that create_mpi_comm_session() (which consumes the IPC address) has an explicit rank 0 assertion and is only invoked on rank 0. Worker nodes (mgmn_worker_node.py) do not reference TLLM_SPAWN_PROXY_PROCESS_IPC_ADDR and only run an MPICommExecutor for task execution, confirming they have no dependency on the proxy process IPC address.

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #21910 [ run ] triggered by Bot. Commit: d8d55ab

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #21910 [ run ] completed with state SUCCESS. Commit: d8d55ab
/LLM/main/L0_MergeRequest_PR pipeline #16517 completed with status: 'FAILURE'

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #21953 [ run ] triggered by Bot. Commit: d8d55ab

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #21953 [ run ] completed with state SUCCESS. Commit: d8d55ab
/LLM/main/L0_MergeRequest_PR pipeline #16550 completed with status: 'FAILURE'

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22000 [ run ] triggered by Bot. Commit: d8d55ab

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22000 [ run ] completed with state SUCCESS. Commit: d8d55ab
/LLM/main/L0_MergeRequest_PR pipeline #16589 completed with status: 'FAILURE'

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22126 [ run ] triggered by Bot. Commit: d8d55ab

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will open another cherry-pick PR.

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22126 [ run ] completed with state SUCCESS. Commit: d8d55ab
/LLM/main/L0_MergeRequest_PR pipeline #16684 completed with status: 'FAILURE'

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22189 [ run ] triggered by Bot. Commit: 8f29050

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22189 [ run ] completed with state SUCCESS. Commit: 8f29050
/LLM/main/L0_MergeRequest_PR pipeline #16731 completed with status: 'FAILURE'

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22292 [ run ] triggered by Bot. Commit: 8f29050

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22292 [ run ] completed with state SUCCESS. Commit: 8f29050
/LLM/main/L0_MergeRequest_PR pipeline #16806 completed with status: 'FAILURE'

Signed-off-by: Yan Chunwei <[email protected]>
@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22392 [ run ] triggered by Bot. Commit: 907a6de

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22392 [ run ] completed with state SUCCESS. Commit: 907a6de
/LLM/main/L0_MergeRequest_PR pipeline #16876 completed with status: 'FAILURE'

@hchings hchings 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

@Superjomn

Copy link
Copy Markdown
Contributor Author

/bot run

@Superjomn
Superjomn enabled auto-merge (squash) October 28, 2025 01:54
@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22707 [ run ] triggered by Bot. Commit: 907a6de

@tensorrt-cicd

Copy link
Copy Markdown
Collaborator

PR_Github #22707 [ run ] completed with state FAILURE. Commit: 907a6de
/LLM/main/L0_MergeRequest_PR pipeline #17120 completed with status: 'FAILURE'

@tanmayv25

Copy link
Copy Markdown
Collaborator

@Superjomn What is the status of this PR? Did the fix land in?

@brnguyen2

Copy link
Copy Markdown
Collaborator

👋 Thanks for this contribution! As part of a one-time effort to trim the TensorRT-LLM open-PR backlog, we're closing PRs that have had no activity in over 180 days and currently have merge conflicts with main, and this one qualifies. This isn't a reflection on the work itself: the branch, commits, and discussion are all preserved. If you'd like to revive it, just rebase onto main and reopen (or ping a maintainer) and we'll pick it back up. Thanks again!

@brnguyen2 brnguyen2 closed this Aug 11, 2026
auto-merge was automatically disabled August 11, 2026 01:26

Pull request was closed

sunnyqgg added a commit to sunnyqgg/TensorRT-LLM that referenced this pull request Nov 23, 2026
Re-pin flashinfer-prims-ts-moe from FlashInfer main 855eece4 to 637f9c53,
which adds FlashInfer NVIDIA#8497 (faster MXFP4 x MXFP8 MoE GEMMs: deeper-pipelined
tile configs, 64-byte K-block weights and an opt-in fused FC2 finalize) and
NVIDIA#8498. The integration patch applies unchanged, and the new launch arguments
are optional, so the op keeps the unfused finalize.

NVIDIA#8497 renumbers the tactics. Key the autotuner cache on a digest of the
vendored config mapper and tables instead of a hand-kept version string, so
tuned tactics from other config tables are not replayed.

Signed-off-by: qgai <[email protected]>
sunnyqgg added a commit to sunnyqgg/TensorRT-LLM that referenced this pull request Nov 25, 2026
Re-pin flashinfer-prims-ts-moe from FlashInfer main 855eece4 to 637f9c53,
which adds FlashInfer NVIDIA#8497 (faster MXFP4 x MXFP8 MoE GEMMs: deeper-pipelined
tile configs, 64-byte K-block weights and an opt-in fused FC2 finalize) and
NVIDIA#8498. The integration patch applies unchanged, and the new launch arguments
are optional, so the op keeps the unfused finalize.

NVIDIA#8497 renumbers the tactics. Key the autotuner cache on a digest of the
vendored config mapper and tables instead of a hand-kept version string, so
tuned tactics from other config tables are not replayed.

Signed-off-by: qgai <[email protected]>
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.

7 participants