Skip to content

test(efa): add the EFA disaggregated deploy test for vllm - #12915

Merged
jh-nv merged 26 commits into
mainfrom
jihao/efa-deploy-test-nightly
Aug 25, 2026
Merged

jh-nv merged 26 commits into
mainfrom
jihao/efa-deploy-test-nightly

Conversation

@jh-nv

@jh-nv jh-nv commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Overview:

Adds a nightly test that a Dynamo -efa image actually moves KV over Elastic Fabric Adapter. It deploys a disaggregated vLLM stack on a real EFA cluster (aws-dev-02, p5/H100), serves a chat completion, and asserts the prefill→decode transfer rode NIXL → LIBFABRIC → EFA.

EFA regressions degrade silently: a broken image still serves tokens, it just stops using EFA and falls back to UCX. Nothing in CI currently notices. A test that only checked or HTTP 200 would pass.

Nightly rather than per-commit — EFA changes are sparse, so a cluster-backed test on every push costs far more than the risk warrants.

Details:

tests/deploy/test_deploy_efa.py (marker framework_with_efa) — deploys the manifest, waits for both workers, sends one completion, then applies four gates. Every one fails closed: if the evidence cannot be read, the test fails rather than skipping.

Gate Proves
Per worker: Backend LIBFABRIC was instantiated present, Backend UCX was instantiated absent, libfabric efa:mr:/efa_mr_reg present each worker selected the LIBFABRIC backend over the EFA provider — not just one of them, and not UCX
Each worker's own EFA adapter counters moved (node_amazonefa_rdma_read_bytes on decode, node_amazonefa_rdma_read_resp_bytes on prefill) the bytes crossed the physical adapter. Read from the NIC via efa-node-exporter, not from NIXL, so no software-reported value can satisfy it
NIXL agent_rx_bytes increased across the request NIXL agrees with the adapter on how much moved
Completion returns 200 with non-trivial content the 1P1D path actually served, so a KV transfer had to occur

The adapter-counter gate is the load-bearing one — it is the only backend-independent evidence, and measured idle noise on an assigned NIC is zero. The device is resolved per pod (/dev/infiniband/uverbs* → ibdev) so the scrape is filtered to that worker's own NIC.

Teardown itself is guaranteed by the finally: in ManagedDeployment._cleanup, and the workflow's Teardown vCluster step is what actually reclaims the GPUs and VPC IPs.

tests/deploy/efa/disagg-efa.yaml — 1P1D, Qwen3-0.6B, TP=1, one GPU and one vpc.amazonaws.com/efa per worker. Three deliberate choices:

  • No tolerations or nodeSelector. The clusters' Kyverno deploy-test-pod-policy injects them for GPU pods in dynamo-deploy-test, and what it injects differs per cluster
    (H100 ci-pool label on aws-dev-02, gpu.product on aws-dev-01). Hardcoding either breaks the other, and the policy is flux-managed.
  • nvidia.com/gpu on requests as well as limits. That Kyverno rule keys off resources.requests, so relying on requests being defaulted from limits would make the
    injection depend on admission ordering.
  • IPC_LOCK + SYS_PTRACE, not privileged. What real deployments use; privileged also exposes every NIC and can mask device-selection bugs.

.github/workflows/nightly-ci.yml — three jobs, mirroring the deploy-operator → deploy-test-* → deploy-cleanup split this file already uses:

job timeout-minutes if:
efa-deploy-operator none → 360 default run_tests
efa-deploy-test-vllm 30 run_tests
efa-deploy-cleanup none → 360 default always()

Setup gets no tight ceiling because setup-dynamo-operator's own waits (900s/1800s/1800s) can exceed any reasonable one, and cleanup is a separate job with job-level if: always() so it survives job timeout, cancellation and a dead runner — none of which a step-level always() does. That matters because setup-dynamo-operator skips the nscleanup/ttl label for the shared dynamo-deploy-test namespace, so a leak has no automated reaper.

The image comes straight from ECR — aws-dev-02's node instance role grants ECR read, so no copy-to-ACR hop and no pull secret are needed (verified: a cold 18.2 GB pull into dynamo-deploy-test succeeds while the namespace's only imagePullSecret covers dynamoci.azurecr.io alone). It cannot reuse shared-deploy-test.yml, which hardcodes its runner, timeout, ACR image reference and -m framework_only selector, and forwards no kube context.

.github/actions/set-kube-context/ — copies the runner's Teleport kubeconfig to a job-local path before selecting $KUBE_CONTEXT, so the three jobs share one implementation and none of them mutates the kubeconfig other jobs on the runner are reading.

tests/conftest.py — register the framework_with_efa marker (markers are validated in both pyproject.toml and pytest_configure). The test carries no framework marker at all, so it needs no exemption from the framework-not-installed auto-skip.

