Architecture Decision Records
ADR 0076: Rank-scoped weights: the rank variable in a subfolder, resolved at create into one model artifact per rank
On this page
Date: 2026-11-19 · Status: Accepted
Context
Some multi-node recipes pre-split their weights into one part per rank. The TP4 DeepSeek-V4.1-Flash recipe on four GB10 nodes, for example, gives each rank its own rank<r>.dsw and Engram tables (about 128 GB); the four parts live in one repository under rank0/ … rank3/, 510 GB in all. Until now a deployment had one model artifact, so every node of the group downloaded and mounted all of it: three times the disk and bandwidth, and disk admission counted the whole repository.
Template weight sources already support subfolder, and the model artifact identity (source, source_id, revision, artifact_subfolder), the agent's download and model marker, and peer copies all tell subfolders apart. What was missing is "different ranks read different subfolders".
Decision
- Shape: the rank variable in the
subfolderof the spec's own weight sources, such assubfolder: rank${GPUWORKS_NODE_RANK}. The spelling rule is the one of the template's launch fields (placement.Canonical): the documentation writes the prefixed form and the unprefixed${NODE_RANK}is an alias; a subfolder has no rule of its own. A subfolder may name only this variable; either every source of the spec names it or none does (a mirror that did not would give every rank the whole repository).weight_bytesandruntime_weight_bytesstate one rank's size. - Expanded at create into one model artifact per rank: for a deployment over
nnodes, rank 0's subfolder is resolved by the existing rules (source choice, revision, reuse of a registered artifact), and the result is the deployment'smodel_id; ranks 1…n-1 resolve with rank 0's provider, repository and revision plus their own subfolder, so a group never mixes mirrors or commits. The whole repository does not stand in for a rank's subfolder. - The binding is kept in the deployment snapshot:
deploy.CatalogSelection.rank_weightsis[{rank, subfolder, store_model_id}], andweight_subfolderkeeps the template's text (an exported template writes it back as it was). Like a component'sstore_model_id, the binding is fixed at create and never resolved from the mutable catalog again. - Read per rank:
planning.RankModelIDs(dep, r)is what rankrreads (its own artifact, plus the components and mounts every rank shares). On each rank's node the controller makes only these ready (download tasks, copies and cache fills are all for that artifact), and the instance records that read and mounts its path.planning.DeploymentModelIDsstays the union of every rank's, for download ownership, cancellation and eviction guards; preparation progress lists for a node only its rank's models. - Admission and estimate:
planning.Input.WeightModelis the rank's artifact (the deployment's model under the rank's identity), which disk admission and its insufficient-disk explanation count. The memory estimate multiplies one rank's weights by the number of ranks as the group's weights and splits that over TP×PP as usual. At create, model admission, the save-to storage and shared-storage downloads also pair each rank's artifact with its own node only. - Unsupported combinations: combined with
componentsorpd_modeit is refused at import; deployed as PD it is refused (RANK_WEIGHTS_PD_UNSUPPORTED); amodel_idthe request names must be rank 0's artifact (RANK_WEIGHTS_MODEL_NOT_RANK_ZERO). A single-node deployment reads rank 0 only.
Trade-offs
components[].rankrejected: one component per rank ties the template to a node count and leaves four near-identical entries to keep in step; components are mounted on every rank and the primary component overlaps the deployment's model, so a rank dimension would rewrite all of their semantics. The subfolder variable reuses the existing sources, artifact identity and download path with one expansion added.- Rank 0's artifact is the deployment's model: its name, served name, inference configuration and the config the estimate reads all keep coming from one model row; the platform creates the other ranks' rows only as artifact identities. The cost is that one deployment shows as
nmodel rows of the same repository with different subfolders. - The mount keeps the repository-relative paths: consistent with existing subfolder semantics, the weights are under
${GPUWORKS_MODEL_PATH}/rank<r>/…in the container, and the recipe refers to${GPUWORKS_MODEL_PATH}/rank${GPUWORKS_NODE_RANK}/…; no new "mount the subfolder" rule. - One more snapshot key: the rank binding cannot be derived reliably on every reconcile (a model row may be deleted and recreated, a revision may resolve elsewhere), so like the component binding it is recorded as a fact of the create. It belongs to the snapshot's one named type, read and written whole; an old snapshot without the key means "not rank-scoped".
- Not done: automatic placement preferring to put rank
ron a node that already holdsrank<r>/(today rank order is node order, and a node holding another rank's subfolder downloads its own part).
Consequences
- The subfolder rules
deploy.RankWeight,deploy.ExpandRankSubfolderand friends; import validation ininferencecatalog; per-rank resolution and admission indeployment;planning.RankModelIDsandplanning.NodeModelIDs; the controller's per-rankensureDeploymentModelsPresent. - The agent and the protocol are unchanged: each rank's artifact is an ordinary model with a subfolder.
- New failure codes
RANK_WEIGHTS_MODEL_NOT_RANK_ZEROandRANK_WEIGHTS_PD_UNSUPPORTED; no new table or column.
2026-11-20 addendum: for a rank-scoped source the revision is part of the artifact's identity, not a preference. The ranks are one pre-split set of files of one commit, so a registered artifact of a known revision different from the one the template states now does not match (re-importing the template at a new revision makes a deployment create and download new artifacts for every rank; an empty revision still means unknown, not different). A whole-repository source keeps treating the revision as a preference under ADR 0018. By the same rule the deploy form's "use a registered model" lists only rank 0's artifact at that revision: the other ranks' artifacts are created by the platform, and picking one is refused with RANK_WEIGHTS_MODEL_NOT_RANK_ZERO; naming an artifact of another revision returns TEMPLATE_MODEL_MISMATCH. No new table, column or failure code.
Was this page helpful?