Skip to main content

Module gpu

Module gpu 

Source
Expand description

GPU-accelerated matching via wgpu. GPU-accelerated batch inference for the MoE classifier via wgpu compute shaders.

Processes N feature vectors in a single GPU dispatch, achieving ~10-100x throughput over CPU for large batches. Falls back to CPU when no GPU is available or for batches smaller than the crossover threshold.

Architecture mirrors ml_scorer.rs exactly:

  • Gate: Linear(55→6) + softmax
  • 6 experts: Linear(55→32)+ReLU → Linear(32→16)+ReLU → Linear(16→1)
  • Output: sigmoid(weighted sum of expert logits)

§Feature-gating in the lean build

Every entry point that would touch wgpu / vyre-driver-wgpu directly is wrapped in #[cfg(feature = "gpu")]. With the gpu feature off (the cargo install keyhog --no-default-features --features ci path), the GPU drivers aren’t linked at all, the probe functions report “no GPU available” without ever calling into wgpu, and the self-test functions return a “not available in this build” Err instead of panicking. The CPU MoE path in ml_scorer.rs is the entire scoring story under that profile.

Structs§

GpuRegionPresencePeerSelfTest
One acquired peer proven by the production GPU region-presence self-test.
GpuRegionPresenceSelfTest
Status report from the production GPU region-presence self-test.
GpuRegionPresenceSelfTestFailure
Honest aggregate failure from the peer self-test.
GpuSelfTest
Result from an explicit GPU adapter and dispatch self-test.
VyreGpuSelfTest
Result from an explicit VYRE GPU scanner self-test.

Enums§

GpuRuntimePolicy

Functions§

gpu_available
Return true when GPU scoring support is available in this build/runtime.
gpu_region_presence_self_test
Build a minimal one-detector CompiledScanner and dispatch a scan through the production GPU backend. A PASS proves device acquisition, compilation, lowering, dispatch, and host readback on this host.
gpu_required_by_policy
True when the resolved runtime policy demands a usable GPU and a silent CPU fallback is forbidden.
gpu_runtime_policy
The current process-wide GPU runtime policy.
gpu_self_test
Force a GPU compute dispatch and validate the returned scores.
require_gpu_preflight
Require-GPU preflight, independent of backend routing.
set_gpu_runtime_policy
Set the process-wide GPU runtime policy (Auto/On/Off) consulted by backend routing and GPU init.
vyre_gpu_self_test
Force the VYRE GPU scanner and coalesced scanner paths.