Where should the reviewer start?

  1. tests/deploy/test_deploy_efa.py — the three assertions are the substance
  2. tests/deploy/efa/disagg-efa.yaml — note what is deliberately absent
  3. .github/workflows/nightly-ci.yml — the efa-deploy-* jobs

Validation: passes live on aws-dev-02, most recently against the nightly-built <sha>-vllm-runtime-efa-nightly from ECR (1 passed in 389.15s), with prefill and decode forced onto different hosts by podAntiAffinity so the transfer is genuinely cross-node:

  • LIBFABRIC backend on both workers, UCX on neither, efa:mr: registration on both
  • decode node_amazonefa_rdma_read_bytes +16,515,072, prefill node_amazonefa_rdma_read_resp_bytes +16,515,072 — exact agreement across the two NICs
  • NIXL agent_rx_bytes 1,835,008 → 18,350,080, matching the adapter delta
  • teardown verified, no worker pods left behind

Negative controls: removing the backends: ["LIBFABRIC"] pin makes NIXL choose UCX (32 Amazon EFA(s) were detected, but the UCX backend was configured) and the per-worker gate fails; idle EFA counters were measured over 25s and moved zero bytes, so the deltas above are the request and not background traffic.

Appendix: deploy-test-pod-policy

Requested in review — the manifest's "no tolerations/nodeSelector" and "GPU on
requests as well as limits" choices both rest on this policy, which is
cluster-side and flux-managed, so nothing in-repo can corroborate it. Captured
live from both EFA CI clusters. Kyverno's derived autogen-* rules are elided.

dynamo-aws-dev-02 (p5 / H100 / amd64)

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: deploy-test-pod-policy
spec:
  failurePolicy: Fail
  rules:
  - match:
      any:
      - resources:
          kinds:
          - Pod
          namespaces:
          - dynamo-deploy-test
    mutate:
      patchStrategicMerge:
        spec:
          +(priorityClassName): ci-nightly-high-priority
    name: inject-priority-class
    skipBackgroundRequests: true
  - match:
      any:
      - resources:
          kinds:
          - Pod
          namespaces:
          - dynamo-deploy-test
    mutate:
      patchStrategicMerge:
        spec:
          nodeSelector:
            ai-dynamo.github.com/ci-pool: h100
          tolerations:
          - effect: NoSchedule
            key: github-runners
            operator: Equal
            value: 'true'
          - effect: NoSchedule
            key: nvidia.com/gpu
            operator: Equal
            value: 'true'
          - key: dedicated
            operator: Exists
    name: target-h100-pool
    preconditions:
      any:
      - key: '{{ request.object.spec.containers[].resources.requests."nvidia.com/gpu" | to_array(@) |
          length(@) }}'
        operator: GreaterThan
        value: 0
    skipBackgroundRequests: true

dynamo-aws-dev-01 (p6e-gb200 / GB200 / arm64)

apiVersion: kyverno.io/v1
kind: ClusterPolicy
metadata:
  name: deploy-test-pod-policy
spec:
  failurePolicy: Fail
  rules:
  - match:
      any:
      - resources:
          kinds:
          - Pod
          namespaces:
          - dynamo-deploy-test
    mutate:
      patchStrategicMerge:
        spec:
          +(priorityClassName): ci-nightly-high-priority
    name: inject-priority-class
    skipBackgroundRequests: true
  - match:
      any:
      - resources:
          kinds:
          - Pod
          namespaces:
          - dynamo-deploy-test
    mutate:
      patchStrategicMerge:
        spec:
          nodeSelector:
            nvidia.com/gpu.product: NVIDIA-GB200
    name: target-gb200-nodes
    preconditions:
      any:
      - key: '{{ request.object.spec.containers[].resources.requests."nvidia.com/gpu" | to_array(@) |
          length(@) }}'
        operator: GreaterThan
        value: 0
    skipBackgroundRequests: true

Three things a reviewer may want to confirm from the above:

  1. The nodeSelector genuinely differs per cluster — ai-dynamo.github.com/ci-pool: h100
    on dev-02 vs nvidia.com/gpu.product: NVIDIA-GB200 on dev-01 — so hardcoding
    either one in the manifest would break the other cluster.
  2. The precondition keys off spec.containers[].resources.requests."nvidia.com/gpu",
    not limits. That is why the manifest sets the GPU resource on requests
    rather than relying on it being defaulted from limits by admission ordering.
  3. Only dev-02 injects tolerations; dev-01 injects the nodeSelector alone.

This is a point-in-time snapshot for review, not documentation — the live cluster
remains the source of truth via kubectl get clusterpolicy deploy-test-pod-policy -o yaml.

Related Issues

-Relates to: DIS-2147

