engine-qwen35-cuda: no #[allow(unused_imports)] left (re-exports nobody used are gone, names only the test build needs are cfg(test), names only another platform needs sit under their cfg)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Pavlo Ratushnyi
2026-11-14 20:57:34 +01:00
co-authored by Claude Sonnet 5.5
parent c0d34a6648
commit f2bc888459
172 changed files with 244 additions and 1470 deletions
@@ -1,21 +1,10 @@
//! Private sole new changed-path model gate; actual source identity/load preserved.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationExecution,
EvaluationMeasurement, EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent,
GenerationRequest, GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive,
InputBindingError, KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION,
LoadedModel, MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice,
OriginalServeMode, OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda,
Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender,
SystemClock, Tokenizer, Usage, VerifiedGgufFile, WindowWitness, close_context, load, thread,
Driver, EvaluationExecution, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1,
Tokenizer, VerifiedGgufFile,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{DenseWeightCache, KarPleCache, MoeWeightCache, OutputStage, QwenForward, QwenSession};
use crate::qwen_forward::loaded_target_owners::LoadedTargetOwners as LoadedTarget;
use std::env;
pub(super) mod rig;
@@ -1,20 +1,12 @@
//! Candidate-only PUBLIC quality proof against one retained actual Native arm.
//! Historical wall time is never used as an A/B measurement.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, DenseWeightCache, Digest, Dimension, Driver, Duration, ErrorCode,
EvaluationExecution, EvaluationMeasurement, EvaluationObserver, ExperimentalConfig, ExpertSource, FRAME_LIMIT,
FinishReason, Generation, GenerationEvent, GenerationFailure, GenerationRequest, GenerationSink, GenerationStream,
GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError, InputConstants, Instant,
KAR_MTP_PROFILE, KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, KarPleCache,
LOAD_CONFIG_VERSION, LoadedModel, MODEL_DIGEST, MeasurementFailure, ModelBinding, ModelDescriptor, MoeWeightCache,
MtpContinuation, MtpDecoder, MtpWindowError, MtpWindowSpec, Mutex, Ordering, OriginalServeChoice,
OriginalServeMode, OriginalServeOptions, OutputStage, PathBuf, Position, PrefixCacheOptions, PrefixTail, QUEUE,
Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, QwenForward, QwenSession, Rc, Receiver, RecentIds,
ResidentConversations, ResidentPolicy, RuntimeConfig, SHARD0, SHARD1, Sha256, Shared, SupportedModelTuple,
SyncSender, SystemClock, TargetStepProduct, TokenId, Tokenizer, Usage, VerifiedGgufFile, WindowWitness,
combined_changed_boundary_proof, emit_terminal, error, generate, generate_mtp_resume, load, measurement, owner,
prepare_prompt, request, session, spawn, thread,
AtomicBool, CacheCounts, DenseWeightCache, Digest, Driver, Duration, EvaluationExecution, EvaluationMeasurement,
FRAME_LIMIT, FinishReason, Generation, GenerationEvent, GenerationFailure, GenerationRequest, GenerationSink,
GenerationStream, GenerationTerminal, InheritedKarArchive, Instant, KAR_MTP_PROFILE, KarPleCache, MODEL_DIGEST,
ModelBinding, MoeWeightCache, MtpContinuation, Mutex, Ordering, OutputStage, PathBuf, QUEUE, Qwen4ExpArtifact,
QwenForward, QwenSession, Rc, SHARD0, SHARD1, Sha256, Shared, SystemClock, Tokenizer, Usage, VerifiedGgufFile,
WindowWitness, emit_terminal, generate_mtp_resume, measurement, prepare_prompt, request, thread,
};
use serde_json::{Value, json};
use std::{
@@ -2,25 +2,13 @@
//! No Native inference replay; original paired quality/timing remains separately required.
use super::super::combined_changed_boundary_proof::rig::close_context_flags;
use super::{
Arc, AssertUnwindSafe, AtomicBool, AtomicU64, BACKEND_API_VERSION, BASELINE_SHA, Backend, BackendCapabilities,
BackendError, BackendIdentity, Baseline, CAP, CacheCounts, Clock, ContractError, DEVICE_BUDGET, DeferredTail,
Digest, Driver, Duration, ErrorCode, EvaluationMeasurement, EvaluationObserver, ExperimentalConfig, ExpertSource,
FinishReason, GenerationEvent, GenerationRequest, GenerationSink, GenerationStream, GenerationTerminal,
InferenceMode, InheritedKarArchive, InputBindingError, Inputs, KAR_MTP_PROFILE, KarArchiveRef, KarExpertLevels,
KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel, MODEL_DIGEST, MeasurementFailure,
ModelBinding, ModelDescriptor, Mutex, OpenOptions, OpenOptionsExt, Ordering, OriginalServeChoice,
OriginalServeMode, OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Proof, Qwen4ExpArtifact,
Qwen35Cuda, Qwen35CudaStart, Rc, Read, Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, Shared,
SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage, Value, VerifiedGgufFile, WindowWitness, Write,
baseline, catch_unwind, env, error, fivecase_runtime, json, metadata, path, request, resume_unwind, save, sha,
thread, token_ids,
AssertUnwindSafe, AtomicBool, BASELINE_SHA, Baseline, CAP, DEVICE_BUDGET, Driver, InheritedKarArchive, Inputs,
KAR_MTP_PROFILE, MODEL_DIGEST, ModelBinding, Mutex, OpenOptions, OpenOptionsExt, PathBuf, Qwen4ExpArtifact, Rc,
Read, SHARD0, SHARD1, Shared, Tokenizer, Value, VerifiedGgufFile, baseline, catch_unwind, env, fivecase_runtime,
json, metadata, path, request, resume_unwind, save, sha, token_ids,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{DenseWeightCache, Instant, KarPleCache, MoeWeightCache, OutputStage};
use leleka_model_format::qwen4exp::{ProvisionalExpertSource, ResidentExpertSourceReport};
use std::path::Path;
@@ -1,23 +1,13 @@
//! One-load private PUBLIC generation pair; actual owner timings, never HTTP timings.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationExecution,
EvaluationMeasurement, EvaluationObserver, ExperimentalConfig, ExpertSource, FRAME_LIMIT, FinishReason, Generation,
GenerationEvent, GenerationFailure, GenerationRequest, GenerationSink, GenerationStream, GenerationTerminal,
InferenceMode, InheritedKarArchive, InputBindingError, KAR_MTP_PROFILE, KarArchiveRef, KarExpertLevels,
KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel, MODEL_DIGEST, MeasurementFailure,
ModelBinding, ModelDescriptor, MtpContinuation, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, QUEUE, Qwen4ExpArtifact, Qwen35Cuda,
Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, Shared, SupportedModelTuple,
SyncSender, SystemClock, Tokenizer, Usage, VerifiedGgufFile, WindowWitness, emit_terminal, error,
generate_mtp_resume, load, measurement, owner, request, spawn, thread,
AtomicBool, CacheCounts, Digest, Driver, Duration, EvaluationExecution, EvaluationMeasurement, FRAME_LIMIT,
FinishReason, Generation, GenerationEvent, GenerationFailure, GenerationRequest, GenerationSink, GenerationStream,
GenerationTerminal, InheritedKarArchive, KAR_MTP_PROFILE, MODEL_DIGEST, ModelBinding, MtpContinuation, Mutex,
Ordering, PathBuf, QUEUE, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, Sha256, Shared, SystemClock, Tokenizer, Usage,
VerifiedGgufFile, WindowWitness, emit_terminal, generate_mtp_resume, measurement, request, thread,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId, session,
};
use super::{DenseWeightCache, KarPleCache, MoeWeightCache, OutputStage, QwenSession};
#[cfg(test)]
use super::prepare_prompt;
use serde_json::{Value, json};
@@ -134,17 +134,10 @@ pub(super) mod runner;
mod tests;
mod original_serve_mode;
#[allow(unused_imports)]
pub(super) use original_serve_mode::choose;
#[allow(unused_imports)]
pub(super) use original_serve_mode::context_fits;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
pub(super) use original_serve_mode::current_unsealed;
#[cfg(not(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64")))]
#[allow(unused_imports)]
pub(super) use original_serve_mode::current_unsealed;
#[allow(unused_imports)]
use original_serve_mode::ineligible;
#[allow(unused_imports)]
pub(super) use original_serve_mode::published_prefix_summary;
@@ -94,43 +94,27 @@ mod capture_tests {
}
mod stack_config_and_reports;
#[allow(unused_imports)]
use stack_config_and_reports::CapturedIds;
#[allow(unused_imports)]
use stack_config_and_reports::PhaseDurations;
#[allow(unused_imports)]
use stack_config_and_reports::admission_error;
#[allow(unused_imports)]
use stack_config_and_reports::capture_request;
#[allow(unused_imports)]
use stack_config_and_reports::gpu_probe;
#[allow(unused_imports)]
use stack_config_and_reports::log_request_end;
#[allow(unused_imports)]
use stack_config_and_reports::meta_facts;
#[allow(unused_imports)]
use stack_config_and_reports::open_error;
#[allow(unused_imports)]
use stack_config_and_reports::publish_prefix_summary;
#[allow(unused_imports)]
use stack_config_and_reports::stack_config;
mod request_generation;
#[allow(unused_imports)]
pub(in super::super) use request_generation::generate;
#[allow(unused_imports)]
pub(in super::super) use request_generation::{ClientLink, RequestToServe, TokenVocabulary};
mod owner_run_steps;
#[allow(unused_imports)]
use owner_run_steps::{
GenerateEnv, RecordedModel, abandon_stack, close_context, close_stack, open_run_stack, publish_open,
serve_generate, sweep_idle,
};
mod command_loop;
#[allow(unused_imports)]
use command_loop::{LoopCtx, announce, answer_unload, command_loop};
mod reconfigure_command;
#[allow(unused_imports)]
use reconfigure_command::{Live, ReopenEnv, reconfigure};
mod owner_run;
#[allow(unused_imports)]
pub(in super::super) use owner_run::run;
@@ -2,14 +2,11 @@
//! sweep idle sessions and close everything; early exits stay in `run`.
use super::{
ActiveGuard, Admission, AtomicBool, BackendError, CapturedIds, ClientLink, Clock, Command, DeferredTail, Duration,
ErrorCode, FinishReason, ForwardError, GENERATION_TIMEOUT, GenerationEvent, GenerationFailure, GenerationRequest,
GenerationSink, GenerationTerminal, IdleSweep, Live, LoadPhase, LoadedModel, LoopCtx, ModelBinding, Ordering,
OriginalServeOptions, OriginalServeStack, PREFIX_SUMMARY, PathBuf, PhaseDurations, PrefixTail, QUEUE, Rc, Receiver,
ReopenEnv, Reply, RequestToServe, ServeDevice, ServeError, ServeFailure, ServeRequest, ServeStop, Shared,
StackConfig, SystemClock, TokenVocabulary, Tokenizer, Usage, Utf8Pending, context_fits, emit_terminal, exhausted,
generate, invalid, load_failure, meta_facts, open_error, prepare_prompt, publish_prefix_summary, stack_config,
unavailable,
QUEUE, ActiveGuard, AtomicBool, BackendError, ClientLink, DeferredTail, ErrorCode, GenerationFailure,
GenerationRequest, GenerationSink, GenerationTerminal, IdleSweep, LoadedModel, LoadPhase, ModelBinding, Ordering,
OriginalServeOptions, OriginalServeStack, PathBuf, Rc, Reply, RequestToServe, Shared, SystemClock, Tokenizer,
TokenVocabulary, context_fits, emit_terminal, exhausted, generate, invalid, load_failure, meta_facts, open_error,
prepare_prompt, publish_prefix_summary, stack_config, unavailable,
};
use leleka_backend_api::GenerationStream;
use leleka_cuda_driver::Context;
@@ -27,23 +27,7 @@
//!
//! Run: `cargo test -p leleka-engine-qwen35-cuda --features cuda-driver[,sm86] --release -- --ignored --nocapture
//! original_serve_laptop_bench`.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc,
Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender, SystemClock,
Tokenizer, Usage, VerifiedGgufFile, WindowWitness, config, load, request,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{Driver, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, VerifiedGgufFile};
use crate::qwen_forward::{
original_serve_engine::ServeOutcome,
original_serve_request::{ServeError, ServeRequest},
@@ -1,22 +1,5 @@
//! The serving passes of the laptop bench: the sequence, the soak limits and the per-request reports.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PathBuf, Plan, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact,
Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, ServeError, ServeOutcome, ServeRequest,
Sha256, StackConfig, SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage, VerifiedGgufFile,
WindowWitness, elapsed, env, laptop_request, memory_line, request, soak,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{OriginalServeStack, Plan, ServeError, ServeOutcome, ServeRequest, env, laptop_request, memory_line};
/// The serving sequence and the soak limits.
pub(super) struct Soak {
@@ -24,21 +24,8 @@
//! Output lines: `MEM-REPORT <tag> <json>` (the governor's full report), `MEM-CENSUS <json>`, `MEM-SOAK ...`, `MEM-SHED
//! ...`, `MEM-RESULT`.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc,
Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender, SystemClock,
Tokenizer, Usage, VerifiedGgufFile, WindowWitness, config, probes, spawn, thread,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId, session,
Driver, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, Tokenizer,
VerifiedGgufFile,
};
use crate::qwen_forward::original_serve_stack::dbg_el;
use crate::qwen_forward::{
@@ -1,24 +1,6 @@
//! The inventory scenario: the allocation inventory and the load ledger at idle, after a long request and with the
//! prefix cache full.
use super::{
Admission, Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError,
BackendIdentity, CacheCounts, Census, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode,
EvaluationMeasurement, EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent,
GenerationRequest, GenerationSink, GenerationStream, GenerationTerminal, Governor, HostProc, InferenceMode,
InheritedKarArchive, InputBindingError, KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig,
LOAD_CONFIG_VERSION, Level, LoadedModel, MeasurementFailure, Mem, ModelBinding, ModelDescriptor, Mutex, Ordering,
OriginalServeChoice, OriginalServeMode, OriginalServeOptions, OriginalServeStack, PathBuf, PrefixBudget,
PrefixCacheOptions, PrefixConfig, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc, Receiver,
RecentIds, RequestShape, RuntimeConfig, ServeError, ServeRequest, Sha256, StackConfig, SupportedModelTuple,
SyncSender, SystemClock, Tokenizer, Tolerances, Usage, VerifiedGgufFile, WindowWitness, guard, inventory, list,
number, print_report,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{Mem, list, number, print_report};
/// The number after `key` in a prefix metrics line.
fn metric(line: &str, key: &str) -> Option<u64> {
@@ -34,21 +34,8 @@
//! Run: `cargo test -p leleka-engine-qwen35-cuda -- --ignored --exact
//! backend::original_serve_prefix_smoke::original_serve_prefix_cache_smoke`.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc,
Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender, SystemClock,
Tokenizer, Usage, VerifiedGgufFile, WindowWitness, config, probes, request,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId, session,
Driver, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, Tokenizer,
VerifiedGgufFile,
};
use crate::qwen_forward::original_serve_stack::dbg_el;
use crate::qwen_forward::{
@@ -1,22 +1,5 @@
//! The knobs and the scripted workload of the prefix-cache smoke (identical for every mode).
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PathBuf, PrefixBudget, PrefixCacheOptions, PrefixConfig, PrefixTail,
Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, Rng, RuntimeConfig, ServeError,
ServeRequest, Session, Sha256, StackConfig, SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage,
VerifiedGgufFile, WindowWitness, env, filler, number, text,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{Rng, Session, Tokenizer, env, filler, number, text};
/// What the operator asked for.
pub(super) struct Plan {
@@ -30,23 +30,7 @@
//!
//! Run (inside a holder job): `<test binary> --ignored --nocapture original_serve_replay_smoke`.
use super::super::qwen_forward::original_serve_stack::dbg_el;
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc,
Receiver, RecentIds, Reply, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender, SystemClock,
Tokenizer, Usage, VerifiedGgufFile, WindowWitness, config, request,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{Driver, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, VerifiedGgufFile};
use crate::qwen_forward::{
original_serve_request::{ServeError, ServeRequest},
original_serve_stack::{OriginalServeStack, PrefixBudget, PrefixConfig, StackConfig},
@@ -65,5 +49,4 @@ fn original_serve_replay_smoke() {
}
mod required_path;
#[allow(unused_imports)]
use required_path::required_path;
@@ -1,21 +1,6 @@
//! The captured requests and the pinned model of the replay.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PathBuf, PrefixBudget, PrefixCacheOptions, PrefixConfig, PrefixTail,
Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, ServeError,
ServeRequest, Sha256, StackConfig, SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage,
VerifiedGgufFile, WindowWitness, env, required_path,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, SHARD0, SHARD1, VerifiedGgufFile, env, required_path,
};
pub(super) fn number(name: &str, default: usize) -> usize {
@@ -1,24 +1,7 @@
//! One pass of an arm over the captured requests: every recorded prompt served greedily with the recorded output
//! length as the budget, and what it printed.
use super::load::number;
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PathBuf, PrefixBudget, PrefixCacheOptions, PrefixConfig, PrefixTail,
Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, ServeError, ServeRequest,
Sha256, StackConfig, SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage, VerifiedGgufFile,
WindowWitness, env, load, pass, request,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{OriginalServeStack, PathBuf, ServeError, ServeRequest, env};
use crate::qwen_forward::original_serve_engine::ServeOutcome;
use std::time::Duration;
@@ -1,24 +1,7 @@
//! Functions: `required_path`.
//! Split out of `original_serve_replay` to keep its files under the line limit.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PathBuf, PrefixBudget, PrefixCacheOptions, PrefixConfig, PrefixTail,
Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, ServeError, ServeRequest,
Sha256, StackConfig, SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage, VerifiedGgufFile,
WindowWitness, env,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{PathBuf, env};
pub(super) fn required_path(name: &str) -> PathBuf {
env::var_os(name).map(PathBuf::from).unwrap_or_else(|| panic!("missing operator-owned input {name}"))
@@ -3,22 +3,7 @@ use super::arm_flags::{self, ArmShape};
use super::load::{self, number};
use super::pass::Replay;
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PathBuf, PrefixBudget, PrefixCacheOptions, PrefixConfig, PrefixTail,
Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, Reply, RuntimeConfig, ServeError,
ServeRequest, Sha256, StackConfig, SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage,
VerifiedGgufFile, WindowWitness, config, dbg_el, env, pass,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
Driver, ModelBinding, OriginalServeStack, PathBuf, PrefixBudget, PrefixConfig, Rc, StackConfig, dbg_el, env,
};
use crate::qwen_forward::original_serve_stack::TailMode;
@@ -26,24 +26,11 @@
//! with the first missing producer's name; that refusal is the expected result of this smoke until they land.
use super::super::qwen_forward::original_serve_stack::dbg_el;
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc,
Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender, SystemClock,
Tokenizer, Usage, VerifiedGgufFile, WindowWitness, config, load, original_prompt, probes,
Driver, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, Tokenizer,
VerifiedGgufFile,
};
#[cfg(all(test, target_arch = "x86_64"))]
use super::original_serve_arms;
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use crate::qwen_forward::{
original_serve_request::{RequestSampling, ServeError, ServeRequest},
original_serve_stack::{OriginalServeStack, StackConfig},
@@ -1,25 +1,11 @@
//! The main smoke: greedy twice across a reset, a sampled request, a cancellation, the optional parity corpus
//! and a short prompt on the scalar draft-KV path.
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, OriginalServeStack, PROMPT, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact,
Qwen35Cuda, Qwen35CudaStart, Rc, Receiver, RecentIds, RuntimeConfig, ServeError, ServeRequest, Sha256, StackConfig,
SupportedModelTuple, SyncSender, SystemClock, Tokenizer, Usage, VerifiedGgufFile, WindowWitness, agent_sampler,
collect, dbg_el, env, env_or, ids, open_pinned, open_stack, optin, report_timing, request, with_context,
OriginalServeStack, PROMPT, PathBuf, ServeError, ServeRequest, StackConfig, Tokenizer, agent_sampler, collect,
dbg_el, env, env_or, open_pinned, open_stack, optin, report_timing, request, with_context,
};
#[cfg(all(test, target_arch = "x86_64"))]
use super::original_serve_arms;
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
mod corpus;
@@ -11,23 +11,7 @@
//! Inputs: those of the replay (`LELEKA_ORIGINAL_SERVE_REPLAY=yes`, model, expert tier, `LELEKA_REPLAY_CAPACITY`,
//! `LELEKA_REPLAY_PREFIX_MIB`, `LELEKA_ORIGINAL_SERVE_RT_DIR`), `LELEKA_SWEEP_MAX_NEW` (4).
use super::super::qwen_forward::original_serve_stack::dbg_el;
use super::{
Arc, AtomicBool, AtomicU64, BACKEND_API_VERSION, Backend, BackendCapabilities, BackendError, BackendIdentity,
CacheCounts, Clock, ContractError, DeferredTail, Digest, Driver, Duration, ErrorCode, EvaluationMeasurement,
EvaluationObserver, ExperimentalConfig, ExpertSource, FinishReason, GenerationEvent, GenerationRequest,
GenerationSink, GenerationStream, GenerationTerminal, InferenceMode, InheritedKarArchive, InputBindingError,
KarArchiveRef, KarExpertLevels, KarExpertSource, KarExpertSourceConfig, LOAD_CONFIG_VERSION, LoadedModel,
MeasurementFailure, ModelBinding, ModelDescriptor, Mutex, Ordering, OriginalServeChoice, OriginalServeMode,
OriginalServeOptions, PathBuf, PrefixCacheOptions, PrefixTail, Qwen4ExpArtifact, Qwen35Cuda, Qwen35CudaStart, Rc,
Receiver, RecentIds, RuntimeConfig, SHARD0, SHARD1, Sha256, SupportedModelTuple, SyncSender, SystemClock,
Tokenizer, Usage, VerifiedGgufFile, WindowWitness, config, load,
};
#[cfg(feature = "preview-path")]
use super::{
DenseWeightCache, Dimension, InputConstants, Instant, KarPleCache, MoeWeightCache, MtpDecoder, MtpWindowError,
MtpWindowSpec, OutputStage, Position, QwenForward, QwenSession, ResidentConversations, ResidentPolicy,
TargetStepProduct, TokenId,
};
use super::{Driver, InheritedKarArchive, ModelBinding, PathBuf, Qwen4ExpArtifact, Rc, SHARD0, SHARD1, VerifiedGgufFile};
use crate::qwen_forward::{
original_serve_request::ServeRequest,
original_serve_stack::{OriginalServeStack, PrefixBudget, PrefixConfig, StackConfig},
@@ -5,7 +5,6 @@
//! every ambiguity (malformed, duplicated, wrongly-united, I/O failure)
//! reads as unknown so admission fails closed.
use std::io::BufRead;
pub use leleka_engine_core::memory::{mem_available, memory_admit};
@@ -4,8 +4,6 @@
//! The pure policy modules live in `leleka-engine-core::conversation` and are re-exported here under their old paths;
//! the CUDA-owner bindings live next to the session owners.
#[cfg(test)]
pub(crate) use leleka_engine_core::conversation::testing;
pub use leleka_engine_core::conversation::{
binding, buffer, cache, checked, kv, manager, model, retention, snapshot, state,
};
@@ -1,9 +1,6 @@
//! Page-cache release after the load (`drop_file_cache`), moved out of `memory_governor` by STRA-338 (size).
use super::{
BackendError, CacheWish, DeviceSample, Entry, EnvSource, FixedItem, Governor, GovernorConfig, HostFacts, HostProc,
KarForm, Mutex, OpenStage, PlanInput, SamplerGuard, Settings, Space, VramFacts, When,
};
use super::{Governor, HostFacts, HostProc};
/// Give back the page cache the load created: the shards were read once to verify and to copy the resident bank, and
/// nothing reads those pages again (the bank is a RAM copy). Left in place they are the cache pressure that pushed the
@@ -147,12 +147,6 @@ pub(crate) use native_output::NativeOutputRole;
mod binding_identity_and_input_binding_error;
mod model_binding;
#[allow(unused_imports)]
use model_binding::bind_expert_counts;
mod validate_ple_descriptor;
#[allow(unused_imports)]
use validate_ple_descriptor::bind_layer;
#[allow(unused_imports)]
use validate_ple_descriptor::bind_layers;
#[allow(unused_imports)]
use validate_ple_descriptor::validate_ple_descriptor;
@@ -150,22 +150,16 @@ pub(crate) struct MoeRoutedSourceScope<'source, 'group> {
}
mod moe_expert_weights;
#[allow(unused_imports)]
use moe_expert_weights::descriptor;
#[allow(unused_imports)]
use moe_expert_weights::index;
#[allow(unused_imports)]
#[cfg(test)]
use moe_expert_weights::matrix_kind;
#[allow(unused_imports)]
use moe_expert_weights::validate_range;
#[allow(unused_imports)]
use moe_expert_weights::validate_selected;
mod model_binding;
mod routed_source_descriptor;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use routed_source_descriptor::routed_source_descriptor;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use routed_source_descriptor::routed_source_role;
mod moe_routed_source_scope;
@@ -20,71 +20,41 @@ mod backing;
mod tests;
mod pack_identity;
#[allow(unused_imports)]
use pack_identity::descriptor;
#[allow(unused_imports)]
pub(super) use pack_identity::pack_identity;
#[allow(unused_imports)]
pub(crate) use pack_identity::pinned_dense_bytes;
#[allow(unused_imports)]
pub(crate) use pack_identity::rt_dense_name;
#[allow(unused_imports)]
pub(crate) use pack_identity::rt_dense_roles;
#[allow(unused_imports)]
pub(crate) use pack_identity::rt_dense_shape;
mod mtp_weight_reads;
#[allow(unused_imports)]
#[cfg(test)]
use mtp_weight_reads::validate_identity;
mod read_expert_rows;
#[allow(unused_imports)]
use read_expert_rows::allocate;
#[allow(unused_imports)]
#[cfg(test)]
use read_expert_rows::interleave_q2;
#[allow(unused_imports)]
use read_expert_rows::read_exact_range;
#[allow(unused_imports)]
use read_expert_rows::read_expert_rows;
#[allow(unused_imports)]
use read_expert_rows::row_range;
#[allow(unused_imports)]
use read_expert_rows::validate_numeric;
mod mtp_kind_types;
#[allow(unused_imports)]
use mtp_kind_types::Dense;
#[allow(unused_imports)]
use mtp_kind_types::Descriptor;
#[allow(unused_imports)]
pub(crate) use mtp_kind_types::MtpExpertMatrix;
#[allow(unused_imports)]
pub(crate) use mtp_kind_types::MtpExpertRef;
#[allow(unused_imports)]
pub(crate) use mtp_kind_types::MtpKind;
#[allow(unused_imports)]
pub(crate) use mtp_kind_types::MtpRole;
mod descriptors_types;
#[allow(unused_imports)]
use descriptors_types::DESCRIPTORS;
mod dense_bytes_types;
#[allow(unused_imports)]
use dense_bytes_types::DENSE_BYTES;
#[allow(unused_imports)]
use dense_bytes_types::EXPERT_BLOB;
#[allow(unused_imports)]
use dense_bytes_types::EXPERT_BYTES;
#[allow(unused_imports)]
use dense_bytes_types::FILE_PINS;
#[allow(unused_imports)]
use dense_bytes_types::INDEX_BYTES;
#[allow(unused_imports)]
use dense_bytes_types::INDEX_LIMIT;
#[allow(unused_imports)]
use dense_bytes_types::MAX_READ;
#[allow(unused_imports)]
use dense_bytes_types::MAX_ROWS;
#[allow(unused_imports)]
use dense_bytes_types::MtpIndex;
#[allow(unused_imports)]
pub(crate) use dense_bytes_types::MtpRows;
#[allow(unused_imports)]
pub(crate) use dense_bytes_types::MtpWeights;
@@ -1,11 +1,9 @@
//! Methods of `OwnedCopy`: `create`, `writer`, `owns_directory`, `owns_file` and 1 more.
//! Implements `Drop for OwnedCopy`. Functions: `inode`, `regular`, `root`, `copy_exact` and 8 more.
use super::{
BindingIdentity, DENSE_BYTES, DESCRIPTORS, Dense, Descriptor, EXPERT_BLOB, EXPERT_BYTES, FILE_PINS, File,
INDEX_BYTES, INDEX_LIMIT, InputBindingError, InputResult, MAX_READ, MAX_ROWS, ModelBinding, MtpExpertMatrix,
MtpExpertRef, MtpIndex, MtpKind, MtpRole, MtpRows, MtpWeights, Path, read_exact_range, read_expert_rows,
};
use super::{File, InputBindingError, InputResult, Path};
#[cfg(test)]
use super::{EXPERT_BLOB, MtpExpertMatrix, MtpKind, read_exact_range, read_expert_rows};
use sha2::{Digest, Sha256};
use std::io::Read;
use std::os::unix::fs::{DirBuilderExt, MetadataExt, OpenOptionsExt, PermissionsExt};
@@ -1,10 +1,9 @@
//! The reads of the MTP weights: dense rows, expert rows and the binding identity check.
use super::{
BindingIdentity, DENSE_BYTES, DESCRIPTORS, Dense, Descriptor, EXPERT_BLOB, EXPERT_BYTES, FILE_PINS, File,
INDEX_BYTES, INDEX_LIMIT, InputBindingError, InputResult, MAX_READ, MAX_ROWS, ModelBinding, MtpExpertMatrix,
MtpExpertRef, MtpIndex, MtpKind, MtpRole, MtpRows, MtpWeights, Path, backing, descriptor, read_exact_range,
read_expert_rows, row_range, validate_numeric,
DENSE_BYTES, DESCRIPTORS, EXPERT_BLOB, EXPERT_BYTES, FILE_PINS, INDEX_BYTES, MAX_ROWS, BindingIdentity,
InputBindingError, InputResult, ModelBinding, MtpExpertRef, MtpIndex, MtpKind, MtpRole, MtpRows, MtpWeights,
Path, backing, descriptor, read_exact_range, read_expert_rows, row_range, validate_numeric,
};
impl MtpWeights {
@@ -1,11 +1,9 @@
//! Functions: `read_expert_rows`, `read_expert_row`, `row_range`, `allocate` and 3 more.
//! Split out of `mtp` to keep its files under the line limit.
use super::{
BindingIdentity, DENSE_BYTES, DESCRIPTORS, Dense, Descriptor, EXPERT_BLOB, EXPERT_BYTES, FILE_PINS, File,
INDEX_BYTES, INDEX_LIMIT, InputBindingError, InputResult, MAX_READ, MAX_ROWS, ModelBinding, MtpExpertMatrix,
MtpExpertRef, MtpIndex, MtpKind, MtpRole, MtpRows, MtpWeights, Path, backing,
};
use super::{EXPERT_BLOB, MAX_READ, MAX_ROWS, File, InputBindingError, InputResult, MtpExpertMatrix, MtpKind, MtpRows};
#[cfg(not(target_os = "linux"))]
use super::backing;
pub(super) fn read_expert_rows(
experts: &File,
@@ -123,55 +123,30 @@ mod private_copy;
mod inherited_kar_archive;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
use inherited_kar_archive::check_read_only_archive;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
use inherited_kar_archive::open_read_only_archive;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
use inherited_kar_archive::open_sealed_archive_fd;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
use inherited_kar_archive::reopen_read_only_archive;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
use inherited_kar_archive::verify_open_provenance;
mod load_pinned_inherited_archive;
#[allow(unused_imports)]
use load_pinned_inherited_archive::error;
#[allow(unused_imports)]
#[cfg(test)]
use load_pinned_inherited_archive::input_diagnostic;
#[allow(unused_imports)]
use load_pinned_inherited_archive::input_failure;
#[allow(unused_imports)]
#[cfg(test)]
use load_pinned_inherited_archive::kar_diagnostic;
#[allow(unused_imports)]
use load_pinned_inherited_archive::kar_failure;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
pub(crate) use load_pinned_inherited_archive::load_pinned_inherited_archive;
#[cfg(target_os = "windows")]
#[allow(unused_imports)]
pub(crate) use load_pinned_inherited_archive::load_pinned_inherited_archive;
#[cfg(not(any(target_os = "linux", target_os = "windows")))]
#[allow(unused_imports)]
pub(crate) use load_pinned_inherited_archive::load_pinned_inherited_archive;
#[allow(unused_imports)]
use load_pinned_inherited_archive::log_startup_read;
mod pinned_profile;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
pub(crate) use pinned_profile::load_pinned_archive;
#[cfg(not(target_os = "linux"))]
#[allow(unused_imports)]
pub(crate) use pinned_profile::load_pinned_archive;
#[allow(unused_imports)]
use pinned_profile::pinned_parts;
#[allow(unused_imports)]
pub(crate) use pinned_profile::pinned_profile;
#[allow(unused_imports)]
#[cfg(test)]
use pinned_profile::pinned_profile_spec;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
use pinned_profile::verify_pinned_provenance;
@@ -2,9 +2,8 @@
//! Functions: `open_sealed_archive_fd`, `open_read_only_archive`, `check_read_only_archive`, `reopen_read_only_archi...
use super::{
ARCHIVE_DIGEST, BindingIdentity, File, InheritedKarArchive, InputBindingError, InputResult, KarError,
KarPlePartProvenance, KarPleProfile, KarPleProfileSpec, PINNED_ARCHIVE_BYTES, PLE_ROWS, PROVENANCE_DIGEST, Path,
PathBuf, RefCell, SparseArchive, VerifiedKarPleArtifact, private_copy,
ARCHIVE_DIGEST, PINNED_ARCHIVE_BYTES, PROVENANCE_DIGEST, File, InheritedKarArchive, InputBindingError,
InputResult, Path, PathBuf, SparseArchive, private_copy,
};
use leleka_model_format::weight_source::{BackingKind, FileWeightSource, Verification, WeightIdentity};
@@ -1,10 +1,6 @@
//! New real Linux seal/FD gate; tiny metadata fixture, no CUDA/model capability.
#![cfg(target_os = "linux")]
use super::{
BindingIdentity, File, InheritedKarArchive, InputBindingError, InputResult, KarError, KarPlePartProvenance,
KarPleProfile, KarPleProfileSpec, PINNED_ARCHIVE_BYTES, PLE_ROWS, PROVENANCE_DIGEST, Path, PathBuf, RefCell,
VerifiedKarPleArtifact,
};
use super::{File, InheritedKarArchive, InputBindingError, PINNED_ARCHIVE_BYTES, PROVENANCE_DIGEST, PathBuf};
#[cfg(target_os = "linux")]
use super::{open_sealed_archive_fd, verify_open_provenance};
use rustix::fs::{MemfdFlags, SealFlags, fcntl_add_seals, fcntl_get_seals, memfd_create};
@@ -2,10 +2,9 @@
//! Functions: `open_archive_reader`, `load_pinned_inherited_archive`, `log_startup_read`, `load_pinned_inherited_arc...
use super::{
BindingIdentity, File, InheritedKarArchive, InputBindingError, InputResult, KarError, KarPleBinding,
KarPlePartProvenance, KarPleProfile, KarPleProfileSpec, KarRowPacket, KarRowReader, LoadPhase, NATIVE_DIGESTS,
PINNED_ARCHIVE_BYTES, PLE_ROWS, PROVENANCE_DIGEST, Path, PathBuf, RefCell, VerifiedKarPleArtifact,
open_sealed_archive_fd, pinned_profile, reopen_read_only_archive, verify_open_provenance,
NATIVE_DIGESTS, PINNED_ARCHIVE_BYTES, PLE_ROWS, PROVENANCE_DIGEST, BindingIdentity, File, InheritedKarArchive,
InputBindingError, InputResult, KarError, KarPleBinding, KarRowPacket, KarRowReader, LoadPhase, RefCell,
VerifiedKarPleArtifact, open_sealed_archive_fd, pinned_profile, reopen_read_only_archive, verify_open_provenance,
};
/// The read handle of the inherited archive: a read-only reopen of the file, or the sealed memfd itself.
@@ -2,10 +2,9 @@
//! Functions: `pinned_profile`, `pinned_parts`, `pinned_profile_spec`, `load_pinned_archive` and 3 more.
use super::{
ARCHIVE_DIGEST, BindingIdentity, File, InheritedKarArchive, InputBindingError, InputResult, KarError,
KarPlePartProvenance, KarPleProfile, KarPleProfileSpec, LoadPhase, NATIVE_DIGESTS, PART0_F32_DIGEST,
PART1_F32_DIGEST, PLE_ROWS, PROVENANCE_DIGEST, Path, PathBuf, RefCell, VIRTUAL_F32_DIGEST, VerifiedKarPleArtifact,
error, input_failure, kar_failure, private_copy,
ARCHIVE_DIGEST, NATIVE_DIGESTS, PART0_F32_DIGEST, PART1_F32_DIGEST, PROVENANCE_DIGEST, VIRTUAL_F32_DIGEST, File,
InheritedKarArchive, InputBindingError, InputResult, KarPlePartProvenance, KarPleProfile, KarPleProfileSpec,
LoadPhase, Path, VerifiedKarPleArtifact, error, input_failure, kar_failure, private_copy,
};
/// Candidate expectations from independently verified v4 conversion receipts
@@ -2,9 +2,8 @@
//! Functions: `diagnostic_cases`, `assert_kar_diagnostic_redacts`, `assert_input_diagnostic_survives_broken_sink`, `...
use super::{
BindingIdentity, File, InputBindingError, InputResult, KarError, KarPlePartProvenance, KarPleProfile,
KarPleProfileSpec, LoadPhase, NATIVE_DIGESTS, PLE_ROWS, Path, PathBuf, RefCell, VerifiedKarPleArtifact, error,
input_diagnostic, kar_diagnostic, pinned_profile, pinned_profile_spec,
NATIVE_DIGESTS, PLE_ROWS, InputBindingError, KarError, LoadPhase, error, input_diagnostic, kar_diagnostic,
pinned_profile, pinned_profile_spec,
};
#[cfg(not(target_os = "windows"))]
@@ -283,32 +283,24 @@ mod private_loader_tests {
}
mod inode;
#[allow(unused_imports)]
#[cfg(test)]
use inode::diagnostic;
#[cfg(target_os = "linux")]
#[allow(unused_imports)]
pub(super) use inode::freeze;
#[cfg(target_os = "macos")]
#[allow(unused_imports)]
pub(super) use inode::freeze;
#[allow(unused_imports)]
#[cfg(target_os = "macos")]
use inode::inode;
#[allow(unused_imports)]
pub(super) use inode::open_regular;
#[allow(unused_imports)]
#[cfg(target_os = "macos")]
use inode::phase_error;
#[cfg(target_os = "macos")]
#[allow(unused_imports)]
use inode::protected_root;
#[allow(unused_imports)]
pub(super) use inode::provenance_error;
#[allow(unused_imports)]
use inode::report_io;
mod checked_reader;
#[cfg(target_os = "macos")]
#[allow(unused_imports)]
use checked_reader::checked_reader;
#[allow(unused_imports)]
use checked_reader::copy_exact;
#[allow(unused_imports)]
#[cfg(test)]
use checked_reader::copy_exact_reporting;
@@ -1,10 +1,9 @@
//! Functions: `checked_reader`, `copy_exact`, `copy_exact_reporting`, `copy_buffer` and 1 more.
//! Split out of `private_copy` to keep its files under the line limit.
use super::{
COPY_BUFFER, File, InputBindingError, InputResult, IoPhase, LoadPhase, Metadata, MetadataExt, OpenOptions,
OpenOptionsExt, Path, Read, SOURCE_FLAGS, Seek, Write, inode, input_failure, phase_error, report_io,
};
use super::{COPY_BUFFER, InputBindingError, InputResult, IoPhase, LoadPhase, Read, Write, input_failure, report_io};
#[cfg(not(target_os = "linux"))]
use super::{SOURCE_FLAGS, File, Metadata, MetadataExt, OpenOptions, OpenOptionsExt, Seek, inode, phase_error};
#[cfg(target_os = "macos")]
pub(super) fn checked_reader(own: &OwnedCopy, bytes: u64) -> InputResult<File> {
@@ -2,9 +2,11 @@
//! Functions: `inode`, `diagnostic`, `report_io`, `phase_error` and 8 more.
use super::{
File, Inode, InputBindingError, InputResult, IoPhase, LoadPhase, Metadata, MetadataExt, OpenOptions,
OpenOptionsExt, Path, Read, SOURCE_FLAGS, Seek, Write, checked_reader, copy_exact, input_failure,
SOURCE_FLAGS, File, Inode, InputBindingError, InputResult, IoPhase, LoadPhase, Metadata, MetadataExt,
OpenOptions, OpenOptionsExt, Path, Seek, Write, copy_exact, input_failure,
};
#[cfg(not(target_os = "linux"))]
use super::{Read, checked_reader};
pub(super) fn inode(meta: &Metadata) -> Inode {
(meta.dev(), meta.ino())
@@ -97,8 +97,6 @@ mod dense_slab_policy;
mod workspaces;
use workspaces::Workspaces;
mod dense_weight_cache_methods;
#[allow(unused_imports)]
use dense_slab_policy::dense_slab_policy;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use dense_slab_policy::startup_step;
@@ -77,7 +77,6 @@ pub(crate) struct QwenForward;
mod tests;
mod prefill_step_product;
#[allow(unused_imports)]
use prefill_step_product::diagnose;
mod qwen_forward;
mod read_layer_attention;
@@ -85,15 +84,11 @@ mod step_layers;
mod step_request;
mod step_residual_capture;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use read_layer_attention::LayerEntry;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use read_layer_attention::prepare_layer_attention_micro;
#[allow(unused_imports)]
use read_layer_attention::read_layer_attention;
#[allow(unused_imports)]
#[cfg(test)]
use read_layer_attention::validate_descriptors;
#[allow(unused_imports)]
use read_layer_attention::validate_layer_plan;
pub(crate) use step_request::{StepCaches, StepPurpose, StepRequest};
@@ -151,14 +151,9 @@ mod prompt_chunk_operands;
pub(in crate::qwen_forward) use prompt_chunk_operands::{
ChunkCaches, ChunkDraft, PromptChunkSource, PromptChunkTarget,
};
#[allow(unused_imports)]
use prompt_chunk_operands::{ChunkInFlight, ChunkRollback, ChunkWork, OpenChunk};
mod staged_input_enabled;
#[allow(unused_imports)]
use staged_input_enabled::staged_input_enabled;
mod original_prompt_executor;
mod original_prompt_executor_drop;
#[allow(unused_imports)]
use original_prompt_executor_drop::driver_error;
#[allow(unused_imports)]
pub(in crate::qwen_forward) use original_prompt_executor_drop::run_original_prompt;
@@ -4,13 +4,13 @@
#![allow(dead_code)]
use super::super::session::chunk::QwenChunkTxn;
use super::{
BindingIdentity, BoundLayerKind, DenseWeightCache, Dimension, Error, ForwardPhase, GdnStage, GrRead, GrStage,
InjectedResidual, InputStage, KarPleCache, LayerEntry, LayerId, ModelBinding, MoeExpertStage, MoeRouteStage,
MoeWeightCache, OutputStage, Position, QsaAttentionStage, QsaIndexStage, QsaPrepareRequest, QwenForward,
QwenSession, QwenStepTxn, Result, Stage, StepCaches, StepPurpose, StepRequest, TargetStepOrigin, TargetStepProduct,
TokenId, VerificationChunk, VerificationSource, WindowCaches, diagnose, prefill_chunk,
prepare_layer_attention_micro, read_layer_attention, validate_layer_plan,
BoundLayerKind, DenseWeightCache, Dimension, Error, ForwardPhase, GdnStage, GrStage, InjectedResidual, InputStage,
KarPleCache, LayerEntry, LayerId, ModelBinding, MoeExpertStage, MoeRouteStage, MoeWeightCache, OutputStage,
Position, QsaAttentionStage, QsaIndexStage, QwenForward, QwenSession, QwenStepTxn, Result, Stage, TargetStepProduct,
TokenId, diagnose, prepare_layer_attention_micro, read_layer_attention, validate_layer_plan,
};
#[cfg(test)]
use super::{StepCaches, StepRequest};
#[derive(Clone, Copy)]
enum ChunkMoePolicy {
Native,
@@ -32,22 +32,17 @@ mod window_numeric;
mod native_mmq_evaluation;
mod target_step_product;
#[allow(unused_imports)]
use target_step_product::chunk_diagnostic;
mod qwen_forward;
pub(crate) use qwen_forward::PrefillChunkInputs;
use qwen_forward::PrefillChunkPlan;
mod prepare_micro_ffn_rows;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use prepare_micro_ffn_rows::{MicroEnv, prepare_micro_ffn_rows};
mod prepare_q6_layer_columns;
#[allow(unused_imports)]
use prepare_q6_layer_columns::prepare_q6_layer_columns;
mod check_chunk_on_loaded;
#[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
pub(in crate::qwen_forward) use check_chunk_on_loaded::check_chunk_on_loaded;
mod read_chunk_attention_ffn;
#[allow(unused_imports)]
use read_chunk_attention_ffn::{AttentionHandoff, read_chunk_attention_ffn};
@@ -2,19 +2,17 @@
//! Split out of `prefill_chunk` to keep its files under the line limit.
use super::{
AttentionHandoff, BindingIdentity, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension, Error,
ForwardPhase, GdnStage, GrRead, GrStage, InjectedResidual, InputStage, KarPleCache, LayerEntry, LayerId, MicroEnv,
ModelBinding, MoeExpertStage, MoeRouteStage, MoeWeightCache, OutputStage, Position, QsaAttentionStage,
QsaIndexStage, QsaPrepareRequest, QwenChunkTxn, QwenForward, QwenSession, QwenStepTxn, Result, Stage, StepCaches,
StepPurpose, StepRequest, TargetStepOrigin, TargetStepProduct, TokenId, VerificationChunk, VerificationSource,
WindowCaches, chunk_diagnostic, diagnose, prefill_chunk, prepare_layer_attention_micro, prepare_micro_ffn_rows,
prepare_q6_layer_columns, qwen_forward, read_chunk_attention_ffn, read_layer_attention, validate_layer_plan,
AttentionHandoff, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension, Error, ForwardPhase, GdnStage,
GrStage, InjectedResidual, InputStage, KarPleCache, LayerEntry, LayerId, MicroEnv, ModelBinding, MoeExpertStage,
MoeRouteStage, MoeWeightCache, OutputStage, Position, QsaAttentionStage, QsaIndexStage, QwenChunkTxn, QwenForward,
QwenSession, QwenStepTxn, Result, Stage, TargetStepProduct, TokenId, chunk_diagnostic, diagnose,
prepare_layer_attention_micro, prepare_micro_ffn_rows, prepare_q6_layer_columns, read_chunk_attention_ffn,
read_layer_attention, validate_layer_plan,
};
#[cfg(all(test, target_arch = "x86_64"))]
use super::{check_chunk_on_loaded, window_numeric};
mod joint_chunk;
#[allow(unused_imports)]
use joint_chunk::AllocationTrace;
pub(crate) use joint_chunk::PrefillChunkInputs;
pub(super) use joint_chunk::PrefillChunkPlan;
@@ -7,6 +7,7 @@ use super::{
#[cfg(all(test, target_arch = "x86_64"))]
use super::window_numeric;
use crate::qwen_forward::mtp_decode::MtpDecoder;
#[cfg(test)]
use leleka_cuda_driver::Context;
/// The borrowed inputs of one prefill chunk (the session and the MoE cache travel beside them).
@@ -2,14 +2,12 @@
//! Defines `MicroBank`, `MicroBank`, `NativeMoe` and 6 more.
use super::{
AllocationTrace, AttentionHandoff, BindingIdentity, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension,
Error, ForwardPhase, GdnStage, GrRead, GrStage, InjectedResidual, InputStage, KarPleCache, LayerEntry, LayerId,
MicroEnv, ModelBinding, MoeExpertStage, MoeRouteStage, MoeWeightCache, OutputStage, Position, PrefillChunkInputs,
PrefillChunkPlan, QsaAttentionStage, QsaIndexStage, QsaPrepareRequest, QwenChunkTxn, QwenForward, QwenSession,
QwenStepTxn, Result, Stage, StepCaches, StepPurpose, StepRequest, TargetStepOrigin, TokenId, VerificationChunk,
VerificationSource, WindowCaches, chunk_diagnostic, diagnose, prepare_layer_attention_micro,
prepare_micro_ffn_rows, prepare_q6_layer_columns, qwen_forward, read_chunk_attention_ffn, read_layer_attention,
validate_layer_plan,
AttentionHandoff, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension, Error, ForwardPhase, GdnStage,
GrStage, InjectedResidual, InputStage, KarPleCache, LayerEntry, LayerId, MicroEnv, ModelBinding, MoeExpertStage,
MoeRouteStage, MoeWeightCache, OutputStage, Position, PrefillChunkInputs, PrefillChunkPlan, QsaAttentionStage,
QsaIndexStage, QwenChunkTxn, QwenForward, QwenSession, QwenStepTxn, Result, Stage, TokenId, chunk_diagnostic,
diagnose, prepare_layer_attention_micro, prepare_micro_ffn_rows, prepare_q6_layer_columns, read_chunk_attention_ffn,
read_layer_attention, validate_layer_plan,
};
#[cfg(all(test, target_arch = "x86_64"))]
use super::window_numeric;
@@ -9,7 +9,6 @@ use crate::qwen_forward::contract::TokenLayer;
use crate::qwen_forward::gr::{DetachedGrRead, GrRead};
use crate::qwen_forward::moe_expert::PreparedMoeRow;
use crate::qwen_forward::q6_attention_columns::ProjectionRow;
use crate::qwen_forward::qsa_attention::QsaReady;
impl QwenForward {
/// Attention, FFN read and routing of one row on the host stages; the policy selects the retained GR flow or the
@@ -2,12 +2,9 @@
//! The returned report owns only counts/booleans; its assertions belong AFTER
//! the caller has closed all actual GPU owners and checked allocated_bytes=0.
use super::{
AttentionHandoff, BindingIdentity, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension, Error, GdnStage,
GrRead, GrStage, InjectedResidual, InputStage, KarPleCache, LayerEntry, LayerId, MicroEnv, ModelBinding,
MoeExpertStage, MoeRouteStage, MoeWeightCache, OutputStage, Position, PrefillChunkInputs, PrefillChunkPlan,
QsaAttentionStage, QsaIndexStage, QsaPrepareRequest, QwenChunkTxn, QwenForward, QwenSession, QwenStepTxn, Result,
Stage, StepCaches, StepPurpose, StepRequest, TargetStepOrigin, TargetStepProduct, TokenId, VerificationChunk,
VerificationSource, WindowCaches, qwen_forward,
ChunkMoePolicy, DenseWeightCache, Dimension, Error, KarPleCache, ModelBinding, MoeWeightCache, OutputStage,
Position, PrefillChunkInputs, PrefillChunkPlan, QwenChunkTxn, QwenForward, QwenSession, Result, Stage, StepCaches,
StepRequest, TargetStepProduct, TokenId,
};
use crate::qwen_forward::loaded_target_owners::LoadedTargetOwners;
use crate::qwen_forward::mtp_decode::MtpDecoder;
@@ -196,8 +196,6 @@ mod tests {
}
}
#[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
pub(crate) use chunk_device::numeric_gpu::run_gdn_chunk_numeric;
#[cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
mod four_borrow_gpu;
@@ -211,69 +209,45 @@ pub(in crate::qwen_forward) use prompt_device::{PromptLayer, PromptProgram, Prom
mod cached_step;
mod gdn_ready;
mod stage_steps;
#[allow(unused_imports)]
use cached_step::preflight_budget;
#[allow(unused_imports)]
use cached_step::project_chain_input;
#[allow(unused_imports)]
use cached_step::step_cached;
mod projection;
#[allow(unused_imports)]
use projection::convolve;
#[allow(unused_imports)]
use projection::dispatch_projection;
#[allow(unused_imports)]
use projection::normalize_qk;
#[allow(unused_imports)]
#[cfg(test)]
use projection::project_retained;
#[allow(unused_imports)]
use projection::{ProjectionOperands, project};
mod gates;
#[allow(unused_imports)]
use gates::{GateHostOperands, OutNormScale};
mod step_operands;
#[allow(unused_imports)]
#[cfg(test)]
use gates::all_finite;
#[allow(unused_imports)]
use gates::allocate;
#[allow(unused_imports)]
use gates::binding_error;
#[allow(unused_imports)]
use gates::download;
#[allow(unused_imports)]
use gates::download_unchecked;
#[allow(unused_imports)]
use gates::gates;
#[allow(unused_imports)]
use gates::out_norm;
#[allow(unused_imports)]
pub(super) use gates::pool_enabled;
#[allow(unused_imports)]
use gates::recur;
#[allow(unused_imports)]
use gates::release;
#[allow(unused_imports)]
#[cfg(test)]
pub(crate) use gates::set_pool_override;
#[allow(unused_imports)]
use gates::upload;
#[allow(unused_imports)]
use gates::validate_values;
#[allow(unused_imports)]
use gates::zeros;
#[allow(unused_imports)]
use step_operands::MirrorStep;
#[allow(unused_imports)]
pub(in crate::qwen_forward) use step_operands::{
DeviceChunkRow, GdnLayerInput, GdnMatrixLayout, LeaseClaim, LeasedProjection, MirrorAuthority, ProjectedQkvSource,
ReadoutClaim, RecurrenceOperands,
};
mod driver_error;
#[allow(unused_imports)]
pub(super) use driver_error::driver_error;
#[allow(unused_imports)]
#[cfg(test)]
use driver_error::key_head;
#[allow(unused_imports)]
#[cfg(test)]
use driver_error::state_index;
#[cfg(test)]
#[allow(unused_imports)]
use driver_error::validate_candidates;
@@ -331,9 +331,8 @@ mod retained_qk_gpu {
}
mod allocate_qk_slot;
#[allow(unused_imports)]
#[cfg(test)]
use allocate_qk_slot::allocate_qk_slot;
#[allow(unused_imports)]
use allocate_qk_slot::normalize_retained_qk;
mod chain;
mod chain_drop;
@@ -3,18 +3,10 @@
use super::super::session::chunk::GdnChunkMicro;
use super::super::session::chunk::{GdnChunkRow, GdnChunkSeal, GdnChunkStart};
use super::{
ALL_MIRROR_BYTES, Bf16ProjectionShape, BindingIdentity, BoundLayerKind, Context, DenseFormat, DenseWeightCache,
DeviceBuffer, DeviceChunkRow, Dimension, DriverError, Error, GateHostOperands, GdnInputLease, GdnInputScratch,
GdnLayerInput, GdnMatrixKind, GdnMatrixLayout, GdnMatrixRole, GdnOwner, GdnPending, GdnPrior, GdnStateKey,
GdnStateMirror, GdnWeights, GrRole, HISTORY_ELEMENTS, InputBindingError, LayerId, LeaseClaim, LeasedProjection,
MirrorAuthority, MirrorStep, ModelBinding, OutNormScale, ProjectedQkvSource, ProjectionKind, ProjectionOperands,
ProjectionSpec, PromptLayer, PromptProgram, PromptSource, Q5KProjectionShape, Q6KProjectionShape, QkScratch,
QwenStepTxn, ReadoutClaim, RecurrenceOperands, ResidualReady, Result, STATE_ELEMENTS, Stage, TokenLayer, VALUES,
allocate, chain, download, download_unchecked, driver_error, pool_enabled, preflight_budget, release, state,
upload, validate_values, verification,
BindingIdentity, Context, DenseWeightCache, DeviceBuffer, Error, GdnPrior, HISTORY_ELEMENTS, ModelBinding, Result,
STATE_ELEMENTS, TokenLayer, VALUES, allocate, download, download_unchecked, driver_error, pool_enabled,
preflight_budget, upload, validate_values,
};
#[cfg(test)]
use super::CHANNELS;
use leleka_cuda_driver::{GdnRowQueue, GdnStateFiniteGuard};
use std::{cell::Cell, rc::Rc};
pub(in crate::qwen_forward) const CHUNK_DEVICE_CHARGE: usize = 2 * STATE_ELEMENTS * 4 + 4;
@@ -66,9 +58,7 @@ pub(in crate::qwen_forward) mod numeric_gpu;
mod mirror_reuse_enabled;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use mirror_reuse_enabled::micro_rows;
#[allow(unused_imports)]
use mirror_reuse_enabled::mirror_reuse_enabled;
mod gdn_chunk_device_methods;
mod native_fused_step;
@@ -2,17 +2,10 @@
//! Split out of `chunk_device` to keep its files under the line limit.
use super::{
ALL_MIRROR_BYTES, Bf16ProjectionShape, BindingIdentity, BoundLayerKind, CHUNK_DEVICE_CHARGE, Cell, ChunkEdge,
ChunkReadout, Context, DenseFormat, DenseWeightCache, DeviceBuffer, DeviceChunkRow, Dimension, DriverError, Error,
GateHostOperands, GdnChunkDevice, GdnChunkMicro, GdnChunkRow, GdnChunkSeal, GdnChunkStart, GdnInputLease,
GdnInputScratch, GdnLayerInput, GdnMatrixKind, GdnMatrixLayout, GdnMatrixRole, GdnOwner, GdnPending, GdnPrior,
GdnRowQueue, GdnStateFiniteGuard, GdnStateKey, GdnStateMirror, GdnWeights, GrRole, HISTORY_ELEMENTS,
InputBindingError, LayerId, LeaseClaim, LeasedProjection, MirrorAuthority, MirrorStep, ModelBinding, OutNormScale,
ProjectedQkvSource, ProjectionKind, ProjectionOperands, ProjectionSpec, PromptLayer, PromptProgram, PromptSource,
Q5KProjectionShape, Q6KProjectionShape, QkScratch, QwenStepTxn, Rc, ReadoutClaim, ReadoutDownload,
RecurrenceOperands, ResidualReady, Result, STATE_ELEMENTS, Stage, TokenLayer, VALUES, allocate, chain, download,
download_unchecked, driver_error, micro_rows, mirror_reuse_enabled, pool_enabled, preflight_budget, release, state,
upload, validate_values, verification,
BindingIdentity, CHUNK_DEVICE_CHARGE, Cell, ChunkEdge, ChunkReadout, Context, DenseWeightCache, DeviceBuffer, Error,
GdnChunkDevice, GdnChunkMicro, GdnChunkRow, GdnChunkSeal, GdnChunkStart, GdnPrior, GdnRowQueue, HISTORY_ELEMENTS,
ModelBinding, Rc, ReadoutDownload, Result, STATE_ELEMENTS, VALUES, allocate, download, download_unchecked,
driver_error, micro_rows, mirror_reuse_enabled, pool_enabled, preflight_budget, upload, validate_values,
};
mod chunk_device_batch_compute;
@@ -4,16 +4,9 @@ use super::super::super::contract::{Dimension, LayerId};
use super::super::super::session::chunk::TestGdnComponentRows;
use super::super::{RecurrenceOperands, convolve, recur};
use super::{
ALL_MIRROR_BYTES, Bf16ProjectionShape, BindingIdentity, BoundLayerKind, CHANNELS, CHUNK_DEVICE_CHARGE, Cell,
ChunkReadout, Context, DenseFormat, DenseWeightCache, DeviceBuffer, DeviceChunkRow, DriverError, Error,
GateHostOperands, GdnChunkDevice, GdnChunkMicro, GdnChunkRow, GdnChunkSeal, GdnChunkStart, GdnInputLease,
GdnInputScratch, GdnLayerInput, GdnMatrixKind, GdnMatrixLayout, GdnMatrixRole, GdnOwner, GdnPending, GdnPrior,
GdnRowQueue, GdnStateFiniteGuard, GdnStateKey, GdnStateMirror, GdnWeights, GrRole, HISTORY_ELEMENTS,
InputBindingError, LeaseClaim, LeasedProjection, MirrorAuthority, MirrorStep, ModelBinding, OutNormScale,
ProjectedQkvSource, ProjectionKind, ProjectionOperands, ProjectionSpec, PromptLayer, PromptProgram, PromptSource,
Q5KProjectionShape, Q6KProjectionShape, QkScratch, QwenStepTxn, Rc, ReadoutClaim, ResidualReady, Result,
STATE_ELEMENTS, Stage, TokenLayer, allocate, chain, download, driver_error, preflight_budget, release, state,
upload, validate_values,
BindingIdentity, CHUNK_DEVICE_CHARGE, Cell, ChunkReadout, Context, DeviceBuffer, Error, GdnChunkDevice, GdnChunkRow,
GdnChunkSeal, GdnChunkStart, GdnPrior, GdnStateFiniteGuard, HISTORY_ELEMENTS, Rc, Result, STATE_ELEMENTS, allocate,
download, driver_error, preflight_budget, upload, validate_values,
};
use leleka_cuda_driver::Driver;
@@ -65,25 +58,14 @@ fn batch_adoption_is_consecutive_atomic_and_swaps_the_final_state_once() {
}
mod operands;
#[allow(unused_imports)]
use operands::component_owner;
#[allow(unused_imports)]
use operands::convolution_input;
#[allow(unused_imports)]
use operands::convolution_weights;
#[allow(unused_imports)]
use operands::difference;
#[allow(unused_imports)]
use operands::operands;
#[allow(unused_imports)]
use operands::reference;
#[allow(unused_imports)]
use operands::require;
mod exercise;
#[allow(unused_imports)]
use exercise::exercise;
#[allow(unused_imports)]
pub(crate) use exercise::run_gdn_chunk_numeric;
mod batch_adoption;
#[allow(unused_imports)]
use batch_adoption::batch_adoption;
@@ -2,16 +2,9 @@
//! Functions: `operands`, `convolution_input`, `convolution_weights`, `difference` and 3 more.
use super::{
ALL_MIRROR_BYTES, Bf16ProjectionShape, BindingIdentity, BoundLayerKind, CHANNELS, CHUNK_DEVICE_CHARGE, Cell,
Context, DenseFormat, DenseWeightCache, DeviceBuffer, DeviceChunkRow, Dimension, Driver, DriverError, Error,
GateHostOperands, GdnChunkDevice, GdnChunkMicro, GdnChunkRow, GdnChunkSeal, GdnChunkStart, GdnInputLease,
GdnInputScratch, GdnLayerInput, GdnMatrixKind, GdnMatrixLayout, GdnMatrixRole, GdnOwner, GdnPending, GdnPrior,
GdnRowQueue, GdnStateFiniteGuard, GdnStateKey, GdnStateMirror, GdnWeights, GrRole, InputBindingError, LayerId,
LeaseClaim, LeasedProjection, MirrorAuthority, MirrorStep, ModelBinding, Operands, OutNormScale,
ProjectedQkvSource, ProjectionKind, ProjectionOperands, ProjectionSpec, PromptLayer, PromptProgram, PromptSource,
Q5KProjectionShape, Q6KProjectionShape, QkScratch, QwenStepTxn, ROWS, Rc, ReadoutClaim, RecurrenceOperands,
Reference, ResidualReady, Result, STATE_ELEMENTS, Stage, TestGdnComponentRows, TokenLayer, allocate, chain,
convolve, driver_error, preflight_budget, recur, state, upload, validate_values,
CHUNK_DEVICE_CHARGE, Cell, Context, Error, GdnChunkDevice, GdnChunkStart, GdnPrior, Operands, ROWS, Rc,
RecurrenceOperands, Reference, Result, STATE_ELEMENTS, allocate, convolve, driver_error, preflight_budget, recur,
upload, validate_values,
};
impl Operands {
@@ -74,5 +74,4 @@ mod gpu_tests;
mod gdn_state_mirror_methods;
mod mirror_readout;
mod upload_checked;
#[allow(unused_imports)]
use upload_checked::upload_checked;
@@ -132,16 +132,10 @@ mod tests {
mod gpu;
mod gdn_batch_resources;
#[allow(unused_imports)]
use gdn_batch_resources::admit_batch_bytes;
#[allow(unused_imports)]
#[cfg(test)]
pub(in crate::qwen_forward) use gdn_batch_resources::batch_device_bytes;
#[allow(unused_imports)]
use gdn_batch_resources::f32_bytes;
#[allow(unused_imports)]
use gdn_batch_resources::native_format;
mod buffers;
#[allow(unused_imports)]
use buffers::release_pool;
mod gdn_stage;
mod step_batch;
@@ -1,7 +1,6 @@
//! Methods of `GdnStage`: `step_chunk_batch`.
//! Split out of `prefill_batch` to keep its files under the line limit.
#[allow(unused_imports)]
use super::step_batch::{
check_gdn_window, gather_gdn_rows, gdn_operands, latch_cuda_failure, prepare_or_refuse, run_gdn_program,
settle_gdn, window_bytes,
@@ -79,6 +79,5 @@ pub(super) struct PoolRow<'ctx> {
mod numeric_gpu;
mod compute_row;
#[allow(unused_imports)]
pub(super) use compute_row::compute_row;
mod workspace;
@@ -9,7 +9,6 @@ use super::{
};
mod verified_row_compute_and_lease;
#[allow(unused_imports)]
pub(in super::super) use verified_row_compute_and_lease::compute_row;
mod workspace;
mod workspace_replay;
@@ -93,9 +93,8 @@ mod gr_residual_reuse_gpu;
mod batch_chunk;
pub(in crate::qwen_forward) use batch_chunk::GrBatchRow;
pub(in crate::qwen_forward) use batch_chunk::GrMicroAttentionBlock as GrMicroBlock;
pub(in crate::qwen_forward) use batch_chunk::{
GrMicroAttention, GrMicroAttentionBank, GrMicroAttentionBlock, GrMicroInput, MicroBlockRequest,
GrMicroAttentionBank, GrMicroAttentionBlock, GrMicroInput, MicroBlockRequest,
};
mod attention_chunk;
@@ -108,42 +107,25 @@ pub(in crate::qwen_forward) use retained_handoff::AttentionBlockOutput;
mod output_workspace_gpu;
mod diagnose;
#[allow(unused_imports)]
use diagnose::diagnose;
#[allow(unused_imports)]
use diagnose::diagnose_extrema;
mod gr_stage;
mod read_cuda;
mod residual_ready;
#[allow(unused_imports)]
use read_cuda::read_cuda;
mod read_cached_cuda;
#[allow(unused_imports)]
use read_cached_cuda::admit_budget;
#[allow(unused_imports)]
use read_cached_cuda::copy_cached_f32;
#[allow(unused_imports)]
use read_cached_cuda::inject_cached_cuda;
#[allow(unused_imports)]
use read_cached_cuda::read_cached_cuda;
#[allow(unused_imports)]
use read_cached_cuda::release_all;
#[allow(unused_imports)]
use read_cached_cuda::upload_bf16;
#[allow(unused_imports)]
use read_cached_cuda::upload_cached_f32;
#[allow(unused_imports)]
use read_cached_cuda::upload_f32;
mod download_f32;
#[allow(unused_imports)]
use download_f32::binding_error;
#[allow(unused_imports)]
use download_f32::download_f32;
#[allow(unused_imports)]
use download_f32::driver_error;
#[allow(unused_imports)]
use download_f32::validate_layer;
#[allow(unused_imports)]
use download_f32::validate_streams;
#[allow(unused_imports)]
use download_f32::validate_values;
@@ -52,9 +52,7 @@ pub(in crate::qwen_forward) struct GrBatchRow {
}
mod gr_micro_input;
#[allow(unused_imports)]
pub(super) use gr_micro_input::micro_driver_error;
#[allow(unused_imports)]
pub(super) use gr_micro_input::save_micro_values;
mod batch_inject;
mod gr_stage;
@@ -1,7 +1,6 @@
//! Methods of `GrStage`: `mint_micro_input`, `prepare_micro_initial`, `prepare_micro_after_ple`, `prepare_micro_afte...
//! Methods of `GrBatchScope`: `detach_rows`, `refuse_device`, `seal`.
#[allow(unused_imports)]
use super::super::super::dense_weight_cache::GrResident;
use super::{
Cell, Context, DenseWeightCache, DetachedGrRead, DeviceBuffer, Dimension, Error, GrBatchScope, GrMicroAttention,
@@ -1,7 +1,6 @@
//! Methods of `GrStage`: `prepare_detached_batch_injection`, `prepare_batch_injection`, `inject_batch`.
//! Functions: `check_batch_read`.
#[allow(unused_imports)]
use super::batch_inject::{device_inject, gather_batch};
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
use super::batch_inject::{finish_queued, queued_inject};
@@ -1,7 +1,6 @@
//! Methods of `GrStage`: `apply`, `read_ffn`, `read_attention`, `read_attention_after_ple` and 6 more.
//! Functions: `copy_streams`, `resolve_gr_weights`, `read_candidate`, `check_injection_origin` and 2 more.
#[allow(unused_imports)]
use super::super::dense_weight_cache::GrResident;
use super::{
Context, DenseWeightCache, DeviceBuffer, Dimension, Error, GrPhase, GrRead, GrRole, GrScratch, GrStage, GrWeights,
@@ -2,11 +2,9 @@
//! Defines `Tally`.
use super::{
AttentionBlockOutput, BindingIdentity, Cell, Context, DenseWeightCache, DetachedGrRead, DeviceBuffer, Dimension,
DriverError, Error, GR_OUTPUT_BYTES, GR_OUTPUT_DEVICE_BYTES, GrBatchRow, GrMicroAttention, GrMicroAttentionBank,
GrMicroAttentionBlock, GrMicroBlock, GrMicroInput, GrRole, GrScratch, GrWeights, InputBindingError, LayerId,
MicroBlockRequest, ModelBinding, PleReady, QwenStepTxn, Rc, ReadCandidate, RefCell, RefMut, Result, TokenLayer,
download_f32, driver_error, inject_cached_cuda, read_cached_cuda, retained_handoff, upload_bf16, upload_f32,
BindingIdentity, Cell, Context, DeviceBuffer, Error, GR_OUTPUT_BYTES, GR_OUTPUT_DEVICE_BYTES, GrScratch, Rc,
ReadCandidate, RefCell, Result, download_f32, driver_error, inject_cached_cuda, read_cached_cuda, retained_handoff,
upload_bf16, upload_f32,
};
use leleka_cuda_driver::Driver;
@@ -99,18 +97,11 @@ fn original_first_fixed_outputs_repeat_overwrite_abort_and_cleanup() {
}
mod fresh_read;
#[allow(unused_imports)]
use fresh_read::block;
#[allow(unused_imports)]
use fresh_read::coefficients;
#[allow(unused_imports)]
use fresh_read::fresh_inject;
#[allow(unused_imports)]
use fresh_read::fresh_read;
#[allow(unused_imports)]
use fresh_read::poison_all;
#[allow(unused_imports)]
use fresh_read::streams;
mod check_handoff;
#[allow(unused_imports)]
use check_handoff::check_handoff;
@@ -5,14 +5,6 @@ use super::{
BindingIdentity, Context, DeviceBuffer, Error, GR_OUTPUT_DEVICE_BYTES, GrScratch, ReadCandidate, Result, block,
download_f32, driver_error, fresh_inject, fresh_read, poison_all, read_cached_cuda, retained_handoff, streams,
};
// used only with some cargo features of this crate
#[allow(unused_imports)]
use super::{
AttentionBlockOutput, Cell, DenseWeightCache, DetachedGrRead, Dimension, Driver, DriverError, GrBatchRow,
GrMicroAttention, GrMicroAttentionBank, GrMicroAttentionBlock, GrMicroBlock, GrMicroInput, GrRole, GrWeights,
InputBindingError, LayerId, MicroBlockRequest, ModelBinding, PleReady, QwenStepTxn, Rc, RefCell, RefMut, Stage,
TokenLayer, coefficients,
};
pub(super) fn check_handoff<'ctx>(
scratch: &mut GrScratch<'ctx>,
@@ -2,14 +2,6 @@
//! Split out of `output_workspace_gpu` to keep its files under the line limit.
use super::{Context, DeviceBuffer, Error, GR_OUTPUT_BYTES, GrScratch, Result, download_f32, driver_error, upload_f32};
// used only with some cargo features of this crate
#[allow(unused_imports)]
use super::{
AttentionBlockOutput, BindingIdentity, Cell, DenseWeightCache, DetachedGrRead, Dimension, Driver, DriverError,
GrBatchRow, GrMicroAttention, GrMicroAttentionBank, GrMicroAttentionBlock, GrMicroBlock, GrMicroInput, GrRole,
GrWeights, InputBindingError, LayerId, MicroBlockRequest, ModelBinding, PleReady, QwenStepTxn, Rc, RefCell, RefMut,
Stage, TokenLayer,
};
pub(super) fn fresh_read(
context: &Context<'_>,
@@ -220,39 +220,20 @@ mod ple_tests {
mod input_stage;
mod residual_streams;
pub(super) use input_stage::PositionedToken;
#[allow(unused_imports)]
use input_stage::gather_ple;
#[allow(unused_imports)]
use input_stage::trace_ple;
#[allow(unused_imports)]
#[cfg(test)]
use input_stage::validate_ids;
mod gather_rows;
#[allow(unused_imports)]
pub(super) use gather_rows::binding_error;
#[allow(unused_imports)]
use gather_rows::gather_rows;
mod input_stage_ple_micro;
#[allow(unused_imports)]
use input_stage_ple_micro::ple_cuda_cached;
mod ple_cuda;
#[allow(unused_imports)]
use ple_cuda::ple_budget;
#[allow(unused_imports)]
use ple_cuda::ple_cuda;
#[allow(unused_imports)]
use ple_cuda::ple_project;
#[allow(unused_imports)]
use ple_cuda::ple_upload;
#[allow(unused_imports)]
use ple_cuda::ple_values;
#[allow(unused_imports)]
use ple_cuda::ple_zeros;
mod ple_upload_f32;
#[allow(unused_imports)]
use ple_upload_f32::ple_download;
#[allow(unused_imports)]
use ple_upload_f32::ple_driver_error;
#[allow(unused_imports)]
use ple_upload_f32::ple_upload_f32;
#[allow(unused_imports)]
use ple_upload_f32::ple_upload_u16;
@@ -50,17 +50,11 @@ struct Transport<'ctx> {
mod ple_key_retained_gpu;
mod role;
#[allow(unused_imports)]
use role::admit;
#[allow(unused_imports)]
use role::at;
#[allow(unused_imports)]
pub(super) use role::compose;
mod ple_inner_composition;
#[allow(unused_imports)]
use ple_inner_composition::compose_inner;
#[cfg(test)]
#[allow(unused_imports)]
use ple_inner_composition::compose_observed;
#[allow(unused_imports)]
pub(super) use ple_inner_composition::compose_queued;
@@ -2,8 +2,8 @@
#![cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
use super::super::{ple_upload, ple_upload_f32};
use super::{
Bf16ProjectionShape, Cell, Context, DeviceBuffer, Error, Finite, PLE_HC, PLE_HISTORY, PleCandidate, PleRows, Rc,
Result, Role, Transport, at, compose, ple_download, ple_driver_error, role,
Bf16ProjectionShape, Cell, Context, DeviceBuffer, Error, Finite, PleCandidate, PleRows, Rc, Result, Role, Transport,
at, compose, ple_download, ple_driver_error,
};
#[cfg(test)]
use super::{Observations, compose_observed};
@@ -216,17 +216,9 @@ fn prove_sticky_policy(ctx: &Context<'_>, device: &leleka_cuda_driver::Device<'_
}
mod bf16;
#[allow(unused_imports)]
use bf16::bf16;
#[allow(unused_imports)]
use bf16::exact;
#[allow(unused_imports)]
use bf16::original;
#[allow(unused_imports)]
use bf16::owned_key;
#[allow(unused_imports)]
use bf16::run;
#[allow(unused_imports)]
use bf16::source;
#[allow(unused_imports)]
use bf16::value_bytes;
@@ -2,9 +2,8 @@
//! Methods of `Chain`: `key_value`, `norms`, `gate`, `gated` and 2 more.
use super::{
Bf16ProjectionShape, Cell, Context, DeviceBuffer, Driver, Error, Finite, Matrices, PLE_HC, PLE_HISTORY,
PleCandidate, PleClosedWeights, Rc, Result, Role, Transport, at, ple_download, ple_driver_error, ple_upload,
ple_upload_f32,
Bf16ProjectionShape, Context, DeviceBuffer, Finite, Matrices, Role, Transport, at, ple_download, ple_driver_error,
ple_upload, ple_upload_f32,
};
#[cfg(test)]
use super::Observations;
@@ -134,18 +134,12 @@ mod slot_tests;
mod lru_tests;
mod scratch_bytes;
#[allow(unused_imports)]
use scratch_bytes::assign_slots;
#[allow(unused_imports)]
use scratch_bytes::lookup_rows;
#[allow(unused_imports)]
use scratch_bytes::plan_gather;
#[allow(unused_imports)]
use scratch_bytes::scratch_bytes;
mod publish_gather;
#[allow(unused_imports)]
use publish_gather::ahead_enabled;
#[allow(unused_imports)]
use publish_gather::publish_gather;
mod ahead_rows;
mod kar_ple_cache_methods;
@@ -5,10 +5,8 @@ use super::contract::{Error, LayerId, Result, Stage, TokenLayer};
use super::gr::ResidualReady;
use super::moe_route::RoutedExperts;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use super::moe_weight_cache::SourceMatrix;
use super::moe_weight_cache::{CachedMoeMatrix, MoeWeightCache};
#[allow(unused_imports)]
use super::moe_weight_cache::{MmqChunkRequest, SharedTailRow};
use super::session::QwenStepTxn;
use crate::model_binding::kar_expert_source::{KarExpertSource, KarSourceError};
@@ -70,65 +68,34 @@ mod tests;
mod expert_step;
pub(in crate::qwen_forward) use expert_step::ExpertRowRequest;
#[allow(unused_imports)]
use expert_step::StepCuda;
#[allow(unused_imports)]
use expert_step::execute_cuda;
#[allow(unused_imports)]
use expert_step::execute_cuda_kar;
#[allow(unused_imports)]
use expert_step::kar_error;
mod cached_expert_run;
#[allow(unused_imports)]
use cached_expert_run::execute_cuda_cached;
#[allow(unused_imports)]
use cached_expert_run::finish_with_parts;
mod scoped_expert_mlp;
#[allow(unused_imports)]
use scoped_expert_mlp::DownProvenance;
#[allow(unused_imports)]
use scoped_expert_mlp::cached_gate_up_scoped;
#[allow(unused_imports)]
use scoped_expert_mlp::cached_mlp_down;
mod expert_mlp_values;
#[allow(unused_imports)]
use expert_mlp_values::expert_mlp;
#[allow(unused_imports)]
#[cfg(test)]
use expert_mlp_values::finish_cached_mlp;
#[allow(unused_imports)]
use expert_mlp_values::project_cached_gate_up;
#[allow(unused_imports)]
#[cfg(test)]
use expert_mlp_values::project_retained_gate_up;
mod expert_matrix_projection;
#[allow(unused_imports)]
use expert_matrix_projection::admit_budget;
#[cfg(test)]
#[allow(unused_imports)]
use expert_matrix_projection::collect_rows;
#[allow(unused_imports)]
use expert_matrix_projection::dual_format_kind;
#[allow(unused_imports)]
use expert_matrix_projection::dual_routed_format;
#[allow(unused_imports)]
use expert_matrix_projection::launch_cached_prepared;
#[allow(unused_imports)]
use expert_matrix_projection::launch_cached_projection;
#[allow(unused_imports)]
#[cfg(test)]
use expert_matrix_projection::launch_projection;
#[allow(unused_imports)]
use expert_matrix_projection::project_matrix;
#[allow(unused_imports)]
use expert_matrix_projection::{DeclaredMatrix, ExpertActivation, ExpertMatrix, MatrixDims};
mod validate_values;
#[allow(unused_imports)]
use validate_values::binding_error;
#[allow(unused_imports)]
use validate_values::download_f32;
#[allow(unused_imports)]
use validate_values::driver_error;
#[allow(unused_imports)]
use validate_values::upload_bytes;
#[allow(unused_imports)]
use validate_values::upload_f32;
#[allow(unused_imports)]
use validate_values::validate_values;
@@ -1,7 +1,6 @@
//! Methods of `ActualSlotPacket`: `validate`. Methods of `ActualDown`: `take`.
//! Functions: `shared_scalar_buffers`, `release_shared_inputs`, `scaled_shared`, `finish_with_parts` and 1 more.
#[allow(unused_imports)]
use super::moe_down::{RetainedScalar, ScaledDown};
use super::{
ActualDown, ActualSlotPacket, BoundExpert, Cell, Context, DeviceBuffer, DownOrigin, DownProvenance, DownScope,
@@ -11,11 +11,6 @@ use super::{
Stage, StepCuda, TokenLayer, TransportBuffer, admit_budget, binding_error, cached_mlp_down, download_f32,
driver_error, dual_routed_format, execute_cuda_cached, launch_cached_projection, moe_down, validate_values,
};
#[cfg(test)]
use super::{
DeclaredMatrix, DenseFormat, ExpertMatrix, ExpertRowRequest, InputBindingError, KarExpertSource, KarSourceError,
MoeExpertBlock, ProjectionKind, ProjectionSpec, Q5KProjectionShape, Q6KProjectionShape, ResidualReady,
};
use leleka_cuda_driver::DownColumns;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
mod adaptive_packets;
@@ -78,42 +73,28 @@ mod adaptive;
mod prepared_moe_row;
pub(in crate::qwen_forward) use prepared_moe_row::ChunkFfnLayer;
#[allow(unused_imports)]
use prepared_moe_row::grouped_pairs;
mod bound_rows;
mod execute_bound;
#[allow(unused_imports)]
use execute_bound::execute_bound;
mod project_group;
#[allow(unused_imports)]
use project_group::{ExpertGroup, project_group};
mod packet_run_project_group_direct;
mod project_group_shared_fns;
mod project_group_source_consumers;
mod project_group_source_fenced;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
use project_group_source_consumers::project_group_source_consumers;
mod direct_packets_fns;
mod ordered_down_refusal;
#[allow(unused_imports)]
use ordered_down_refusal::PacketGroupMembers;
#[allow(unused_imports)]
use ordered_down_refusal::finish_shared;
#[allow(unused_imports)]
use ordered_down_refusal::finish_shared_queued;
#[allow(unused_imports)]
use ordered_down_refusal::ordered_down_refusal;
#[allow(unused_imports)]
use ordered_down_refusal::use_direct_packets;
#[allow(unused_imports)]
use ordered_down_refusal::use_shared_tail;
#[allow(unused_imports)]
use ordered_down_refusal::validate_packet_pairs;
mod finish_shared_with;
#[allow(unused_imports)]
use finish_shared_with::RowTail;
#[allow(unused_imports)]
use finish_shared_with::finish_shared_with;
#[allow(unused_imports)]
use finish_shared_with::uses_adaptive;
@@ -8,12 +8,10 @@ use super::{
use crate::qwen_forward::cpu_expert_miss::runtime_error;
mod adaptive_packet_projection;
#[allow(unused_imports)]
pub(super) use adaptive_packet_projection::project_adaptive_packets;
mod packet_plan;
mod packet_wave;
pub(super) use packet_wave::PacketWave;
mod packet_wave_projection;
#[allow(unused_imports)]
use packet_wave_projection::project_inner;
mod gpu_wave_staging;
@@ -1,15 +1,9 @@
//! ONE loaded actual-row transport proof. No source admission, ModelBinding,
//! session advancement, standalone Load or full-model qualification is minted.
use super::{
BindingIdentity, BoundExpert, CachedMoeMatrix, ChunkFfnLayer, ChunkFfnRow, CompletedCpuRow, Context, DEVICE_PEAK,
DeclaredMatrix, DenseFormat, DeviceBuffer, DownColumns, DownProvenance, DownScope, DownSelection, DriverError,
Error, ExpertActivation, ExpertGroup, ExpertMatrix, ExpertReady, ExpertRowRequest, FF, GrRole, GrStage,
InputBindingError, K, KarExpertSource, KarSourceError, LayerId, MatrixDims, MmqChunkRequest, ModelBinding,
MoeExpertBlock, MoeExpertSelection, MoeExpertStage, MoeExpertWeights, MoeMatrixKind, MoeMatrixRole, MoeWeightCache,
N, NativePromptFinish, PackedDown, PacketGroupMembers, PreparedMoeRow, ProjectionKind, ProjectionSpec,
Q5KProjectionShape, Q6KProjectionShape, QwenChunkTxn, Rc, ResidualReady, Result, RetainedDown, RoutedExperts,
RoutedFormat, RoutedGateUpQ8, RowTail, SharedTailRow, SourceMatrix, Stage, StepCuda, TokenLayer, TransportBuffer,
download_f32, driver_error, moe_down, validate_values,
ChunkFfnLayer, ChunkFfnRow, Context, DEVICE_PEAK, DeviceBuffer, DownScope, DownSelection, DriverError, Error,
ExpertReady, FF, GrStage, K, LayerId, ModelBinding, MoeExpertStage, MoeWeightCache, N, PreparedMoeRow, QwenChunkTxn,
Rc, Result, Stage, TransportBuffer, download_f32, driver_error, validate_values,
};
use crate::qwen_forward::gr::DetachedGrRead;
use crate::qwen_forward::session::{QwenStepTxn, ResetReplaySnapshot, chunk::ChunkAttentionRow};
@@ -70,44 +64,21 @@ pub(crate) struct LoadedArms<'a, 'k, 'ctx> {
}
mod policy;
#[allow(unused_imports)]
use policy::arm_attention_reads;
#[allow(unused_imports)]
use policy::arm_chunk_rows;
#[allow(unused_imports)]
use policy::arm_consume_inputs;
#[allow(unused_imports)]
use policy::arm_ffn_rows;
#[allow(unused_imports)]
use policy::arm_prepare_row;
#[allow(unused_imports)]
use policy::arm_tokens;
#[allow(unused_imports)]
use policy::cancel_probe;
#[allow(unused_imports)]
use policy::compare;
#[allow(unused_imports)]
pub(super) use policy::copy_completed;
#[allow(unused_imports)]
pub(super) use policy::observe_packet;
#[allow(unused_imports)]
pub(super) use policy::policy;
mod arm;
#[allow(unused_imports)]
use arm::arm;
#[allow(unused_imports)]
use arm::corrupted_bytes;
#[allow(unused_imports)]
use arm::preflight_copy;
#[allow(unused_imports)]
use arm::probe_payload;
#[allow(unused_imports)]
use arm::refuse_alien_scope;
mod probe;
#[allow(unused_imports)]
use probe::output_differences;
#[allow(unused_imports)]
use probe::same_outputs;
#[allow(unused_imports)]
use probe::transport_probe;
mod loaded_arms;
@@ -2,7 +2,6 @@
//! Methods of `DirectGroup`: `check_descriptors`, `run`, `project_gate_up`, `project_gate_up_role` and 6 more.
use super::direct_packets_fns::PacketRun;
#[allow(unused_imports)]
use super::project_group_shared_fns::*;
use super::{
ActualSlotPacket, CachedMoeMatrix, ChunkFfnRow, Context, DeviceBuffer, DownColumns, DownOrigin, DownScope,
@@ -2,7 +2,6 @@
//! Methods of `DownArgs`: `refusal_values`. Functions: `project_group`.
use super::packet_run_project_group_direct::{DownProjection, GroupBuffers, RefusalReplay};
#[allow(unused_imports)]
use super::project_group_shared_fns::{
GateUpColumns, check_group_descriptors, close_group_buffers, down_kind_format, down_outcome, gate_up_format,
gate_up_plain, hidden_buffer, launch_down_in_workspace, launch_down_plain, prepared_refs, swiglu_into_hidden,
@@ -11,7 +11,7 @@ use leleka_cuda_driver::{MmqWorkspace, OriginalMmqLayer};
mod expert_gather;
mod layer_walk;
use super::resident_layer::{LayerResources, Resident, RoutedGroups};
use layer_walk::{SlotState, StagingPlan, Walk, WalkOwners};
use layer_walk::{StagingPlan, Walk, WalkOwners};
pub(super) fn execute_adaptive_groups<'ctx>(
resident: &Resident<'_, '_, 'ctx>,
@@ -62,24 +62,11 @@ fn small_context_refusals(device: &leleka_cuda_driver::Device<'_>) {
}
mod encoded;
#[allow(unused_imports)]
use encoded::bounded_gate_up;
#[allow(unused_imports)]
use encoded::compare_mlp;
#[allow(unused_imports)]
use encoded::down;
#[allow(unused_imports)]
use encoded::down_projection;
#[allow(unused_imports)]
use encoded::encoded;
#[allow(unused_imports)]
use encoded::exact;
#[allow(unused_imports)]
use encoded::format_case;
#[allow(unused_imports)]
use encoded::raw;
mod former_fixture_domain_refusal;
#[allow(unused_imports)]
use former_fixture_domain_refusal::former_fixture_domain_refusal;
#[allow(unused_imports)]
use former_fixture_domain_refusal::saturation_and_refusals;
@@ -44,17 +44,10 @@ mod pair;
use down_reuse_refusal_rig::Rig;
use pair::Env;
mod exact;
#[allow(unused_imports)]
use exact::down_weights;
#[allow(unused_imports)]
use exact::exact;
#[allow(unused_imports)]
use exact::original_down;
#[allow(unused_imports)]
use exact::project;
#[allow(unused_imports)]
use exact::refused;
#[allow(unused_imports)]
use exact::retained;
#[allow(unused_imports)]
use exact::scalar_weights;
@@ -1,6 +1,5 @@
//! The refusal and abort phases of the retained Down proof (one body per phase, STRA-338).
#[allow(unused_imports)]
use super::pair::{Env, le_bytes};
use super::{
Cell, Context, DeviceBuffer, DownScope, DownSelection, Error, K, N, PackedDown, Rc, RetainedScalar, ScaledDown,
@@ -145,19 +145,11 @@ use route_micro::{
validate_micro,
};
mod moe_prefill_resources;
#[allow(unused_imports)]
use moe_prefill_resources::admit;
#[allow(unused_imports)]
use moe_prefill_resources::down_format;
#[allow(unused_imports)]
use moe_prefill_resources::f32_bytes;
#[allow(unused_imports)]
use moe_prefill_resources::gate_up_format;
#[allow(unused_imports)]
pub(in crate::qwen_forward) use moe_prefill_resources::validate_route_row;
mod device_bytes;
#[allow(unused_imports)]
use device_bytes::device_bytes;
#[allow(unused_imports)]
use device_bytes::release_pool;
mod moe_prefill_stage;
@@ -93,32 +93,20 @@ mod projection_tests {
}
mod router_logits;
#[allow(unused_imports)]
#[cfg(test)]
use router_logits::admit_projection_budget;
#[allow(unused_imports)]
pub(super) use router_logits::validate_activation;
mod project_logits;
#[allow(unused_imports)]
use project_logits::RouterInput;
#[allow(unused_imports)]
use project_logits::binding_error;
#[allow(unused_imports)]
#[cfg(test)]
use project_logits::collect_logits;
#[allow(unused_imports)]
use project_logits::project_logits;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
pub(super) use project_logits::route_batch_row;
#[allow(unused_imports)]
use project_logits::route_with;
#[allow(unused_imports)]
use project_logits::routed_from_raw;
#[allow(unused_imports)]
pub(super) use project_logits::validate_logits;
#[allow(unused_imports)]
use project_logits::validate_request;
mod run_cuda;
#[allow(unused_imports)]
pub(super) use run_cuda::map_driver_error;
#[allow(unused_imports)]
use run_cuda::run_cuda;
@@ -36,7 +36,10 @@ mod cache_strata_adaptive;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
pub(in crate::qwen_forward) use cache_original_prompt::PromptWeightOwners;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
pub(crate) use cache_original_prompt::{PREFILL_STREAM_OVERRIDE, set_span_cache_override};
#[cfg(test)]
pub(crate) use cache_original_prompt::PREFILL_STREAM_OVERRIDE;
#[cfg(test)]
pub(crate) use cache_original_prompt::set_span_cache_override;
pub(crate) use cache_profile::{LearnedMainWitness, SharedPermanentWitness};
pub(crate) use cache_strata_adaptive::AdaptiveWitness;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
@@ -344,23 +347,16 @@ mod original_mtp_weights;
pub(in crate::qwen_forward) use original_mtp_weights::{MtpHeadSources, RetainedOriginalMtpWeights};
mod validate_ranked_profile;
#[allow(unused_imports)]
// pinning and the epoch are read by the decode graph reuse, which the stack does not wire yet
#[allow(dead_code)]
mod window_pins;
use validate_ranked_profile::dual_layout;
#[allow(unused_imports)]
use validate_ranked_profile::integer_iq3_triplet;
#[allow(unused_imports)]
pub(super) use validate_ranked_profile::oldest_weight;
#[allow(unused_imports)]
pub(in crate::qwen_forward) use validate_ranked_profile::original_dual_layout;
#[allow(unused_imports)]
use validate_ranked_profile::original_mmq_triplet;
#[allow(unused_imports)]
pub(super) use validate_ranked_profile::room_fits;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[allow(unused_imports)]
pub(crate) use validate_ranked_profile::validate_ranked_profile;
mod moe_cache_routed_owners;
mod moe_weight_cache_methods;
@@ -116,17 +116,11 @@ struct MappedStage<'ctx> {
}
mod healthy_cancel;
#[allow(unused_imports)]
use healthy_cancel::close_buffers;
#[allow(unused_imports)]
use healthy_cancel::close_slot;
#[allow(unused_imports)]
use healthy_cancel::combine;
#[allow(unused_imports)]
use healthy_cancel::empty_slot;
#[allow(unused_imports)]
use healthy_cancel::healthy_cancel;
#[allow(unused_imports)]
pub(in crate::qwen_forward) use healthy_cancel::observe_cancel;
mod ephemeral_mapped_stage;
mod ephemeral_routed_owner;
@@ -33,7 +33,6 @@ pub(super) struct PreparedUpdates {
mod tests;
mod slot;
#[allow(unused_imports)]
use slot::slot;
mod lru_index;
mod lru_index_seeding;
@@ -16,13 +16,10 @@ pub static PREFILL_STREAM_OVERRIDE: std::sync::atomic::AtomicI8 = std::sync::ato
static SPAN_CACHE_OVERRIDE: std::sync::atomic::AtomicI8 = std::sync::atomic::AtomicI8::new(-1);
mod prompt_stream_settings;
#[allow(unused_imports)]
use prompt_stream_settings::native_format;
#[allow(unused_imports)]
use prompt_stream_settings::prompt_stream_settings;
#[allow(unused_imports)]
#[cfg(test)]
pub(crate) use prompt_stream_settings::set_span_cache_override;
#[allow(unused_imports)]
pub(crate) use prompt_stream_settings::span_cache_enabled;
mod moe_weight_cache;
mod moe_weights_original_prompt;
@@ -1,7 +1,6 @@
//! Methods of `MoeWeightCache`: `original_prompt_moe`, `original_prompt_parts`, `original_prompt_precheck`.
//! Functions: `raw_weight`, `shared_formats`, `shared_weights`.
#[allow(unused_imports)]
use super::prompt_layer_fns::{PromptIo, PromptParts, PromptWeightOwners, SpanScan, run_prompt_layer};
use super::{
DenseWeightCache, DeviceBuffer, EncodedWeight, Entry, Error, GdnNativeFormat, HashMap, LayerId, ModelBinding,
@@ -126,7 +126,5 @@ mod learned_main_sdet;
mod ranked_profile;
mod shared_permanent_pool;
#[allow(unused_imports)]
pub(super) use shared_permanent_pool::learned_main_slot_bound;
#[allow(unused_imports)]
pub(super) use shared_permanent_pool::remaining_shared_main;
@@ -1,13 +1,8 @@
//! Binding-authenticated constructor; metadata alone cannot produce weights.
use super::{
AdaptiveWitness, BindingIdentity, BoundExpert, Cell, Context, DeviceBuffer, DeviceRef, EncodedWeight, Entry, Error,
FixedMtpWeights, HashMap, LearnedMainWitness, LruIndex, MAIN_LIMIT, MmqChunkRequest, MmqFormat, MmqWeights,
MmqWorkspace, ModelBinding, MoeExpertSelection, MoeExpertWeights, MoeMatrixRole, MoeWeightCache,
MoeWeightDescriptor, MtpExpertPicks, MtpHeadSources, MtpInputWorkspace, MtpKind, MtpKvClaim, MtpKvResident,
MtpRole, MtpStepSite, PREFILL_STREAM_OVERRIDE, PendingMtpKv, PreparedUpdates, PromptWeightOwners, Rc, RefCell,
Result, RetainedOriginalMtpWeights, RoutedFiniteStage, RoutedGroupWorkspace, RoutedStageFiniteGuard, SharedKeys,
SharedPermanentWitness, SharedTailRow, SharedWeightsRequest, SourceMatrix, TripletLoanRequest, WORKING_RESERVE,
WeightCacheCounters, binding_error, cache_profile, cache_strata_adaptive, driver_error,
Context, DeviceBuffer, DeviceRef, EncodedWeight, Entry, Error, HashMap, MAIN_LIMIT, ModelBinding, MoeMatrixRole,
MoeWeightCache, MoeWeightDescriptor, Rc, RefCell, Result, WORKING_RESERVE, WeightCacheCounters, binding_error,
cache_profile, cache_strata_adaptive, driver_error,
};
#[cfg(test)]
use super::room_fits;
@@ -181,9 +176,8 @@ mod reusable_spill_floor_planning {
mod moe_weight_cache;
mod profile_window_spill;
#[allow(unused_imports)]
#[cfg(test)]
use profile_window_spill::profile_window_spill;
#[allow(unused_imports)]
use profile_window_spill::profile_window_spill_with_floor;
mod learned_main_lru_profile;
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
@@ -1,7 +1,6 @@
//! Methods of `MoeWeightCache`: `new_profile_shared_permanent_learned_main_lru`, `learned_main_totals`, `check_learn...
//! Split out of `cache_profile_fill` to keep its files under the line limit.
#[allow(unused_imports)]
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
use super::profile_build::{ProfileFile, ProfileKind, ProfileRequest};
use super::{
@@ -2,15 +2,9 @@
//! Split out of `cache_profile_fill` to keep its files under the line limit.
use super::{
AdaptiveWitness, BindingIdentity, BoundExpert, Cell, Context, DeviceBuffer, DeviceRef, EncodedWeight, Entry, Error,
FixedMtpWeights, HOST_CAP, HashMap, LearnedMainWitness, LruIndex, MAIN_LIMIT, MmqChunkRequest, MmqFormat,
MmqWeights, MmqWorkspace, ModelBinding, MoeExpertSelection, MoeExpertWeights, MoeMatrixRole, MoeWeightCache,
MoeWeightDescriptor, MtpExpertPicks, MtpHeadSources, MtpInputWorkspace, MtpKind, MtpKvClaim, MtpKvResident,
MtpRole, MtpStepSite, PREFILL_STREAM_OVERRIDE, PROFILE_SHA, PendingMtpKv, PinnedPool, PrefixPlan, PreparedUpdates,
ProfileLimits, PromptWeightOwners, RankedProfile, Rc, RefCell, Result, RetainedOriginalMtpWeights,
RoutedFiniteStage, RoutedGroupWorkspace, RoutedStageFiniteGuard, SharedKeys, SharedPermanentWitness, SharedTailRow,
SharedWeightsRequest, SourceMatrix, TripletLoanRequest, WORKING_RESERVE, binding_error, driver_error,
profile_window_spill_with_floor,
Context, DeviceRef, EncodedWeight, Entry, Error, HOST_CAP, HashMap, MAIN_LIMIT, ModelBinding, MoeMatrixRole,
MoeWeightCache, MoeWeightDescriptor, PROFILE_SHA, PinnedPool, PrefixPlan, ProfileLimits, RankedProfile, Result,
WORKING_RESERVE, binding_error, driver_error, profile_window_spill_with_floor,
};
#[cfg(test)]
use super::ProfileWitness;
@@ -1,8 +1,8 @@
//! Methods of `MoeWeightCache`: `new_native_integer_iq3_mmq_retained_mtp_kv_shared_tail_profile_mtp_input_spill_floo...
//! Defines `QuartetRoom`.
#[allow(unused_imports)]
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
#[cfg(test)]
use super::profile_build::{ProfileFile, ProfileKind, ProfileRequest};
use super::{
DeviceRef, EncodedWeight, Entry, Error, MAIN_LIMIT, ModelBinding, MoeWeightCache, MoeWeightDescriptor, Result,
@@ -1,7 +1,6 @@
//! Methods of `MoeWeightCache`: `new_native_strata_adaptive_shared_permanent`, `new_native_strata_adaptive_shared_pe...
//! Functions: `adaptive_template`. Defines `AdaptivePlan`, `SharedKeys`.
#[allow(unused_imports)]
use super::profile_build::ProfileFile;
use super::{
Context, DeviceBuffer, Entry, Error, HOST_CAP, HashMap, MAIN_LIMIT, ModelBinding, MoeMatrixRole, MoeWeightCache,
@@ -94,13 +94,9 @@ pub(crate) struct AdaptiveWitness {
}
mod reserve;
#[allow(unused_imports)]
use reserve::blob_bytes;
#[allow(unused_imports)]
use reserve::cell;
#[allow(unused_imports)]
use reserve::reserve;
mod adaptive_cache;
mod transfer_metadata_bound;
#[allow(unused_imports)]
pub(super) use transfer_metadata_bound::transfer_metadata_bound;
@@ -161,8 +161,8 @@ mod share_tests {
}
mod dense_copies_equal;
#[allow(unused_imports)]
#[cfg(test)]
use dense_copies_equal::dense_copies_equal;
mod retained_original_mtp_weights;
#[allow(unused_imports)]
#[cfg(test)]
use retained_original_mtp_weights::rt_kind;
@@ -7,15 +7,7 @@
//! `window_keys` remembers which entries a window reads; freeing one of them (only possible while unpinned) and
//! releasing the pins both bump `weights_epoch`, which is part of the graph key, so a set recorded before is retired.
//! Everything is `&self` (cells): the assembly holds the cache by shared reference while a request runs.
use super::{
AdaptiveWitness, BindingIdentity, BoundExpert, Cell, Context, DeviceBuffer, DeviceRef, Error, FixedMtpWeights,
HashMap, LearnedMainWitness, LruIndex, MmqChunkRequest, MmqFormat, MmqWeights, MmqWorkspace, ModelBinding,
MoeExpertSelection, MoeExpertWeights, MoeMatrixRole, MoeWeightCache, MoeWeightDescriptor, MtpExpertPicks,
MtpHeadSources, MtpInputWorkspace, MtpKind, MtpKvClaim, MtpKvResident, MtpRole, MtpStepSite,
PREFILL_STREAM_OVERRIDE, PendingMtpKv, PreparedUpdates, PromptWeightOwners, Rc, RefCell, Result,
RetainedOriginalMtpWeights, RoutedFiniteStage, RoutedGroupWorkspace, RoutedStageFiniteGuard, SharedKeys,
SharedPermanentWitness, SharedTailRow, SharedWeightsRequest, SourceMatrix, TripletLoanRequest, window_pins,
};
use super::{Error, MoeWeightCache, MoeWeightDescriptor, Result};
/// The entries a window reads, and whether the cache currently protects them.
#[derive(Default)]
@@ -61,31 +61,15 @@ pub(super) struct MtpFinalMixed {
}
mod mtp_frame;
#[allow(unused_imports)]
use mtp_frame::input_refusal;
#[allow(unused_imports)]
use mtp_frame::queued_fc_shape;
mod step;
#[allow(unused_imports)]
pub(super) use step::f32_weights;
#[allow(unused_imports)]
use step::norm;
#[allow(unused_imports)]
pub(super) use step::preflight;
#[allow(unused_imports)]
pub(super) use step::project;
#[allow(unused_imports)]
pub(super) use step::project_attention_output;
#[allow(unused_imports)]
pub(super) use step::reserve;
#[allow(unused_imports)]
pub(super) use step::step;
#[allow(unused_imports)]
use step::step_core;
#[allow(unused_imports)]
pub(super) use step::warm_chunk_row;
#[allow(unused_imports)]
pub(super) use step::warm_step;
mod project_attention_out_numeric;
#[allow(unused_imports)]
pub(super) use project_attention_out_numeric::project_attention_out_numeric;

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