flashinfer.comm.resolve_ulysses_backend¶
- flashinfer.comm.resolve_ulysses_backend(backend: str = 'auto', group: ProcessGroup | None = None, device: device | str | int | None = None) UlyssesBackendDecision¶
Group-consistent backend selection. Must run before any IPC allocation or JIT compilation. It allocates no IPC workspace and compiles nothing; the
all_gather_objectmetadata collectives may themselves stage through CUDA buffers on NCCL process groups.Collective-safe outcome protocol: every rank participates in the same fixed prefix of
all_gather_objectcalls (at most three; a group-wide explicit NCCL request or an invalid/inconsistent request exits jointly after the first) no matter what fails locally — rank-local errors are encoded as serializable outcomes and re-raised (or turned into an NCCL fallback) jointly after the gather, so no rank can leave the collective sequence early and deadlock its peers. The only uncoordinated failure mode left is the process group itself failing.Sequence:
gather every rank’s requested backend; jointly reject invalid or inconsistent requests. A group-wide explicit
"nccl"request returns here, skipping the CUDA/NVML topology probe entirely (the gather itself may stage through CUDA on NCCL groups).gather every rank’s probe outcome (the probe never raises; even a buggy probe implementation is caught into the outcome).
every rank evaluates the same pure decision on the same gathered list, catches the result into an outcome, gathers, and cross-checks. Any disagreement conservatively selects NCCL — or raises for
backend="nvlink".