Skip to content

weight cache: key daemon paths by GPU UUID - #36101

Open
TarangKhanna wants to merge 1 commit into
sgl-project:mainfrom
TarangKhanna:weight-cache-registry-tarang
Open

weight cache: key daemon paths by GPU UUID#36101
TarangKhanna wants to merge 1 commit into
sgl-project:mainfrom
TarangKhanna:weight-cache-registry-tarang

Conversation

@TarangKhanna

@TarangKhanna TarangKhanna commented Aug 23, 2026

Copy link
Copy Markdown

Motivation

Weight cache daemon discovery currently uses distributed rank in the Unix socket and ready file paths. Rank identifies a process within one distributed job, not a physical GPU across independent jobs.

As a result, two jobs on the same host can use the same daemon path even when their ranks run on different GPUs. For example, two TP jobs can both contain rank 0, allowing one job to discover the other job's daemon.

Change

Key daemon socket and ready file paths by physical GPU UUID instead of distributed rank.

Discovery and weight compatibility remain separate:

  • Physical GPU UUID identifies the daemon associated with the GPU used by an engine rank.
  • CacheConfig continues to validate that the daemon holds compatible weights before CUDA IPC import.

This preserves the existing failure semantics. If no daemon exists for the GPU, the existing fallback behavior still applies. If a daemon exists but its cached weights are incompatible, the client still reaches the existing explicit CacheConfig mismatch instead of treating the cache as absent.

The launcher already computes the local GPU id for each daemon, so it can derive the corresponding GPU UUID while preserving the existing stale file cleanup, readiness polling, timeout, and process liveness flow.

Scope

The change is intentionally limited to node local daemon discovery identity.

Config matched registry discovery, configurable runtime directories, namespaces, cross node discovery, peer copy, admission control, and cache eviction remain separate roadmap work in #33522.

Validation

  • test/registered/unit/model_loader/test_weight_cache_protocol.py: 31 passed.
  • Unit tests verify that different physical GPU UUIDs produce different socket and ready paths, independent of logical rank.
  • Unit tests verify that automatic discovery uses the caller's physical GPU UUID rather than logical rank or an implicit GPU 0.
  • Existing CacheConfig compatibility checks remain unchanged and continue to detect incompatible cached weights.
  • TP1 CUDA E2E on A40 and TP2 CUDA E2E on 2x H100 SXM GPUs: daemon startup, automatic client discovery, weight import over CUDA IPC, and generation all passed.

CI States

Latest PR Test (Base): ❌ Run #32852938143
Latest PR Test (Extra): ❌ Run #32852937767
Latest PR Test (AMD ROCm 7.2): ❌ Run #32852937999

@TarangKhanna
TarangKhanna marked this pull request as draft August 23, 2026 17:33
@TarangKhanna
TarangKhanna force-pushed the weight-cache-registry-tarang branch 3 times, most recently from a13d5d8 to 4ed8515 Compare August 24, 2026 17:18
@TarangKhanna
TarangKhanna marked this pull request as ready for review August 24, 2026 17:19
@TarangKhanna
TarangKhanna marked this pull request as draft August 24, 2026 17:21
@liusy58

liusy58 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

@TarangKhanna Is this PR ready for review yet? Can we limit the scope of the codebase it modifies?

@TarangKhanna
TarangKhanna force-pushed the weight-cache-registry-tarang branch 3 times, most recently from 82793ec to 64ce87b Compare August 25, 2026 07:44
@TarangKhanna

Copy link
Copy Markdown
Author

@TarangKhanna Is this PR ready for review yet? Can we limit the scope of the codebase it modifies?

@liusy58 Not quite yet. I’m doing one final pass to reduce the diff. The change is broader than just changing the socket key because moving from rank based identity to GPU UUID plus config also means the old rank based ready file can no longer provide the ownership/readiness coordination we need. The new path uses an identity scoped lock for ownership and the socket itself for readiness. I’m trimming the remaining lifecycle and wiring changes to only what’s required to preserve those, then I’ll mark it ready once the diff is tighter.

@liusy58

liusy58 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

@liusy58 Not quite yet. I’m doing one final pass to reduce the diff. The change is broader than just changing the socket key because moving from rank based identity to GPU UUID plus config also means the old rank based ready file can no longer provide the ownership/readiness coordination we need. The new path uses an identity scoped lock for ownership and the socket itself for readiness. I’m trimming the remaining lifecycle and wiring changes to only what’s required to preserve those, then I’ll mark it ready once the diff is tighter.

Thanks for your contribution. We’d like to keep the scope of the changes as tight as possible.

@TarangKhanna

Copy link
Copy Markdown
Author

@liusy58 Not quite yet. I’m doing one final pass to reduce the diff. The change is broader than just changing the socket key because moving from rank based identity to GPU UUID plus config also means the old rank based ready file can no longer provide the ownership/readiness coordination we need. The new path uses an identity scoped lock for ownership and the socket itself for readiness. I’m trimming the remaining lifecycle and wiring changes to only what’s required to preserve those, then I’ll mark it ready once the diff is tighter.

Thanks for your contribution. We’d like to keep the scope of the changes as tight as possible.

I agree. I’ll trim this back to the discovery change and keep the existing startup behavior where possible. The remaining changes will focus on identifying daemons by physical GPU UUID plus cache config, with only the minimal loader wiring needed for that.

@TarangKhanna
TarangKhanna force-pushed the weight-cache-registry-tarang branch 4 times, most recently from 4e83ea9 to b58f5fc Compare August 25, 2026 12:39
@TarangKhanna TarangKhanna changed the title weight cache: discover daemons by GPU UUID and config weight cache: key daemon paths by GPU UUID Aug 25, 2026
@TarangKhanna
TarangKhanna force-pushed the weight-cache-registry-tarang branch 3 times, most recently from 500f053 to 4482bba Compare August 25, 2026 13:00
Weight cache discovery used rank in the socket/ready-file paths.
Rank isn't unique across independent jobs sharing a host, so a
client could discover and attach to another job's daemon.

Daemon identity is now the physical GPU UUID; CacheConfig still
validates weight compatibility unchanged, so a mismatched config
produces the existing loud error instead of looking like an
absent daemon.
@TarangKhanna
TarangKhanna force-pushed the weight-cache-registry-tarang branch from 4482bba to e4bdb9c Compare August 25, 2026 13:22
@TarangKhanna
TarangKhanna marked this pull request as ready for review August 25, 2026 13:56
@TarangKhanna

Copy link
Copy Markdown
Author

@liusy58 Ready for review now. I trimmed the change further to use physical GPU UUID only for daemon socket and ready path identity, while leaving the existing CacheConfig compatibility check and startup lifecycle unchanged. I also validated the final revision with the unit suite plus TP1 and TP2 CUDA IPC end to end tests. Thanks for the scope guidance.

@liusy58

liusy58 commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

@TarangKhanna Will review soon.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants