Skip to content

fix(deploy): resolve inference coordinator host to bindable address - #743

Open
pruprakash wants to merge 3 commits into
mainfrom
pruprakash/fix-inframework-coordinator-host-default
Open

fix(deploy): resolve inference coordinator host to bindable address#743
pruprakash wants to merge 3 commits into
mainfrom
pruprakash/fix-inframework-coordinator-host-default

Conversation

@pruprakash

Copy link
Copy Markdown

Summary

Fixes NVBug 6457372: in-framework PyTriton deploys fail on single-node Docker because
create_mcore_engine() passes os.environ.get("MASTER_ADDR") (None when unset) as
coordinator_host, so MCore falls back to socket.gethostname() — a name, not an address —
which inside Docker is the container ID and cannot be bound:
zmq.error.ZMQError: No such device (addr='tcp://f3879bac406e:*'). Present since 26.08.rc1
and still reproducing on 26.08.rc9. The Ray path is unaffected because
megatronllm_deployable_ray.py:72 exports the node IP as MASTER_ADDR itself; the PyTriton
deployable exports nothing, so PR #719 added the parameter but no usable default.

Changes

  • nemo_deploy/llm/inference/inference_base.py: add _default_coordinator_host(), resolving
    the hostname to its IP and falling back to loopback only if resolution fails; use it when
    MASTER_ADDR is unset.
  • tests/unit_tests/deploy/test_inference_base.py: three tests asserting the resolved address
    is used and the bare hostname never passed through, that an explicit MASTER_ADDR still wins,
    and that unresolvable hostnames fall back to loopback rather than None.

Verification

  • Red-green: bug-sensitive unit test FAILS with the fix reverted, PASSES with it applied —
    verified in nvcr.io/nvidian/nemo:26.08.rc9. ruff check and ruff format --check clean.
  • Bind behaviour measured in nvcr.io/nvidian/nemo:26.08.rc9: socket.gethostname()
    f411026bc80c (ZMQ bind FAILS); socket.gethostbyname(gethostname())172.17.0.2
    (bind OK, routable); 127.0.0.1 (bind OK, not routable).
  • e2e: test_inframework_mlm_triton and test_inframework_mlm_llm_triton both FAIL on unfixed
    source and both PASS against this branch on nvcr.io/nvidian/nemo:26.08.rc9, with
    MASTER_ADDR unset and zero ZMQ errors (run 20260812T180350Z-77c29fc6).
  • Control: setting MASTER_ADDR=127.0.0.1 against unfixed source also turns both green,
    confirming the mechanism independently of the code change.

Reference

create_mcore_engine passed os.environ.get("MASTER_ADDR") straight through to
MegatronLLM. When the variable is unset that is None, which is indistinguishable
from passing nothing, so MCore falls back to socket.gethostname(). Inside Docker
that resolves to the container ID, which is not a bindable interface, and the
data-parallel inference coordinator dies with:

    zmq.error.ZMQError: No such device (addr='tcp://<container-id>:*')

The Ray path never hit this because megatronllm_deployable_ray sets MASTER_ADDR
to the node IP itself; the PyTriton path sets nothing, so every in-framework
Triton deploy failed on single-node Docker.

Fall back to 127.0.0.1 only when MASTER_ADDR is absent, so multi-node launches
that already export a routable address are unaffected.

Signed-off-by: Pruthviraj Prakash <pruprakash@nvidia.com>
Defaulting to 127.0.0.1 fixed the reported Docker failure but is bindable only
locally, so a multi-node launch that did not export MASTER_ADDR would bind a
coordinator nobody else can reach - trading a loud ZMQError for a silent hang.

Resolve the hostname to its IP instead. That is what the Ray path effectively
gets by exporting the node IP as MASTER_ADDR, and it is both bindable and
reachable from other containers. Loopback remains only as a last resort if
resolution itself fails.

Measured in nvcr.io/nvidian/nemo:26.08.rc9:

    socket.gethostname()                 -> f411026bc80c   ZMQ bind FAILS
    socket.gethostbyname(gethostname())  -> 172.17.0.2     ZMQ bind OK
    127.0.0.1                                              ZMQ bind OK, not routable

Signed-off-by: Pruthviraj Prakash <pruprakash@nvidia.com>
@pruprakash pruprakash added the bug Something isn't working label Aug 12, 2026
@pruprakash pruprakash added LLM tests qa_rcca_done r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. labels Aug 12, 2026
@copy-pr-bot

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

The fabricated container ID was 12 hex characters, which detect-secrets flags as
a Hex High Entropy String and fails the secrets-detector job. The test only needs
a value that is not an address, so name it that rather than allowlisting a
non-secret or regenerating the shared baseline.

Signed-off-by: Pruthviraj Prakash <pruprakash@nvidia.com>
@pruprakash

Copy link
Copy Markdown
Author

/ok to test 49943f0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working deploy LLM qa_rcca_done r0.7.0 Auto-cherrypick to release branch. Apply before merge; cherrypick happens after merge. tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant