mirror of
https://github.com/Niko1221/Strata.git
synced 2026-12-04 15:28:40 +00:00
Prefill::bytes_needed answers for the current device (prefill.cpp fused_ring decides the fused layout per card), and part_slots / ring_room priced every participant of a layer split with whatever device was current, CUDA0's. On an RTX 5080 + RTX 4090 split the 4090's loan was 2882 MiB for buffers that take 3014 MiB there, and its prompt path stepped down to small chunks. New helper split_ring.hpp split_part_figure(on_device, dev, fn) evaluates fn() with the participant's device current (OnDevice, put back after); generate.cpp part_slots and ring_room's bytes_needed_no_ring go through it. CUDA0's own part (dev -1) is priced as before. On like cards every device gives the same figure, so the numbers are unchanged. Test: tests/program/split_part_price_test.cpp (cpu-check, faked devices). With the old pricing: CUDA1 lent 2880 MiB for 3014 MiB of buffers, reads 6144-token chunks (fail); now lent 3016 MiB, reads 8192; 2 and 4 like cards give identical slot counts over the 256..32768 chunk grid. No mixed-card machine was available: no real mixed-card run backs this.