jh-nv and others added 2 commits August 10, 2026 00:15
Verifies that an -efa image actually moves KV over EFA, which the packaging
checks in tests/container/test_efa_image.py cannot: deploys a 1P1D vLLM stack
on an EFA-capable cluster, serves a chat completion, and asserts the transfer
rode NIXL -> LIBFABRIC -> EFA rather than silently falling back to UCX.

Revives the test from #10721 (stale-closed, passed live on aws-dev-02 twice)
rebased onto main and hardened against what the cluster probes since found:

- rewritten to the v1beta1 DGD schema; the repo has migrated (91 v1beta1 vs
  11 v1alpha1 manifests) since the original was written
- no tolerations or nodeSelector. Kyverno's deploy-test-pod-policy injects
  them for GPU pods in dynamo-deploy-test, and what it injects differs per
  cluster, so hardcoding either would break the other
- nvidia.com/gpu set on requests as well as limits: that Kyverno rule keys off
  resources.requests."nvidia.com/gpu" > 0, so relying on requests being
  defaulted from limits would make the injection depend on admission ordering
- privileged: true replaced with IPC_LOCK + SYS_PTRACE, which is what the
  policy allows and what real deployments use
- dropped the LD_LIBRARY_PATH and PATH overrides. The image sets
  NIXL_PLUGIN_DIR and LD_PRELOAD itself and those paths are arch-dependent, so
  overriding them masked the packaging regressions test_efa_image.py catches
- the NIXL agent_rx_bytes assertion is capability-gated. The libfabric log
  evidence is the gate that must hold everywhere; the Prometheus exporter has
  not been observed working on GB200, so an unreadable counter now warns
  instead of failing the run for the wrong reason

Also exempt deploy-marked tests from the framework-not-installed auto-skip.
A deploy test drives an image on a cluster and never imports the framework
locally, so skipping it for a missing local import turns a real failure into a
silently green job.

Marked nightly: cluster-backed EFA testing on every commit would cost far more
than sparse EFA changes warrant.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
Wires tests/deploy/test_deploy_efa.py into nightly-ci.yml. This is the only
job that exercises real EFA hardware; everything else validates the -efa
images statically.

- vllm-efa-copy-to-acr: the -efa builds only push to ECR, but the shared
  dynamo-deploy-test namespace holds acr-token-secret, so mirror what every
  other deploy test does and copy the nightly -efa image to ACR first.
- efa-deploy-test-vllm: creates its own vCluster on aws-dev-02 via the
  Teleport kubeconfig, runs the test through the existing dynamo-deploy-test
  action, and tears the vCluster down on always().

It cannot reuse shared-deploy-test.yml, which pins its own runner and timeout
and cannot select a kube context.

timeout-minutes is 40, well above the test's own @pytest.mark.timeout(1200).
A job-level timeout cancels the run, which loses the junit XML and skips the
always() cleanup, leaking the DGD and its GPUs; letting pytest fail first keeps
the failure reportable and the cluster clean.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv
jh-nv requested review from a team as code owners August 10, 2026 04:48
@github-actions github-actions Bot added the test label Aug 10, 2026
@jh-nv

jh-nv commented Aug 10, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bfdd5a7

@devin-ai-integration devin-ai-integration 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.

Devin Review found 5 potential issues.

Open in Devin Review

Comment thread .github/workflows/nightly-ci.yml Resolved
Comment thread .github/workflows/nightly-ci.yml Resolved
Comment thread .github/workflows/nightly-ci.yml Resolved
Comment thread tests/conftest.py Resolved
Comment thread .github/workflows/nightly-ci.yml Resolved
@coderabbitai

coderabbitai Bot commented Aug 10, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Changes

EFA nightly deployment

Layer / File(s) Summary
EFA test foundation
pyproject.toml, tests/conftest.py, tests/deploy/efa/disagg-efa.yaml, tests/deploy/test_deploy_efa.py
Adds the framework_with_efa marker, deployment-test skip handling, EFA deployment manifest, and test configuration.
EFA deployment validation
tests/deploy/test_deploy_efa.py
Adds deployment checks, chat completion validation, worker log inspection, LIBFABRIC/EFA marker checks, and NIXL receive-byte telemetry validation.
Nightly CI integration
.github/workflows/nightly-ci.yml
Copies the EFA image to ACR, runs the test on aws-dev-02 through a vCluster, and always tears down the vCluster.

Estimated code review effort: 4 (Complex) | ~45 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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.
Title check ✅ Passed The title clearly identifies the main change: adding an EFA disaggregated deployment test for vLLM.
Description check ✅ Passed The description covers all required sections and provides detailed implementation, validation, reviewer guidance, and a related issue reference.

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

🧹 Nitpick comments (3)
tests/deploy/test_deploy_efa.py (3)

