﻿# Torchrun rendezvous identity: endpoint reuse must not merge independent jobs

Review torchrun rendezvous endpoint, backend and unique run identity together when independent distributed jobs launch from a shared template.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/pytorch-rendezvous-run-id-collision/
Language: en

Two distributed jobs launch from the same template and unexpectedly wait for the wrong participant population. Their model configurations differ, but their coordination settings were copied together. The rendezvous endpoint locates coordination; the run identity says which worker group a participant intends to join.

## Record the whole rendezvous tuple

Preserve backend, endpoint, run identifier and expected node range from every launch participant. The [torchrun reference](https://docs.pytorch.org/docs/2.15/elastic/run.html) requires a unique job identifier shared by nodes in the same job. A hostname alone does not define membership identity. The [coordination endpoint guide](/journal/guide-dc-etcd-advertised-url-boundary/) explains an adjacent routing distinction: an accessible address proves a path to a service, not that the service state belongs to the intended computation.

## Separate agreement from isolation

Nodes belonging to one run must agree on their coordination settings. Independent runs must not accidentally reuse the same effective identity and conflicting endpoint arrangement. The torchrun guide specifically warns about port conflicts or merged jobs when stacking independent single-node launches and describes separate-port handling for that case. Preserve the selected backend's actual semantics rather than claiming every backend isolates jobs solely through a port or solely through the textual run identifier.

## Inspect the admitted membership

The [rendezvous guide](https://docs.pytorch.org/docs/2.15/elastic/rendezvous.html) describes agreed membership and exclusivity for a job's completed rendezvous. It does not validate that a participant loaded the intended dataset, model or experiment configuration. Record those application identities when workers start and compare them with the launch manifest. A group reaching its minimum size can still be the wrong group if the launch configuration admitted unintended participants. Treat a successful barrier as evidence of coordination, not experiment equivalence.

## Define restart versus independent launch

Document which retries belong to the same logical run and which create a separate experiment. Reusing identity accidentally for a new experiment differs from preserving it for the intended recovery path. Keep checkpoint selection consistent with that decision. The [checkpoint identity guide](/journal/bytecheckpoint-load-time-resharding-state-scope-evidence/) explains why changed worker layout and restored state need explicit scope. Do not use a shared latest-checkpoint directory as an implicit solution to ambiguous rendezvous ownership between independent jobs.

## Exercise simultaneous templates

In a disposable environment, launch independent small jobs from the same template with deliberately distinct accepted identities. Verify each group's admitted hosts, application configuration and outputs. Include an intentional conflicting configuration only within that controlled fixture to inspect the actual failure mode. Acceptance should demonstrate separation and consistent within-run agreement. It does not claim a completed launch test or prescribe a public endpoint, and it should preserve errors rather than quietly retrying until some group happens to start.

## Retain the security boundary

A unique run identifier is a namespace choice, not proof of participant authentication or network authorization. Review backend access and permitted routes separately under the deployment's security design. The useful result is an auditable mapping from logical run to coordination tuple and admitted members. It does not establish trusted model artifacts, correct dataset selection or protection against an unauthorized party merely because the rendezvous name was unlikely to collide with another well-behaved job.
