Merge main into claude/debt-rename

This commit is contained in:
Pavlo Ratushnyi
2026-11-14 20:36:02 +01:00
744 changed files with 1218 additions and 2517 deletions
+2 -57
View File
@@ -3,80 +3,25 @@
"violations": [],
"oversize": {},
"source": {
"allow-unused-imports:leleka-cpu-sys": 35,
"allow-unused-imports:leleka-cuda-driver": 410,
"allow-unused-imports:leleka-engine-core": 18,
"allow-unused-imports:leleka-engine-qwen35-cuda": 166,
"allow-unused-imports:leleka-experimental-ref": 1,
"allow-unused-imports:leleka-harmony": 2,
"allow-unused-imports:leleka-igpu": 2,
"allow-unused-imports:leleka-model-format": 22,
"allow-unused-imports:leleka-native-cpu-expert": 75,
"allow-unused-imports:leleka-tokenizer": 3,
"dyn-trait:leleka-cpu-worker": 4,
"dyn-trait:leleka-cuda-driver": 45,
"dyn-trait:leleka-cuda-model": 3,
"dyn-trait:leleka-engine-core": 18,
"dyn-trait:leleka-engine-fake": 1,
"dyn-trait:leleka-engine-qwen35-cuda": 53,
"dyn-trait:leleka-experimental-ref": 3,
"dyn-trait:leleka-gptoss": 10,
"dyn-trait:leleka-gptoss-igpu": 3,
"dyn-trait:leleka-gptoss-npu": 3,
"dyn-trait:leleka-gpu-npu-worker": 5,
"dyn-trait:leleka-memory": 12,
"dyn-trait:leleka-model-format": 8,
"dyn-trait:leleka-tokenizer": 1,
"env-read:leleka-cpu-kernels": 1,
"env-read:leleka-cpu-worker": 2,
"env-read:leleka-cuda-driver": 2,
"env-read:leleka-cuda-model": 2,
"env-read:leleka-engine-qwen35-cuda": 1,
"env-read:leleka-gptoss": 1,
"env-read:leleka-gptoss-npu": 1,
"env-read:leleka-gpu-npu-worker": 2,
"env-read:leleka-igpu": 1,
"env-read:leleka-libc-shim": 3,
"env-read:leleka-memory": 2,
"env-read:leleka-memory-os": 1,
"env-read:leleka-model-format": 1,
"env-read:leleka-native-cpu-expert": 2,
"env-read:leleka-native-parity-bench": 1,
"env-read:leleka-npu-worker": 1,
"env-read:leleka-obs": 2,
"env-read:leleka-tokenizer": 2,
"env-read:leleka-control-plane": 3,
"glob-super-import:leleka-cuda-driver": 3,
"glob-super-import:leleka-cuda-driver": 2,
"glob-super-import:leleka-engine-qwen35-cuda": 70,
"instant-now:leleka-cpu-worker": 9,
"instant-now:leleka-cuda-driver": 25,
"instant-now:leleka-engine-qwen35-cuda": 16,
"instant-now:leleka-gptoss": 4,
"instant-now:leleka-gptoss-igpu": 5,
"instant-now:leleka-gptoss-npu": 12,
"instant-now:leleka-gpu-npu-worker": 4,
"instant-now:leleka-igpu": 1,
"instant-now:leleka-memory": 1,
"instant-now:leleka-model-format": 10,
"instant-now:leleka-native-cpu-expert": 27,
"instant-now:leleka-obs": 3,
"instant-now:leleka-control-plane": 15,
"instant-now:leleka-engine-host": 4,
"path-include:leleka-cuda-driver": 118,
"path-include:leleka-engine-qwen35-cuda": 1,
"path-include:leleka-model-format": 12,
"path-include:leleka-native-cpu-expert": 2,
"path-include:leleka-cuda-driver": 1,
"process-global:leleka-cuda-driver": 96,
"process-global:leleka-cuda-model": 10,
"process-global:leleka-engine-qwen35-cuda": 59,
"process-global:leleka-gptoss-npu": 2,
"process-global:leleka-libc-shim": 12,
"process-global:leleka-memory": 6,
"process-global:leleka-memory-os": 2,
"process-global:leleka-model-format": 8,
"process-global:leleka-native-cpu-expert": 27,
"process-global:leleka-obs": 6,
"process-global:leleka-tokenizer": 4,
"process-global:leleka-control-plane": 2
},
"mechanical_names": []
+81 -1
View File
@@ -51,10 +51,90 @@
},
"_exceptions": "Sites that must stay, so the ratchet is zero outside this list (STRA-338 stage 10). Each entry: crate, file (relative to the crate directory), ratchet (a source_patterns id), reason. The file's hits of that ratchet are not counted; an entry that excuses nothing is an error.",
"exceptions": [
{"crate": "leleka-cuda-model", "file": "src/env_switch.rs", "ratchet": "env-read", "reason": "EnvSwitch is the one reader of the operator environment in this crate: it reads one named variable on the first get() and applies a typed rule"},
{"crate": "leleka-cuda-model", "file": "src/env_switch.rs", "ratchet": "process-global", "reason": "the OnceLock inside EnvSwitch caches the switch position for the process life (an immutable operator setting; a hot path pays one atomic load)"},
{"crate": "leleka-cuda-model", "file": "src/serving_context.rs", "ratchet": "process-global", "reason": "the serving context and the resident KV window are fixed once at engine start (configure_*) and read by every kernel geometry; injecting them through every owner is the settings follow-up of S13"},
{"crate": "leleka-cpu-worker", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-tokenizer", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-gptoss-npu", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-gpu-npu-worker", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-igpu", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-memory", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-gptoss", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-model-format", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: it returns the operator's switches as typed values"},
{"crate": "leleka-obs", "file": "src/level.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: LELEKA_LOG* parsed once into Settings, and the request-log path"},
{"crate": "leleka-cuda-driver", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate; call sites still parse the text they ask for (typed switches: EnvSwitch in leleka-cuda-model, in progress on claude/debt-hot-low)"},
{"crate": "leleka-native-cpu-expert", "file": "src/settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate; call sites still parse the text they ask for (CPU expert pool: hot path, in progress on claude/debt-hot-low)"},
{"crate": "leleka-cpu-kernels", "file": "src/dispatch.rs", "ratchet": "env-read", "reason": "the one reader of the process environment in this crate: ISA_ENV is parsed by Isa::from_request into the selected instruction set"},
{"crate": "leleka-libc-shim", "file": "src/cuda_trace/trace_state.rs", "ratchet": "env-read", "reason": "Windows interposer (FFI): the CUDA call tracer reads its own LELEKA_BRINGUP_TRACE switches and must not depend on other crates"},
{"crate": "leleka-libc-shim", "file": "src/lib.rs", "ratchet": "env-read", "reason": "Windows interposer (FFI): the DLL search directories come from the process environment before any other crate can load"},
{"crate": "leleka-memory-os", "file": "src/heap.rs", "ratchet": "env-read", "reason": "platform adapter (glibc heap): reads its own LELEKA_MEMORY_NO_TRIM switch once"},
{"crate": "leleka-native-parity-bench", "file": "src/lib.rs", "ratchet": "env-read", "reason": "benchmark host (L4): reads the operator's STRATA_IQ_MT_MIN override to report which value it measured"},
{"crate": "leleka-npu-worker", "file": "src/main.rs", "ratchet": "env-read", "reason": "worker binary (composition root): reads LELEKA_OPENVINO_ROOT into its configuration"},
{"crate": "leleka-memory", "file": "src/settings.rs", "ratchet": "process-global", "reason": "the cached LELEKA_NO_TRIM_FILE path: an immutable operator setting read once by the crate's one environment reader"},
{"crate": "leleka-memory", "file": "src/governor.rs", "ratchet": "process-global", "reason": "Governor::global(): the process-wide memory governor installed once at engine start; its injection through the engine stack (S13/S14) belongs to the engine crate"},
{"crate": "leleka-memory", "file": "src/inventory.rs", "ratchet": "process-global", "reason": "Inventory::global(): the process-wide census of live mappings and pinned regions, filled by the loaders; injected with the governor (S13/S14)"},
{"crate": "leleka-memory", "file": "src/governor.rs", "ratchet": "dyn-trait", "reason": "port boundary: the Governor holds its MemoryPressure adapter as Arc<dyn MemoryPressure>, chosen at start-up (hexagonal.md, ports table)"},
{"crate": "leleka-memory", "file": "src/governor/operations/setup.rs", "ratchet": "dyn-trait", "reason": "port boundary: Governor::new takes the host as Arc<dyn ProcSource + Send + Sync> (the adapter is chosen by the composition root) and source() hands it back"},
{"crate": "leleka-memory", "file": "src/lock/page_locking.rs", "ratchet": "dyn-trait", "reason": "port boundary: SharedPageLocking = Arc<dyn PageLocking>, the OS adapter of mmap/mlock chosen by the composition root"},
{"crate": "leleka-memory", "file": "src/telemetry.rs", "ratchet": "dyn-trait", "reason": "port boundary: the GPU probe is a closure chosen at start-up (nvidia-smi or NVML) and owned by the sampler thread"},
{"crate": "leleka-memory", "file": "src/smi.rs", "ratchet": "dyn-trait", "reason": "port boundary: the nvidia-smi probe closure handed to the telemetry sampler (see telemetry.rs)"},
{"crate": "leleka-cpu-worker", "file": "src/engine.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: load and prefill wall-time measurement, reported in the worker's timing line"},
{"crate": "leleka-cpu-worker", "file": "src/serve.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-request wall-time measurement (prefill and decode), reported in the worker's timing line"},
{"crate": "leleka-cpu-worker", "file": "src/serve/decode_loop.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-token lap timers of the decode loop; one reading per lap, summed into the timing line"},
{"crate": "leleka-gptoss", "file": "src/forward_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: per-pass lap timer inside the forward pass; one reading per lap, summed into the timing report"},
{"crate": "leleka-gptoss", "file": "src/generation.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: generation wall-time measurement for the timing report"},
{"crate": "leleka-gptoss-igpu", "file": "src/prefill_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of one prefill pass, reported with the pass"},
{"crate": "leleka-gptoss-igpu", "file": "src/prefill_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the iGPU prefill, reported in the timing line"},
{"crate": "leleka-gptoss-npu", "file": "src/expert_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the NPU expert pass, reported in the timing line"},
{"crate": "leleka-gptoss-npu", "file": "src/prefill_batch.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: stage lap timers of the NPU prefill batch, reported in the timing line"},
{"crate": "leleka-gptoss-npu", "file": "src/prefill_part_pass.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of one NPU prefill part, reported with the pass"},
{"crate": "leleka-gptoss-npu", "file": "src/service_transfers.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: transfer wall-time measurement toward the NPU service"},
{"crate": "leleka-gpu-npu-worker", "file": "src/lib.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the split prefill passes, reported in the timing line"},
{"crate": "leleka-gpu-npu-worker", "file": "src/split_run.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: lap timers of the GPU and NPU legs of the split prefill"},
{"crate": "leleka-igpu", "file": "src/matrices_and_moe_plan.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the weight upload, reported at load"},
{"crate": "leleka-npu-service", "file": "src/engine/execution.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: lap timers of one NPU execution, summed into the profile report"},
{"crate": "leleka-model-format", "file": "src/bulk_read/for_each_chunk.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the bulk read, reported in the load report"},
{"crate": "leleka-model-format", "file": "src/huge_pages.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of the huge-page allocation probe, reported in the load report"},
{"crate": "leleka-model-format", "file": "src/kar/independent_handles.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: wall-time measurement of opening the independent file handles"},
{"crate": "leleka-model-format", "file": "src/pinned_arena_plan/expert_parallel_load.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: read and copy lap timers of the expert load, reported in the load report"},
{"crate": "leleka-model-format", "file": "src/ple_reader/read_queue.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: readings of the per-row read queue's latency window, inside the reader loop"},
{"crate": "leleka-model-format", "file": "src/ple_reader/row_reading.rs", "ratchet": "instant-now", "reason": "measurement timer, not decision logic: latency measurement of one PLE row read, inside the reader loop"},
{"crate": "leleka-obs", "file": "src/time/clock.rs", "ratchet": "instant-now", "reason": "the clock adapter itself: SystemClock, AnyClock and ManualClock are the one place that reads the monotonic clock"},
{"crate": "leleka-memory-os", "file": "src/heap.rs", "ratchet": "process-global", "reason": "platform adapter (glibc heap): the LELEKA_MEMORY_NO_TRIM switch is read once and cached"},
{"crate": "leleka-libc-shim", "file": "src/cuda_trace/trace_state.rs", "ratchet": "process-global", "reason": "Windows interposer (FFI): the CUDA call tracer is process-wide state behind C-ABI hooks that carry no context pointer"},
{"crate": "leleka-obs", "file": "src/lib.rs", "ratchet": "process-global", "reason": "the logger is process-wide: its Settings, rate limiter and request sink are built once from the environment"},
{"crate": "leleka-obs", "file": "src/write_stderr.rs", "ratchet": "process-global", "reason": "the request-log sink of the process-wide logger (see lib.rs)"},
{"crate": "leleka-tokenizer", "file": "src/lib.rs", "ratchet": "process-global", "reason": "immutable constant tables built once: the pre-tokenizer regex and the character classes"},
{"crate": "leleka-gptoss-npu", "file": "src/half.rs", "ratchet": "process-global", "reason": "immutable constant table: the half-to-float conversion table, built once"},
{"crate": "leleka-cuda-model", "file": "src/original_prefill_schedule.rs", "ratchet": "dyn-trait", "reason": "parameter struct SourceView borrows three residency queries (resident, pinned, transient) from the caller's tables; a generic parameter per closure would make the type unnameable in the callers' signatures"},
{"crate": "leleka-experimental-ref", "file": "src/remote_experts.rs", "ratchet": "dyn-trait", "reason": "parameter struct Candidates borrows the primary's residency test from the caller's table; generic parameters would leak into every caller's signature"},
{"crate": "leleka-cpu-worker", "file": "src/engine.rs", "ratchet": "dyn-trait", "reason": "port boundary: the engine holds the prefill accelerator (iGPU, NPU or split) as Box<dyn PrefillAccelerator + Send>, chosen by the worker binary"},
{"crate": "leleka-cpu-worker", "file": "src/serve.rs", "ratchet": "dyn-trait", "reason": "dyn-compatible worker trait: the progress callback of a trait method must be a trait object"},
{"crate": "leleka-gptoss", "file": "src/state_and_cache.rs", "ratchet": "dyn-trait", "reason": "port boundary: PrefillAccelerator and LayerCache are the accelerator seams, chosen by the worker binary; their methods take the progress callback as a trait object"},
{"crate": "leleka-gptoss", "file": "src/model.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
{"crate": "leleka-gptoss", "file": "src/tensor_loading.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
{"crate": "leleka-gptoss", "file": "src/weights.rs", "ratchet": "dyn-trait", "reason": "port boundary: the model's weights read through Arc<dyn ModelBytes> (file, memory map or test bytes), chosen when the model is loaded"},
{"crate": "leleka-gptoss", "file": "src/pool.rs", "ratchet": "dyn-trait", "reason": "the worker pool runs heterogeneous closures: Box<dyn FnOnce + Send> is the type-erased job of its queue"},
{"crate": "leleka-gptoss-igpu", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure and the PrefillAccelerator impl (trait objects by the trait's own signature)"},
{"crate": "leleka-gptoss-npu", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure chosen by the worker binary"},
{"crate": "leleka-gptoss-npu", "file": "src/accelerator.rs", "ratchet": "dyn-trait", "reason": "PrefillAccelerator impl: the progress callback is a trait object by the trait's own signature"},
{"crate": "leleka-gpu-npu-worker", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "port boundary: the memory probe closure, the LayerCache seam and the PrefillAccelerator impl (trait objects by the traits' own signatures)"},
{"crate": "leleka-tokenizer", "file": "src/lib.rs", "ratchet": "dyn-trait", "reason": "Result<T, Box<dyn Error>> of the public tokenizer API: the error is the std error object at the library boundary"},
{"crate": "leleka-model-format", "file": "src/gguf.rs", "ratchet": "dyn-trait", "reason": "Result<T, Box<dyn Error>> of the GGUF reader's public API: the std error object at the library boundary"},
{"crate": "leleka-model-format", "file": "src/qwen4exp.rs", "ratchet": "dyn-trait", "reason": "the artifact error wraps any std error (Box<dyn Error>) from the byte sources it reads through"},
{"crate": "leleka-model-format", "file": "src/qwen4exp/binding_topology.rs", "ratchet": "dyn-trait", "reason": "std::error::Error::source() returns &(dyn Error + 'static) by the trait's own signature"},
{"crate": "leleka-model-format", "file": "src/ple_reader.rs", "ratchet": "dyn-trait", "reason": "port boundary: the PLE reader holds its PageSource (file, direct-IO file or test double) as Arc<dyn PageSource>"},
{"crate": "leleka-model-format", "file": "src/ple_reader/row_reading.rs", "ratchet": "dyn-trait", "reason": "port boundary: PleReader::open takes the PageSource as Arc<dyn PageSource>"},
{"crate": "leleka-model-format", "file": "src/huge_pages.rs", "ratchet": "process-global", "reason": "the huge-page mode is an operator setting parsed once from LELEKA_HUGEPAGES and cached for the process"},
{"crate": "leleka-model-format", "file": "src/kar/independent_handles.rs", "ratchet": "process-global", "reason": "the identity-recheck switch is an operator setting parsed once and cached for the process"},
{"crate": "leleka-model-format", "file": "src/kar.rs", "ratchet": "process-global", "reason": "a per-instance lazily opened set of file handles (a OnceLock field of the archive), not a process global"},
{"crate": "leleka-model-format", "file": "src/kar/verified_kar_ple_artifact.rs", "ratchet": "process-global", "reason": "constructs the per-instance lazy handle cell of kar.rs, not a process global"},
{"crate": "leleka-model-format", "file": "src/verify_stamp.rs", "ratchet": "process-global", "reason": "the process-wide registry of verified-file stamps, written by the loaders and read by the identity re-checks; its injection belongs to the loader stack (S13)"},
{"crate": "leleka-control-plane", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (number, path, flag, mode)"},
{"crate": "leleka-deploy", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: every variable is parsed here into a typed value (path, flag, text)"},
{"crate": "leleka-engine-host", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate and its binaries: credentials by name, the evaluation switches, the inherited child variables"},
{"crate": "leleka-gateway-text", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the two prompt rendering switches"},
{"crate": "leleka-gateway-text", "file": "src/prompt/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the two prompt rendering switches"},
{"crate": "leleka-npu-service", "file": "src/env_settings.rs", "ratchet": "env-read", "reason": "the one reader of the process environment of the crate: the profile report switch"},
{"crate": "leleka-control-plane", "file": "src/adapters/system_clock.rs", "ratchet": "instant-now", "reason": "the production Clock adapter: the one place that reads the runtime clock for the injected Clock port"},
{"crate": "leleka-control-plane", "file": "src/ports/fakes/clock.rs", "ratchet": "instant-now", "reason": "test fixture: the manual clock needs one base instant to count from and never moves by itself"},
-2
View File
@@ -127,8 +127,6 @@ pub struct EngineResidentEstimate {
mod tests;
mod geometry_sizes;
#[allow(unused_imports)]
pub use geometry_sizes::*;
mod per_token_plan;
#[allow(unused_imports)]
pub use per_token_plan::*;
-3
View File
@@ -166,11 +166,8 @@ pub enum SetupRopeError {
mod tests;
mod rope_scaling_type;
#[allow(unused_imports)]
pub use rope_scaling_type::*;
mod rope_table;
#[allow(unused_imports)]
pub use rope_table::*;
mod setup_rope_error_and_resolve;
#[allow(unused_imports)]
pub use setup_rope_error_and_resolve::*;
@@ -2,7 +2,6 @@
//! yarn_is_observably_different_from_none, strata_plan_cli_output_is_reproduced_exactly,
//! kv_pool_bytes_match_the_originals_layer_cpp.
#[allow(unused_imports)]
use super::*;
#[test]
-37
View File
@@ -84,92 +84,55 @@ mod ffi {
}
mod abi_version;
#[allow(unused_imports)]
pub use abi_version::abi_version;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::avxvnni_available;
#[allow(unused_imports)]
use abi_version::check_i4;
#[allow(unused_imports)]
use abi_version::check_i8;
#[allow(unused_imports)]
use abi_version::check_mx;
#[allow(unused_imports)]
use abi_version::check_mx_out;
#[allow(unused_imports)]
use abi_version::check_q8;
#[allow(unused_imports)]
use abi_version::check_q8r;
#[allow(unused_imports)]
use abi_version::check_quantize;
#[allow(unused_imports)]
pub use abi_version::dot_i4i8_scalar;
#[allow(unused_imports)]
pub use abi_version::dot_i8i8_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8_0_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8_0_avxvnni;
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8_0_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8r_avx2;
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8r_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8r4_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::dot_mxfp4_q8r4_avxvnni;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::mxfp4_q8_0_isums_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use abi_version::mxfp4_q8_0_isums_avxvnni;
#[allow(unused_imports)]
pub use abi_version::mxfp4_q8_0_isums_scalar;
mod quantize_q8_0_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_i4i8_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_i4i8_avxvnni;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_i8i8_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_i8i8_avxvnni;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_q8_0_q8_0_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_q8_0_q8_0_avxvnni;
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::dot_q8_0_q8_0_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::f32_to_f16_bits_f16c;
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::f32_to_f16_bits_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::q8_0_q8_0_isums_avx2;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::q8_0_q8_0_isums_avxvnni;
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::q8_0_q8_0_isums_scalar;
#[cfg(target_arch = "x86_64")]
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::quantize_q8_0_avx2;
#[allow(unused_imports)]
pub use quantize_q8_0_scalar::quantize_q8_0_scalar;
+2 -1
View File
@@ -174,6 +174,7 @@ pub fn load(options: &LoadOptions) -> Result<Loaded, String> {
let stop_tokens = stop_tokens_of(&tokenizer)?;
let mapping = Mapping::open(options.model).map_err(|e| format!("cannot map the model: {e}"))?;
if options.warm {
// Measurement timer, not decision logic (instant-now exception in architecture.json).
let started = Instant::now();
let checksum = mapping.touch_pages();
eprintln!(
@@ -225,7 +226,7 @@ impl GptOssEngine {
max_slots: 1,
active: 0,
clock: 0,
log_slots: std::env::var_os("LELEKA_SLOT_LOG").is_some(),
log_slots: crate::settings::slot_log_enabled(),
context,
accelerator: None,
accelerate_from: usize::MAX,
+1
View File
@@ -4,4 +4,5 @@
pub mod engine;
pub mod protocol;
pub mod serve;
mod settings;
pub mod slots;
+1
View File
@@ -221,6 +221,7 @@ fn generate<D: Decoder, W: Write>(
output: &Mutex<W>,
) -> Result<(), GenerationError> {
check_budget(decoder, request)?;
// Measurement timer, not decision logic (instant-now exception in architecture.json).
let started = Instant::now();
let reused = prefill_prompt(decoder, request, control, output)?;
let prompt_ms = started.elapsed().as_secs_f64() * 1000.0;
+2 -1
View File
@@ -54,6 +54,7 @@ impl Speculation {
self.abandon_pending(decoder, times);
}
self.logits = None;
// Measurement timer, not decision logic (instant-now exception in architecture.json).
let lap = Instant::now();
let mut drafts = self.drafter.draft(&self.history);
times.draft += lap.elapsed();
@@ -193,7 +194,7 @@ impl Decoding {
/// The diagnostics line of `LELEKA_SPECULATION_LOG`, when set.
pub(super) fn log(&self, decode_started: Instant) {
if std::env::var_os("LELEKA_SPECULATION_LOG").is_none() {
if !crate::settings::speculation_log_enabled() {
return;
}
if let Some(s) = self.speculation.as_ref().filter(|s| s.batches > 0) {
+11
View File
@@ -0,0 +1,11 @@
//! The only place of this crate that reads the process environment: the operator's logging switches, as typed values.
/// `LELEKA_SLOT_LOG` is set: print the slot reuse decisions.
pub(crate) fn slot_log_enabled() -> bool {
std::env::var_os("LELEKA_SLOT_LOG").is_some()
}
/// `LELEKA_SPECULATION_LOG` is set: print the speculation diagnostics line after each generation.
pub(crate) fn speculation_log_enabled() -> bool {
std::env::var_os("LELEKA_SPECULATION_LOG").is_some()
}
@@ -1,6 +1,5 @@
//! Engine failure, quit, a broken output pipe, and speculative decoding with rollback.
#[allow(unused_imports)]
use super::*;
#[test]
@@ -1,6 +1,5 @@
//! Streaming a generation to its stop token or budget, prefix reuse, cancellation by stop, and reported errors.
#[allow(unused_imports)]
use super::*;
#[test]
-1
View File
@@ -43,5 +43,4 @@ mod async_api;
any(target_os = "linux", target_os = "windows"),
target_pointer_width = "64"
)))]
#[allow(unused_imports)]
pub(crate) use async_api::page_size;
+2 -13
View File
@@ -230,32 +230,21 @@ mod tests {
}
mod stream_k_off;
#[allow(unused_imports)]
pub(crate) use stream_k_off::cc_major_ok;
#[allow(unused_imports)]
pub(crate) use stream_k_off::chunk_drain;
#[allow(unused_imports)]
#[cfg(all(test, feature = "sm86"))]
pub(crate) use stream_k_off::companion_cc;
#[cfg(feature = "sm86")]
#[allow(unused_imports)]
#[cfg(all(test, feature = "sm86"))]
pub(crate) use stream_k_off::companion_for;
#[allow(unused_imports)]
pub(crate) use stream_k_off::forced_sms;
#[cfg(not(feature = "sm86"))]
#[allow(unused_imports)]
pub(crate) use stream_k_off::image;
#[cfg(feature = "sm86")]
#[allow(unused_imports)]
pub(crate) use stream_k_off::image;
#[allow(unused_imports)]
pub(crate) use stream_k_off::latch_stream_k_policy;
#[cfg(feature = "sm86")]
#[allow(unused_imports)]
pub(crate) use stream_k_off::loadable;
#[allow(unused_imports)]
pub(crate) use stream_k_off::mmq_cc_ok;
#[cfg(feature = "sm86")]
#[allow(unused_imports)]
pub(crate) use stream_k_off::native_sm120;
#[allow(unused_imports)]
pub(crate) use stream_k_off::stream_k_off;
@@ -358,5 +358,4 @@ impl Drop for PendingOwnedCopy<'_> {
}
#[cfg(test)]
#[path = "async_owned_copy_gpu.rs"]
mod gpu;
-11
View File
@@ -184,24 +184,13 @@ pub struct SBytes {
mod tests;
mod program;
#[allow(unused_imports)]
pub use program::admit;
#[allow(unused_imports)]
pub use program::admit_ptx;
#[allow(unused_imports)]
pub use program::conforms;
#[allow(unused_imports)]
pub use program::flash_bytes;
#[allow(unused_imports)]
pub use program::flash_slots;
#[allow(unused_imports)]
pub use program::poison_slots;
#[allow(unused_imports)]
use program::s_activation_bytes;
#[allow(unused_imports)]
pub use program::s_gemv_entry_index;
#[allow(unused_imports)]
pub use program::s_operand_bytes;
mod s_gemv_slots;
#[allow(unused_imports)]
pub use s_gemv_slots::s_gemv_slots;
@@ -64,7 +64,5 @@ fn arg_kinds(entry: &Entry) -> Vec<&'static str> {
.collect()
}
#[path = "tests/flash_and_poison_signatures_match.rs"]
mod flash_and_poison_signatures_match;
#[path = "tests/sealed_assets_match_their_pins.rs"]
mod sealed_assets_match_their_pins;
@@ -104,6 +104,5 @@ struct Launch {
}
mod failure;
#[allow(unused_imports)]
use failure::failure;
mod closed_kernels;
@@ -94,23 +94,13 @@ fn closed_gpu_s_gemv_matches_the_shim_executed_golden() {
ctx.close().unwrap();
}
#[path = "closed_kernels_gpu_smoke/cases.rs"]
mod cases;
#[path = "closed_kernels_gpu_smoke/rng.rs"]
mod rng;
#[allow(unused_imports)]
use rng::download;
#[allow(unused_imports)]
use rng::f16_bits;
#[allow(unused_imports)]
use rng::f32s;
#[allow(unused_imports)]
use rng::json_bytes;
#[allow(unused_imports)]
use rng::json_f32;
#[allow(unused_imports)]
use rng::open;
#[allow(unused_imports)]
use rng::upload;
#[allow(unused_imports)]
use rng::zero_kv;
+3 -3
View File
@@ -226,8 +226,9 @@ mod device {
}
}
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
#[allow(unused_imports)]
pub(crate) use device::{begin, finish, pending, resolve};
pub(crate) use device::{begin, finish, resolve};
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
pub(crate) use device::pending;
#[cfg(not(all(
feature = "cuda-driver",
@@ -263,7 +264,6 @@ pub(crate) use unsupported::{begin, finish, pending, resolve};
any(target_os = "linux", target_os = "windows"),
target_pointer_width = "64"
))]
#[path = "deferred_status_gpu.rs"]
mod gpu_tests;
#[cfg(test)]
+9 -9
View File
@@ -61,21 +61,21 @@ fn a_handle_to_a_slab_range_keeps_the_slab_alive_after_the_allocator_released_it
#[test]
fn the_window_and_journal_modules_never_clone_a_handle() {
let window_ops = [
include_str!("../original_verify_window_ops.rs"),
include_str!("../original_verify_window_ops/gdn_stages.rs"),
include_str!("../original_verify_window_ops/window_launches.rs"),
include_str!("../original_verify_window_ops/qsa_prelude_ops.rs"),
include_str!("../original_verify_window_ops/side_qsa_branches.rs"),
include_str!("../original_verify_window_ops/side_shared_expert.rs"),
include_str!("../original_verify_window_ops/window_ops_kernels_and_pcie_plan.rs"),
include_str!("../original_verify/window_ops.rs"),
include_str!("../original_verify/window_ops/gdn_stages.rs"),
include_str!("../original_verify/window_ops/window_launches.rs"),
include_str!("../original_verify/window_ops/qsa_prelude_ops.rs"),
include_str!("../original_verify/window_ops/side_qsa_branches.rs"),
include_str!("../original_verify/window_ops/side_shared_expert.rs"),
include_str!("../original_verify/window_ops/window_ops_kernels_and_pcie_plan.rs"),
];
let journals = [
include_str!("../original_verify/original_verify_gdn_journal/verify_gdn_fused_step.rs"),
include_str!("../original_verify/original_verify_gdn_journal/verify_gdn_journal_ladder_logits_scan.rs"),
include_str!("../original_verify/original_verify_gdn_journal/verify_gdn_journal_stage_and_commit.rs"),
include_str!("../original_verify/original_verify_gdn_journal/verify_gdn_journal_window_launches.rs"),
include_str!("../qsa_verification_commit/verify_qsa_journal_capture_commit.rs"),
include_str!("../qsa_verification_commit/verify_qsa_journal_index_image.rs"),
include_str!("../qsa_prompt_index/resident_index/verification_commit/verify_qsa_journal_capture_commit.rs"),
include_str!("../qsa_prompt_index/resident_index/verification_commit/verify_qsa_journal_index_image.rs"),
];
for source in window_ops.iter().chain(journals.iter()) {
let code = source.split("#[cfg(test)]").next().unwrap_or(source);
-23
View File
@@ -305,48 +305,25 @@ pub(crate) struct LoadedProgram {
mod tests;
mod mode;
#[allow(unused_imports)]
pub use mode::admit;
#[allow(unused_imports)]
pub use mode::admit_ptx;
#[allow(unused_imports)]
use mode::grid_x;
#[allow(unused_imports)]
use mode::grid_yz;
#[allow(unused_imports)]
pub(crate) use mode::invalid;
#[allow(unused_imports)]
pub use mode::source_is_sealed;
mod kv_shape;
#[allow(unused_imports)]
pub use kv_shape::attn_chunk_grid;
#[allow(unused_imports)]
pub use kv_shape::attn_merge_grid;
#[allow(unused_imports)]
pub use kv_shape::attn_scratch_floats;
#[allow(unused_imports)]
pub use kv_shape::check_stream_resolve;
#[allow(unused_imports)]
pub use kv_shape::copy_u4_grid;
#[allow(unused_imports)]
pub use kv_shape::cvec_grid;
#[allow(unused_imports)]
pub use kv_shape::fwht_bytes;
#[allow(unused_imports)]
pub use kv_shape::fwht_grid;
#[allow(unused_imports)]
pub use kv_shape::keyless_grid;
#[allow(unused_imports)]
pub use kv_shape::keyless_matrices_bytes;
#[allow(unused_imports)]
pub use kv_shape::q4_batch_grid;
#[allow(unused_imports)]
pub use kv_shape::q4_gather_grid;
#[allow(unused_imports)]
pub use kv_shape::q4_step_grid;
#[allow(unused_imports)]
pub use kv_shape::q8_gather_grid;
#[allow(unused_imports)]
pub use kv_shape::q8_step_grid;
#[allow(unused_imports)]
use kv_shape::stream_error_text;
@@ -110,12 +110,9 @@ struct Call<'g, 'c> {
mod context;
mod operands;
#[allow(unused_imports)]
use context::i32_of;
#[allow(unused_imports)]
use context::i64_of;
pub use operands::*;
mod facade_launches;
mod stream_map;
#[allow(unused_imports)]
use stream_map::failure;
-10
View File
@@ -8,7 +8,6 @@
//! a fixed export ABI from the newer alias.
use crate::{DenseFormat, Error, FixedOperation, ProjectionKind, Result, RoutedFormat};
#[path = "mmq_original_enqueue_ffi.rs"]
pub(crate) mod original_enqueue;
#[derive(Clone, Copy, PartialEq, Eq)]
@@ -94,7 +93,6 @@ pub(crate) struct Q5ProjectionArguments {
storage: std::ptr::NonNull<Q5ProjectionStorage>,
}
#[path = "mmq_ffi.rs"]
mod mmq_abi;
pub(crate) use mmq_abi::{
Iq3NativeIntegerArguments, MmqArguments, MmqFixupArguments, MmqGatherShape, MmqGroupBuffers, MmqGroupRouting,
@@ -103,7 +101,6 @@ pub(crate) use mmq_abi::{
// Closed kernel-parameter storage of the Strata-prefill GDN / native dequant modules.
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))]
#[path = "gdn_native_batch_abi.rs"]
mod gdn_native_abi;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))]
pub(crate) use gdn_native_abi::{GdnPrefillArguments, KernelArg};
@@ -143,29 +140,22 @@ struct HeadGreedyStorage {
pub(crate) struct HeadGreedyArguments(std::ptr::NonNull<HeadGreedyStorage>);
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
#[path = "original_expert_stager_ffi.rs"]
pub(crate) mod original_stager;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
#[path = "original_file_expert_source_ffi.rs"]
pub(crate) mod original_file_source;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
#[path = "deferred_status_ffi.rs"]
pub(crate) mod deferred_status;
mod context_handle;
#[allow(unused_imports)]
pub(crate) use context_handle::projection_available;
#[allow(unused_imports)]
use context_handle::projection_entry;
#[allow(unused_imports)]
use context_handle::projection_ptx;
#[cfg(any(
test,
all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64")
))]
#[allow(unused_imports)]
use context_handle::validate_projection_ptx;
mod api;
mod function_handle;
@@ -3,7 +3,6 @@
use super::{BufferHandle, DenseFormat, Error, ProjectionKind, Result, RoutedFormat};
// used only with some cargo features or targets of this crate
#[allow(unused_imports)]
use super::ModuleHandle;
#[cfg(all(
@@ -106,7 +106,6 @@ macro_rules! symbol {
include!("../kar_decode_levels_ffi.rs");
mod library_drop;
#[allow(unused_imports)]
use library_drop::check;
mod api;
mod device_context_memory_copies;
@@ -7,7 +7,6 @@ use super::{
Q6ProjectionArguments, Q6ProjectionStorage, Q8QuantizeArguments, Q8QuantizeStorage,
};
// used only with some cargo features or targets of this crate
#[allow(unused_imports)]
use super::{Error, FunctionHandle, Result};
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64", feature = "cuda-driver"))]
@@ -54,11 +54,7 @@ pub(crate) struct MmqGatherShape {
pub(crate) blocks: u32,
}
#[path = "mmq_ffi/owned.rs"]
mod owned;
#[allow(unused_imports)]
use owned::fastdiv;
#[path = "mmq_ffi/mmq_original_gather_arguments.rs"]
mod mmq_original_gather_arguments;
#[path = "mmq_ffi/mmq_resident_arguments.rs"]
mod mmq_resident_arguments;
@@ -45,22 +45,13 @@ pub(crate) struct Copy {
}
#[cfg(test)]
#[path = "original_file_expert_source_ffi/tests.rs"]
#[path = "../original_file_expert_source_ffi/tests.rs"]
mod tests;
#[path = "original_file_expert_source_ffi/check.rs"]
mod check;
#[allow(unused_imports)]
use check::check;
#[path = "original_file_expert_source_ffi/arena.rs"]
mod arena;
#[allow(unused_imports)]
pub(crate) use arena::copy_parts_record;
#[allow(unused_imports)]
pub(crate) use arena::copy_parts_to;
#[allow(unused_imports)]
pub(crate) use arena::partial_pin_cap;
#[allow(unused_imports)]
pub(crate) use arena::warm;
#[allow(unused_imports)]
pub(crate) use arena::worker_stack_bytes;
@@ -62,14 +62,10 @@ pub(crate) struct ExpertFileMap {
}
#[cfg(test)]
#[path = "original_expert_stager_ffi/tests.rs"]
#[path = "../original_expert_stager_ffi/tests.rs"]
mod tests;
#[path = "original_expert_stager_ffi/check.rs"]
mod check;
#[allow(unused_imports)]
use check::check;
#[path = "original_expert_stager_ffi/api.rs"]
mod api;
#[path = "original_expert_stager_ffi/host_buffer.rs"]
mod host_buffer;
-1
View File
@@ -3,7 +3,6 @@ use super::{Context, DeviceBuffer, Error, Result, combine, ffi};
#[cfg(test)]
use super::Driver;
// used only with some cargo features or targets of this crate
#[allow(unused_imports)]
use super::{FixedOperation, Rc};
const BYTES: [usize; 5] = [40960, 1280, 1280, 40960, 40960];
fn shape(bytes: [usize; 5]) -> Result<()> {
-1
View File
@@ -245,7 +245,6 @@ impl Drop for HeadGreedyWorkspace<'_> {
}
#[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "head_greedy_gpu.rs"]
mod gpu;
const ASSET_SHA: [u8; 32] = [
@@ -74,13 +74,8 @@ mod context;
mod expert_mlp;
mod f32_bytes;
mod kar_decode_levels;
#[allow(unused_imports)]
use f32_bytes::download;
#[allow(unused_imports)]
use f32_bytes::f32_bytes;
#[allow(unused_imports)]
use f32_bytes::failure;
#[allow(unused_imports)]
use f32_bytes::finite_f32;
#[allow(unused_imports)]
use f32_bytes::release_all;
-9
View File
@@ -45,21 +45,12 @@ fn streamed_attention_equals_fully_resident_attention_with_a_20480_cell_window()
mod append_proof;
mod rng;
mod stream_proof;
#[allow(unused_imports)]
use rng::addr;
#[allow(unused_imports)]
use rng::f32s;
#[allow(unused_imports)]
use rng::group;
#[allow(unused_imports)]
use rng::i32s;
#[allow(unused_imports)]
use rng::launch;
#[allow(unused_imports)]
use rng::load;
#[allow(unused_imports)]
use rng::selection;
#[allow(unused_imports)]
use rng::upload;
#[allow(unused_imports)]
use rng::{ImageLayout, KernelShape, expected};
+1 -28
View File
@@ -91,7 +91,6 @@ pub mod experimental;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
pub mod experimental_gpu;
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "experimental_gpu_smoke.rs"]
mod experimental_gpu_smoke;
pub mod kar_decode_levels;
// Closed driver programs for native_flash_attn / s_gemv_legacy / device_poison: pins, entry signatures, argument slots
@@ -100,12 +99,10 @@ pub mod closed_kernels;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
pub mod closed_kernels_gpu;
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "closed_kernels_gpu_smoke.rs"]
mod closed_kernels_gpu_smoke;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
pub mod kar_decode_levels_gpu;
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "kar_decode_levels_gpu_smoke.rs"]
mod kar_decode_levels_gpu_smoke;
#[cfg(all(
test,
@@ -117,15 +114,12 @@ mod original_prefill_schedule_crosscheck;
// Model-free stress of DMA out of a read-only file mapping that is page-locked in place, under working-set trimming
// (Windows only).
#[cfg(all(test, windows, feature = "cuda-driver", target_pointer_width = "64"))]
#[path = "mapped_file_dma_stress_gpu.rs"]
mod mapped_file_dma_stress_gpu;
#[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "moe_down_pack_gpu.rs"]
mod moe_down_pack_gpu_tests;
#[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "ple_value_full_gpu.rs"]
mod ple_value_full_gpu_tests;
#[cfg(test)]
@@ -155,7 +149,6 @@ pub mod q6_layer_preview;
any(target_os = "linux", target_os = "windows"),
target_pointer_width = "64"
))]
#[path = "grouped_down_columns_gpu.rs"]
mod grouped_down_columns_gpu;
// Separately selected asynchronous owned-copy adapter; original APIs unchanged.
@@ -166,7 +159,6 @@ mod async_owned_copy;
mod refill_batch_copy;
pub use refill_batch_copy::RefillBatchReport;
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
#[path = "refill_batch_copy_gpu.rs"]
mod refill_batch_copy_gpu;
// Explicit experimental resident pipeline; original entry bodies remain unchanged.
@@ -263,27 +255,18 @@ mod original_serve_assets;
mod original_serve_access;
mod bringup_trace_enabled;
#[allow(unused_imports)]
use bringup_trace_enabled::combine;
#[allow(unused_imports)]
use bringup_trace_enabled::valid_size;
mod projection_grids_and_bounds;
#[allow(unused_imports)]
use projection_grids_and_bounds::projection_ranges;
#[allow(unused_imports)]
use projection_grids_and_bounds::projection_shape;
#[allow(unused_imports)]
#[cfg(test)]
use projection_grids_and_bounds::q4_k_native_indices_fit;
#[allow(unused_imports)]
use projection_grids_and_bounds::q5_k_shape;
mod q6_k_shape;
#[allow(unused_imports)]
use q6_k_shape::matvec_allocations;
#[allow(unused_imports)]
use q6_k_shape::matvec_shape;
#[allow(unused_imports)]
use q6_k_shape::q6_k_shape;
#[allow(unused_imports)]
use q6_k_shape::vector_shape;
mod context;
mod context_gate_up_projection_admission;
@@ -294,24 +277,14 @@ mod context_unload_close_destroy;
mod device_buffer;
mod prompt_sync_trace_types;
#[allow(unused_imports)]
use prompt_sync_trace_types::FixedKernel;
#[allow(unused_imports)]
use prompt_sync_trace_types::FixedOperation;
#[allow(unused_imports)]
use prompt_sync_trace_types::FixedPairKernels;
#[allow(unused_imports)]
pub(crate) use prompt_sync_trace_types::PoisonCell;
#[allow(unused_imports)]
use prompt_sync_trace_types::ProjectionKernels;
#[allow(unused_imports)]
use prompt_sync_trace_types::ProjectionShape;
mod q5_kshape_types;
#[allow(unused_imports)]
use q5_kshape_types::CurrentGuard;
#[allow(unused_imports)]
use q5_kshape_types::MatvecShape;
#[allow(unused_imports)]
use q5_kshape_types::Q5KShape;
#[allow(unused_imports)]
use q5_kshape_types::Q6KShape;
@@ -81,9 +81,7 @@ mod locked_tests {
}
mod context;
#[allow(unused_imports)]
pub(crate) use context::aligned_copy_enabled;
mod mapped_expert_bank_drop;
mod mapped_expert_bank_operations;
#[allow(unused_imports)]
use mapped_expert_bank_drop::range_covered;
-9
View File
@@ -5,7 +5,6 @@ use super::{
};
#[cfg(test)]
use super::{DenseFormat, Device, Driver, qwen_ffi};
#[path = "mmq_original_weights.rs"]
mod original_weights;
use std::ffi::CStr;
@@ -100,10 +99,8 @@ pub struct MmqWeights<'ctx> {
}
#[cfg(all(test, target_os = "linux", target_arch = "x86_64"))]
#[path = "mmq_numeric_gpu.rs"]
mod mmq_numeric_gpu_tests;
#[path = "mmq_resident.rs"]
pub(crate) mod resident;
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
@@ -294,22 +291,16 @@ mod triplet_upload_installed {
}
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[path = "owned_gate_up_upload_gpu.rs"]
mod owned_gate_up_upload_gpu;
mod asset;
mod tile;
#[allow(unused_imports)]
pub(crate) use asset::asset;
#[allow(unused_imports)]
use asset::bytes;
#[allow(unused_imports)]
use asset::finite_f32;
#[allow(unused_imports)]
use asset::original_formats_asset;
mod context;
mod release_triplet;
#[allow(unused_imports)]
use release_triplet::release_triplet;
mod experiment_load;
mod mmq_experiment;
@@ -169,23 +169,10 @@ fn original_first_mmq_adaptive_and_distinct_fixed_profiles_exact() {
);
}
#[path = "mmq_numeric_gpu/digest.rs"]
mod digest;
#[allow(unused_imports)]
use digest::compare;
#[allow(unused_imports)]
use digest::digest;
#[allow(unused_imports)]
use digest::field;
#[allow(unused_imports)]
use digest::finite;
#[allow(unused_imports)]
use digest::hex;
#[allow(unused_imports)]
use digest::integer;
#[allow(unused_imports)]
use digest::read_regular;
#[path = "mmq_numeric_gpu/format_cases.rs"]
mod format_cases;
#[allow(unused_imports)]
use format_cases::cases;
@@ -6,13 +6,9 @@ use super::{
};
#[cfg(test)]
use super::{Device, DownColumns, Driver, MmqRequest, finite_f32, qwen_ffi};
#[path = "mmq_native_activation.rs"]
pub(crate) mod native_activation;
#[path = "mmq_native_down.rs"]
mod native_down;
#[path = "iq3_native_integer_mma.rs"]
pub(crate) mod native_integer;
#[path = "mmq_original_group.rs"]
pub(crate) mod original_group;
const INPUT: usize = 0;
const CHUNK: usize = 1;
@@ -76,20 +72,14 @@ pub struct FiniteMmqOutput<'lease, 'ctx> {
}
#[cfg(all(test, target_os = "linux", target_arch = "x86_64"))]
#[path = "mmq_resident_gpu.rs"]
mod mmq_resident_gpu_tests;
#[cfg(all(test, target_os = "linux", target_arch = "x86_64"))]
#[path = "mmq_native_resident_gpu.rs"]
mod mmq_native_resident_gpu_tests;
#[path = "mmq_resident/asset.rs"]
mod asset;
#[allow(unused_imports)]
pub(crate) use asset::asset;
#[allow(unused_imports)]
use asset::commands;
#[path = "mmq_resident/mmq_workspace_drop.rs"]
mod mmq_workspace_drop;
/// The workspace slots of one projection: the packed activation and the output.
#[derive(Clone, Copy)]
@@ -97,5 +87,4 @@ struct ProjectionSlots {
packed: usize,
out: usize,
}
#[path = "mmq_resident/mmq_workspace.rs"]
mod mmq_workspace;
@@ -5,7 +5,7 @@ use super::{Context, Error, MmqWorkspace, QueuedCommand, Result, combine, origin
// PTX is supplied only by ROOT's pinned GPU-hidden compiler. No placeholder artifact.
pub(crate) fn asset() -> Result<&'static [u8]> {
let b = include_bytes!("../mmq_resident_helpers.ptx");
let b = include_bytes!("../../mmq_resident_helpers.ptx");
if b.last() != Some(&0) || !b[..b.len() - 1].is_ascii() || b[..b.len() - 1].contains(&0) {
return Err(Error::InvalidDriverValue("MMQ resident artifact"));
}
@@ -303,33 +303,16 @@ fn actual_expert215_native_resident_gu_and_same_source_down_diagnostic() {
);
}
#[path = "mmq_native_resident_gpu/digest.rs"]
mod digest;
#[allow(unused_imports)]
use digest::associate;
#[allow(unused_imports)]
use digest::digest;
#[allow(unused_imports)]
use digest::download;
#[allow(unused_imports)]
use digest::fixture;
#[allow(unused_imports)]
use digest::floats;
#[allow(unused_imports)]
use digest::half_bits;
#[allow(unused_imports)]
use digest::measure;
#[allow(unused_imports)]
use digest::ordered;
#[allow(unused_imports)]
use digest::prefix;
#[allow(unused_imports)]
use digest::read;
#[allow(unused_imports)]
use digest::upload;
#[allow(unused_imports)]
use digest::write_file;
#[path = "mmq_native_resident_gpu/native_hidden_q8.rs"]
mod native_hidden_q8;
#[allow(unused_imports)]
use native_hidden_q8::native_hidden_q8;
@@ -95,57 +95,26 @@ fn queued_finite_chain_and_bulk_down_packets_exact() {
);
}
#[path = "mmq_resident_gpu/owner_proof.rs"]
mod owner_proof;
#[allow(unused_imports)]
use owner_proof::*;
#[path = "mmq_resident_gpu/queued_proof.rs"]
mod queued_proof;
#[allow(unused_imports)]
use queued_proof::*;
#[path = "mmq_resident_gpu/digest.rs"]
mod digest;
#[allow(unused_imports)]
use digest::compare;
#[allow(unused_imports)]
use digest::digest;
#[allow(unused_imports)]
use digest::download;
#[allow(unused_imports)]
use digest::encoded;
#[allow(unused_imports)]
use digest::field;
#[allow(unused_imports)]
use digest::file;
#[allow(unused_imports)]
use digest::finite;
#[allow(unused_imports)]
use digest::floats;
#[allow(unused_imports)]
use digest::hex;
#[allow(unused_imports)]
use digest::integer;
#[allow(unused_imports)]
use digest::raw_format;
#[allow(unused_imports)]
use digest::read_regular;
#[allow(unused_imports)]
use digest::same;
#[allow(unused_imports)]
use digest::upload;
#[path = "mmq_resident_gpu/native_owner.rs"]
mod native_owner;
#[allow(unused_imports)]
use native_owner::direct;
#[allow(unused_imports)]
use native_owner::gather;
#[allow(unused_imports)]
use native_owner::native_owner;
#[path = "mmq_resident_gpu/resident_chain.rs"]
mod resident_chain;
#[allow(unused_imports)]
use resident_chain::chain;
#[allow(unused_imports)]
use resident_chain::witness;
#[path = "mmq_resident_gpu/live_packet_alias_drop.rs"]
mod live_packet_alias_drop;
@@ -7,9 +7,6 @@ use super::{
bytes, combine, commands, ffi, native_activation, native_integer,
};
#[path = "mmq_workspace/mmq_workspace_bring_up.rs"]
mod mmq_workspace_bring_up;
#[path = "mmq_workspace/mmq_workspace_gate_up_chunk_close.rs"]
mod mmq_workspace_gate_up_chunk_close;
#[path = "mmq_workspace/projection_plan.rs"]
mod projection_plan;
@@ -2,7 +2,7 @@
use super::{Context, DeviceBuffer, Error, FixedOperation, Layout, QueuedCommand, Result, combine, ffi};
pub(super) const CHARGE: usize = 184320;
pub(crate) fn asset() -> Result<&'static [u8]> {
let b = include_bytes!("mmq_native_resident_d4.ptx");
let b = include_bytes!("../../mmq_native_resident_d4.ptx");
if b.len() != 5200
|| b.last() != Some(&0)
|| !b[..b.len() - 1].is_ascii()
@@ -4,7 +4,7 @@ use super::{Context, DeviceBuffer, Error, Layout, QueuedCommand, Result, combine
pub(super) const CHARGE: usize = 13_107_200;
/// Actual root GPU-hidden NVCC 12.8.93 sm_120 asset; explicit experimental policy.
pub(crate) fn asset() -> Result<&'static [u8]> {
let b = include_bytes!("iq3_native_integer_mma.ptx");
let b = include_bytes!("../../iq3_native_integer_mma.ptx");
if b.len() != 17928 || b.last() != Some(&0) || !b[..b.len() - 1].is_ascii() || b[..b.len() - 1].contains(&0) {
return Err(Error::InvalidDriverValue("IQ3 native integer MMA PTX encoding"));
}
@@ -125,44 +125,27 @@ pub struct OriginalMmqOutput<'lease, 'layer, 'ctx> {
// Additive literal Original stream/event adapter. Old synchronous APIs above
// remain whole-byte unchanged, including their original default finite errors.
#[path = "mmq_original_ring.rs"]
mod copy_ring;
use copy_ring::GatherDest;
pub(crate) use copy_ring::prefetch_point;
pub use copy_ring::{OriginalMmqCopySchedule, PrefetchSource, PrefetchTarget, RingExperts};
// Closed global issuer consumer. Old per-layer/synchronous producers unchanged.
#[path = "mmq_original_stream_all.rs"]
mod stream_all_mmq;
#[cfg(all(test, feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unsafe_code)]
#[path = "mmq_original_group_stress_gpu.rs"]
mod stress_gpu;
#[path = "mmq_original_group/asset.rs"]
mod asset;
#[allow(unused_imports)]
pub(crate) use asset::asset;
#[allow(unused_imports)]
pub use asset::original_mmq_group_bank_bytes;
#[allow(unused_imports)]
use asset::sizes;
#[path = "mmq_original_group/kind.rs"]
mod kind;
#[allow(unused_imports)]
use kind::format_index;
#[allow(unused_imports)]
use kind::kind;
#[allow(unused_imports)]
use kind::layout;
#[allow(unused_imports)]
use kind::shared;
#[path = "mmq_original_group/copy_ring_layer.rs"]
mod copy_ring_layer;
#[path = "mmq_original_group/mmq_workspace.rs"]
mod mmq_workspace;
#[path = "mmq_original_group/original_mmq_layer.rs"]
mod original_mmq_layer;
#[path = "mmq_original_group/original_mmq_output.rs"]
mod original_mmq_output;
@@ -8,9 +8,9 @@ use super::{
pub(crate) fn asset(kind: u32) -> Result<&'static [u8]> {
let bytes: &[u8] = match kind {
0 => include_bytes!("../mmq_original_group_swiglu.ptx"),
1 => include_bytes!("../mmq_original_group_mul.ptx"),
2 => include_bytes!("../mmq_original_group_fixup.ptx"),
0 => include_bytes!("../../../mmq_original_group_swiglu.ptx"),
1 => include_bytes!("../../../mmq_original_group_mul.ptx"),
2 => include_bytes!("../../../mmq_original_group_fixup.ptx"),
_ => return Err(Error::InvalidProjectionShape),
};
let (size, sha) = SEALED[kind as usize].ok_or(Error::InvalidDriverValue("unsealed Original MMQ group"))?;
@@ -5,11 +5,9 @@ use crate::ffi::original_enqueue::{Api, Command};
use crate::original_gpu_schedule::{OriginalEventKind, OriginalGpuEvent, OriginalGpuStream, OriginalStreamKind};
use leleka_model_format::qwen4exp::{ResidentExpertBankSpan, TensorRole};
use std::rc::Rc;
#[path = "mmq_original_host_stage.rs"]
mod host_stage;
use host_stage::{HostStage, Job};
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
#[path = "mmq_original_chunk_stream.rs"]
mod chunk_stream;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
pub(crate) use chunk_stream::prefetch_point;
@@ -133,28 +131,19 @@ pub(super) struct Ring<'read, 'ctx> {
closed: bool,
}
#[path = "mmq_original_ring/skip_expert_dma.rs"]
mod skip_expert_dma;
#[cfg(not(all(
feature = "cuda-driver",
any(target_os = "linux", target_os = "windows"),
target_pointer_width = "64"
)))]
#[allow(unused_imports)]
pub(crate) use skip_expert_dma::prefetch_point;
#[allow(unused_imports)]
use skip_expert_dma::serialize_ring;
#[allow(unused_imports)]
use skip_expert_dma::skip_expert_dma;
#[path = "mmq_original_ring/original_mmq_copy_schedule.rs"]
mod original_mmq_copy_schedule;
#[path = "mmq_original_ring/original_mmq_copy_schedule_drop.rs"]
mod original_mmq_copy_schedule_drop;
#[path = "mmq_original_ring/ring.rs"]
mod ring;
#[path = "mmq_original_ring/ring_drop.rs"]
mod ring_drop;
#[path = "mmq_original_ring/ring_prefetch_issue.rs"]
mod ring_prefetch_issue;
use ring_prefetch_issue::RingPrefetch;
pub use ring_prefetch_issue::{PrefetchSource, PrefetchTarget};
@@ -86,10 +86,7 @@ pub(super) struct ChunkStream {
thread: Option<std::thread::JoinHandle<()>>,
}
#[path = "mmq_original_chunk_stream/chunk_issuing.rs"]
mod chunk_issuing;
#[allow(unused_imports)]
pub(crate) use chunk_issuing::prefetch_point;
#[path = "mmq_original_chunk_stream/chunk_stream.rs"]
mod chunk_stream;
pub(crate) use chunk_stream::CoreParts;
@@ -76,20 +76,12 @@ pub(super) struct HostStage {
}
#[cfg(test)]
#[path = "mmq_original_host_stage/tests.rs"]
#[path = "../../../../mmq_original_host_stage/tests.rs"]
mod tests;
#[path = "mmq_original_host_stage/verify_enabled.rs"]
mod verify_enabled;
#[allow(unused_imports)]
use verify_enabled::apply_priority;
#[allow(unused_imports)]
use verify_enabled::block_bytes;
#[allow(unused_imports)]
pub(super) use verify_enabled::layer_priority;
#[allow(unused_imports)]
#[cfg(test)]
pub(super) use verify_enabled::scales_finite;
#[allow(unused_imports)]
use verify_enabled::verify_enabled;
#[path = "mmq_original_host_stage/host_stage.rs"]
mod host_stage;
@@ -3,8 +3,6 @@
use super::{Arc, Job, NON_FINITE, NORMAL_PRIORITY, Ordering, Shared, thread};
// used only with some cargo features or targets of this crate
#[allow(unused_imports)]
use super::{LAYERS, LOW_PRIORITY};
/// Bring-up: `LELEKA_BRINGUP_TRACE` and `LELEKA_STAGE_VERIFY` compare every staged buffer with its source when its DMA
/// is released.
@@ -6,7 +6,6 @@ use super::{
chunk_stream, combine,
};
// used only with some cargo features or targets of this crate
#[allow(unused_imports)]
use super::ffi;
#[cfg(all(feature = "cuda-driver", any(target_os = "linux", target_os = "windows"), target_pointer_width = "64"))]
@@ -8,14 +8,10 @@ use super::{
host_stage, kind, serialize_ring, skip_expert_dma,
};
#[path = "ring/ring_construction.rs"]
mod ring_construction;
#[path = "ring/ring_gather_and_finish.rs"]
mod ring_gather_and_finish;
mod ring_init;
#[path = "ring/ring_prefetch.rs"]
mod ring_prefetch;
pub(super) use ring_prefetch::profile_prefetch;
#[path = "ring/ring_stage_expert_copies.rs"]
mod ring_stage_expert_copies;
pub(super) use ring_init::RingPlan;
@@ -1,6 +1,5 @@
//! Copy-ring execution of an `OriginalMmqLayer`: stage, gather, enqueue, drain (a glob import: at the line limit).
#[allow(unused_imports)]
use super::*;
impl<'layer, 'ctx> OriginalMmqLayer<'layer, 'ctx> {

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