260-263: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use lazy logging interpolation consistently.

These calls build f-strings eagerly. assert_efa_rdma_traffic at lines 198-218 already uses %s arguments, so the module is inconsistent. Pass the format string and arguments separately.

♻️ Example for one call site
-        logger.info(f"NIXL {NIXL_RX_BYTES_METRIC} before request: {rx_before}")
+        logger.info("NIXL %s before request: %s", NIXL_RX_BYTES_METRIC, rx_before)

As per coding guidelines: "Use lazy formatting for log messages; pass format strings and arguments separately to logging calls".

Also applies to: 283-283, 291-291, 308-308, 328-328, 336-339

🤖 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/deploy/test_deploy_efa.py` around lines 260 - 263, Update the logging
calls in the deploy test, including the message near EFA deploy startup and the
additional listed call sites, to use lazy logging interpolation: pass a
`%s`-style format string and values as separate arguments. Match the existing
pattern used by `assert_efa_rdma_traffic` and preserve each message’s current
content.

Source: Coding guidelines


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

Blanket except Exception with # noqa: BLE001 in the EFA test helpers. Both helpers swallow every exception and suppress the linter warning, so an infrastructure failure becomes a silent empty log string or a None counter, which weakens the EFA assertions instead of failing the test.

  • tests/deploy/test_deploy_efa.py#L90-L112: in _read_pod_logs, catch the Kubernetes API exception raised by pod.logs and drop the # noqa: BLE001; also replace the hasattr(pod, "raw") guard with direct attribute access.
  • tests/deploy/test_deploy_efa.py#L157-L162: in _read_nixl_rx_bytes, catch the Kubernetes API exception from pod.exec and UnicodeDecodeError, and let other errors propagate.

As per coding guidelines: "In test error handling, do not use blanket except Exception; catch only specific exceptions you can actually handle and let failures propagate".

🤖 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/deploy/test_deploy_efa.py` around lines 90 - 112, The EFA test helpers
currently swallow infrastructure failures with blanket exception handling. In
tests/deploy/test_deploy_efa.py lines 90-112, update _read_pod_logs to access
pod.raw directly and catch only the Kubernetes API exception raised by pod.logs,
removing the BLE001 suppression; in lines 157-162, update _read_nixl_rx_bytes to
catch only the Kubernetes API exception from pod.exec and UnicodeDecodeError,
allowing all other errors to propagate.

Source: Coding guidelines


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

Resolve the manifest path relative to the test file. Replace _get_workspace_dir() and the os.path.exists guard with Path(__file__).parent / "efa" / "disagg-efa.yaml". ManagedDeployment.__aexit__ already stops tracked port forwards, so no additional context manager is required.

🤖 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/deploy/test_deploy_efa.py` around lines 41 - 45, Update the deployment
manifest setup in the test to resolve the path directly from __file__ using
Path(__file__).parent / "efa" / "disagg-efa.yaml". Remove the _get_workspace_dir
import and the os.path.exists guard, while leaving ManagedDeployment context
handling unchanged.
🤖 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 @.github/workflows/nightly-ci.yml:
- Around line 587-595: Update the EFA image-copy workflow configuration around
vllm-efa-copy-to-acr so the setup-dynamo-operator step receives repository: ${{
vars.ACR_REPOSITORY }} when registry is configured. Preserve the existing
target_tag_plain, cuda_version, and image_tag handling.

In `@tests/deploy/test_deploy_efa.py`:
- Around line 221-233: Add the pytest.mark.gpu_2 decorator to
test_efa_deployment, alongside its existing test markers, so the test is
scheduled with the two GPUs required by its EFA worker manifest. Do not add
pytest.mark.asyncio.

---

Nitpick comments:
In `@tests/deploy/test_deploy_efa.py`:
- Around line 260-263: Update the logging calls in the deploy test, including
the message near EFA deploy startup and the additional listed call sites, to use
lazy logging interpolation: pass a `%s`-style format string and values as
separate arguments. Match the existing pattern used by `assert_efa_rdma_traffic`
and preserve each message’s current content.
- Around line 90-112: The EFA test helpers currently swallow infrastructure
failures with blanket exception handling. In tests/deploy/test_deploy_efa.py
lines 90-112, update _read_pod_logs to access pod.raw directly and catch only
the Kubernetes API exception raised by pod.logs, removing the BLE001
suppression; in lines 157-162, update _read_nixl_rx_bytes to catch only the
Kubernetes API exception from pod.exec and UnicodeDecodeError, allowing all
other errors to propagate.
- Around line 41-45: Update the deployment manifest setup in the test to resolve
the path directly from __file__ using Path(__file__).parent / "efa" /
"disagg-efa.yaml". Remove the _get_workspace_dir import and the os.path.exists
guard, while leaving ManagedDeployment context handling unchanged.
🪄 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: f6f58432-973f-4f64-90b3-c7eaa09c8e20

📥 Commits

Reviewing files that changed from the base of the PR and between a3a3c24 and bfdd5a7.

📒 Files selected for processing (5)
  • .github/workflows/nightly-ci.yml
  • pyproject.toml
  • tests/conftest.py
  • tests/deploy/efa/disagg-efa.yaml
  • tests/deploy/test_deploy_efa.py

Comment thread .github/workflows/nightly-ci.yml Resolved
Comment thread tests/deploy/test_deploy_efa.py Resolved
@datadog-official

datadog-official Bot commented Aug 10, 2026 •

Copy link
Copy Markdown

Pipelines

⚠️ Warnings

🚦 13 Pipeline jobs failed

Pre Merge | pre-commit   View in Datadog   GitHub Actions

🔧 Fix in code. This looks caused by changes in this PR. Black formatter identified formatting issues in tests/deploy/test_dgd.py and made changes.

PR | Operator   View in Datadog   GitHub Actions

See error Push failed. The repository 'ai-dynamo/dynamo' has reached its maximum image limit of 100000.

PR | Power Agent   View in Datadog   GitHub Actions

See error Failed to push image: The repository 'ai-dynamo/dynamo' has reached the maximum allowed number of images (100000).

View all 13 failed jobs.

📋 Copy prompt for your agent
CI on my pull request is failing. Help me find and fix the root cause of each failing job below — they were flagged as caused by changes in this PR, so focus on the diff. For each job, explain the failure and propose a fix.

Branch: jihao/efa-deploy-test-nightly

Pre Merge | pre-commit
Commit: dd24e44d50bd894b815f2717b628ffa72344841e
Error (code / quality):
Black formatter identified formatting issues in tests/deploy/test_dgd.py and made changes.
CI job: https://github.com/ai-dynamo/dynamo/actions/runs/31870635888/job/94978609478

Useful? React with 👍 / 👎

This comment will be updated automatically if new data arrives.
🔗 Commit SHA: dd24e44 | Docs | Datadog PR Page | Give us feedback!

Two review findings:

- .ai/pytest-guidelines.md requires every marker in both pyproject.toml and
  tests/conftest.py:pytest_configure, so --strict-markers recognises it
  regardless of config-load order. framework_with_efa was only in pyproject.
- Carry over the one piece of the (now dropped) static packaging checks worth
  keeping: log where NIXL actually lives in the worker image, without asserting
  on it. vLLM and TRT-LLM expose the canonical /opt/nvidia/nvda_nixl tree via
  NIXL_PLUGIN_DIR; the CUDA SGLang image gets NIXL from the pip wheel and
  exports no NIXL_* variables at all. Pinning the layout breaks on the next
  repackaging with no EFA regression having occurred, but recording it keeps a
  failed run diagnosable.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv

jh-nv commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

Updated in a512ab4bb7 after review of the (now closed) #12868:

  • Dual-registered framework_with_efa in tests/conftest.py:pytest_configure as well as pyproject.toml. .ai/pytest-guidelines.md:235 requires both so --strict-markers resolves it regardless of config-load order.
  • Carried over the one useful piece of the dropped static checks: log_nixl_layout() records NIXL_PLUGIN_DIR / NIXL_LIB_DIR / LD_PRELOAD and the plugin listing from the decode worker — as logging, not assertions.

On that last point: #12868 tried to assert the NIXL layout, and it doesn't hold still. vLLM and TRT-LLM expose the canonical /opt/nvidia/nvda_nixl tree; the CUDA SGLang image gets NIXL from the pip wheel and exports no NIXL_* variables at all — and that changed between the 1.3.1 release and current main. Pinning it breaks on the next repackaging with no EFA regression having occurred. This test asserts the observable outcome instead (bytes moved, libfabric registration, no UCX fallback), which is invariant to layout, and just records where NIXL was for diagnosis.

This PR is now the EFA test. Merge order is #12915 → #12914.

@jh-nv

jh-nv commented Aug 11, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test a512ab4

The pre-commit marker report collects only the changed files, so importing
tests.deploy.test_deploy from tests/deploy/test_deploy_efa.py fails collection
with ModuleNotFoundError -- the sibling module is not resolvable in that
narrowed run.

Inline the four constants and replace validate_chat_response with a local
validate_completion. Beyond fixing the hook, this stops the EFA test's
pass/fail from being coupled to edits in the deploy-matrix test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv

jh-nv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5abe758

1 similar comment
@jh-nv

jh-nv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 5abe758

Three findings from review, all verified against the actions they call:

- setup-dynamo-operator hard-errors when registry is set without repository,
  so the job would have failed at cluster setup every night. Every other
  caller passes repository beside registry.
- The teardown ran against the wrong cluster. dynamo-deploy-test exports
  KUBECONFIG=<workspace>/.kubeconfig (the vCluster) into GITHUB_ENV, which
  persists for the rest of the job; teardown passes no kubeconfig, so it used
  that, found no dynamo-deploy-test namespace, reported nothing to delete and
  left the vCluster and its GPUs running on aws-dev-02 every night. Every
  pre-existing teardown is a separate job with a fresh environment. Pin
  KUBECONFIG back to the Teleport host config on the teardown step.
- shared-copy defaults copy_timeout_minutes to 10; the sibling multi-arch
  runtime copies all set 20. The -efa image is at least as large.

Also, in the test: resolve the manifest from __file__ instead of the private
_get_workspace_dir helper, and use lazy %s logging throughout.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv

jh-nv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 542f2bd

1 similar comment
@jh-nv

jh-nv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 542f2bd

A pod wedged in Terminating keeps its GPU and its VPC IP until the sandbox is
torn down, so a teardown that quietly leaves pods behind degrades the shared
cluster for everyone else on it: later runs hit "failed to assign an IP
address" or simply cannot get GPUs, and none of it points back here. Both have
been seen on these clusters this week, with pods stuck for 20+ minutes.

Assert the worker pods are gone after ManagedDeployment tears down, with a
180s budget so a normal termination passes and a wedge fails loudly.

Also document that the deployment name is fixed, so a manual run needs the
namespace clear of a previous one. CI is unaffected -- every nightly gets a
fresh vCluster.

Signed-off-by: Jie Hao <[email protected]>
@jh-nv

jh-nv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test 02cb14a

jh-nv added 2 commits August 12, 2026 01:02
#11946 moved tests/utils/managed_deployment.py to tests/deploy/dgd_utils.py,
so the import here stopped resolving once main was merged in. This is what the
pytest-marker-report hook was failing on: CI builds the PR merged with main, so
it saw the rename while a branch based on the older main did not.

Import DeploymentSpec/ManagedDeployment from their new home.

Signed-off-by: Jie Hao <[email protected]>
@jh-nv

jh-nv commented Aug 12, 2026

Copy link
Copy Markdown
Contributor Author

/ok to test bdb5ed4

…tes baseline

Two review findings, both valid.

assert_nixl_used_libfabric computed saw_ucx_fallback but only used it to enrich
the found_libfabric failure message, so logs containing both libfabric
registration lines and the UCX marker passed -- contradicting what the PR
claimed. It is now an unconditional assertion.

It was not asserted blind: the marker string is emitted by a dependency rather
than by this repo, so it was unclear whether it signals a real fallback or
merely that UCX defaults were initialised, and a gate that fires on healthy
deployments would be worse than the gap. Confirmed by observation first -- on a
known-good run against vllm-runtime:1.3.1-efa the marker is absent -- then
promoted.

assert_efa_rdma_traffic substituted a zero baseline when the pre-request scrape
failed (`rx_before or 0.0`), so any pre-existing counter satisfied
`rx_after > baseline` without the request having moved a byte. Not theoretical:
the counter is routinely ~1.8 MB before the request because model-availability
probing warms the path. Now three explicit cases -- both samples missing is a
capability skip, exactly one is a failure, both present is a hard delta gate.

Signed-off-by: Jie Hao <[email protected]>
jh-nv added 2 commits August 14, 2026 23:43
A successful scrape that lacks agent_rx_bytes was tolerated as a platform
without NIXL telemetry. It is not: the scrape succeeding proves the exporter is
up, so a missing principal counter means NIXL_TELEMETRY_ENABLE did not take
effect or the metric was renamed. Both are defects worth hearing about.

More to the point, without that counter there is no evidence the KV moved
through the NIXL agent, and with that unknown the test cannot claim the
transfer used EFA RDMA. Lacking the data to be sure, it should fail.

Every EFA assertion now fails rather than warning-and-returning: backend
selection, efa provider, NIXL agent bytes, and adapter bytes.

Verified on aws-dev-02, workers on different hosts: LIBFABRIC/no-UCX/efa on
both, agent_rx_bytes +16,515,072, rdma_read_bytes and rdma_read_resp_bytes
each +16,515,072.

Signed-off-by: Jie Hao <[email protected]>
@pytest.mark.vllm bought nothing -- the nightly job selects with
-m framework_with_efa -- but it cost two things. It forced an exemption in
tests/conftest.py's framework auto-skip, and it made the test collectable by the
multi-GPU jobs, whose selectors are "vllm and (gpu_2 or gpu_4)" with no
lifecycle filter; those run pytest in a container with no cluster, no
--namespace and no --image.

Dropping it reverts tests/conftest.py to main apart from registering the
framework_with_efa marker, and removes a latent trap: with the exemption in
place, the first future deploy test that legitimately imports vllm or kvbm in
the runner process would hard-fail with ImportError instead of skipping, and the
reason would be buried in that hook.

With the marker gone, gpu_2 is safe to add, so the test now declares its GPU
count (one prefill, one decode) and a component bucket. Verified that
-m "vllm and (gpu_2 or gpu_4)" deselects it.

Also drop the docstring's reference to tests/container/test_efa_image.py, which
exists on no branch that is an ancestor of this one, and state the nightly
rationale directly instead.

Verified on aws-dev-02: 1 passed, both workers LIBFABRIC/no-UCX/efa-provider,
adapter counters +16,515,072 each.

Signed-off-by: Jie Hao <[email protected]>
@copy-pr-bot

copy-pr-bot Bot commented Aug 15, 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.

Comment thread .github/workflows/nightly-ci.yml Fixed
Comment thread .github/workflows/nightly-ci.yml Fixed
jh-nv and others added 3 commits August 15, 2026 02:33
The EFA deploy test runs on aws-dev-02, an AWS cluster whose node instance role
already grants ECR read, so the copy-to-ACR hop the job inherited from its
sibling deploy tests buys nothing. Drop vllm-efa-copy-to-acr and reference the
ECR tag that vllm-efa-build already publishes.

Verified on aws-dev-02: a cold pull of an -efa nightly tag into
dynamo-deploy-test succeeds (18.2 GB in 47s) even though the namespace's only
imagePullSecret, acr-token-secret, covers dynamoci.azurecr.io alone. The deploy
test itself passes end to end against the ECR nightly image.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
Two review fixes.

The readiness wait inherited ManagedDeployment's 1800s default, 600s past this
test's own pytest timeout, so a deployment that never became ready was killed by
pytest-timeout with a bare traceback while _wait_for_condition's TimeoutError --
which appends pod statuses, conditions and warning events -- was still 600s away.
Add a readiness_timeout field, defaulted to the existing 1800s so no other deploy
test changes behaviour, and have the EFA test pass 900s so the informative
exception wins the race.

Drop assert_deployment_cleaned_up. It sat after the async with block, so it only
ran when the test had already passed -- the one path least likely to leak -- and
never on the failure paths where wedged pods actually come from. Deletion itself
is already guaranteed by the finally: in ManagedDeployment._cleanup; only the
verification was success-path-only, and re-checking a guarantee cost up to 180s
of nightly wall-clock while attributing cluster-hygiene problems to the EFA test.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
Follow the shape the rest of this workflow already uses --
deploy-operator -> deploy-test-* -> deploy-cleanup -- instead of one job with a
40-minute ceiling and a teardown step. Two properties of that shape were being
lost:

Setup carried the same ceiling as the test. setup-dynamo-operator's own waits
(vCluster 900s, CRD 1800s, operator readiness 1800s) can exceed 40 minutes on
their own, so the ceiling could expire before the test even started. The sibling
deploy-operator job deliberately declares no timeout-minutes for exactly this
reason; efa-deploy-operator now matches, and the tightened 30-minute ceiling
applies to the test alone.

Teardown was a step with if: always(), which does not survive job timeout,
cancellation or a dead runner -- the cases that actually leak. It is now a
separate job with job-level if: always() over needs:, matching deploy-cleanup.
This matters because setup-dynamo-operator skips the nscleanup/ttl label for the
shared dynamo-deploy-test namespace, so a leaked vCluster holds p5 GPUs and EFA
interfaces with no automated reaper. Running teardown from a fresh job also drops
the KUBECONFIG override the in-job version needed to avoid pointing at the
vCluster it was trying to delete.

Extract the repeated kubeconfig selection into a set-kube-context composite
action, so the three jobs cannot drift.

Validation: actionlint reports zero new findings against the merge-base (both
report the same 30, all pre-existing). The test itself passes live on aws-dev-02
against the nightly ECR -efa image -- LIBFABRIC on both workers, no UCX, adapter
counters +16,515,072 each side -- and the readiness wait now logs "/900s",
confirming the new budget is in effect. Teardown verified out of band.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv
jh-nv force-pushed the jihao/efa-deploy-test-nightly branch from ace8e27 to dd82cb9 Compare August 15, 2026 06:36
The EFA test carried its own TEST_PROMPT, request constants and response
validator, duplicating test_dgd.py. Reviewers were right that this is the
copy-paste hazard .ai/pytest-guidelines.md warns about, and it had already bitten:
the private validate_completion was a weakened copy of validate_chat_response --
it never checked role == "assistant" and reached through missing keys with
`.get(...) or {}`, so a response with no message or no content failed as
"content is 0 chars" rather than naming the missing field, and a wrong role
passed outright.

Move TEST_PROMPT, the request defaults and validate_chat_response into
dgd_utils.py -- a non-test module both test files already import, so the
pre-commit marker report is unaffected -- and delete validate_completion. The
moved function is test_dgd.py's original, byte-identical apart from
Dict[str, Any] -> dict[str, Any]; the EFA test adopts the existing stronger
contract rather than the deploy-matrix test adopting a new one, so no behaviour
changes on the path that already runs in PR and post-merge CI.

Not folded in: tests/frontend/test_vllm.py has its own _validate_chat_response
with a different signature, and test_dynamocheckpoint.py's TEST_PROMPT is
deliberately different ("Reply with one short sentence...", max_tokens=24) --
a genuine variation, not duplication.

Validation, both consumers live on aws-dev-02:
  test_dgd.py::test_deployment[vllm-agg]  1 passed in 140.99s
  test_deploy_efa.py::test_efa_deployment 1 passed in 176.73s
Both log "tests.deploy.dgd_utils: Response validation passed", confirming the
shared helper is what executes. A 12-case malformed-payload matrix passes,
including the two cases the deleted copy accepted (wrong role, missing role).
Ruff reports two fewer findings than before and none added.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv
jh-nv requested review from nv-tusharma and sttts August 15, 2026 06:56
Comment thread .github/workflows/nightly-ci.yml Resolved

@nv-tusharma nv-tusharma 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.

One blocking finding from the re-review.

Comment thread tests/deploy/test_deploy_efa.py Resolved
jh-nv and others added 2 commits August 19, 2026 23:35
The adapter-counter gate filtered exporter samples with `dev not in ln`, a
substring test, and keyed the result by metric name alone. Device names nest --
rdmap16s2 is a prefix of rdmap16s27, which is a prefix of rdmap16s270 -- so a
longer name's sample matched the shorter device's filter and, being keyed only by
metric name, silently overwrote it. That could attribute another NIC's traffic to
the worker and pass the one backend-independent assertion in this test on
evidence from the wrong adapter.

Move the parsing out of the string executed over kubectl exec: the in-pod snippet
now only fetches and coarse-filters to node_amazonefa_* lines, and attribution
happens in parse_efa_device_metrics, which compares the parsed `device` label for
equality. The part that has to be exact is now ordinary local code with tests.

Add regression coverage over a fixture with deliberately nested device names,
plus cases for unlabelled and unparseable samples. Against the old logic that
fixture returns rdmap16s270's counters for rdmap16s2 (300 instead of 100) and for
rdmap16s27 (300 instead of 200), so the tests fail closed on the previous
implementation.

Not currently reachable on aws-dev-02: scraped live, the node publishes 32 EFA
devices all named rdmap<bus>s0 with no substring relationships among them. The
defect is latent rather than active, but it sits under the assertion everything
else rests on.

Also reformat test_dgd.py: removing validate_chat_response in dd24e44 left two
blank lines that black strips, which is what turned the pre-commit job red.

Reported by nv-tusharma in review.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv
jh-nv requested a review from nv-tusharma August 21, 2026 22:10

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

Approving changes to tests/conftest.py for @ai-dynamo/dynamo-runtime-codeowners

@rmccorm4

Copy link
Copy Markdown
Contributor

/ok to test e70e862

@jh-nv
jh-nv removed the request for review from sttts August 25, 2026 02:20
CodeQL flags three alerts on efa-deploy-cleanup -- two high-severity
cache-poisoning/poisonable-step and one untrusted-checkout -- all rooted in the
checkout pinning needs.resolve-source-sha.outputs.source_sha and then running
local composite actions from that checkout.

The premise does not hold here: nightly-ci.yml has no pull_request trigger,
resolve-source-sha emits plain GITHUB_SHA, and 21 other jobs in this file pin the
same ref without being flagged. The lone structural difference is this job's
if: always(). So the alerts are false positives -- but they block the merge, and
the pin buys nothing.

teardown-dynamo-operator takes vcluster_name and vcluster_namespace as inputs
from efa-deploy-operator's outputs, so it does not depend on the commit checked
out here. Dropping the ref makes this job match deploy-cleanup, which has never
pinned one, and drops resolve-source-sha from its needs.

The narrow case the pin covered -- teardown-dynamo-operator changing on main
between a nightly starting and its cleanup running -- is theoretical, and the
sibling cleanup job has run without that protection indefinitely.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Signed-off-by: Jie Hao <[email protected]>
@jh-nv
jh-nv merged commit 4c3e61f into main Aug 25, 2026
120 checks passed
@jh-nv
jh-nv deleted the jihao/efa-deploy-test-nightly branch August 25, 2026 14:02
ntheanh201 pushed a commit to ntheanh201/dynamo that referenced this pull request Sep 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants