feat(st): COLI_MODEL_DIRS ΓÇö split model shards across N drives, no duplication (capacity aggregation; composable with #421 mirror)#469
Merged
JustVugg merged 1 commit intoJul 20, 2026
Conversation
…plication Each extra directory holds a DISTINCT subset of the .safetensors shards (search path, dedup by basename; first-listed dir wins). Demand preads hit whichever drive holds the shard, so concurrent expert loads parallelise across drives and combined capacity is used - a 400 GB container fits across two smaller drives that individually cannot hold it, which COLI_MODEL_MIRROR (a full second copy) cannot do. Composable with the mirror: st_mirror_init matches per-shard by basename against the merged index. st_init stays as a back-compat wrapper over st_init_multi. Verified on RTX 5080 / Windows: 72+70 shards across two NVMes, coherent output, [SPLIT] startup log, decode parity with single-drive at full RAM (0.92 vs 0.89-0.90).
BColsey
added a commit
to BColsey/colibri
that referenced
this pull request
Jul 21, 2026
Retarget PR JustVugg#377 onto current dev (origin/dev @ 4aca059) after JustVugg#391 split glm.c into colibri.c + quant.h/sample.h/kv_persist.h/telemetry.h. Reconciles four collisions: - JustVugg#391 split: all glm.c hunks resited -- prof_*/g_prof_io/ProfBase live in colibri.c (NOT telemetry.h); tiers_emit/emap_emit -> telemetry.h (with a rammap_slot forward-decl); st_fd_is_tmpfs/st_fd_fs_magic -> st.h; .coli_kv state-dir -> serve_ctx_init/run_serve/run_serve_mux + main. - DISK-CLASS (1f00142): prof_physical_read_bytes/ProfPhysicalWire merged ON TOP of dev's dc_* fields; PROF protocol line extended 9->17 fields additively; expert_load_impl 6-arg `demand` signature preserved; g_prof_io routed through prof_ssd_tensor_bytes (tmpfs-excluded). - DUAL-SSD mirror (JustVugg#298/JustVugg#469): ESlot.backing hand-merged with dev's aslab/afslab; map_of_fd exact-length + MADV_HUGEPAGE composes with rep_bfd. - int3 fmt=5 (JustVugg#168): rammap_bind_one reuses dev's qt_resolve_fmt/detect_group_size (inline fmt-detection dropped; duplicate detect_group_size not re-added). Verified: make colibri 0 warnings; make check 187 tests pass (test_uring skips in sandboxes via the PR's helpers; test_rammap builds against colibri.c and passes). Default path byte-identical -- oracle-safe by construction. Co-Authored-By: Claude <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Per the green light in #467 (finding 4):
COLI_MODEL_DIRS=<dir>[;<dir>...]— split the model's.safetensorsshards across N drives with no duplication. Complementary to #421's mirror, not a competitor.Why
The mirror gives 2× read bandwidth at 2× disk cost. The split gives capacity aggregation, which the mirror fundamentally can't: a 400 GB container fits across two smaller drives that individually can't hold it (or three, or N —
ST_MAX_SHARDSis the only bound). Demand preads hit whichever drive holds the shard, so concurrent expert loads still parallelise across spindles when routing spreads.Design
COLI_MODELfirst). No layout convention imposed — any partition of the shards works; users move files between drives freely.st_open_fd/pread/O_DIRECT twins/PIPEworkers all work per-fd already. The whole feature is in indexing.COLI_MODEL_MIRROR(the init-order ask from [Performance]: RTX 5080 / 128 GB resource matrix (drive x compute x RAM) ΓÇö RAM dominates; COLI_CUDA=0 Windows quirk; PR-ready N-drive shard split #467):st_mirror_initruns after indexing and matches per-shard by basename against the merged index, so a mirror dir may hold a copy of any subset of the split's shards — partial mirrors of a split are valid, divergent files are rejected per-file exactly as on a single-dir model. They cannot fight at init: split resolves which file is primary, mirror only ever adds a replica fd to an already-indexed shard.config.json, tokenizer,.coli_usage,.coli_kv) stays in the primaryCOLI_MODELdir only — extra dirs are weights-only, never written.st_init(S, dir)remains as a one-line back-compat wrapper over the newst_init_multi(S, dir, extra); every existing call site and test is untouched.[SPLIT] +C:\glm_split_b -> 70 shard(s)/[SPLIT] model across 2 dir(s): 142 shard(s) total (primary ... -> 72 shard(s)), no duplication.Verification (RTX 5080 / Windows 11, g64 container, 142 shards, 399.8 GB)
CUDA_DENSE=1full residency.Scope
+61/−10 over
c/st.h(scan/dedup/init-multi), one call site inc/colibri.c(env read atmodel_init),docs/ENVIRONMENT.mdrow. No kernel, no read-path, no format changes. Happy to add atest_st_split.csibling oftest_st_mirror.c(dedup priority, partial-dir, missing-dir error) if you want one in-tree — say the word and I'll push it to this branch.