Skip to content

fix(perf): reinstate aws-ofi-nccl EFA plugin for EKS - #5033

Merged
ko3n1g merged 2 commits into
mainfrom
ko3n1g/fix/aws-efa-nccl-net-plugin
Jul 23, 2026
Merged

fix(perf): reinstate aws-ofi-nccl EFA plugin for EKS#5033
ko3n1g merged 2 commits into
mainfrom
ko3n1g/fix/aws-efa-nccl-net-plugin

Conversation

@ko3n1g

@ko3n1g ko3n1g commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Background

The NVIDIA PyTorch base image no longer ships the aws-ofi-nccl plugin (the
NCCL ⇆ libfabric bridge for AWS EFA) and now defaults NCCL_NET_PLUGIN=spcx
(HPCX Spectrum-X). The EFA/libfabric userspace is still present in the image
(/opt/amazon/efa), but without the aws-ofi-nccl libnccl-net.so, NCCL cannot
run over EFA on EKS. The base even leaves a dangling
/etc/ld.so.conf.d/aws-ofi-nccl.conf → /opt/amazon/ofi-nccl/lib.

This restores the plugin and selects it for AWS jobs.

What changed

  • Image build rebuilds aws-ofi-nccl from source (public
    github.com/aws/aws-ofi-nccl, pinned v1.17.3) against the reinstalled NCCL and
    the image's libfabric, installing it into /opt/amazon/ofi-nccl — the prefix the
    leftover aws-ofi-nccl.conf already registers.
  • Launcher pins NCCL_NET_PLUGIN to that plugin for AWS jobs, overriding the
    base image's spcx default. GCP is untouched (still selects gIB).

Details

  • docker/common/install_aws_ofi_nccl.sh — clones + builds the plugin
    (--with-libfabric=/opt/amazon/efa --with-cuda=/usr/local/cuda --with-nccl=/usr --enable-platform-aws), installs to /opt/amazon/ofi-nccl, refreshes the
    ldconfig entry, ldconfig. Version pinned via --AWS_OFI_NCCL_VER.
  • docker/Dockerfile.fw_base — new ARG AWS_OFI_NCCL_VERSION=v1.17.3; runs the
    script in fw_toolkit_builder right after install_nccl.sh, so the plugin links
    against the reinstalled NCCL.
  • scripts/performance/utils/csp_plugins.pyEKSEnvPlugin now
    setdefaults NCCL_NET_PLUGIN=/opt/amazon/ofi-nccl/lib/libnccl-net.so (absolute
    path — the image also ships an HPCX libnccl-net.so, so a bare soname is
    ambiguous). A recipe/user override still wins. GKEEnvPlugin unchanged.
  • tests/unit_tests/scripts/performance/test_csp_plugins.py — new coverage for
    both CSP plugins (previously untested).

Tested

  • pytest tests/unit_tests/scripts/performance/test_csp_plugins.py — asserts the
    EKS plugin pins aws-ofi + EFA, respects a pre-set override, and no-ops off
    Kubeflow; the GKE plugin never sets NCCL_NET_PLUGIN.
  • Image build is validated by CI (requires the FW build + registry).

The NVIDIA PyTorch >= 26.06 base image dropped aws-ofi-nccl and defaults
NCCL_NET_PLUGIN=spcx (HPCX Spectrum-X), so NCCL cannot use EFA on EKS.
Rebuild the plugin from source into /opt/amazon/ofi-nccl against the
reinstalled NCCL and the image's libfabric, and pin it in EKSEnvPlugin
for AWS jobs (overriding the spcx default). GCP is untouched.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g
ko3n1g requested a review from a team as a code owner July 22, 2026 20:13
balasaajay
balasaajay previously approved these changes Jul 22, 2026
@claude

claude Bot commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Light review — looks solid. The change is well-scoped and clearly documented: rebuild aws-ofi-nccl in the FW image and pin NCCL_NET_PLUGIN to it in EKSEnvPlugin so NCCL uses EFA instead of the base image's new spcx default. The setdefault usage correctly lets a recipe/user override win, and the new unit tests cover the pin, the override-respect path, the off-Kubeflow no-op, and that GKE never touches the aws-ofi plugin. Nice tests.

A few points to verify:

1. (Question) Installed library filename. AWS_OFI_NCCL_NET_PLUGIN = "/opt/amazon/ofi-nccl/lib/libnccl-net.so" and the docker install must agree on the exact filename make install drops. Recent aws-ofi-nccl releases have installed the plugin as libnccl-net-ofi.so (with a libnccl-net.so symlink) in some build configurations. If v1.17.3 installs it under a different name, this absolute path is a dangling reference and NCCL silently falls back to TCP — the exact failure this PR aims to prevent, but now hard to notice. Worth confirming the built artifact name in ${PREFIX}/lib matches, e.g. add a post-install test -e "${PREFIX}/lib/libnccl-net.so" guard in install_aws_ofi_nccl.sh so a rename fails the build loudly instead of at runtime.

2. (Minor) Shebang placement. #!/bin/bash sits after the license header (line 14), matching the other docker/common/install_*.sh scripts. A shebang after comments is inert but harmless since the script is invoked via bash /opt/.... No action needed — just noting it matches convention.

Suggested test cases:

  • test_eks_plugin_pins_aws_ofi_and_enables_efa
  • test_eks_plugin_respects_preset_net_plugin
  • test_eks_plugin_is_noop_off_kubeflow
  • test_gke_plugin_never_sets_net_plugin_and_selects_gib
  • test_gke_plugin_is_noop_without_networks

No perf/recipe configs under scripts/performance/configs/ are touched — No perf tests impacted.

cuichenx
cuichenx previously approved these changes Jul 22, 2026
Moving the plugin build below the vLLM install keeps the CUDA-toolkit and
vLLM layers cache-valid (the step only appends a new final layer).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Signed-off-by: oliver könig <okoenig@nvidia.com>
@ko3n1g
ko3n1g dismissed stale reviews from cuichenx and balasaajay via bc07ffc July 22, 2026 21:14
@yaoyu-33 yaoyu-33 added area:perf Performance optimizations and benchmarking bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer labels Jul 22, 2026
@ko3n1g
ko3n1g merged commit 4dca9d9 into main Jul 23, 2026
72 checks passed
@ko3n1g
ko3n1g deleted the ko3n1g/fix/aws-efa-nccl-net-plugin branch July 23, 2026 07:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:perf Performance optimizations and benchmarking bug Something isn't working needs-review PR is ready for code review and waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants