Expand description
Mockable multi-GPU work partitioning. Multi-GPU adapter probing, backend acquisition, and work partitioning.
The pure partitioner stays separately testable, but production callers can now derive device loads from live wgpu adapters and acquire one backend per selected adapter instead of stopping at scheduling math.
§Two allocation modes
- Batch + cost-aware (
partition_work_stealing): caller knows every work item + its cost up front; LPT greedy assigns the heaviest item to the least-loaded device. - Stream + content-addressed
(
shard_by_blake3+StreamShardAllocator): caller yields(key, cost)pairs one at a time from a walker. The initial device isblake3(key)[0] % n_gpusfor deterministic affinity - files with the same path always land on the same GPU across runs, which enables cache-warm re-scans. Overflow (queue on the target GPU is already loaded above threshold) spills to the least-loaded neighbor to keep tail latency bounded.
Structs§
- Borrowed
GpuWork Item - Borrowed multi-GPU work packet for hot scan paths.
- Device
Load - Current device load snapshot.
- GpuWork
Item - One executable multi-GPU work packet.
- GpuWork
Output - Output from one dispatched
GpuWorkItem. - LiveGpu
- A live GPU selected for multi-device scheduling.
- Multi
GpuExecutor - Real multi-GPU executor backed by one
crate::WgpuBackendper adapter. - Partition
- Work assigned to one device.
- Stream
Shard Allocator - Streaming shard allocator.
- Weighted
Work Item - One pending unit of GPU work.
Functions§
- live_
gpu_ loads - Enumerate live wgpu GPU adapters as zero-load scheduling targets.
- partition_
work_ stealing - Partition work by repeatedly assigning the largest remaining item to the least-loaded device.
- shard_
by_ blake3 - Deterministic content-addressed device pick.