Repository navigation
gpu: a placed load reads the parts its host bytes planned instead of planning them again - #1030
Conversation
…planning them again
There was a problem hiding this comment.
Verdict: CLEAN: No must-fix defect was found in the changed allocation, shard-read or load-plan paths.
Non-blocking
⚠ Record FAIL-first runs: crates/gpu/src/weights.rs:1934. The PR lists passing runs only. Add failing mutant runs for the whole-buffer checks, room-sensitive cache reuse and extent ordering. This confirms the regression assertions before merging.
Checked
Duplicates: 8 new items checked, none duplicated; dryer reported no candidate pairs.
Complexity: crapper flagged no functions.
Silent failure: 5 sites followed. Whole/split size mismatches and truncated extents return named errors; unsupported direct IO uses mapped bytes; the empty-lane default is unreachable.
Tests: static mutation checks show that removing weights.rs:1792 or weakening upload.rs:192 breaks short-upload assertions; reusing a cached window across rooms breaks the cache assertion; removing part.rs:727 breaks extent-order assertions.
Gates: no numerical bands moved; the unsafe-count increase has a dated PIN and allocation-specific reason. The hardware test is ignored and hw-prefixed.
Adversarial checks: disjoint pread windows, empty extent sets, short buffers, changed room and changed card selections have guards or defined handling. Changes run at load time.
Escape catalog: C1–C4 do not match.
Notes
Static review only; builds and gates were not run here.
GPU evidence is incomplete: the GB10 card/driver line accompanies timings, while the RTX 5090 gate output lacks that card's nvidia-smi line and a matching base/head pair. Add those beside the gate output.
Card check: needs-gpu. This pull request changes crates/gpu/src/folder.rs, crates/gpu/src/model.rs, crates/gpu/src/parts.rs … and carries no gate run on a card (CONTRIBUTING's evidence list); a maintainer adds gpu-verified after one.
🔨 Shingler, bloomery's review bot: approves a clean pull request and requests changes on a must-fix (how it works)
|
The review is done and the contribution check passed, so I'm merging this. |
Qwen3.8 FP4-Local와 NVFP4 체크포인트를 카드에 올리는 시간을 DGX Spark에서 줄이는 PR입니다.
What and why
Loading a Qwen3.8 FP4-Local or NVFP4 folder onto a card spends most of its load time in the weight upload (
upload_s). This PR shortens that step with three changes that touch only how the bytes get to the card:crates/gpu/src/tensor.rs,weights.rs,upload.rs: a weight upload that writes its whole buffer no longer zero-fills the buffer first.DeviceTensor::unfilledallocates without a memset, andupload_wholerejects a take that is not the buffer's full size before it allocates.UploadRing::copy_splitnow rejects a row that does not fill both planes exactly. K-quant tails that rely on zero padding still useDeviceTensor::zeroed.crates/model-hf/src/part.rs:Wholes::readsplits a shard's extents overREAD_LANES = 8threads, so one shard's direct reads stay in flight together. A part still holds one shard open at a time, and the first error in extent order is the one returned.crates/gpu/src/parts.rs:PlacedSource::readingplans a card's parts and costs once per card and card-tensor set, and a different room recomputes only the read-ahead (LoadPlan::at). Before, the host-bytes memo was keyed by room and missed at the load's room, so the load planned every part again.load_placed_in_placeis folded intoPlacedSource::load, its only caller, and two doc references are updated.The placement rules, model formats, normalization, resident layout, zero padding and precision are unchanged.
Release notes: Changed: weight uploads skip the zero fill, a part's direct reads run in parallel and a placed load plans its parts once, so FP4-Local and NVFP4 folders load faster.
Code shape
upload_wholeandcopy_split; the F32 and BF16 arms andplanes::fill_wholeno longer repeat it.fill_whole, its test andload_placed_in_placeare removed.tools/unsafe-ratchet.txtrises for the new allocation, with a PIN line.cargo fmtandcargo clippyare clean on what I touched; the lint count did not go up.Duplication found or removed (
path:line), or "none": none. The duplicate scan reported no candidates.What I ran
Timing is on one DGX Spark. The base is
f924cd8c4a8e90dabf86cf7534afa4ee4152fcfband the head is69642d1480692433d8280a3717076a154c552ddd, both built withcargo oxide build --arch sm_121a -p bloomery-gpu-gates --release --bin bloomery-serve. The models arenvidia/Qwen3.8-Flash-Next-FP4-Localatb9ce18a6887e18c089fdea8509a33e63429a3300andnvidia/Qwen3.8-Flash-Next-NVFP4atfc694b54fb0174e0913e6adf86691ef85a4ead47.To reproduce, serve each side three times per model, alternating base and head, and read the
load phasesline the server prints at start:Each cell is the median of three starts with its range in parentheses.
upload_supload_sother_sother_sDecode, prefill and p95 TTFT are unchanged: FP4-Local decode 31.18 to 31.31 tok/s and NVFP4 decode 22.73 to 22.71 tok/s, with every range overlapping. The greedy replies of base and head are identical (
greedy_equal: True).GPU tests and gates on an RTX 5090 machine, driver 595.99.02, at head
9c23050339726b34a7425dd8bd0a6f1f14776cf1:AI help
AI 코딩 에이전트가 코드를 작성한 후 설명을 썼고, 테스트를 마쳤습니다. diff 리뷰와 PR 초안 리뷰는 제가 직접 했습니다.