Expand description
Fast safetensors loader (InstantTensor-style) — pure Rust.
Two wins over the mmap-based loader in crate::weights:
O_DIRECTreads. Bypasses the OS page cache, so the bytes never compete with GPU allocations on GB10 unified memory. The mmap path already works around this withPOSIX_FADV_DONTNEEDpost-load; here we avoid the pollution in the first place.- Pipelined read/copy. One background reader thread fetches the
next tensor while the main thread does
copy_h2dfor the current one. Overlaps disk I/O with the host→device memcpy.
Behavioural parity with crate::weights::SafetensorsLoader is
preserved — same EP filtering, same OOM pre-flight, same UVM fallback
on GPU allocation failure, same extra-weights handling.
Structs§
- Fast
Safetensors Loader - Pure-Rust InstantTensor-style loader. Same public shape as
crate::weights::SafetensorsLoader.
Constants§
- DEFAULT_
DIRECT_ IO_ TENSOR_ CAP - Default tensor-count cap for per-shard
O_DIRECT. Above this, the fast loader uses buffered reads even whentry_direct_io = true. See the field doc onFastSafetensorsLoader::direct_io_tensor_cap.
Functions§
- is_
vision_ tensor - Is this tensor part of a multimodal checkpoint’s vision tower?