Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions docs/model-preparation.md
Original file line number Diff line number Diff line change
Expand Up @@ -236,13 +236,20 @@ overrides that setting. Omitting both retains automatic sizing, including
shared-memory limits on DGX Spark.

Forward compilation allocates workers across each host after checking cached
forwards. Ranks without a worker lend missing forwards to other
ranks on that host; every serving rank binds and captures its full catalog.
forwards, grouped by GPU product name so every active GPU SKU group on a host
is seeded with at least one compiler worker before surplus workers are
distributed. Admission raises `ValueError` if a host's effective CPU worker
limit (for example under a tight CPU affinity mask, cgroup limit, or
`compile_threads` cap) is smaller than its active SKU group count. Ranks
without a worker lend missing forwards only to peers on the same host with the
same GPU product name; every serving rank binds and captures its full catalog.
Concurrency uses a 32 GiB host-RAM estimate per worker, plus device storage on
integrated GPUs. When that estimate admits no worker, one worker per host may
start under the 2 GiB minimum host allowance plus integrated device storage.
These allowances estimate compiler demand; actual peaks depend on the forward.
Linux cgroup-v2 memory limits also constrain the available RAM used for admission.
integrated GPUs. When a host has a single active SKU group and that estimate
admits no worker, one worker may start under the 2 GiB minimum host allowance
plus integrated device storage; hosts with multiple active SKU groups require
the full per-worker estimate for each seeded worker. These allowances estimate
compiler demand; actual peaks depend on the forward. Linux cgroup-v2 memory
limits also constrain the available RAM used for admission.

On integrated GPUs, kernel tuning is divided into memory-bounded jobs. The
terminal dashboard shows the active job number and total job count, with a
Expand Down
53 changes: 32 additions & 21 deletions docs/preparation-development.md
Original file line number Diff line number Diff line change
Expand Up @@ -348,27 +348,38 @@ ranks without local remainders still join completion and failure relays.
independent kernel candidates retain corresponding-rank sharding across replicas.
Preparation-time search ends before graph handoff.

- **Compile tensor-parallel forwards once, sharded across ranks.** Pass the
preparation coordinator to `capture_forwards`. Each forward variant compiles
once, on a rank that selects it, from that rank's own forward; on one host, a
rank without variants left, or without room for a compiler, compiles another
rank's variant from that rank's traced forward metadata. Compiler pools are
budgeted for their host's ranks and close when their local and borrowed work
finishes, before ranks exchange completion results. Ranks on one host share its cache directory;
ranks on other hosts receive the artifacts they lack. Every rank loads the same
artifacts, binds its tensors and native handles, and participates in ordered
warmup and local capture. Inductor's first owner-process warmup may tune the
same generated kernel independently on several ranks. At each complete-forward
boundary, ranks adopt one measured selection and compiled kernel for each exact
generated source and candidate contract, with only the CUDA ordinal normalized.
The first canonical selection remains authoritative across the complete catalog.
A second warmup verifies the frozen selections before capture; cached artifacts
retain those selections on single-rank and tensor-parallel reloads. No selection
exchange occurs inside a forward or a native collective. Keep shard offsets and native handles in runtime
bindings when they do not change the computation. For distinct rank behavior,
select a variant key through `compilation_variant` on each rank. Every
selected variant must compile before collective warmup; ranks must not retrace
or compile on a binding mismatch.
- **Compile tensor-parallel forwards once per variant and GPU product name,
sharded across ranks.** Pass the preparation coordinator to `capture_forwards`.
All ranks in a tensor-parallel group must share the same CUDA compute
capability; cross-architecture rank groups are rejected before compilation.
Cache roots and `publication.lock` acquisitions are partitioned per
`(host, GPU product name)` pair in deterministic sorted order, keeping
un-suffixed artifact filenames inside each GPU product name's cache root.
Each `(compilation_variant, GPU product name)` key compiles once, on a rank
that selects it, from that rank's own forward; on one host, a rank without
variants left, or without room for a compiler, compiles a same-SKU peer's
variant from that peer's traced forward metadata. Compiler pools are budgeted
per host across active GPU product-name subgroups and close when their local
and borrowed work finishes, before ranks exchange completion results. Ranks
sharing a host and GPU product name share that cache directory; ranks on
other hosts receive only the artifacts they lack under their own cache root.
Every rank loads the artifacts for its `(compilation_variant, GPU product name)`
key, binds its tensors and native handles, and participates in ordered warmup
and local capture. During warmup, ranks verify identical Inductor kernel
inventories within each `(compilation_variant, GPU product name)` group.
Inductor's first owner-process warmup may tune the same generated kernel
independently on several ranks. At each complete-forward boundary, ranks
adopt one measured selection and compiled kernel for each exact generated
source and candidate contract, with only the CUDA ordinal normalized. The
first canonical selection remains authoritative across the complete catalog.
A second warmup verifies the frozen selections before capture; cached
artifacts retain those selections on single-rank and tensor-parallel reloads.
No selection exchange occurs inside a forward or a native collective. Keep
shard offsets and native handles in runtime bindings when they do not change
the computation. For distinct rank behavior, select a variant key through
`compilation_variant` on each rank. Every selected variant must compile
before collective warmup; ranks must not retrace or compile on a binding
mismatch.
Load, warm, freeze, and save one forward at a time in descending order of
largest compiler-planned CUDA allocation (breaking ties by total planned bytes,
then catalog order, using the maximum request sizes across ranks). Release
Expand Down
Loading