Skip to content

feat(container): libfabric2.5.1 for EFA and TRTLLM - #10047

Merged
dillon-cullinan merged 1 commit into
ai-dynamo:mainfrom
erezzarum:libfabric251
May 28, 2026
Merged

feat(container): libfabric2.5.1 for EFA and TRTLLM#10047
dillon-cullinan merged 1 commit into
ai-dynamo:mainfrom
erezzarum:libfabric251

Conversation

@erezzarum

@erezzarum erezzarum commented May 27, 2026

Copy link
Copy Markdown
Contributor

Overview:

This PR fixes issues with PR #9727

Details:

  • Use EFA installer aws-ofi-nccl instead of TRTLLM container image aws-ofi-nccl
  • Use NIXL libraries from wheel builder step to be used with EFA

Where should the reviewer start?

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • closes GitHub issue: #xxx

Summary by CodeRabbit

  • Chores
    • Enhanced AWS EFA container template with improved libfabric overlay handling for cases when bundled versions are outdated, including refined path management and optimized dynamic linker configuration
    • Simplified NIXL plugin setup and framework integration to improve container initialization, deployment reliability, and compatibility across different environments

Review Change Stack

Signed-off-by: Erez Zarum <erezz@amazon.com>
@erezzarum
erezzarum requested a review from a team as a code owner May 27, 2026 16:16
@erezzarum
erezzarum requested a review from a team May 27, 2026 16:16
@erezzarum
erezzarum requested review from a team as code owners May 27, 2026 16:16
@copy-pr-bot

copy-pr-bot Bot commented May 27, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@github-actions

Copy link
Copy Markdown
Contributor

👋 Hi erezzarum! Thank you for contributing to ai-dynamo/dynamo.

Just a reminder: The NVIDIA Test Github Validation CI runs an essential subset of the testing framework to quickly catch errors.Your PR reviewers may elect to test the changes comprehensively before approving your changes.

🚀

@github-actions github-actions Bot added feat external-contribution Pull request is from an external contributor container labels May 27, 2026
@dillon-cullinan

Copy link
Copy Markdown
Contributor

/ok to test f143f4d

@coderabbitai

coderabbitai Bot commented May 27, 2026

Copy link
Copy Markdown
Contributor

Walkthrough

The PR updates the AWS EFA Dockerfile template with three configuration changes: narrowed post-installer cleanup scope, a new libfabric directory overlay strategy with pkgconfig rewriting when version conditions are met, and simplified TRTLLM NIXL plugin setup using direct environment variable configuration instead of arch-specific logic.

Changes

AWS EFA and NIXL Configuration

Layer / File(s) Summary
EFA installer post-installation cleanup
container/templates/aws.Dockerfile
Adjusts the cleanup command after EFA installer runs to remove only the aws-ofi-nccl directory and its conf file before re-running ldconfig, instead of removing additional paths.
Libfabric version-conditional overlay
container/templates/aws.Dockerfile
When EFA-bundled libfabric is older than NIXL_LIBFABRIC_REF, clears /opt/amazon/efa, copies the built libfabric tree wholesale into that location, rewrites the libfabric pkgconfig prefix field, creates new ld.so configuration at /etc/ld.so.conf.d/000_efa.conf, and removes the older /etc/ld.so.conf.d/efa.conf file.
TRTLLM NIXL plugin setup
container/templates/aws.Dockerfile
Replaces arch-specific NIXL plugin consolidation logic with direct copying of the entire /opt/nvidia/nvda_nixl directory from the build mount, sets LD_PRELOAD and NIXL_PLUGIN_DIR environment variables to the lib64 plugin subdirectory, runs ldconfig, and updates corresponding ENV defaults.

🎯 2 (Simple) | ⏱️ ~12 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: updating to libfabric 2.5.1 for both EFA and TRTLLM components, which aligns with the core modifications in the Dockerfile template.
Description check ✅ Passed The description includes all required sections (Overview, Details, Where to start, Related Issues) with relevant information about fixes and changes, though the Related Issues section uses a placeholder.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


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: 2

🧹 Nitpick comments (1)
container/templates/aws.Dockerfile (1)

81-89: ⚡ Quick win

Update the TRTLLM note to match the new flow.

The block comment above still says this stage clears LD_PRELOAD and exposes a stable /opt/nvidia/nvda_nixl/plugins alias, but Lines 84-89 now set LD_PRELOAD to libnixl.so and point NIXL_PLUGIN_DIR at lib64/plugins directly. Please sync the comment so it does not mislead the next change.

🤖 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 `@container/templates/aws.Dockerfile` around lines 81 - 89, The comment above
the RUN/ENV block is out of sync: it still claims this stage clears LD_PRELOAD
and exposes a stable /opt/nvidia/nvda_nixl/plugins alias, but the Dockerfile now
sets LD_PRELOAD to /opt/nvidia/nvda_nixl/lib64/libnixl.so and NIXL_PLUGIN_DIR to
/opt/nvidia/nvda_nixl/lib64/plugins; update that note to describe the new flow
(explicitly mention LD_PRELOAD is set to libnixl.so and NIXL_PLUGIN_DIR points
at lib64/plugins rather than a cleared LD_PRELOAD or a plugins alias) so future
readers see accurate behavior for LD_PRELOAD and NIXL_PLUGIN_DIR.
🤖 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 `@container/templates/aws.Dockerfile`:
- Line 39: The cleanup command is removing /etc/ld.so.conf.d/aws-ofi-nccl.conf
but targeting the wrong plugin directory (/opt/amazon/aws-ofi-nccl); update the
Dockerfile cleanup to remove the correct installed path (/opt/aws-ofi-nccl)
instead of /opt/amazon/aws-ofi-nccl so both the plugin directory and the .conf
file are deleted (adjust the rm -rf target from "/opt/amazon/aws-ofi-nccl" to
"/opt/aws-ofi-nccl" while keeping "/etc/ld.so.conf.d/aws-ofi-nccl.conf").
- Around line 58-62: Do not delete the installer-owned EFA tree; instead of "rm
-rf /opt/amazon/efa && cp -Pfr /tmp/libfabric_build /opt/amazon/efa", copy/merge
the overlay into the existing prefix (e.g., use rsync -a or cp -a
--no-dereference to merge from /tmp/libfabric_build into /opt/amazon/efa) so
existing files owned by the installer are preserved; keep the sed edit on
/opt/amazon/efa/lib/pkgconfig/libfabric.pc but only update prefix there, ensure
the ldconfig file (/etc/ld.so.conf.d/000_efa.conf) contains both
/opt/amazon/efa/lib and /opt/amazon/efa/lib64 (append rather than overwrite),
and do not remove /etc/ld.so.conf.d/efa.conf unconditionally—preserve or merge
it instead.

---

Nitpick comments:
In `@container/templates/aws.Dockerfile`:
- Around line 81-89: The comment above the RUN/ENV block is out of sync: it
still claims this stage clears LD_PRELOAD and exposes a stable
/opt/nvidia/nvda_nixl/plugins alias, but the Dockerfile now sets LD_PRELOAD to
/opt/nvidia/nvda_nixl/lib64/libnixl.so and NIXL_PLUGIN_DIR to
/opt/nvidia/nvda_nixl/lib64/plugins; update that note to describe the new flow
(explicitly mention LD_PRELOAD is set to libnixl.so and NIXL_PLUGIN_DIR points
at lib64/plugins rather than a cleared LD_PRELOAD or a plugins alias) so future
readers see accurate behavior for LD_PRELOAD and NIXL_PLUGIN_DIR.
🪄 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: Pro

Run ID: f3221241-866f-405c-a49d-db36cfcc5205

📥 Commits

Reviewing files that changed from the base of the PR and between 44be317 and f143f4d.

📒 Files selected for processing (1)
  • container/templates/aws.Dockerfile

# before re-running ldconfig.
rm -rf /opt/amazon/aws-ofi-nccl /opt/amazon/ofi-nccl \
/etc/ld.so.conf.d/aws-ofi-nccl.conf && \
rm -rf /opt/amazon/aws-ofi-nccl /etc/ld.so.conf.d/aws-ofi-nccl.conf && \

@coderabbitai coderabbitai Bot May 27, 2026

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.

⚠️ Potential issue | 🟡 Minor | ⚡ Quick win

Fix the aws-ofi-nccl cleanup path.

The EFA images elsewhere in this repo use /opt/aws-ofi-nccl, so this currently removes the .conf file but leaves the installed plugin directory behind.

