Repository navigation
Conversation
Post-merge builds six -efa runtime image variants (vllm/sglang/trtllm x amd64/arm64) and validates the EFA-ness of none of them: vllm-efa-test and trtllm-efa-test run the same CPU-only framework markers as their non-EFA counterparts, and sglang-efa-build has no test job at all. Every EFA regression so far has been a packaging regression that no functional test could see until it reached a p5/GB200 cluster, and each one degrades to a silent UCX fallback rather than a hard failure: - an image shipping a NIXL plugin directory with no LIBFABRIC plugin - NIXL linked against the generic from-source libfabric instead of the EFA SDK's, so HMEM/CUDA dmabuf descriptors do not match at runtime - arm64 putting plugins somewhere other than where NIXL_PLUGIN_DIR points Add tests/container/test_efa_image.py (marker efa_image): EFA SDK installed, EFA_VERSION recorded, efa provider compiled into libfabric, NIXL_PLUGIN_DIR holds libplugin_LIBFABRIC.so, that plugin's ldd resolves libfabric under /opt/amazon/efa, and libnixl.so sits beside the plugins with every LD_PRELOAD entry resolvable. No GPU, no EFA device and no cluster required, so it runs in the existing image test jobs on both arches. Paths come from the environment rather than hardcoded: 1.3.1-efa uses NIXL_PLUGIN_DIR=/opt/nvidia/nvda_nixl/lib64/plugins on amd64 but /opt/dynamo/nixl/plugins on arm64, and NIXL_LIB_DIR is not exported by every runtime stage. Widen the vllm and trtllm EFA jobs to '(<framework> or efa_image)' and add the missing sglang-efa-test job. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Jie Hao <[email protected]>
|
/ok to test 50f220c |
WalkthroughThe PR adds pytest checks for EFA runtime-image packaging and enables them in vLLM, TRT-LLM, and SGLang EFA post-merge CI jobs. ChangesEFA image validation and CI
Estimated code review effort: 3 (Moderate) | ~20 minutes 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 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 `@tests/container/test_efa_image.py`:
- Around line 33-39: Add pytest.mark.timeout(180) to the module-level pytestmark
list in test_efa_image.py, alongside the existing markers, so each test has a
180-second runtime limit.
🪄 Autofix
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: 2a1d6d6c-99cb-41b5-824f-bcd29bbe7073
📒 Files selected for processing (3)
.github/workflows/post-merge-ci.ymlpyproject.tomltests/container/test_efa_image.py
| pytestmark = [ | ||
| pytest.mark.efa_image, | ||
| pytest.mark.pre_merge, | ||
| pytest.mark.post_merge, | ||
| pytest.mark.unit, | ||
| pytest.mark.gpu_0, | ||
| ] |
There was a problem hiding this comment.
🩺 Stability & Availability | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -eu
printf '%s\n' '--- tests/container/test_efa_image.py outline ---'
ast-grep outline tests/container/test_efa_image.py || true
printf '%s\n' '--- tests/container/test_efa_image.py ---'
cat -n tests/container/test_efa_image.py
printf '%s\n' '--- timeout and marker configuration ---'
rg -n -C 3 'timeout|efa_image|pre_merge|post_merge|unit|gpu_0' \
.ai/pytest-guidelines.md pyproject.toml tests/conftest.py tests/container \
2>/dev/null || trueRepository: ai-dynamo/dynamo
Length of output: 27568
🏁 Script executed:
#!/bin/bash
set -eu
sed -n '1,220p' tests/container/test_efa_image.py
printf '\n--- timeout references ---\n'
rg -n -C 4 'pytest\.mark\.timeout|timeout\(' tests/container .ai/pytest-guidelines.md pyproject.toml tests/conftest.py 2>/dev/null || trueRepository: ai-dynamo/dynamo
Length of output: 10447
🏁 Script executed:
#!/bin/bash
set -eu
python3 - <<'PY'
from pathlib import Path
path = Path("tests/container/test_efa_image.py")
lines = path.read_text().splitlines()
for number, line in enumerate(lines, 1):
print(f"{number:4}: {line}")
PY
printf '\n--- relevant repository rules ---\n'
for path in .ai/pytest-guidelines.md pyproject.toml tests/conftest.py; do
if [ -f "$path" ]; then
printf '\n[%s]\n' "$path"
rg -n -C 5 'timeout|efa_image|pre_merge|post_merge|unit|gpu_0' "$path" || true
fi
doneRepository: ai-dynamo/dynamo
Length of output: 23376
Add a module-level pytest timeout marker.
The module runs fi_info and ldd through subprocess.run(..., timeout=60). Add pytest.mark.timeout(180) to bound each test's total runtime.
🤖 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/container/test_efa_image.py` around lines 33 - 39, Add
pytest.mark.timeout(180) to the module-level pytestmark list in
test_efa_image.py, alongside the existing markers, so each test has a 180-second
runtime limit.
Sources: Coding guidelines, Path instructions, Learnings
| pytestmark = [ | ||
| pytest.mark.efa_image, | ||
| pytest.mark.pre_merge, | ||
| pytest.mark.post_merge, | ||
| pytest.mark.unit, | ||
| pytest.mark.gpu_0, | ||
| ] |
There was a problem hiding this comment.
🔴 New EFA image checks will also run in ordinary non-EFA test images and fail
The new EFA packaging checks are labelled only as "pre-merge, no-GPU" without any framework label (pytestmark at tests/container/test_efa_image.py:33-39), so the general pre-merge test job that runs everything not tied to a framework will pick them up inside a plain image that has no EFA software installed.
Impact: Every pull request's pre-merge run (and the nightly run) will report failures for these checks even though nothing is wrong.
Marker selection math: the framework-exclusion job matches these tests
The pre-merge "dynamo-runtime" pipeline runs the whole repo suite with -m 'pre_merge and not parallel and not (vllm or sglang or trtllm) and (gpu_0)' (.github/workflows/pr.yaml:991, and the same selector in .github/workflows/nightly-ci.yml:946) inside the plain dynamo runtime image built by .github/workflows/dynamo-pipeline.yml.
tests/container/test_efa_image.py carries pre_merge, gpu_0, unit and no parallel and no framework marker, so it satisfies that selector exactly. In a non-EFA image /opt/amazon/efa does not exist and EFA_VERSION / NIXL_PLUGIN_DIR are unset — the PR description's own negative-control runs show "5 failed, 1 skipped" / "4 failed" for exactly this situation.
The pytest action runs a repo-wide collection (.github/actions/pytest/action.yml:284), so file location does not shield the tests.
Options: gate the module on the EFA image (e.g. pytest.mark.skipif on absence of /opt/amazon/efa, or an explicit opt-in env var set by the -efa jobs), or exclude efa_image from the framework-agnostic selectors in pr.yaml/nightly-ci.yml.
Prompt for agents
The new tests in tests/container/test_efa_image.py are marked pre_merge + gpu_0 + unit with no framework marker. The pre-merge 'dynamo-runtime' pipeline (.github/workflows/pr.yaml:990-992, mirrored in .github/workflows/nightly-ci.yml:945-946) selects 'pre_merge and not parallel and not (vllm or sglang or trtllm) and (gpu_0)' and runs a repo-wide pytest collection inside the plain (non-EFA) dynamo runtime image. These EFA packaging assertions therefore get collected there and will fail hard, since /opt/amazon/efa, EFA_VERSION and NIXL_PLUGIN_DIR do not exist in a non-EFA image (the PR's own negative-control runs demonstrate this). Decide on a gating mechanism: either make the module skip when the image is not an EFA image (e.g. a module-level skipif on the EFA SDK root / an opt-in env var set only in the *-efa jobs), or add 'and not efa_image' to the framework-agnostic marker selectors in pr.yaml and nightly-ci.yml. Note that a skipif on the SDK root weakens the negative-control value, so an explicit env opt-in set by the -efa CI jobs may be preferable.
Was this helpful? React with 👍 or 👎 to provide feedback.
| def _run(cmd: list[str]) -> str: | ||
| """Run a command and return stdout+stderr, failing the test on OSError.""" | ||
| try: | ||
| proc = subprocess.run(cmd, capture_output=True, text=True, timeout=60) | ||
| except OSError as exc: | ||
| pytest.fail(f"could not execute {' '.join(cmd)}: {exc}") | ||
| return proc.stdout + proc.stderr |
There was a problem hiding this comment.
🟡 New tests that shell out to external commands lack the required per-test timeout marker
The new checks run external programs (subprocess.run at tests/container/test_efa_image.py:56) without the timeout marker the repository requires for any test containing subprocess waits, so a stuck invocation is not bounded at the test level.
Impact: A hung external command can leave CI waiting far longer than intended instead of failing the test promptly.
Rule reference
.ai/pytest-guidelines.md ("Timeouts") states: "Always flag any test that runs over 30 seconds or contains time.sleep(), polling loops, network calls, or subprocess waits but lacks a @pytest.mark.timeout(...) marker. This is a required change, not a style suggestion." test_efa_provider_compiled_in and test_libfabric_plugin_links_efa_sdk both call _run, which performs a subprocess wait. Adding pytest.mark.timeout(...) to the module-level pytestmark list satisfies the rule.
Was this helpful? React with 👍 or 👎 to provide feedback.
| "integration: marks tests as integration tests", | ||
| "unit: marks tests as unit tests", | ||
| "wheel_smoke: marks tests that validate wheels copied from runtime images", | ||
| "efa_image: marks tests that validate EFA packaging inside an -efa runtime image (no GPU or EFA device required)", |
There was a problem hiding this comment.
🟡 New test marker is registered in only one of the two required places
The new marker is declared only in the project configuration (pyproject.toml:288) and not additionally in the test suite's configuration hook, which the repository's test guidelines require for every marker.
Impact: Under an unusual configuration load order strict-marker checking can reject the marker and fail collection.
Rule reference
.ai/pytest-guidelines.md ("Markers"): "--strict-markers and --strict-config are enforced. Using an undefined marker fails collection. Register all markers in both pyproject.toml and tests/conftest.py:pytest_configure." tests/conftest.py:228-237 dual-registers markers via config.addinivalue_line("markers", ...); efa_image was not added there.
Was this helpful? React with 👍 or 👎 to provide feedback.
| run_cpu_only_tests: true | ||
| # efa_image adds the EFA packaging checks (tests/container/test_efa_image.py), | ||
| # which are what makes this job differ from the non-EFA sglang-test. | ||
| cpu_only_test_markers: '(pre_merge or post_merge) and (sglang or efa_image) and gpu_0' |
There was a problem hiding this comment.
The new SGLang EFA job selects efa_image, but the rendered SGLang CUDA runtime/EFA image does not export NIXL_PLUGIN_DIR/NIXL_LIB_DIR in its final stage, so the new NIXL packaging assertions fail in this job. Fix: enable efa_image for SGLang only after the SGLang EFA runtime image provides the expected NIXL lib/plugin layout.
🤖 AI Fix
In .github/workflows/post-merge-ci.yml, change sglang-efa-test cpu_only_test_markers from '(pre_merge or post_merge) and (sglang or efa_image) and gpu_0' to '(pre_merge or post_merge) and sglang and gpu_0' until container/templates/sglang_runtime.Dockerfile or container/templates/aws.Dockerfile exports a valid NIXL_LIB_DIR, NIXL_PLUGIN_DIR, libnixl.so, and libplugin_LIBFABRIC.so layout for framework == "sglang" EFA runtime images.
This comment has been minimized.
This comment has been minimized.
EFA changes are sparse, so verifying the -efa images on every commit to main spends far more CI than the risk warrants. Run the checks once a night instead, in the pipeline that already builds all three -efa images. - revert post-merge-ci.yml: leave vllm-efa-test and trtllm-efa-test exactly as they were, and drop the sglang-efa-test job added there - add vllm/sglang/trtllm -efa-test jobs to nightly-ci.yml, each running only 'efa_image and gpu_0' against its nightly -efa image on amd64 and arm64 - retag the tests nightly instead of pre_merge/post_merge Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Signed-off-by: Jie Hao <[email protected]>
|
/ok to test 2248f69 |
|
Closing in favour of the end-to-end test in #12915. The static checks here would not have caught What remains is the layout assertions, and those are brittle by nature. SGLang demonstrated it twice: NIXL lives at a mesonpy wheel path rather than #12915 asserts the outcome instead — KV bytes moved, libfabric memory registration happened, no UCX fallback — which is invariant to where the files live. The diagnostic value is carried over there as logging rather than assertions. Thanks to the reviewers; every one of the findings held up under checking. Filed separately: EFA release staging is not gated on any test result, and build-time libfabric provenance ( |
Summary
Nightly and post-merge both build six
-efaruntime image variants (vllm/sglang/trtllm × amd64/arm64), and nothing verifies the EFA packaging of any of them. The existingvllm-efa-test/trtllm-efa-testpost-merge jobs run'(pre_merge or post_merge) and <framework> and gpu_0'— character-for-character the same markers as their non-EFA counterparts, touching nothing EFA-specific. Nightly has no EFA test jobs at all.Every EFA regression we have hit was a packaging regression that no functional test could see until it reached a p5/GB200 cluster, and each degrades to a silent UCX fallback rather than a hard failure:
NIXL_PLUGIN_DIRpointsChanges
tests/container/test_efa_image.py(new, markerefa_image) — six checks: EFA SDK installed ·EFA_VERSIONrecorded ·efaprovider compiled into libfabric (fi_info -l) ·NIXL_PLUGIN_DIRholdslibplugin_LIBFABRIC.so· that plugin'slddresolves libfabric under/opt/amazon/efa·libnixl.sosits beside the plugins and everyLD_PRELOADentry resolves. No GPU, no EFA device, no cluster; a few seconds per image.pyproject.toml— register theefa_imagemarker..github/workflows/nightly-ci.yml— addvllm-efa-test,sglang-efa-test,trtllm-efa-test, each running onlyefa_image and gpu_0against its nightly-efaimage on amd64 and arm64.Cadence: nightly, not per-commit. EFA changes are sparse, so paying for these on every push to
maincosts more CI than the risk warrants.post-merge-ci.ymlis deliberately left untouched by this PR.Paths are read from the environment rather than hardcoded, because they genuinely differ:
vllm-runtime:1.3.1-efausesNIXL_PLUGIN_DIR=/opt/nvidia/nvda_nixl/lib64/pluginson amd64 but/opt/dynamo/nixl/pluginson arm64. A hardcodedlib64assertion would have failed on arm64 — which is the very bug class this test exists to catch.NIXL_LIB_DIRis also not exported by every runtime stage (trtllm_runtime.Dockerfilesets onlyNIXL_PLUGIN_DIRandLD_PRELOAD), so the libnixl check falls back to the plugin directory's parent rather than going vacuous.Validation
Executed in CI-built EFA images. Before the switch to nightly, this branch's post-merge variant was dispatched on
pull-request/12868(run 31238756257);vllm-runtime-efabuilt and both CPU Test jobs passed:All six tests appear by name in both logs with zero FAILED/ERROR lines. Only the wiring changed afterwards; the test file's assertions are unchanged.
Executed in released images on the AWS dev clusters (mounted at
/workspace/tests/container, run with the image's own Python, in pods holding no GPU and no EFA device — the same condition as the CI runner):vllm-runtime:1.3.1-efa— amd64vllm-runtime:1.3.1-efa— arm64sglang-runtime:1.3.1-efa— amd64sglang-runtime:1.3.1(non-EFA, negative control)vllm-runtime:1.3.1(non-EFA, negative control)Repo-level:
pytest --collect-onlyunder--strict-markerscollects 6, and-m 'efa_image and gpu_0'selects all 6;tests/report_pytest_markers.pyreportsMissing sets: 0across 4660 tests; isort / black / flake8 / ruff / codespell / check-yaml / check-toml pass; both workflow files parse.Known gaps
nvcr.io/nvidia/ai-dynamo/trtllm-runtimeis not publicly pullable, so the TRT-LLM EFA image was not exercised directly. By inspection,aws.Dockerfile's trtllm branch setsNIXL_PLUGIN_DIR=/opt/nvidia/nvda_nixl/lib64/pluginsandLD_PRELOAD=/opt/nvidia/nvda_nixl/lib64/libnixl.so, which both checks handle — worth watching the first nightlytrtllm-efa-test.pytest-marker-reportpre-commit hook was skipped at commit time: its hook venv runs on this machine's Python 3.9, which cannot importtests/utils/collection_env_guard.py(str | None). The same script was run under Python 3.12 —Missing sets: 0.An internal Linear ticket also tracks this work.
🤖 Generated with Claude Code