Crate metrale_core

Crate metrale_core 

Source
Expand description

2026-09-25: Shared foundation types and host-side helpers for the engine crates, one module each (listed below).

Owner: metrale-core. Invariants:

  • The cuda feature gates only device::MetraleDevice and the error::MetraleError::CudaDriver variant; the crate builds without it.

Modulesยง

arch
2026-09-25: Decide whether PTX built for one SM architecture runs on a device, and name the target to rebuild when it does not.
compute
2026-09-25: A build-time kernel compilation target: the Vendor parsed from HARDWARE.toml, the ComputeTarget trait, and its nvcc implementation.
device
2026-09-25: GB10 hardware constants (sm121) and the cudarc device handle MetraleDevice.
dtype
2026-09-25: Element types for weights and scales, and the quantization layout of a weight tensor.
error
fault
2026-09-25: Process-wide latch for a destroyed CUDA context, the probe-based verdict that sets it, and the exit status it maps to.
mxfp4_e8m0
2026-09-25: Native MXFP4 host unpack: packed E2M1 nibbles + E8M0 scales.
numeric
2026-09-25: Host-side numeric conversions: the FP8 E4M3 decode table, the f32 -> BF16 cast and BF16 widening.
safetensors
2026-09-25: The one place that turns a safetensors data_offsets pair into a byte span.
scope
2026-09-25: Model teardown: ordered, fallible release of state that owns device memory.
target
2026-09-25: Kernel target descriptor: the (arch, model, quant) key of a compiled kernel set.
tensor
2026-09-25: TensorRef, a non-owning description of a device tensor.