Suggested fix
-    rm -rf /opt/amazon/aws-ofi-nccl /etc/ld.so.conf.d/aws-ofi-nccl.conf && \
+    rm -rf /opt/aws-ofi-nccl /etc/ld.so.conf.d/aws-ofi-nccl.conf && \
🤖 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 `@container/templates/aws.Dockerfile` at line 39, The cleanup command is
removing /etc/ld.so.conf.d/aws-ofi-nccl.conf but targeting the wrong plugin
directory (/opt/amazon/aws-ofi-nccl); update the Dockerfile cleanup to remove
the correct installed path (/opt/aws-ofi-nccl) instead of
/opt/amazon/aws-ofi-nccl so both the plugin directory and the .conf file are
deleted (adjust the rm -rf target from "/opt/amazon/aws-ofi-nccl" to
"/opt/aws-ofi-nccl" while keeping "/etc/ld.so.conf.d/aws-ofi-nccl.conf").

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.

We never use /opt/aws-ofi-nccl can you confirm this?

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.

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Search for all references to aws-ofi-nccl paths in the repository
rg -n "aws-ofi-nccl" --type=dockerfile
rg -n "ofi-nccl" --type=dockerfile
# Also search in shell scripts and other files
rg -n "aws-ofi-nccl" -g "*.sh" -g "*.yml" -g "*.yaml" -g "*.json" -g "*.py" -g "*.txt" -g "*.md" 2>/dev/null || true
rg -rn "opt/aws-ofi-nccl" 2>/dev/null | head -30
rg -rn "opt/amazon/aws-ofi-nccl" 2>/dev/null | head -30
rg -rn "opt/amazon/ofi-nccl" 2>/dev/null | head -30

Length of output: 3490



@erezzarum You are correct — my suggestion was wrong. The path /opt/aws-ofi-nccl does exist in the repo, but only in an unrelated recipe (recipes/glm-5-nvfp4/sglang/disagg/efa/) and docs — it has no connection to this Dockerfile.

Looking at the diff more carefully, the current code (rm -rf /opt/amazon/aws-ofi-nccl) makes sense in context: the pre-PR code removed both /opt/amazon/aws-ofi-nccl and /opt/amazon/ofi-nccl (plus the conf file) to fully disable aws-ofi-nccl. This PR intentionally drops the /opt/amazon/ofi-nccl removal so the EFA installer's aws-ofi-nccl is preserved, while still cleaning up the duplicate /opt/amazon/aws-ofi-nccl path. That's consistent with the PR goal of "switching to the EFA installer aws-ofi-nccl."

My original review comment is invalid. Apologies for the noise!


✏️ Learnings added
Learnt from: erezzarum
Repo: ai-dynamo/dynamo PR: 10047
File: container/templates/aws.Dockerfile:39-39
Timestamp: 2026-05-27T16:26:36.525Z
Learning: In the ai-dynamo/dynamo repository, the EFA installer installs aws-ofi-nccl primarily at `/opt/amazon/ofi-nccl` (without the `aws-` prefix). The path `/opt/amazon/aws-ofi-nccl` is a secondary/duplicate location. The path `/opt/aws-ofi-nccl` is used only in unrelated recipes (e.g., `recipes/glm-5-nvfp4/sglang/disagg/efa/`) and is not related to `container/templates/aws.Dockerfile`. Do not confuse these paths when reviewing EFA-related Dockerfile cleanup commands.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: yuanwu2017
Repo: ai-dynamo/dynamo PR: 7889
File: container/templates/dev.Dockerfile:221-225
Timestamp: 2026-04-04T09:52:48.051Z
Learning: For CPU-target build Dockerfiles in ai-dynamo/dynamo (e.g., templates used for CPU device builds), treat hard-coded `x86_64-linux-gnu` multiarch triplets in `NIXL_LIB_DIR` and `NIXL_PLUGIN_DIR` paths as intentional. Do not raise a multi-arch portability/architecture issue for these paths when the target is explicitly x86_64-only for CPU builds.

Comment thread container/templates/aws.Dockerfile
@dillon-cullinan
dillon-cullinan merged commit 98b3390 into ai-dynamo:main May 28, 2026
66 of 67 checks passed
tmonty12 pushed a commit that referenced this pull request Jun 8, 2026
Signed-off-by: Erez Zarum <erezz@amazon.com>
jh-nv pushed a commit that referenced this pull request Jun 8, 2026
Signed-off-by: Erez Zarum <erezz@amazon.com>
Signed-off-by: Jie Hao <jihao@nvidia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

container external-contribution Pull request is from an external contributor feat size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants