Low-level crates: the generated doc headers (Methods of ..., Functions: ..., Split out of ...) are real descriptions: what the file holds and why it is a file of its own (604 files, comment lines only)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-14 20:53:02 +01:00
co-authored by Claude Sonnet 5.5
parent 252fa1a890
commit 001f2a3063
604 changed files with 1187 additions and 1143 deletions
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of the context policy: 2x256k needs no scaling and 1x512k needs YaRN 2, INT8 pool closing, refusal of
//! explicit none past the trained range, stray scale, bad rope knobs and request errors, and state sizing by slots.
use super::*;
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of the cell-count geometry: at the trained cell count every value equals its frozen literal, the resident
//! window follows kv_plan, 512k scales linear sizes by exactly two, and invalid cell counts and boundaries.
use super::*;
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of the memory plan arithmetic: real geometry constants, per-cell bytes, INT8 generic versus literal,
//! pool derivation quirks, does-not-close messages, overflow reporting, Q4 versus INT8 closing, FP32 indexer store.
use super::*;
@@ -1,5 +1,5 @@
//! Methods of `RopeScalingType`: `name`, `parse`. Methods of `RopeScalingError`: `reason`.
//! Implements `Default for RopeKernelArgs`, `Display for RopeScalingError` and 5 more.
//! RoPE scaling types and errors: the scaling method names, default kernel arguments, the RopeScaling
//! configuration with its validation and kernel arguments, YaRN ramp and angle, and RoPE table errors and size.
use super::{
DEFAULT_FREQ_BASE, PI, RopeKernelArgs, RopeScaling, RopeScalingError, RopeScalingType, RopeTableError,
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of RoPE scaling: identity default, YaRN mscale and clamped correction dims, rejection of non-finite or bad
//! configs, prefix-stable chunkable tables, table bytes at charter contexts, and setup/knob resolution.
use super::*;
@@ -1,5 +1,5 @@
//! Functions: `abi_version`, `check_i8`, `check_i4`, `dot_i8i8_scalar` and 17 more.
//! Split out of `c_reference` to keep its files under the line limit.
//! Safe Rust wrappers over the C reference kernels: ABI version, int8/int4 dots, MXFP4 x Q8_0 dots and block sums,
//! and the q8r layout, at scalar, AVX2 and AVX-VNNI level, with the shared length checks that make the FFI calls sound.
use super::{BLOCK_ELEMS, KernelError, MAX_DOT_LEN, MXFP4_BLOCK_BYTES, Q8_0_BLOCK_BYTES, avx2_available, ffi};
@@ -1,5 +1,5 @@
//! Functions: `quantize_q8_0_scalar`, `quantize_q8_0_avx2`, `dot_q8_0_q8_0_scalar`, `q8_0_q8_0_isums_scalar` and 10 ...
//! Split out of `c_reference` to keep its files under the line limit.
//! Safe wrappers over the C reference for Q8_0: float quantizer, Q8_0 x Q8_0 dots and block sums, float to half
//! conversion, and the AVX2/AVX-VNNI int8 and int4 dots; each SIMD level is checked against its scalar twin.
use super::{KernelError, avx2_available, check_i4, check_i8, check_mx_out, check_q8, check_quantize, ffi};
#[cfg(target_arch="x86_64")]
+2 -2
View File
@@ -1,5 +1,5 @@
//! Functions: `block_bytes`, `aligned`, `unaligned`, `dequantize_mxfp4` and 3 more.
//! Split out of `crate` to keep its files under the line limit.
//! Safe wrappers over the pinned ggml MXFP4 and Q8_0 quantize/dequantize routines (compiled C), used as the oracle
//! that the Rust kernels are compared against; copies buffers to 8-byte aligned storage for ggml structs.
use super::{BLOCK_ELEMS, MXFP4_BLOCK_BYTES, Q8_0_BLOCK_BYTES};
+2 -2
View File
@@ -1,5 +1,5 @@
//! Groups the submodules `reductions_and_int_dots`, `mxfp4_q8_dots`, `q8_dots_and_mxfp4_tiles` and 4 more.
//! Split out of `simd` to keep its files under the line limit.
//! x86-64 kernel set: holds the register-tiled macros and the shared safety contract, and declares the kernel groups
//! (int dots, MXFP4 and Q8 dots, tiles, attention and f16 elementwise, Q8_0 quantizer) at AVX2 and AVX-VNNI level.
//! AVX2 (+FMA +F16C) and AVX-VNNI kernels. Every function is `unsafe`: the caller must have
//! verified the CPU features named in its `target_feature` attribute and that all slices have the
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `AsyncApi`: `load`, `create_stream`, `create_event`, `register` and 12 more.
//! Methods of `MappedApi`: `load`, `register_bank`, `bank_alias`, `unregister_bank` and 12 more.
//! Stub implementations of AsyncApi and MappedApi for builds without a usable CUDA driver (no cuda-driver feature,
//! non-Linux/Windows or non-64-bit target): every method fails with UnsupportedPlatform, so callers compile unchanged.
#[cfg(not(all(
feature = "cuda-driver",
@@ -1,5 +1,5 @@
//! Functions: `stream_k_off`, `marker_files_present`, `forced_sms`, `chunk_drain` and 10 more.
//! Split out of `arch_ptx` to keep its files under the line limit.
//! Run-time policy of the per-architecture PTX layer: the stream-K on/off switch (env vars and marker files), the
//! forced SM count and chunk-drain diagnostics, the compute-capability gates, and the sm_86 companion image lookup.
use super::STREAM_K_AVOIDED;
#[cfg(feature = "sm86")]
@@ -1,5 +1,5 @@
//! Methods of `PromptSyncTrace`: `enter`. Methods of `Driver`: `load`, `version`, `device`.
//! Implements `Drop for PromptSyncTrace`, `Drop for RoutedGateUpQ8`. Functions: `combine`, `valid_size`.
//! Driver bring-up core: Driver::load/device, Device::create_context and the Context constructor, the poison flag
//! (PoisonCell) with its trace, the prompt-sync trace guard, and the scratch release of RoutedGateUpQ8.
use super::{
Cell, Context, Device, Driver, Error, PoisonCell, PromptSyncTrace, Rc, Result, RoutedGateUpQ8, ffi, qwen_dispatch,
@@ -1,5 +1,5 @@
//! Methods of `Program`: `name`, `ptx`, `pin`, `source` and 1 more. Methods of `Slot`: `kind`.
//! Functions: `admit_ptx`, `admit`, `s_gemv_entry_index`, `conforms` and 5 more.
//! Program catalogue of the closed kernels: name, sealed PTX, pin and CUDA source of each Program, fail-closed
//! PTX admission against its digest pin, and the slot lists and operand sizes of flash, poison and S-GEMV launches.
use super::{
Arg, DEVICE_POISON_PTX, Entry, ExperimentalError, FLASH_ENTRIES, FlashBytes, Kernel, MAX_ENTRY_ARGUMENTS,
@@ -1,5 +1,5 @@
//! Functions: `s_gemv_slots`, `head_slots`.
//! Split out of `closed_kernels` to keep its files under the line limit.
//! Builds the ordered kernel-argument slots of a planned S-form GEMV (pointers, sizes, code bias, codebook, shift),
//! one layout per kernel variant; kept apart so program.rs holds only the catalogue and its admission.
use super::{Kernel, Plan, Role, SForm, Slot};
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Shared helpers of the closed-kernel tests: they read parameter kinds from the checked-in .cu sources and from the
//! Entry tables so submodules can assert that every Rust signature matches its CUDA entry and every sealed PTX its pin.
use super::*;
use crate::s_gemv_legacy as sg;
@@ -1,5 +1,5 @@
//! Groups the submodules `closed_kernels_flash_and_s_gemv`, `closed_kernels_open_admit_run`.
//! Split out of `closed_kernels_gpu` to keep its files under the line limit.
//! Module root of the ClosedKernels owner on a live context: it shares the imports of its two files, one for
//! opening, admitting and running launches and one for the concrete flash / poison / S-GEMV entry points.
use super::{
Admitted, ClosedKernels, Context, DeviceBuffer, DriverResult, Error, ExperimentalError, FLASH_SHORT,
@@ -1,5 +1,5 @@
//! Methods of `FlashBuffers`: `admit`, `operands`.
//! Methods of `ClosedKernels`: `native_flash_attn_short`, `poison_f32`, `s_gemv`, `s2_gemv`.
//! The launch entry points of ClosedKernels: short FlashAttention step, quiet-NaN poison fill and the S / S2 GEMV.
//! Each checks its operands (FlashBuffers, s_gemv_operands) and builds one Launch; opening and running are elsewhere.
use super::{
ClosedKernels, DeviceBuffer, Error, ExperimentalError, FLASH_SHORT, FlashStepBuffers, Geometry, Operand,
@@ -1,5 +1,5 @@
//! Methods of `ClosedKernels`: `open`, `close`, `expect`, `build` and 4 more.
//! Functions: `resolve_functions`, `reject_aliasing`.
//! Lifecycle and launch plumbing of ClosedKernels: open (pin gate, module load, entry resolution), close, and the
//! per-launch checks (signature, geometry, operand admission, alias rejection) that turn slots into a Launch.
use super::{
Admitted, ClosedKernels, Context, DriverResult, Error, Geometry, Launch, Operand, Program, Rc, Result, Role, Slot,
@@ -1,5 +1,5 @@
//! Functions: `failure`.
//! Split out of `closed_kernels_gpu` to keep its files under the line limit.
//! Folds a primary driver failure and the outcome of the mandatory context restore into one ExperimentalError,
//! so no restore error is lost behind the first one.
use super::{DriverResult, Error, ExperimentalError, combine};
@@ -1,5 +1,5 @@
//! Methods of `Rng`: `next`, `normal`. Functions: `f16_bits`, `upload`, `download`, `f32s` and 4 more.
//! Split out of `closed_kernels_gpu_smoke` to keep its files under the line limit.
//! Helpers of the closed-kernel GPU smoke tests: a small deterministic Rng (uniform and normal-ish), f32 to f16 bits,
//! device upload / download, opening a program, zeroed KV buffers and JSON-to-vector readers for the reference cases.
use super::{ClosedKernels, Context, DeviceBuffer, Program, Rng};
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Context`: `poison`, `retain_driver`, `budget_bytes`, `device_ordinal` and 16 more.
//! Split out of `crate` to keep its files under the line limit.
//! Core of Context, the owner of one CUDA context: budget and allocation accounting, the sticky poison flag, entering
//! the context (CurrentGuard), allocate / deferred frees, synchronize, and the MoE-down pack and vector-add launches.
use super::{
Context, CurrentGuard, DeviceBuffer, Error, FixedOperation, PhantomData, Rc, Result, combine, ffi, valid_size,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `project_routed_gate_up_prepared_weight`, `prepared_scratch`, `gate_up_prepared_shape`, `ga...
//! Split out of `crate` to keep its files under the line limit.
//! Admission of projection launches on a Context: owner, shape, alias and temporary-budget checks for the prepared
//! routed gate/up Q8 path, the native-weight projections and the Q5_K / Q6_K matvec before any native mutation.
use super::{
Context, DeviceBuffer, Error, NativeWeights, ProjectionKind, ProjectionShape, ProjectionSpec, Q5KProjectionShape,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `matvec_f32`, `q5_k_q8_1`, `q5_k_operation`, `q6_k_q8_1` and 4 more. Defines `MatvecDims`.
//! Split out of `crate` to keep its files under the line limit.
//! Context entry points for the f32 matvec and the Q5_K / Q6_K projections (MatvecDims), the shared Q8_1 activation
//! quantization with its scratch and status temporaries, and the closed-format project_q8_1 dispatch.
use super::{
Context, DeviceBuffer, Error, FixedOperation, NativeWeights, ProjectionSpec, Q5KProjectionShape, Q5KShape,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `matvec_admission`, `kernel_slot`, `kernel_slot_rest`, `fixed_kernel` and 10 more.
//! Split out of `crate` to keep its files under the line limit.
//! Kernel cache of Context: matvec admission, the per-operation FixedKernel slots, the Q5 / Q6 pair kernels and the
//! projection kernel pairs, each loaded lazily with the context current and unloaded on failure by poisoning.
use super::{
Cell, Context, DeviceBuffer, Error, FixedKernel, FixedOperation, FixedPairKernels, MatvecShape, ProjectionKernels,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `project_q8_1_weight`, `project_q8_1_operation`, `prepare_routed_gate_up_q8`, `gate_up_sour...
//! Split out of `crate` to keep its files under the line limit.
//! Q8_1 weight projection of one activation and the routed gate/up path: quantizing the activation once into a
//! RoutedGateUpQ8 (prepare), then projecting prepared scratch with each expert weight.
use super::{
Context, DeviceBuffer, Error, FixedOperation, NativeWeights, ProjectionShape, ProjectionSpec, Result, RoutedFormat,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `unload_projections`, `unload_projection_slot`, `unload_q5_kernels`, `unload_q6_kernels` an...
//! Methods of `CurrentGuard`: `finish`, `restore`. Implements `Drop for Context`, `Drop for CurrentGuard`.
//! Teardown of Context: unloading every cached kernel module in a fixed order, close / destroy of the CUDA context,
//! and the Drop impls of Context and CurrentGuard that restore the previously current context.
use super::{Context, CurrentGuard, Error, FixedOperation, ProjectionKernels, Rc, Result, combine};
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `DeviceBuffer`: `len`, `is_empty`, `staging`, `copy_from` and 12 more.
//! Implements `Drop for DeviceBuffer`. Functions: `chain_selects_mtp`, `chain_selects_mtp`, `set_chain_down_override`.
//! DeviceBuffer host/device copies (whole buffer and ranges, staged through a host Vec, synchronised) and its release
//! and Drop, plus the LELEKA_CHAIN 'mtp' selector chain_selects_mtp with its no-driver stubs.
use super::{DeviceBuffer, Error, Result, combine, compute_drain, original_verify, vram_ledger};
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of the device slab packer: policy validation, in-order aligned placement, hole reuse, direct allocations
//! above the limit, no overlapping ranges, the device memory saved for dense weights, and byte isolation of slab views.
use super::*;
use crate::vram_ledger::driver_bytes;
@@ -1,5 +1,5 @@
//! Methods of `KvShape`: `real`, `as_qsa`, `base`, `check_q4` and 8 more. Methods of `Context`: `unload_experimental`.
//! Functions: `fwht_grid`, `fwht_bytes`, `q4_step_grid`, `q4_batch_grid` and 12 more.
//! KvShape of the experimental KV-cache kernels (heads, head_dim, page size) with its validity checks for Q4 / INT8 /
//! attention, the pool byte sizes, and the launch-grid planners for FWHT, Q4/Q8 step and gather, keyless and attention.
use super::{
Context, ExperimentalError, Grid, KvShape, MAX_GRID_YZ, QsaShapes, Result, cvec, grid_x, grid_yz, invalid, keyless,
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Mode`: `name`, `bit`. Methods of `OptIn`: `with`, `is_enabled`, `is_empty`, `modes` and 2 more.
//! Implements `Display for ExperimentalError`, `Error for ExperimentalError` and 1 more.
//! The opt-in model of the experimental kernels: Mode and the OptIn set (all off by default), the Program
//! catalogue and the modes each needs, the pin / seal admission gates (fail closed), ExperimentalError, grid helpers.
use super::{
CVEC_ENTRIES, CVEC_PTX, Entry, Error, ExperimentalError, KEYLESS_ENTRIES, KEYLESS_PTX, KV_Q4_ENTRIES, KV_Q4_PTX,
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of the experimental kernel programs: entry signatures match their CUDA source, sealed PTX matches its pin,
//! modes are off by default with ordered admission, and KV grids, byte sizes and stream guards equal the Original's.
use super::*;
@@ -1,5 +1,5 @@
//! Methods of `Context`: `experimental_program`, `unload_failed`. Functions: `resolve_entries`, `i32_of`, `i64_of`.
//! Split out of `experimental_gpu` to keep its files under the line limit.
//! Loads an experimental Program into a Context: opt-in and pin gates, module load, entry resolution and caching
//! (nothing is published until every entry resolves), plus unload of a failed load and the i32 / i64 argument casts.
use super::{
Context, DriverResult, Error, LoadedProgram, OptIn, Program, Rc, Result, admit, combine, failure, ffi, invalid,
@@ -1,5 +1,5 @@
//! Methods of `StreamMap`: `bind`. Methods of `Call`: `pointer`, `ro`, `rw`, `ro_at` and 7 more. Functions: `failure`.
//! Split out of `experimental_gpu` to keep its files under the line limit.
//! Argument binding for experimental launches: Call adds checked, context-matched pointer and scalar operands
//! (read-only / read-write, with admitted extents) and StreamMap binds the page-table and slot arrays of the KV stream.
use super::{
Admitted, Arg, CTL_INTS, Call, DeviceBuffer, DriverResult, Entry, Error, ExperimentalError, Launch, Result,
+2 -2
View File
@@ -1,5 +1,5 @@
//! Functions: `common_checked_geometry_matches_frozen_native_layouts`, `common_invalid_shapes_have_fixed_errors`, `q...
//! Defines `QuantizeBuffers`.
//! Tests of the common projection family: geometry and launch grids equal the frozen native layouts, invalid shapes
//! give fixed errors, misaligned ranges are refused, and quantizer launch / sync / restore errors keep their order.
use super::*;
const KINDS: [ProjectionKind; 10] = [
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Api`: `memory_info`, `mmq_capabilities`, `load_mmq`, `mmq_function` and 56 more.
//! Split out of `ffi` to keep its files under the line limit.
//! Stub of the whole ffi Api (module loads, launches, memory, contexts) for builds without a usable CUDA driver:
//! every method returns UnsupportedPlatform; the real implementation is in driver_backed.
#[cfg(not(all(
feature = "cuda-driver",
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `ContextHandle`: `synthetic`.
//! Methods of `BufferHandle`: `registered_bank_alias`, `checked_subspan`, `qwen_address`, `validate_extent` and 7 more.
//! Typed handles of device memory and modules: BufferHandle checks extents, sub-spans, alignment, overlap and MoE down
//! slots before a driver call, and the selection of the PTX image and entry name for each projection kind.
use super::{BufferHandle, DenseFormat, Error, ProjectionKind, Result, RoutedFormat};
// used only with some cargo features or targets of this crate
@@ -1,5 +1,5 @@
//! Methods of `Api`: `memory_info`, `mmq_capabilities`, `load_mmq`, `mmq_function` and 9 more.
//! Split out of `enabled` to keep its files under the line limit.
//! Api calls of the real driver for the fixed-function kernels of the MMQ family: memory info, MMQ capability and
//! shared-memory limit, IQ3 native integer, resident d4 and head-greedy module loads and launches.
use super::{
Api, CuDevice, CuResult, Error, FunctionHandle, HeadGreedyArguments, Iq3NativeIntegerArguments, MemGetInfoV2,
@@ -1,5 +1,5 @@
//! Methods of `Api`: `device`, `create`, `destroy`, `push` and 11 more.
//! Split out of `enabled` to keep its files under the line limit.
//! Driver Api calls for devices, contexts and memory: cuDeviceGet, context create / destroy / push / pop,
//! synchronize, allocate / free, host-device copies, zeroing and the device-to-device weight and MoE down copies.
use super::{Api, BufferHandle, ContextHandle, CuContext, Error, Result, c_void, check};
@@ -1,5 +1,5 @@
//! Implements `Drop for Library`. Functions: `check`.
//! Split out of `enabled` to keep its files under the line limit.
//! Ownership of the dlopen'ed driver library (dlclose on Drop) and check(), which maps a non-zero CUDA result
//! code to Error::Driver; kept apart as the two primitives every driver-backed call depends on.
use super::{CuResult, Error, Library, Result};
@@ -1,5 +1,5 @@
//! Methods of `Api`: `launch_qwen`, `load`, `resolve`, `load_q6_batch_preview` and 4 more.
//! Functions: `is_projection_family`.
//! Loads libcuda.so.1 and resolves the sixteen fixed driver symbols into the Api (dlopen, no CUDA toolkit needed),
//! plus the fixed-operation and Q6 batch module loads, function lookup and the launch_qwen entry point.
use super::{
Api, COMMON_QUANTIZER_PTX, ContextCreateV2, ContextDestroyV2, ContextPopCurrentV2, ContextPushCurrentV2,
@@ -1,5 +1,5 @@
//! Methods of `Api`: `unload`, `launch`, `launch_gr_read_guard`, `launch_matvec` and 8 more.
//! Split out of `enabled` to keep its files under the line limit.
//! Real-driver kernel launches of the dense path: module unload, generic launch, matvec, Q8 quantize, Q5 / Q6 and
//! dense / grouped projections, grouped SwiGLU and the GR read guard, each with its grid and arguments checked.
use super::{
Api, FunctionHandle, GrReadGuardArguments, LaunchArguments, MatvecArguments, ModuleHandle, ProjectionArguments,
@@ -1,5 +1,5 @@
//! Methods of `Api`: `mmq_original_group_shared_limit`, `load_mmq_original_group`, `mmq_original_group_function`, `l...
//! Split out of `enabled` to keep its files under the line limit.
//! Real-driver loads and launches of the Original's grouped MMQ path: shared-memory limit query, group module and
//! function lookup, the gather and group-helper launches.
use super::{
Api, CuDevice, CuResult, Error, FunctionHandle, MMQ_ORIGINAL_GROUP_SYMBOLS, MmqOriginalGatherArguments,
@@ -1,5 +1,5 @@
//! Methods of `Api`: `launch_mmq_original_swiglu`, `load_mmq_resident`, `mmq_resident_function`, `launch_mmq_residen...
//! Split out of `enabled` to keep its files under the line limit.
//! Real-driver loads and launches of the resident MMQ pipeline (SwiGLU, quantize, project, fixup), the QSA selected
//! gather kernels and the Qwen asset modules (load_qwen_module, qwen_function).
use super::{
Api, Error, FunctionHandle, MmqArguments, MmqFixupArguments, MmqOriginalSwigluArguments, MmqQuantArguments,
@@ -1,5 +1,5 @@
//! Methods of `FunctionHandle`: `qwen_success`, `synthetic`. Methods of `LaunchArguments`: `new`.
//! Implements `Drop for LaunchArguments`, `Drop for GrReadGuardArguments` and 3 more.
//! FunctionHandle constructors and the heap-pinned kernel-argument blocks (LaunchArguments, matvec, Q8 quantize,
//! Q5 / Q6 / dense projection, GR read guard): self-referential parameter arrays built once and freed by Drop.
use super::{
ArgumentStorage, BufferHandle, GrReadGuardArguments, GrReadGuardStorage, LaunchArguments, MatvecArguments,
@@ -1,5 +1,5 @@
//! Methods of `MmqOriginalGatherArguments`: `new`, `parameters`.
//! Split out of `mmq_abi` to keep its files under the line limit.
//! Parameter block of the Original's gather (copy16) kernel launch: the raw, gate-up and down addresses and
//! 16-byte element counts laid out in the kernel's ABI order.
use super::{BufferHandle, MmqOriginalGatherArguments, Owned, c_void};
@@ -1,5 +1,5 @@
//! Methods of `MmqResidentArguments`: `native_resident_d4`, `zero`, `finite`, `gather` and 1 more.
//! Methods of `Iq3NativeIntegerArguments`: `dot`, `reduce`, `new`, `parameters`.
//! Parameter blocks for the resident MMQ and native IQ3 launches: resident d4, zero, finite check, gather, IQ3
//! dot / reduce, Original indexed quantize, grouped MMQ, fixup and SwiGLU, each laid out in its kernel's ABI order.
use super::{
BufferHandle, Iq3NativeIntegerArguments, Layout, MmqArguments, MmqFixupArguments, MmqGatherShape, MmqGroupBuffers,
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Owned`: `new`, `parameters`. Methods of `MmqQuantArguments`: `new`, `parameters`.
//! Implements `Drop for Owned`. Functions: `fastdiv`.
//! Owned: the heap-pinned Storage (addresses, wide, integers, fastdiv divisors, parameter pointers) behind every MMQ
//! argument block, freed once on Drop; also the fast-division constants and the quantize, MMQ and fixup block builders.
use super::{BufferHandle, Layout, MmqArguments, MmqFixupArguments, MmqQuantArguments, Owned, Storage, c_void};
@@ -1,5 +1,5 @@
//! Methods of `Arena`: `bytes`, `pin_limit`, `locked`, `lock_offset` and 5 more.
//! Methods of `Copy`: `into_slice`, `run`.
//! Host arena of the file expert source: a malloc / pinned block with partial mlock, checked writes, reads and
//! aliases of byte ranges, the three-part parallel Copy of expert pieces, page warm-up and worker stack sizing.
use super::{Arena, Copy, Error, P, Result};
@@ -1,5 +1,5 @@
//! Methods of `Api`: `load`, `allocate`, `try_pinned`, `exchange_allocate` and 3 more.
//! Implements `Drop for Opening`, `Drop for Api`. Functions: `check`, `symbol`. Defines `Opening`.
//! The host-memory Api of the file expert source: dlopen of libcuda for page-locked alloc / register / device alias /
//! async copy, arena allocation (pinned or malloc), exchange copies and close, with the symbol and result checks.
use super::{Alias, Alloc, Api, Arc, Arena, ArenaSpan, CStr, DtoH, Error, Free, P, Register, Result};
@@ -1,5 +1,5 @@
//! Methods of `Api`: `record`, `wait`, `copy_slot`, `load` and 13 more. Implements `Drop for Opening`.
//! Functions: `symbol`. Defines `Opening`.
//! Driver Api of the expert stager: dlopen of libcuda, pinned host buffers, events (record / wait / timing /
//! query), async slot copies and the worker context enter / leave that let staging threads issue DMA safely.
use super::{
Api, BufferHandle, CStr, ContextHandle, Copy, Elapsed, Error, EventCreate, EventRecord, Handle, HandleCall,
@@ -1,5 +1,5 @@
//! Implements `Drop for Api`. Functions: `check`.
//! Split out of `original_stager` to keep its files under the line limit.
//! Result-code check of the stager's driver calls, and the Drop of its Api that dlcloses libcuda only after the
//! last worker holding an Arc of it is gone.
use super::{Api, Error, Handle, Result};
@@ -1,5 +1,5 @@
//! Methods of `HostBuffer`: `pinned`, `capacity`, `slot`.
//! Methods of `CopyJob`: `from_slices`, `bytes`, `copy_to`, `copy_segment` and 1 more.
//! Host side of expert staging: pinned HostBuffer slots, CopyJob (three source slices copied into a slot) and the
//! read-only mmap of the expert file (ExpertFileMap) from which expert byte ranges are read.
use super::{CopyJob, Error, ExpertFileMap, HostBuffer, Result, WorkerSlot, c_void};
@@ -1,5 +1,5 @@
//! Functions: `new_fixed_asset_encoding_refuses_unicode_before_driver_call`, `q4_k_dense_selector_resolves_only_its_...
//! Split out of `ffi` to keep its files under the line limit.
//! Tests of the ffi projection assets: fixed PTX must be ASCII, each format selector (Q4_K, IQ3_S, IQ2_S, Q2_0,
//! IQ4_NL, IQ4_XS) resolves only its own asset and entry, plus handle alignment / overlap and exact parameter widths.
use super::*;
#[test]
@@ -1,5 +1,5 @@
//! Implements `Drop for Q5ProjectionArguments`, `Drop for MatvecArguments`.
//! Split out of `ffi` to keep its files under the line limit.
//! Drop of the Q5 projection and matvec argument blocks: the boxed storage is freed once, and only when the
//! launch never started or completed; after an uncertain sync the owner is forgotten and the block leaks on purpose.
use super::{MatvecArguments, Q5ProjectionArguments};
@@ -1,5 +1,5 @@
//! Methods of `QsaSelectedArguments`: `new`, `parameters`. Methods of `HeadGreedyArguments`: `new`, `parameters`.
//! Implements `Drop for QsaSelectedArguments`, `Drop for HeadGreedyArguments`.
//! Parameter blocks of two small kernels, QSA selected (five buffers, layer, count) and head greedy (source,
//! output): boxed, self-referential pointer arrays freed once by Drop unless completion was uncertain.
use super::{BufferHandle, HeadGreedyArguments, HeadGreedyStorage, QsaSelectedArguments, QsaSelectedStorage};
+2 -1
View File
@@ -1,4 +1,5 @@
//! Unit tests of `ffi`.
//! Tests of ffi handle arithmetic: checked sub-spans refuse empty, wrapping and out-of-allocation ranges, matvec
//! address extents are validated, and the raw argument storage keeps its address when its owner moves.
#[test]
fn checked_subspan_refuses_empty_wrap_and_outside_allocation() {
@@ -1,4 +1,5 @@
//! Unit tests of `gdn_native_batch`.
//! Tests of the native GDN batch program: stage slots and sizes, the fixed step order, earliest-status refusal,
//! witness errors, native format geometry, closed kernel table, 256-block launches, bindings, and artifact pin checks.
use super::*;
@@ -1,4 +1,5 @@
//! Unit tests of this module (split out of its file; the test ids are unchanged).
//! Tests of the KAR level-decode kernel contract: DecodeGeometry window layouts and bounds, multiply and expert
//! shapes, fail-closed status word, the sealed PTX against its pin, and the Rust constants against the CUDA source.
use super::*;
@@ -1,5 +1,5 @@
//! Methods of `Context`: `kar_levels_kernels`, `resolve_kar_entries`, `abandon_kar_module`.
//! Split out of `kar_decode_levels_gpu` to keep its files under the line limit.
//! Loads the KAR level-decode PTX into a Context: pin admission, one cached module, resolution of the decode /
//! multiply / SwiGLU entries (nothing published until all resolve) and unloading of a half-resolved module.
use super::{
Context, DriverResult, ENTRY_DECODE, ENTRY_MULTIPLY, ENTRY_SWIGLU, Error, KAR_DECODE_LEVELS_PIN,
@@ -1,4 +1,5 @@
//! Moved out of kar_decode_levels.rs by the STRA-338 size pass: the single-token routed expert FFN.
//! Single-token routed expert FFN on the GPU from KAR-packed matrices: buffer allocation and admission, the
//! gate / up / SwiGLU / down launch sequence and the host read-back of the checked output (expert_mlp_to_host).
use super::{
Admitted, BLOCK_THREADS, Context, DeviceBuffer, ExpertShape, KarDecodeError, KarDecodeLevels, KarMatrix, Launch,
@@ -1,5 +1,5 @@
//! Functions: `f32_bytes`, `download`, `failure`, `release_all` and 1 more.
//! Split out of `kar_decode_levels_gpu` to keep its files under the line limit.
//! Small host helpers of the KAR GPU owner: f32 to little-endian bytes, device download, finite-only f32 parse,
//! joint release of buffers, and folding a primary failure with the context restore into one KarDecodeError.
use super::{DeviceBuffer, DriverResult, Error, KarDecodeError, Result, combine};
@@ -1,5 +1,5 @@
//! Methods of `KarDecodeLevels`: `open`, `close`, `admit`, `disjoint` and 15 more. Defines `MultiplyBuffers`.
//! Split out of `kar_decode_levels_gpu` to keep its files under the line limit.
//! The KarDecodeLevels owner: opens the module on a context, admits buffers and builds decode / multiply launches,
//! runs them under one drain, and offers decode_to_host / decode_multiply_to_host with status and finite checks.
use super::{
Admitted, BLOCK_THREADS, Context, DecodeGeometry, DecodeMultiplyBuffers, DeviceBuffer, Error, KarDecodeError,
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Rng`: `next`, `unit`, `below`. Functions: `upload`, `addr`, `f32s`, `i32s` and 6 more.
//! Defines `KernelShape`, `ImageLayout`.
//! Shared fixtures of the KV-stream GPU proofs: an xorshift Rng, device upload / address / byte helpers, a kernel
//! launch and module-load wrapper, random value groups and block selections, and the expected pool image layout.
use super::{
Arg, Arguments, Context, DeviceBuffer, HD, Module, NativeBatchWorkspace, PAGE, Result, Rng, combine, kv_q8,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `mapped_expert_bank`, `check_bank_inputs`, `bank_ranges`, `bank_role` and 2 more.
//! Methods of `MappedExpertBank`: `opened`, `load_banks`. Functions: `aligned_copy_enabled`.
//! Opening a MappedExpertBank on a Context: checks the lease and member banks, plans page ranges and the budget
//! charge, loads the mapped driver ABI and registers each bank for a device alias; also the aligned-copy A/B switch.
use super::{
BANKS, Context, Error, LayerRole, MappedExpertBank, RegisteredBank, ResidentExpertBankLease,
@@ -1,5 +1,5 @@
//! Methods of `PendingMappedExpertCopy`: `destination_bytes`, `new`, `observe`, `settle_observation` and 6 more.
//! Methods of `Context`: `mapped_expert_copy_scratch`.
//! Lifetime of an in-flight mapped expert copy: PendingMappedExpertCopy (event poll / wait, cleanup, leaking on
//! uncertain completion), its reusable scratch and completion owners, and the Drop of the bank that unregisters it.
use super::{
Context, DeviceBuffer, Error, MappedExpertBank, MappedExpertCopyCompletion, MappedExpertCopyScratch,
@@ -1,5 +1,5 @@
//! Methods of `MappedExpertBank`: `retain_uncertain`, `close`.
//! Split out of `mapped_expert_bank_methods` to keep its files under the line limit.
//! Closing a MappedExpertBank: close() and retain_uncertain(), which poisons the context and leaks the bank's
//! ABI and registrations when completion is uncertain, since the device may still read them.
use super::{MappedExpertBank, Result};
@@ -1,5 +1,5 @@
//! Methods of `MappedExpertBank`: `page_locked`, `locked_experts`, `resident_bytes`, `pcie_alias` and 13 more.
//! Functions: `bank_index`, `expert_role_offset`.
//! Device-side use of a MappedExpertBank: PCIe alias lookup, eligibility checks, and copy_triplet, which launches the
//! mapped-copy kernel for one expert's three tensors into device buffers and tracks it as a pending copy.
use super::{
DeviceBuffer, Error, LayerRole, MappedExpertBank, MappedExpertCopyScratch, PendingMappedExpertCopy, Rc,
@@ -1,5 +1,5 @@
//! Methods of `MappedExpertBank`: `cache_context_matches`, `cache_source`, `cache_source_aligned`, `retained_span_ha...
//! Split out of `mapped_expert_bank_methods` to keep its files under the line limit.
//! Host-side views of a MappedExpertBank: cache sources and page-aligned pieces of an expert, and pin_resident,
//! which page-locks the ranked hot experts within a byte budget (round, merge, register) and unwinds on failure.
use super::{
Context, Error, LayerRole, MappedExpertBank, PAGE, RegisteredBank, ResidentExpertBankSpan, Result, TensorRole, api,
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Context`: `mmq_experiment`.
//! Functions: `artifacts_valid`, `asset`, `original_formats_asset`, `bytes` and 1 more.
//! Sealed PTX assets of the MMQ kernels: each artifact is checked once for pinned length, NUL-terminated ASCII and
//! SHA-256 before use (the Original-formats pair against its own pin), plus small buffer helpers and mmq_experiment().
use super::{Context, Error, MmqExperiment, ORIGINAL_FORMATS_FIXUP_PIN, ORIGINAL_FORMATS_MUL_PIN, Result};
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `Context`: `mmq_weight_triplet`, `allocate_triplet`, `publish_triplet`, `admit_formats` and 12 more.
//! Functions: `check_weight_blocks`, `buffer_handles`, `check_padded_targets`, `owned_gate_up_layout`.
//! MMQ weight upload on a Context: format and charge admission, then repacking host or device raw weights into
//! padded MMQ layouts (single, gate/up/down triplet, owned gate-up) with checks that block counts and targets fit.
use super::{
Context, DeviceBuffer, Error, Layout, MmqFormat, MmqWeights, ProjectionKind, ProjectionSpec, Result, RoutedFormat,
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `MmqExperiment`: `new`, `enable_original_formats`, `function`, `weights` and 16 more.
//! Defines `ObservedRun`.
//! The MMQ experiment owner: loads the MMQ kernel modules and runs one observed projection (quantize, MMA, fixup)
//! with full finite readbacks, so the numeric gate tests can compare each stage with the recorded reference.
use super::{
Context, DeviceBuffer, Error, Layout, MmqExperiment, MmqFormat, MmqObservation, MmqProfile, MmqRequest, MmqWeights,
@@ -1,5 +1,5 @@
//! Methods of `MmqWeights`: `allocated_bytes`, `native_buffer`, `native_layout`, `native_spec` and 10 more.
//! Implements `Drop for MmqExperiment`, `Drop for MmqWeights`.
//! Native-path entry points of MmqWeights (Q8_1 quantize, gate/up and down column projections) and the close/Drop
//! implementations of MmqExperiment and MmqWeights, which release the loaded modules and device weight buffers.
use super::{
DeviceBuffer, DownColumns, Error, Layout, MmqExperiment, MmqFormat, MmqWeights, NativeWeights, ProjectionKind,
@@ -1,5 +1,5 @@
//! Methods of `Receipt`: `load`, `read`. Functions: `digest`, `hex`, `read_regular`, `parse_manifest` and 7 more.
//! Defines `Manifest`.
//! Receipt loader of the MMQ numeric GPU tests: reads the pinned fixture manifest, checks its headers and file list
//! and sha256 pins, and offers the JSON field readers and finite/compare helpers the cases use.
use super::{
BTreeMap, CASE_FILES, Component, MetadataExt, OpenOptions, OpenOptionsExt, Path, PathBuf, Pin, Read, Receipt,
@@ -1,5 +1,5 @@
//! Functions: `cases`, `load_case`, `check_metadata`, `check_geometry`. Defines `Shape`.
//! Split out of `mmq_numeric_gpu_tests` to keep its files under the line limit.
//! Per-format test cases of the MMQ numeric GPU tests: loads each case from the receipt and checks that its recorded
//! geometry, grid and provenance flags match what the closed fixture expects before any kernel runs.
use super::{Case, Receipt, field, finite, integer};
@@ -1,5 +1,5 @@
//! Functions: `release_triplet`.
//! Split out of `mmq` to keep its files under the line limit.
//! Releases the three device buffers of an MMQ projection in reverse order, keeps the first error and
//! poisons the context when any release fails; shared by the experiment and workspace cleanup paths.
use super::{Context, DeviceBuffer, Result};
+2 -2
View File
@@ -1,5 +1,5 @@
//! Methods of `QueuedCommand`: `launch`, `launch_projection`.
//! Methods of `Context`: `mmq_workspace`, `native_mmq_workspace`, `native_integer_iq3_mmq_workspace`, `native_intege...
//! The sealed PTX helper artifact of the resident MMQ path (length and sha256 checked), the queued launch commands
//! built from it, and the Context constructors of the MMQ workspace variants (native and original formats).
use super::{Context, Error, MmqWorkspace, QueuedCommand, Result, combine, original_formats_asset};
@@ -1,5 +1,5 @@
//! Functions: `digest`, `read`, `parse_pins`, `read_pinned` and 10 more.
//! Split out of `mmq_native_resident_gpu_tests` to keep its files under the line limit.
//! Fixture and measurement helpers of the native resident MMQ GPU tests: reads the pinned fixture files by
//! manifest size and sha256, moves buffers to and from the device, and reports error metrics between two outputs.
use super::{
BTreeMap, Context, DeviceBuffer, MetadataExt, OpenOptions, OpenOptionsExt, Path, PathBuf, Read, Write, finite_f32,
@@ -1,5 +1,5 @@
//! Implements `Drop for Alias`. Functions: `native_hidden_q8`.
//! Split out of `mmq_native_resident_gpu_tests` to keep its files under the line limit.
//! Independent reference for the native resident tests: runs the original CommonQuantize kernel on a real native
//! hidden row and returns its Q8 bytes. Also owns the Drop of the test Alias buffer view.
use super::{Alias, CHUNK, Context, DeviceBuffer, FixedOperation, download, ffi};
@@ -1,5 +1,5 @@
//! Methods of `Receipt`: `load`, `check_pinned_contents`, `read`.
//! Functions: `digest`, `hex`, `read_regular`, `parse_manifest` and 14 more.
//! Receipt loader of the resident MMQ GPU tests: reads the pinned fixture manifest, checks its headers, file list and
//! sha256 pins (incl. pinned contents), and offers the digest, JSON field and finite/compare helpers the cases use.
use super::{
BTreeMap, CASE_FILES, Component, Context, DeviceBuffer, MetadataExt, MmqFormat, OpenOptions, OpenOptionsExt, Path,
@@ -1,5 +1,4 @@
//! Implements `Drop for LivePacketAlias`.
//! Split out of `mmq_resident_gpu_tests` to keep its files under the line limit.
//! Drop of LivePacketAlias: puts back the original buffer handle that the alias test view had swapped out.
use super::LivePacketAlias;
@@ -1,5 +1,5 @@
//! Functions: `native_owner`, `native_gate_up_owner`, `native_down_owner`, `direct` and 2 more.
//! Split out of `mmq_resident_gpu_tests` to keep its files under the line limit.
//! Owner-equivalence checks of the resident MMQ tests: the native dual weights (gate/up prepared and grouped,
//! down columns) must produce the same bytes as the raw routed projections; plus the direct and gather checks.
use super::{
CHUNK, Context, DOWN, DeviceBuffer, DownColumns, Error, GATE, GROUP, INPUT, MmqWeights, MmqWorkspace, Receipt,
@@ -1,5 +1,5 @@
//! Methods of `LivePacketAlias`: `new`, `buffer`.
//! Functions: `chain_baseline`, `chain`, `chain_hidden_checks`, `chain_slot_checks` and 8 more.
//! The resident MMQ chain test: runs gate/up, SwiGLU and down through the workspace against the original-first
//! nonresident baseline, checks hidden rows, slot output, short and foreign packets, and the witness probes.
use super::{
Context, DOWN, DeviceBuffer, Error, FiniteMmqOutput, GATE, GROUP, HIDDEN, LivePacketAlias, MmqHidden, MmqProfile,
@@ -1,5 +1,5 @@
//! Groups the submodules `mmq_workspace_bring_up`, `mmq_workspace_gate_up_chunk_close`, `projection_plan`.
//! Split out of `resident` to keep its files under the line limit.
//! Module root of the resident MmqWorkspace: shared imports for its bring-up, gate/up chunk and projection-plan
//! files, each of which owns one phase of the workspace lifecycle.
use super::{
CHUNK, Context, DOWN, DeviceBuffer, Error, GATE, GROUP, HIDDEN, INPUT, Layout, MmqChunkActivation, MmqExperiment,
@@ -1,5 +1,5 @@
//! Methods of `MmqWorkspace`: `new`, `check_integer_policy`, `charge`, `bring_up` and 13 more.
//! Split out of `mmq_workspace` to keep its files under the line limit.
//! Construction and bring-up of the resident MmqWorkspace: charges its device budget up front, allocates the
//! eleven fixed buffers, loads the helper kernels and integer/native operators, and runs queued launches.
use super::{
Context, DeviceBuffer, Error, MmqWorkspace, QueuedCommand, Result, bytes, combine, ffi, native_activation,
@@ -1,5 +1,5 @@
//! Methods of `MmqWorkspace`: `prepare_original_gate_up_chunk`, `prepare_gate_up_chunk_with_operator`, `upload_and_q...
//! Split out of `mmq_workspace` to keep its files under the line limit.
//! Original-prompt gate/up chunk activation of the resident MmqWorkspace (affine D4 quantize, independent of the
//! native integer operators), the upload-and-quantize step it uses, and the workspace close.
use super::{CHUNK, Error, INPUT, Layout, MmqChunkActivation, MmqFormat, MmqWorkspace, Result, bytes, combine};
@@ -1,5 +1,5 @@
//! Methods of `MmqWorkspace`: `finish_finite`, `finite`, `quantize`, `quantize_with_operator` and 15 more.
//! Functions: `finite_extent`, `finite_verdict`, `finite_output_name`. Defines `StreamKLaunch`, `ProjectPlan`.
//! Projection planning of the resident MmqWorkspace: finite-output proofs, activation quantize, plan and alias
//! validation, the native integer and stream-k projection launches, and the gate/up chunk preparation.
use super::{
DOWN, Error, GATE, GROUP, HIDDEN, Layout, MmqChunkActivation, MmqExperiment, MmqFormat, MmqProfile, MmqWeights,
@@ -1,5 +1,5 @@
//! Methods of `MmqChunkActivation`: `gather_gate_up`, `gather_group`, `upload_gather_ids`, `gather_handles`.
//! Methods of `MmqGroupActivation`: `admits`, `gate_up`, `project_swiglu`, `swiglu_hidden` and 1 more.
//! Grouped activation flow of the resident MmqWorkspace: gather of expert rows, gate/up with SwiGLU, down
//! projection and bounded copies of finite Down columns into ten-slot packets. Also the Drop of the workspace.
use super::{
CHUNK, DOWN, DOWN_Q8, DeviceBuffer, DownCopyHandles, Error, FiniteMmqOutput, FixedOperation, GATE, GROUP, HIDDEN,
@@ -1,5 +1,5 @@
//! Methods of `OriginalGroupBank`: `new`, `admit_charge`, `init`, `load_guarded` and 9 more.
//! Implements `Drop for OriginalGroupBank`. Functions: `asset`, `sizes`, `original_mmq_group_bank_bytes`.
//! The OriginalGroupBank: sealed PTX per kernel kind, the eager device-budget charge, module and kernel loading,
//! buffer allocation and bounds-checked buffer/handle access for the original prompt expert groups; Drop frees them.
use super::{
Context, DeviceBuffer, Error, FORMATS, MmqFormat, OriginalGroupBank, Result, SEALED, TMP, WIDTHS, combine, ffi,
@@ -1,5 +1,5 @@
//! Methods of `Stats`: `new`. Methods of `Core`: `new`. Implements `Drop for ChunkStream`. Functions: `env_number`.
//! Defines `CoreParts`.
//! ChunkStream state for the prompt-chunk expert stream: an ordered list of expert copy entries (layer, expert)
//! feeding the ring slots, the shared Core and timing Stats, the issuer-thread setup and issue depth; Drop stops it.
use super::{
ACTIVE, Api, Arc, AtomicBool, AtomicU64, AtomicUsize, BufferHandle, ChunkStream, Core, Entry, Error, Ordering,
@@ -1,5 +1,5 @@
//! Methods of `HostStage`: `new`, `stager_sizes`, `unstarted`, `allocate_ring` and 13 more.
//! Implements `Drop for HostStage`.
//! HostStage: the page-locked ring buffers and helper threads that stage pageable experts on the host ahead of their
//! DMA, plus the STAGE_VERIFY check that a released buffer still equals its source. Drop stops helpers and frees them.
use super::{
Arc, AtomicU32, AtomicU64, AtomicUsize, Condvar, Error, HostStage, Job, MAX_JOBS, Mutex, NON_FINITE, Ordering,
@@ -1,5 +1,5 @@
//! Methods of `Shared`: `claim`, `finished`, `work`, `await_jobs` and 4 more.
//! Functions: `verify_enabled`, `layer_priority`, `apply_priority`, `block_bytes` and 1 more.
//! Helper-thread side of HostStage: the shared job claim and copy loop, the finite FP16 block-scale check of copied
//! experts, the LELEKA_STAGE_VERIFY switch and the optional Windows page-cache priority for the layers read first.
use super::{Arc, Job, NON_FINITE, NORMAL_PRIORITY, Ordering, Shared, thread};
// used only with some cargo features or targets of this crate
@@ -1,5 +1,5 @@
//! Methods of `OriginalMmqCopySchedule`: `retain_host_metadata_charge`, `ring_slots`, `prompt_stream_active`, `begin...
//! Split out of `copy_ring` to keep its files under the line limit.
//! Public control of the OriginalMmqCopySchedule: begin and end the prompt-chunk expert stream, metadata byte
//! accounting, context validation, and the ordered close of host stage, events and streams after a failure.
use super::{
ChunkStream, Context, Error, Events, OriginalGpuStream, OriginalMmqCopySchedule, Rc, Result, StreamEntry,
@@ -1,5 +1,4 @@
//! Implements `Drop for OriginalMmqCopySchedule`.
//! Split out of `copy_ring` to keep its files under the line limit.
//! Drop of OriginalMmqCopySchedule: closes the schedule so its streams, events and host stage are released.
use super::OriginalMmqCopySchedule;
@@ -1,5 +1,4 @@
//! Groups the submodules `ring_construction`, `ring_gather_and_finish`, `ring_init` and 2 more.
//! Split out of `copy_ring` to keep its files under the line limit.
//! Module root of the copy Ring: shared imports of its construction, init, prefetch, stage and gather files.
use super::{
Api, COMMAND_CAP, Command, Context, DeviceBuffer, Drain, Error, FORMATS, GatherDest, GroupArena, HostStage, Job,
@@ -1,5 +1,5 @@
//! Methods of `Ring`: `new`, `admitted_slots`. Functions: `schedule_serves_ring`.
//! Split out of `ring` to keep its files under the line limit.
//! Construction of the copy Ring: the rule that a schedule with enough slot events serves a (smaller) arena ring,
//! with its unit tests, and the admission of the arena stage slot count.
use super::{Context, Error, OriginalMmqCopySchedule, Result, Ring, RingArena, RingExperts, RingPlan, combine};
@@ -1,5 +1,5 @@
//! Methods of `Ring`: `gather`, `gather_streamed`, `gather_slot`, `check_gather_destination` and 10 more.
//! Split out of `ring` to keep its files under the line limit.
//! Gather and finish side of the copy Ring: gathers a staged expert slot into the group bank on the compute stream,
//! records the slot as used, releases a layer stream entry, and copies status words after both streams drain.
use super::{Command, DeviceBuffer, Error, GatherDest, MmqFormat, OriginalGpuStream, Result, Ring, combine, ffi};
use crate::ring_prefetch::RingRefusal;
@@ -1,5 +1,5 @@
//! Methods of `Ring`: `metadata_bytes`, `enqueue`, `flag`, `stage_one` and 10 more. Functions: `profile_copied`.
//! Split out of `ring` to keep its files under the line limit.
//! Staging side of the copy Ring: copies one expert (gate, up, down) into a ring slot from a registered bank or
//! the host stage, as page-aligned supersets or exact pieces, and records its copied event and PCIe profile.
use super::{
Api, COMMAND_CAP, Command, Drain, Error, MmqFormat, OriginalGpuEvent, OriginalGpuStream, ResidentExpertBankSpan,
@@ -1,5 +1,4 @@
//! Implements `Drop for Ring`.
//! Split out of `copy_ring` to keep its files under the line limit.
//! Drop of the copy Ring: runs the ordered close so the ring slots, events and host stage are released.
use super::Ring;
@@ -1,5 +1,5 @@
//! Methods of `ChunkStream`: `entry`, `next_layer_is`, `entry_matches`, `acquire` and 3 more.
//! Methods of `Drain`: `index`. Implements `RingArena for OriginalDeviceGrRead`.
//! Diagnostic switches of the copy ring (skip expert DMA, serialize ring), non-CUDA stubs of ChunkStream, the
//! RingArena view of OriginalDeviceGrRead, and Context::original_mmq_copy_schedule, which opens its streams and events.
use super::{
Api, Context, Drain, Error, Events, OriginalEventKind, OriginalMmqCopySchedule, OriginalStreamKind, Rc, Result,
@@ -1,5 +1,5 @@
//! Methods of `Context`: `native_integer_iq3_mmq_original_grouped_workspace`.
//! Implements `GroupArena for OriginalDeviceGrRead`. Functions: `kind`, `shared`, `format_index`, `layout` and 1 more.
//! Format tables of the original grouped MMQ path (kernel kind, shared memory, format index, layout), the Context
//! constructor of the grouped workspace, and the GroupArena span view of the prompt arena.
use super::{
BOUNDS, Context, D, Error, FORMATS, GU, GroupArena, H, HQ, IDENTITY, Layout, MmqFormat, MmqWorkspace,

Some files were not shown because too many files have changed in this diff Show More