engine crates: the generated doc headers (Methods of ..., Functions: ..., Split out of ...) are real descriptions of what the file is and why it is a file of its own (438 files, comment lines only)
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 5.5
parent
8b5e94fce9
commit
e45e4d7aa0
@@ -1,5 +1,6 @@
|
||||
//! Methods of `ConversationCache`: `new`, `enabled`, `budget`, `slots` and 15 more. Functions: `deepest_key`.
|
||||
//! Split out of `cache` to keep its files under the line limit.
|
||||
//! Behaviour of the parked-conversation cache: byte and slot accounting, the retained K/V reuse buffers, best-prefix
|
||||
//! lookup, making room by eviction, removal of superseded copies and `put`.
|
||||
//! Pure CPU policy; the types and the `ParkedConversation` trait it works on are in the parent `cache` module.
|
||||
|
||||
use super::{
|
||||
CheckpointKey, ConversationCache, ConversationImageKey, ConversationKv, ConversationKvReuse, Match,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `ConversationCheckpoint`: `bytes`. Methods of `ConversationKv`: `bytes`, `buffers`, `buffers_mut`.
|
||||
//! Implements `Default for SavedConversation`, `ParkedConversation for SavedConversation`.
|
||||
//! Byte accounting of a saved checkpoint and of a layer's K/V buffers, the reuse bookkeeping for retained K/V, and
|
||||
//! the `ParkedConversation` view of a host-memory `SavedConversation` (live and checkpoint keys, steering, size).
|
||||
|
||||
use super::{
|
||||
CheckpointKey, ConversationBuffer, ConversationCheckpoint, ConversationImageKey, ConversationKv,
|
||||
|
||||
+3
-3
@@ -1,6 +1,6 @@
|
||||
//! Tests of tests by topic (moved out of the test file by STRA-338):
|
||||
//! retained_buffers_count_against_bytes_but_not_slots, a_b_a_recovery_and_slot_eviction,
|
||||
//! checkpoints_steering_and_boundary_rules, image_identity_is_part_of_the_prefix ....
|
||||
//! Pins the cache accounting and eviction rules: retained K/V buffers cost bytes but no slot, A-B-A recovery, slot
|
||||
//! and byte eviction oldest first, checkpoint, steering and boundary matching, image identity as part of the prefix,
|
||||
//! and superseded copies of one conversation never pushing another out.
|
||||
|
||||
use super::{A, B, ConversationCache, ConversationImageKey, ConversationKv, cp, exact_kv_layers, image, size_of, with};
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//! Tests of `tests` by topic: what_is_not_superseded,
|
||||
//! disabled_caches_store_nothing, take_out_of_range_is_none_and_prefix_len_is_generic_over_token_types,
|
||||
//! struct_sizes_match_the_64_bit_original_layout.
|
||||
//! Pins what the cache must NOT treat as superseded (other conversations sharing only a root, a different steering
|
||||
//! mode, entries without checkpoints), plus the disabled-cache, out-of-range `take` and struct-layout edge cases.
|
||||
|
||||
use super::{
|
||||
A, B, ConversationCache, ConversationCheckpoint, ConversationImageKey, ConversationKv, SavedConversation, cp,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Functions: `verify_ring`, `kv_verify`.
|
||||
//! Split out of `kv` to keep its files under the line limit.
|
||||
//! Read-back check of a restored K/V layer: the saved bytes and the drafter ring's resident pages are compared with
|
||||
//! the device and the authoritative payload is fingerprinted. Diagnostic only; it never changes model state.
|
||||
|
||||
use super::{
|
||||
ConvResult, ConversationKv, KvLayer, KvPool, KvTarget, QsaDesc, StateMemory, Verifier, kv_validate, region,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! Methods of `Verifier`: `compare`, `failure`.
|
||||
//! Functions: `set_geometry`, `reusable_prefix`, `capture_buffer`, `capture_layer` and 5 more.
|
||||
//! Capture, validation and restore of one layer's K/V image against device memory. Capture keeps the unchanged prefix
|
||||
//! of buffers retained from an earlier restore and copies only the rest; restore refills streamed residency.
|
||||
//! Also the `Verifier` that compares device bytes with the image for the read-back check.
|
||||
|
||||
use super::{
|
||||
ConvError, ConvResult, ConversationKv, IDX_BLOCK, KvLayer, KvPool, KvTarget, Layout, ModelGeometry, PAGE_SIZE,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `Layout`: `sizes`.
|
||||
//! Functions: `kv_q4_bytes_per_head`, `valid_extent`, `geometry_ok`, `check_layout_inputs` and 12 more.
|
||||
//! Byte layout of one layer's K/V image: the snapshot format code, the extent and geometry checks, and the sizes of
|
||||
//! keys, values, scales and pooled indexer rows. `kv_bytes` and `kv_capture_bytes` give the sizes a capture needs.
|
||||
|
||||
use super::{
|
||||
ConvError, ConvResult, ConversationKv, IDX_BLOCK, KV_HYBRID, KV_ROTATED, KvLayer, KvPool, Layout, ModelGeometry,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Groups the submodules `conversation_resume_checkpoints`, `conversation_state_events`.
|
||||
//! Split out of `manager` to keep its files under the line limit.
|
||||
//! Hub of the `ConversationManager` implementation: the resume and checkpoint half and the state and parking half
|
||||
//! live in the two child modules and share the imports declared here.
|
||||
|
||||
use super::{
|
||||
CheckpointKey, ConvError, ConvResult, ConversationCache, ConversationCheckpoint, ConversationImageKey,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `ConversationManager`: `pick_resume`, `take_incoming`, `restore_parked`, `align_to_request` and 10 more.
|
||||
//! Split out of `conversation_manager` to keep its files under the line limit.
|
||||
//! The request path of `ConversationManager`: choose what a request resumes from (live session, checkpoint or parked
|
||||
//! conversation), restore and position the device, then keep the checkpoint chain through the prompt and at the end.
|
||||
//! Mirrors the resume choice and `checkpoint_at` of the Original's `generate.cpp`.
|
||||
|
||||
use super::{
|
||||
ConvError, ConvResult, ConversationCheckpoint, ConversationImageKey, ConversationManager, PromptAction, PromptPath,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `ConversationManager`: `new`, `options`, `live`, `live_ok` and 13 more.
|
||||
//! Split out of `conversation_manager` to keep its files under the line limit.
|
||||
//! The state half of `ConversationManager`: construction, read-only views of the live tokens, checkpoints and cache,
|
||||
//! the event log, invalidation, and the parking of the current session (size estimate, making room, capture, store).
|
||||
|
||||
use super::{
|
||||
CheckpointKey, ConvResult, ConversationCache, ConversationCheckpoint, ConversationKvReuse, ConversationManager,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Implements `Default for ConversationOptions`. Functions: `images_below`, `starts_with`, `is_allocation`.
|
||||
//! Split out of `manager` to keep its files under the line limit.
|
||||
//! Default `ConversationOptions` and the prompt-prefix helpers the manager uses: picture positions below a limit,
|
||||
//! the "saved point is a prefix of the request" test, and the classification of allocation failures.
|
||||
|
||||
use super::{ConvError, ConversationImageKey, ConversationOptions};
|
||||
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
//! Tests of manager_tests by topic (moved out of the test file by STRA-338):
|
||||
//! the_byte_budget_and_slot_limit_evict_oldest_first,
|
||||
//! an_incompatible_parked_image_is_discarded_and_the_request_falls_back,
|
||||
//! a_failed_restore_transfer_is_fatal_to_the_request,
|
||||
//! switching_steering_invalidates_checkpoints_and_isolates_parked_images ....
|
||||
//! Pins the manager's budget and failure rules: the byte budget and slot limit evict oldest first, an incompatible
|
||||
//! parked image is discarded, a failed restore transfer is fatal, steering switches isolate parked images, a
|
||||
//! cancelled prompt keeps its checkpoints, periodic checkpoints follow the chunk stride, and pictures and the PLE
|
||||
//! history window are part of the resume identity.
|
||||
|
||||
use super::{ConversationImageKey, DeviceEngine, ReplayedRequest, TURN, chat, gen_tokens, options, world};
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//! Tests of manager_tests by topic (moved out of the test file by STRA-338):
|
||||
//! a_continuing_chat_reuses_the_live_session_without_a_copy, an_identical_prompt_still_reads_its_last_token,
|
||||
//! a_rewritten_tail_resumes_from_the_turn_boundary_checkpoint, the_shared_root_is_pinned_while_other_checkpoints_rotate
|
||||
//! ....
|
||||
//! Pins which source a request resumes from: a continuing chat reuses the live session without a copy, a rewritten
|
||||
//! tail resumes from the turn-boundary checkpoint, the shared root stays pinned while other checkpoints rotate,
|
||||
//! switching conversations parks and restores exactly, and physical-memory admission gates parking.
|
||||
|
||||
use super::{GIB, ReplayedRequest, Run, TURN, World, chat, gen_tokens, options, world};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `SimDevice`: `per`, `row_bytes`, `write_cell`, `mirror_ring` and 7 more.
|
||||
//! Implements `StateMemory for SimDevice`. Functions: `hash`, `pat`, `pattern`, `idx`.
|
||||
//! The simulated device memory of the manager tests: token-prefix hashing and patterns, the `SimDevice` byte regions
|
||||
//! (running state, K/V pools, indexer rows, drafter ring) and its `StateMemory` implementation.
|
||||
|
||||
use super::{
|
||||
IdxKind, KvLayer, KvPool, PAGE, RingBlocks, SLOTS, SimDevice, StateMemory, StateRegion, kv_region, state_sizes,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `ReplayedRequest`: `new`. Methods of `World`: `read_plan`, `request`.
|
||||
//! Implements `SessionDevice for SimDevice`.
|
||||
//! The simulated world of the manager tests: `SimDevice` as a `SessionDevice`, the small model geometry, the
|
||||
//! `World` that replays requests (reading a prompt plan into device state) and the chat and token generators.
|
||||
|
||||
use super::{
|
||||
ConversationImageKey, ConversationManager, ConversationOptions, DeviceEngine, Fixture, FixtureGeometry, GIB,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `Fx`: `new`, `unchanged`, `restore`, `reject` and 13 more.
|
||||
//! Functions: `fixture_geometry`, `fixture_session`, `fixture_checkpoint`, `fixture_image` and 3 more.
|
||||
//! The fixture of the snapshot tests: a small model with a first, a last and a drafter layer registered in host
|
||||
//! memory, a complete saved image, and the checks `Fx` runs on it (sizes, save, restore, rejection before any write).
|
||||
|
||||
use super::{
|
||||
ConversationCheckpoint, ConversationImageKey, ConversationKvReuse, ConversationView, HostMemory, IDX_BLOCK,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `Session`: `new`, `spare`, `fill`, `save_checkpoint` and 9 more.
|
||||
//! Functions: `session_geometry`, `put_session_regions`, `session_spec`, `full_session`. Defines `Session`.
|
||||
//! The whole-session scenario of the snapshot tests: a main and a draft layer with running state and checkpoints in
|
||||
//! one host memory, saved and restored, with the observations compared against the golden values.
|
||||
|
||||
use super::{
|
||||
ConversationCheckpoint, ConversationImageKey, ConversationKv, ConversationKvReuse, Fixture, HYBRID, HostMemory,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Functions: `golden_state`, `fnv`, `fnv_buf`, `assert_kv` and 2 more.
|
||||
//! Split out of `snapshot_tests` to keep its files under the line limit.
|
||||
//! Helpers that compare saved images, K/V layers and checkpoints with the golden JSON the Original's C++ produced:
|
||||
//! FNV fingerprints of the buffers and the field-by-field assertions.
|
||||
|
||||
use super::{ConversationCheckpoint, ConversationKv, SavedConversation};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `Level`: `save`, `restore`, `reject_hybrid_streaming`, `reject_bad_extents` and 5 more.
|
||||
//! Functions: `kv_level`. Defines `Level`.
|
||||
//! The per-layer K/V scenario of the snapshot tests: for one format and residency mode, save, restore, verify, and
|
||||
//! reject hybrid-streaming and bad extents, over one fixture layer in host memory.
|
||||
|
||||
use super::{
|
||||
ConversationKv, Fixture, HYBRID, HostMemory, KV_INT8, KV_Q4, KV_VALUE_INT8, KvLayer, KvPool, KvTarget, equal,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `Alloc`: `put`. Methods of `Fixture`: `new`, `with_geometry`, `source`, `fill` and 1 more.
|
||||
//! Functions: `kv_region`, `mk_view`, `equal`, `q4_per_head` and 8 more. Defines `Alloc`, `Dims`.
|
||||
//! Allocation of the K/V pools of a snapshot-test layer (fp16, INT8, Q4_0 and hybrid formats, device slots and host
|
||||
//! pools) in host memory, and the region and view helpers the other snapshot tests share.
|
||||
|
||||
use super::{
|
||||
ConversationCheckpoint, ConversationImageKey, ConversationKv, ConversationView, Fixture, FixtureGeometry, HYBRID,
|
||||
|
||||
+3
-4
@@ -1,7 +1,6 @@
|
||||
//! Tests of snapshot_tests by topic (moved out of the test file by STRA-338):
|
||||
//! layer_snapshots_are_byte_exact_across_formats_and_residency_modes, whole_session_snapshots_round_trip_exactly,
|
||||
//! validation_rejects_before_any_device_write_and_faults_are_fatal,
|
||||
//! checkpoint_save_restore_round_trips_through_host_memory ....
|
||||
//! Pins the snapshot contracts: layer and whole-session images are byte exact across formats and residency modes,
|
||||
//! validation rejects before any device write, checkpoints round-trip through host memory, and geometry, carve sizes,
|
||||
//! layouts and payload hashes match the Original's golden values.
|
||||
|
||||
use super::{
|
||||
ConversationCheckpoint, ConversationKv, Fixture, HYBRID, HostMemory, IDX_BLOCK, IdxKind, KV_F16, KV_INT8, KV_Q4,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `Pools`: `new`, `register`, `image`. Functions: `mark_present`.
|
||||
//! Split out of `snapshot_tests` to keep its files under the line limit.
|
||||
//! The K/V pool set of a snapshot-test layer: which buffers a format has (fp16, INT8, Q4_0), registering them in host
|
||||
//! memory and building the matching image.
|
||||
|
||||
use super::{
|
||||
ConversationKv, HostMemory, IdxKind, KvLayer, KvPool, ModelGeometry, Pools, QsaDesc, StateRegion, kv_region,
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Functions: `decayed`.
|
||||
//! Split out of `store` to keep its files under the line limit.
|
||||
//! Half-life decay of a hit mass or prior with age, shared by the store's value estimate.
|
||||
|
||||
|
||||
pub(super) fn decayed(value: f64, age: u64, half_life: f64) -> f64 {
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
//! Methods of `Candidate`: `key`, `blocks`. Implements `Default for PolicyParams`.
|
||||
//! Split out of `store` to keep its files under the line limit.
|
||||
//! The operator-facing default values of `PolicyParams`, and the accessors of an admission `Candidate`.
|
||||
|
||||
use super::{Candidate, PolicyParams};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Groups the submodules `admit`, `prefix_store_consider_commit`, `prefix_store_evict_and_budget` and 2 more.
|
||||
//! Split out of `store` to keep its files under the line limit.
|
||||
//! Hub of the `PrefixStore` implementation: admission, the consider and commit path, eviction and budget, the
|
||||
//! statistics and clock, and node scoring each live in a child module over the shared store types.
|
||||
|
||||
use super::{
|
||||
Block, ByteSize, CHAIN_SEED, Candidate, Consider, HashMap, HashSet, KeptTail, Match, Node, NodePayload,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `PrefixStore`: `consider`, `consider_tail`, `candidate_value`, `commit` and 3 more.
|
||||
//! Split out of `prefix_store` to keep its files under the line limit.
|
||||
//! Admission decision and commit of prefix-store nodes: `consider` (is a node worth its bytes), the request-end tail
|
||||
//! variants, the value estimate of a candidate, and `commit` once the caller has built the payloads.
|
||||
|
||||
use super::{ByteSize, Candidate, Consider, HashSet, KeptTail, NodePayload, PrefixStore, Reject};
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `PrefixStore`: `enforce_budget`, `abort`, `release_orphans`, `evict` and 6 more.
|
||||
//! Split out of `prefix_store` to keep its files under the line limit.
|
||||
//! Removal from the prefix store: enforcing the byte budget, aborting a candidate, evicting a node together with the
|
||||
//! blocks only it covered, orphan release, clearing, and the invariant check.
|
||||
|
||||
use super::{ByteSize, Candidate, HashSet, Node, PrefixStore};
|
||||
#[cfg(any(test, feature = "testing"))]
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `PrefixStore`: `new`, `config`, `stats`, `bytes` and 26 more.
|
||||
//! Split out of `prefix_store` to keep its files under the line limit.
|
||||
//! Construction, statistics, request clock and expiry of the prefix store, and its lookups: the longest token-exact
|
||||
//! match, the hash-only prefix match a router uses, the node heads, and the hit and miss records that feed admission.
|
||||
|
||||
use super::{
|
||||
ByteSize, CHAIN_SEED, HashMap, HashSet, Match, Node, PrefixStore, Stats, StoreConfig, chain_step, decayed,
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
//! Tests of tests by topic (moved out of the test file by STRA-338):
|
||||
//! a_hit_by_another_session_makes_a_shared_root_outlive_private_leaves,
|
||||
//! thinning_a_chain_keeps_the_deepest_node_and_the_blocks_it_needs,
|
||||
//! the_budget_is_enforced_again_when_the_real_payload_is_bigger_than_the_estimate,
|
||||
//! commit_refuses_blocks_that_are_not_the_candidates ....
|
||||
//! Pins the store's sharing and budget behaviour: a hit by another session keeps a shared root alive, chains are
|
||||
//! thinned, the budget is enforced again when a payload exceeds its estimate, collisions are never matched, the node
|
||||
//! cap evicts by value, and long agent sessions stay inside the budget with a fast lookup.
|
||||
|
||||
use super::{
|
||||
BLOCK, Consider, G, Payload, PolicyParams, PrefixStore, Reject, STATE, StoreConfig, chain, put, store, tokens,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
//! Tests of tests by topic (moved out of the test file by STRA-338):
|
||||
//! a_request_resumes_from_the_deepest_node_of_any_session, common_prefixes_are_stored_once,
|
||||
//! a_node_with_descendants_is_a_branch_point_and_a_frontier_is_not,
|
||||
//! the_prompt_end_checkpoint_survives_the_decode_end_checkpoint_of_its_request ....
|
||||
//! Pins resume and eviction semantics of the store: resume from the deepest node of any session, shared prefixes
|
||||
//! stored once, branch points versus frontiers, request-end tail nodes and their supersession, retention and expiry,
|
||||
//! and value-ordered eviction under a full budget.
|
||||
|
||||
use super::{
|
||||
BLOCK, Consider, G, MINUTE, Payload, PolicyParams, PrefixStore, Reject, STATE, StoreConfig, put, put_tail,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `PromptOptions`: `original_mode17`.
|
||||
//! Methods of `PromptPlan`: `new_in_context`, `new`, `prompt`, `next_segment` and 1 more.
|
||||
//! Prompt planning of the Original serve path: the options and capacity choice (auto ladder, cache-slot loan), the
|
||||
//! validity checks, the `PromptPlan` iterator that cuts a prompt into segments, and `drive`, which runs a plan.
|
||||
|
||||
use super::{
|
||||
DriveError, DriveSummary, PlanError, PlanLimits, PromptAction, PromptOptions, PromptPath, PromptPlan, PromptRunner,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `AdaptiveConfig`: `new`, `with_policy`, `set_option`, `set_tuning` and 1 more.
|
||||
//! Methods of `Cell`: `rate`, `add`. Functions: `p_bucket`, `m_bucket`, `logit`, `sigmoid`.
|
||||
//! Constants of the adaptive window policy: construction, the `LELEKA_SPEC_POLICY` presets, named options for replay
|
||||
//! arms, the acceptance `Cell` statistics, and the probability bucketing and logit helpers.
|
||||
|
||||
use super::{AdaptiveConfig, Cell, FLOOR_CEILING, FLOOR_CEILING_LEGACY, MAX_T, P_BUCKETS, P_EDGES};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `AdaptivePolicy`: `new`, `config`, `rounds`, `begin_request` and 7 more.
|
||||
//! Split out of `adaptive` to keep its files under the line limit.
|
||||
//! State and calibration of the adaptive window policy: per-request reset, the acceptance rate of an MTP draft or a
|
||||
//! suffix row, the per-width cost mean and its fit, and the candidate widths offered to the decision.
|
||||
|
||||
use super::{
|
||||
AdaptiveConfig, AdaptivePolicy, Cand, Cell, M_BUCKETS, MAX_T, N0_BUCKET, N0_DEPTH, N0_SUFFIX, Offer, Origin,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `SpecStats`: `record`, `line`.
|
||||
//! Split out of `adaptive` to keep its files under the line limit.
|
||||
//! Per-round statistics of the adaptive policy (width, accepted rows, flags, milliseconds) and the one-line report
|
||||
//! printed from them.
|
||||
|
||||
use super::{MAX_T, RoundFlags, SpecStats};
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
//! Tests of tests by topic (moved out of the test file by STRA-338):
|
||||
//! the_default_ceiling_is_the_new_one_and_the_legacy_switch_restores_the_old_policy_exactly,
|
||||
//! the_smooth_floor_moves_continuously_with_the_bar, a_trace_is_reproducible, stats_line_reports_the_histograms.
|
||||
//! Pins the policy constants: the default draft-floor ceiling is the new one, the legacy switch restores the earlier
|
||||
//! policy exactly, the smooth floor moves continuously with the bar, traces are reproducible, and the stats line.
|
||||
|
||||
use super::{
|
||||
AdaptiveConfig, AdaptivePolicy, CODE_COSTLY, FLOOR_CEILING, P_BUCKETS, P_EDGES, PROSE_CHEAP, Rng, RoundFlags,
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
//! Tests of `tests` by topic: stationary_regimes_reach_the_best_fixed_width,
|
||||
//! it_widens_when_rows_are_cheap_and_narrows_when_they_are_not, it_follows_a_change_of_content_and_of_cost,
|
||||
//! reaction_to_a_switch_takes_tens_of_rounds_not_hundreds ....
|
||||
//! Pins the adaptive window's learning: stationary regimes reach the best fixed width, it widens when rows are cheap
|
||||
//! and narrows when not, follows a change of content or cost, explores cheaply, interpolates unmeasured widths, and
|
||||
//! keeps the draft plan inside its bounds.
|
||||
|
||||
use super::{
|
||||
AdaptivePolicy, CODE_CHEAP, CODE_COSTLY, Choice, MAX_T, Offer, Origin, PROSE_CHEAP, PROSE_COSTLY, REPEAT, Rng,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `OriginalServeMode`: `parse`, `as_str`. Methods of `ExpertSource`: `parse`, `as_str`.
|
||||
//! Implements `Default for OriginalServeOptions`.
|
||||
//! Parsing and printing of the Original-path choices (`OriginalServeMode`, `ExpertSource`, `PrefixTail`), the
|
||||
//! published prefix-cache pool summary, and the default and run-time validation of `OriginalServeOptions`.
|
||||
|
||||
use super::{
|
||||
BackendError, ConfigFacts, ExpertSource, OriginalServeChoice, OriginalServeMode, OriginalServeOptions,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! The command loop of the Original owner, moved out of `run` by STRA-338 (size): receive, sweep the idle sessions,
|
||||
//! and answer each command in the order `run` did.
|
||||
//! The command loop of the Original owner: publish readiness, then receive commands, sweep idle sessions while none
|
||||
//! arrives, and answer Load (refused), Reconfigure, Unload and Generate until unload or shutdown.
|
||||
|
||||
use super::{
|
||||
BackendError, Command, Duration, GenerateEnv, IdleSweep, Live, LoadPhase, LoadedModel, Ordering,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
//! Unit tests of `original_serve`.
|
||||
//! Pins the Original-path selection and options: modes parse and print symmetrically, `Auto` takes the Original path
|
||||
//! only when everything is sealed and fed, explicit `Original` never falls back and names what is missing, `Preview`
|
||||
//! is never overridden, option bounds, the conversation-cache defaults, and the eight-cell slack of the fit test.
|
||||
|
||||
use super::{ConfigFacts, OriginalServeChoice, OriginalServeMode, OriginalServeOptions, PathBuf, choose, context_fits};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Functions: `required_path`.
|
||||
//! Split out of `original_serve_replay` to keep its files under the line limit.
|
||||
//! Reads an operator-owned input path from an environment variable for the replay and the GPU proofs; a missing
|
||||
//! variable panics with its name, so a proof never runs against a guessed file.
|
||||
|
||||
use super::{PathBuf, env};
|
||||
|
||||
|
||||
@@ -1,3 +1,7 @@
|
||||
//! Backend-level tests of the Native path: the queued-owner identity digest, explicit KAR selection and context
|
||||
//! admission, request caps and sampling plans, incremental UTF-8 publication, cancel with a full control queue,
|
||||
//! control-token encoding, and a request arriving during the deferred tail.
|
||||
|
||||
use super::{
|
||||
Active, ActiveGuard, Arc, AtomicBool, Backend, BackendError, Command, DeferredTail, Digest, ErrorCode,
|
||||
EvaluationExecution, FRAME_LIMIT, GenerationRequest, InferenceMode, KAR_LOAD_REPLY_TIMEOUT, KAR_PROFILE,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
//! Unit tests of this module (split out of its file; the test ids are unchanged).
|
||||
//! Pins the resident-conversation store: a disabled policy keeps the single continuation, an identical prompt may
|
||||
//! reuse the live session but not a parked one, A-B-A swaps pick the longest prefix (ties to the newest), slots and
|
||||
//! bytes bound the parked set oldest first, unusable candidates are dropped, and operator settings parse strictly.
|
||||
|
||||
use super::{ResidentConversations, ResidentPolicy, ResumeSource};
|
||||
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
//! Unit tests of this module (split out of its file; the test ids are unchanged).
|
||||
//! Pins the experimental-mode admission: the default is off and changes nothing, each mode selects the Original's
|
||||
//! format and programs, exclusions follow its rules, pool sizes match, the digest binds modes, values and files,
|
||||
//! an enabled mode is refused until the forward pass consumes it, and control-vector files are validated at load.
|
||||
|
||||
use super::{
|
||||
ExperimentalConfig, ExperimentalError, KvFormat, Mode, OptIn, PathBuf, Program, ensure_consumed,
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
//! Binding of the pinned model files to the engine: the KAR expert source and its levels, the Qwen4Exp input
|
||||
//! binding (weights read from the verified artifact) and the KAR PLE source.
|
||||
|
||||
pub(crate) mod kar_expert_source;
|
||||
pub(crate) mod kar_levels;
|
||||
pub(crate) mod qwen4exp_input;
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `BindingIdentity` and `BoundLayer`, and the `Display` and `Error` impls of `InputBindingError`: what a
|
||||
//! binding says about itself and how its failures read.
|
||||
//! The small identity and constants types of the input binding: `Display` text of `InputBindingError`, the identity
|
||||
//! that ties a weights handle to its binding, the index and kind of a bound layer, and the `InputConstants` read from
|
||||
//! the artifact (PLE head offsets and vocabularies, EOS, context length) with their validation.
|
||||
|
||||
use super::{
|
||||
BindingIdentity, BoundLayer, BoundLayerKind, InputBindingError, InputConstants, InputResult, PLE_ROWS,
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//! Unit tests of this module (split out of its file; the test ids are unchanged).
|
||||
//! Pins the GDN weight binding: the epsilon is the Original's exact layer operand, the projection kinds and
|
||||
//! containers are the closed set, and shapes and row bounds are checked before any read.
|
||||
|
||||
use super::{E, NATIVE_EPSILON, TensorSignature, block_range, descriptor, exact_bf16, kind};
|
||||
#[test]
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
//! Unit tests of this module (split out of its file; the test ids are unchanged).
|
||||
//! Pins the GR weight binding: only exact finite BF16 containers are accepted, role shapes are frozen, and the final
|
||||
//! layer has no injection.
|
||||
|
||||
use super::{GrRole, InputBindingError, TensorSignature, exact_bf16, role_set, validate_descriptor};
|
||||
#[test]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `ModelBinding`: `bind`, `from_artifact`, `from_artifact_with_kar_ple`, `with_kar_expert_source` and 22...
|
||||
//! Functions: `bind_expert_counts`.
|
||||
//! The `ModelBinding` over a verified Qwen4Exp artifact: its constructors (plain, with KAR PLE, KAR expert source or
|
||||
//! MTP pack), layer and expert counts, the embedding and PLE row reads, and expert-count validation.
|
||||
|
||||
use super::{
|
||||
BindingError, BindingIdentity, BoundLayer, EMBEDDING_VALUES, GlobalRole, InputBindingError, InputConstants,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Groups the submodules `model_binding_moe_descriptors`, `moe_expert_block_reads`.
|
||||
//! Split out of `moe_expert` to keep its files under the line limit.
|
||||
//! Hub of the `ModelBinding` MoE accessors: expert matrix admission and preload descriptors (one child) and the
|
||||
//! block reads of selected expert rows from the artifact (the other).
|
||||
|
||||
use super::{
|
||||
E, EXPERTS, FF, InputResult, LayerRole, Matrix, ModelBinding, MoeExpertBlock, MoeExpertSelection, MoeExpertWeights,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `ModelBinding`: `moe_expert_weights`, `moe_preload_descriptor`, `check_preload_key`, `moe_preload_bloc...
|
||||
//! Functions: `moe_matrix`, `check_gate_scalar`, `preload_key`, `preload_matrix_role` and 1 more.
|
||||
//! Admission of one layer's routed and shared MoE matrices against the expected kind, shape and extent, and the
|
||||
//! preload descriptors and blocks of routed experts that the MoE weight cache reads to preload pinned experts.
|
||||
|
||||
use super::super::routed_source_descriptor::validate_rows_finite;
|
||||
use super::super::routed_source_descriptor::{check_matrix_tensor, check_moe_metadata, selected_expert};
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `MoeExpertWeights`: `matches`, `matrix`, `shape`, `kind`.
|
||||
//! Methods of `MoeExpertBlock`: `kind`, `columns`, `rows`, `bytes` and 1 more.
|
||||
//! Accessors of the admitted `MoeExpertWeights` and `MoeExpertBlock`, and the decoding of raw tensor kinds into
|
||||
//! `MoeMatrixKind` for routed and shared matrices, with the selection and row-range checks.
|
||||
|
||||
use super::{
|
||||
BindingIdentity, E, EXPERTS, FF, InputResult, Matrix, MoeExpertBlock, MoeExpertSelection, MoeExpertWeights,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `MoeRoutedSourceScope`: `retarget`, `check_first_member`, `check_members`.
|
||||
//! Methods of `ModelBinding`: `with_moe_routed_group_source`, `moe_shared_preload_descriptors`, `moe_shared_preload_...
|
||||
//! The routed-source group scope (`MoeRoutedSourceScope`): retargeting it to a new set of experts with member checks,
|
||||
//! and the shared-expert preload descriptors and blocks streamed from the artifact.
|
||||
|
||||
use super::routed_source_descriptor::check_moe_metadata;
|
||||
#[cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `MoeRoutedSourceScope`: `validate_binding`, `descriptor`, `block`, `bank_span` and 2 more.
|
||||
//! Methods of `ModelBinding`: `with_moe_routed_source`, `check_members_select`, `open_routed_source`.
|
||||
//! Source descriptors and reads of routed experts: model-metadata and finite-weight admission, and the scope's
|
||||
//! descriptor, block, bank-span and mapped-span reads over the retained artifact owners.
|
||||
|
||||
use super::{
|
||||
BindingIdentity, E, EXPERTS, FF, InputResult, LayerRole, Matrix, ModelBinding, MoeExpertBlock, MoeExpertSelection,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Defines `MtpIndex`, `MtpRows`, `MtpWeights`.
|
||||
//! DENSE_BYTES, EXPERT_BYTES, EXPERT_BLOB, INDEX_BYTES, MAX_ROWS, MAX_READ ....
|
||||
//! The pinned MTP pack: byte sizes, read limits and file digests of `dense.txt`, `dense.bin` and `experts.bin`, and
|
||||
//! the `MtpWeights`, `MtpRows` and `MtpIndex` owners that hold its files and rows.
|
||||
|
||||
use super::{BindingIdentity, File, MtpKind};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Items of the parent module.
|
||||
//! Split out of `mtp` to keep its files under the line limit.
|
||||
//! The table of the 31 MTP tensors: for each role its name, source file, shape, source SHA-256 and, where it is
|
||||
//! packed into `dense.bin`, the kind and byte placement.
|
||||
|
||||
use super::{Dense, Descriptor, MtpKind, MtpRole};
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Defines `MtpKind`, `MtpExpertMatrix`, `MtpExpertRef` and 3 more.
|
||||
//! MtpKind, MtpExpertMatrix, MtpRole, Descriptor, Dense.
|
||||
//! The vocabulary of the MTP pack: storage kinds, expert matrices, the roles of its tensors, and the `Descriptor`
|
||||
//! and `Dense` records that describe one tensor.
|
||||
|
||||
|
||||
#[derive(Clone, Copy, Debug, Eq, PartialEq)]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Methods of `IndexScan`: `accept`, `fits`, `complete`. Methods of `MtpIndex`: `inspect`.
|
||||
//! Functions: `pack_identity`, `descriptor`, `pinned_dense_bytes`, `rt_dense_roles` and 6 more.
|
||||
//! Identity and index of the MTP pack: the digests that name it, the descriptor lookup, the RT-directory contract
|
||||
//! (consumed roles, names, kinds, shapes) and the strict parser that turns `dense.txt` into a validated `MtpIndex`.
|
||||
|
||||
use super::{
|
||||
DENSE_BYTES, DESCRIPTORS, Dense, Descriptor, FILE_PINS, INDEX_LIMIT, InputBindingError, InputResult, MtpIndex,
|
||||
|
||||
@@ -1,4 +1,6 @@
|
||||
//! Unit tests of this module (split out of its file; the test ids are unchanged).
|
||||
//! Pins the MTP pack binding: exact receipts and runtime index, the RT contract's roles and shapes, malformed
|
||||
//! descriptors never becoming an index, bounded rows and lossless Q2 planes keeping signed zeros, non-finite weights
|
||||
//! refused, and an identity that cannot be recreated from metadata.
|
||||
|
||||
use super::{
|
||||
BindingIdentity, DESCRIPTORS, INDEX_LIMIT, InputBindingError, MtpIndex, MtpKind, MtpRole, interleave_q2, row_range,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `InputConstants`: `test_fixture`. Methods of `BindingIdentity`: `test_identity`.
|
||||
//! Functions: `validate_ple_descriptor`, `bind_layers`, `bind_layer`.
|
||||
//! Bind-time admission of a Qwen4Exp artifact: the per-layer token-embedding (PLE) descriptor and the ordered list of
|
||||
//! bound layers with their kinds. Also the test fixtures for `InputConstants` and `BindingIdentity`.
|
||||
|
||||
use super::{
|
||||
BoundLayer, BoundLayerKind, GlobalRole, InputBindingError, InputResult, LayerRole, PLE_ROWS, Qwen4ExpArtifact,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Functions: `dense_slab_policy`, `startup_step`.
|
||||
//! Split out of `dense_weight_cache` to keep its files under the line limit.
|
||||
//! Startup policy of the dense weight cache: whether dense weights are packed into 64 MiB slabs or get one allocation
|
||||
//! each, and the step-named refusal message of the prompt-capacity startup. Both layouts place the same bytes.
|
||||
|
||||
use super::SlabPolicy;
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Groups the submodules `dense_cache_buffers_and_close`, `dense_cache_eager_layer_load`, `dense_cache_gdn_qsa_works...
|
||||
//! Split out of `dense_weight_cache` to keep its files under the line limit.
|
||||
//! The `impl DenseWeightCache` blocks by responsibility: constructors, eager layer load, matrix registration, PLE and
|
||||
//! verifier weight views, prompt and GDN scratch, GDN/QSA workspaces, buffers and close. Shared imports live here.
|
||||
|
||||
use super::{
|
||||
ALL_MIRROR_BYTES, BoundLayerKind, Cell, Context, DenseCacheCounters, DenseWeightCache, DeviceBuffer, DeviceRef,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `DenseWeightCache`: `gr_buffers`, `counters`, `chunk_modules`, `close` and 4 more.
|
||||
//! Functions: `close_into`.
|
||||
//! Buffer access and teardown of the dense weight cache: GR buffers, counters, chunk modules and the consuming close,
|
||||
//! which releases scratch, modules, batch workspaces, buffers and slabs and keeps the first error.
|
||||
|
||||
use super::{
|
||||
Context, DenseCacheCounters, DenseWeightCache, DeviceBuffer, Error, GrResident, ModelBinding, QkScratch, Rc,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `DenseWeightCache`: `new_with_selected`, `unloaded`, `load_eager`, `reserve_layer_tables` and 6 more.
|
||||
//! Functions: `reserve_table`.
|
||||
//! Eager load of the dense weights at construction: reserves the layer tables, loads the router, GDN and QSA layers
|
||||
//! of a binding into the slab allocator and adds the scratch owners.
|
||||
|
||||
use super::{
|
||||
ALL_MIRROR_BYTES, BoundLayerKind, Cell, Context, DenseCacheCounters, DenseWeightCache, Error, GdnInputScratch,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `DenseWeightCache`: `gdn_batch_resources`, `qsa_native_workspace`, `test_record_gr_batch_completed`, `...
|
||||
//! Split out of `dense_weight_cache_methods` to keep its files under the line limit.
|
||||
//! Lookups of the dense cache that the decode and prompt paths borrow from: GDN batch resources, QSA workspace,
|
||||
//! GDN and QSA scratch loans, and the per-layer GDN, QSA, GR and router entries with buffer handles for a held
|
||||
//! verify assembly.
|
||||
|
||||
use super::{
|
||||
Cell, Context, DenseWeightCache, DeviceBuffer, DeviceRef, Error, GdnInputLease, GdnInputScratch, GdnResident,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `DenseWeightCache`: `add`, `add_f32`, `add_bf16`, `add_gr` and 13 more. Defines `ExpectedPleMatrix`.
|
||||
//! Split out of `dense_weight_cache_methods` to keep its files under the line limit.
|
||||
//! Registration of dense matrices (raw, F32, BF16, GR roles, the retained PLE matrices) into the cache with byte and
|
||||
//! finite checks, plus binding validation and the router, GR, PLE and native batch scratch loans.
|
||||
|
||||
use super::{
|
||||
Context, DenseWeightCache, DeviceRef, Error, GrBatchInjectWorkspace, GrResident, GrRole, GrScratch, ModelBinding,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `DenseWeightCache`: `ple`, `ple_key`, `ple_value`, `ple_value_tile` and 16 more.
|
||||
//! Functions: `gdn_native_type`, `qsa_native_type`.
|
||||
//! Read-only views of the loaded dense weights: PLE key, value and norm slots, GDN and QSA matrix and norm slots, and
|
||||
//! the ordered operands of the Original verifier window (GDN weights, QSA gammas, native MMVQ projections). They are
|
||||
//! the cache's own allocations, so no host conversion happens at this boundary.
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Context, DenseWeightCache, DeviceBuffer, DeviceRef, Error, GdnMatrixKind, GdnMatrixRole,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `DenseWeightCache`: `new_original_prompt_capacity`, `load_prompt_owners`, `load_prompt_workspaces`, `l...
|
||||
//! Split out of `dense_weight_cache_methods` to keep its files under the line limit.
|
||||
//! The prompt-capacity constructor of the dense weight cache (prompt owners, workspaces and scratch sized for the
|
||||
//! chunk capacity) and the pools that serve it: idle GDN finite guards, pooled GDN state buffers and the GDN
|
||||
//! verification workspace.
|
||||
|
||||
use super::{
|
||||
Context, DenseWeightCache, DeviceBuffer, Error, GdnVerificationWorkspace, ModelBinding, QkScratch, Rc, RefCell,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `DenseWeightCache`: `new`, `new_qsa_selected`, `new_qsa_selected_router`, `new_qsa_selected_router_gr_...
|
||||
//! Split out of `dense_weight_cache_methods` to keep its files under the line limit.
|
||||
//! The named constructors of the dense weight cache, from the plain cache up to the selected router, GR batch, QK,
|
||||
//! attention and MTP journal variants, and the attachment of the prompt owners, queues and native QSA resources.
|
||||
|
||||
use super::{
|
||||
Context, DenseWeightCache, Error, ModelBinding, QkScratch, QsaAttentionScratch, Rc, RefCell, Result, RouterScratch,
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
//! The lazily created workspaces of the dense weight cache, moved out of it by STRA-338 (size): consecutive owners,
|
||||
//! declared in the order the cache dropped them, so the drop order is unchanged.
|
||||
//! The lazily created workspaces of the dense weight cache (GDN, QSA, GR and router scratch, idle guards and pooled
|
||||
//! GDN state buffers), all empty at construction and filled on first use. The fields are declared in the order the
|
||||
//! cache drops them, so the drop order is unchanged.
|
||||
|
||||
use super::{
|
||||
DeviceBuffer, GdnInputScratch, GrBatchInjectWorkspace, GrScratch, QkScratch, QsaAttentionScratch, QsaIndexKeyCache,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Groups the submodules `construction_and_parking`, `prompt_executor_forward_and_close`, `prompt_executor_retire_ow...
|
||||
//! Split out of `original_prompt` to keep its files under the line limit.
|
||||
//! Impl family of `OriginalPromptExecutor`, the owner of every device resource of the layer-major Original prefill
|
||||
//! (prompt rows, GDN, QSA, MTP). The children share this import list: construction and parking, chunk forward,
|
||||
//! retirement.
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Carrier, ChunkCaches, ChunkDraft, ChunkInFlight, ChunkRollback, ChunkWork, Context,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Groups the submodules `executor_construction`, `session_park_and_qsa_owners`.
|
||||
//! Split out of `original_prompt_executor` to keep its files under the line limit.
|
||||
//! Construction of an `OriginalPromptExecutor` and the parking of its session state. Builds the device owners and the
|
||||
//! twelve resident QSA layers; parks, imports and restores the session for the prefix cache.
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Context, DenseWeightCache, Dimension, DraftAttachmentTables, DraftAttachmentTarget, Error,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `OriginalPromptExecutor`: `new`, `new_with_mtp_weights`, `check_construction`, `empty` and 17 more.
|
||||
//! Split out of `construction_and_parking` to keep its files under the line limit.
|
||||
//! Builds an `OriginalPromptExecutor`: the prompt, GDN, QSA and MTP device owners and the twelve resident QSA layers.
|
||||
//! Also the drafter hooks the serve host calls on it (RT bank selection, prompt length, draft limit, idle, KV
|
||||
//! restore).
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Context, DenseWeightCache, Dimension, DraftAttachmentTables, DraftAttachmentTarget, Error,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `OriginalPromptExecutor`: `take_qsa_owners`, `adopt_qsa_owners`, `rebuild_qsa_layers`, `checkpoint_ses...
|
||||
//! Defines `QsaOwners`.
|
||||
//! Session handoff of the executor: the resident QSA owners lent to the native verifier for a decode phase and taken
|
||||
//! back, and the checkpoint, park, import and restore of the session point (prefix cache, request reset).
|
||||
|
||||
use super::{
|
||||
DenseWeightCache, Error, ModelBinding, OriginalPromptExecutor, OriginalSessionCheckpoint, ParkedBlock,
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
//! Groups the submodules `prompt_chunk_forward`, `prompt_executor_close`.
|
||||
//! Split out of `original_prompt_executor` to keep its files under the line limit.
|
||||
//! Running and closing a prompt chunk on the executor: the forward pass over the arena and the consuming `close`.
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Carrier, ChunkCaches, ChunkDraft, ChunkInFlight, ChunkRollback, ChunkWork, Context,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `OriginalPromptExecutor`: `forward`, `arena_holds_window`, `admit_window`, `finish_forward` and 4 more.
|
||||
//! Functions: `trace_step`, `arena_serves_chunk`, `trace_error`. Defines `ForwardDone`, `StagedRows`.
|
||||
//! `OriginalPromptExecutor::forward`: one batched prompt chunk, from input staging through every layer to the final
|
||||
//! row, its sample and the draft KV. An error rolls the transaction and the draft back; success leaves a pending
|
||||
//! target to publish.
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Carrier, ChunkCaches, ChunkDraft, ChunkInFlight, ChunkRollback, ChunkWork, Context,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the draft-KV phase of `OriginalPromptExecutor::forward`.
|
||||
//! The draft-KV phase of `OriginalPromptExecutor::forward`.
|
||||
|
||||
use super::{
|
||||
ChunkDraft, Context, Error, MoeWeightCache, OriginalDraftKvPending, OriginalMtpPrefill,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the final row of `OriginalPromptExecutor::forward` (conditioning preview, sample, R trace).
|
||||
//! The final row of `OriginalPromptExecutor::forward` (conditioning preview, sample, R trace).
|
||||
|
||||
use super::{
|
||||
Carrier, ChunkWork, DenseWeightCache, Error, ModelBinding, OriginalPromptExecutor, OriginalPromptSample,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the input phase of `OriginalPromptExecutor::forward` (staging, row upload, PLE read-ahead).
|
||||
//! The input phase of `OriginalPromptExecutor::forward` (staging, row upload, PLE read-ahead).
|
||||
|
||||
use super::{
|
||||
ChunkInFlight, Context, DenseWeightCache, Error, InputStage, KarPleCache, ModelBinding, OriginalPrefillArena,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the layer loop of `OriginalPromptExecutor::forward`, one helper per phase of a layer.
|
||||
//! The layer loop of `OriginalPromptExecutor::forward`, one helper per phase of a layer.
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, Carrier, ChunkWork, DenseWeightCache, Error, InputStage, ModelBinding, MoeWeightCache,
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
//! Methods of `OriginalPromptExecutor`: `close`.
|
||||
//! Split out of `prompt_executor_forward_and_close` to keep its files under the line limit.
|
||||
//! Consuming `close` of the executor; the retirement of the owners itself is `close_inner`.
|
||||
|
||||
use super::{OriginalPromptExecutor, Result};
|
||||
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `OriginalPromptExecutor`: `close_inner`, `retire_device_owners`, `retire_mtp_and_layers`.
|
||||
//! Split out of `original_prompt_executor` to keep its files under the line limit.
|
||||
//! Retirement of the executor's device owners: prompt, GDN, QSA, transport, attention, MTP and the resident layers.
|
||||
//! Every owner is closed even after a failure; the first error is kept and the executor is marked failed.
|
||||
|
||||
use super::{Error, OriginalPromptExecutor, Result, driver_error};
|
||||
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `OriginalPromptPending`: `publish`.
|
||||
//! Implements `Drop for OriginalPromptExecutor`, `Drop for OriginalPromptPending` and 2 more.
|
||||
//! Publication and rollback of a prompt chunk: `OriginalPromptPending::publish`, and the drops that close the
|
||||
//! executor or abort an unpublished transaction. Also the `PromptRunner` that drives the chunks of a prompt plan, and
|
||||
//! `driver_error`.
|
||||
|
||||
use super::{
|
||||
ChunkCaches, ChunkDraft, Error, NoPromptHooks, OriginalPromptComposer, OriginalPromptExecutor, OriginalPromptHooks,
|
||||
|
||||
+1
-2
@@ -1,5 +1,4 @@
|
||||
//! Functions: `staged_input_enabled`.
|
||||
//! Split out of `original_prompt` to keep its files under the line limit.
|
||||
//! The `prefill_staged_input` switch: staged chunk input, or the per-token host path of the KAR inputs (the A/B arm).
|
||||
|
||||
|
||||
/// `LELEKA_PREFILL_STAGED_INPUT=0` keeps the per-token host path of the KAR inputs (the A/B arm).
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `Ids`: `new`, `position`.
|
||||
//! Methods of `Rig`: `snapshot`, `prefill`, `step_final`, `prefill_chunk` and 7 more.
|
||||
//! GPU test phase on the loaded target: a genuine four-row prefill chunk must reproduce the scalar known-next path
|
||||
//! exactly (logits, greedy token, residual, state, draft), and a cancelled chunk must leave the committed target and
|
||||
//! draft untouched.
|
||||
#![cfg(all(test, any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
|
||||
|
||||
use super::{
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `MicroRows`: `reserve`, `push`, `collect`, `inject`. Functions: `prepare_micro_ffn_rows`.
|
||||
//! Defines `MicroEnv`, `MicroSources`, `MicroBlockSources` and 2 more.
|
||||
//! FFN preparation of a micro window of a prefill layer: the attention blocks of the window, one whole retained-GR
|
||||
//! FFN read over them, then the per-row proofs. The block kinds and the FFN routing are the child modules.
|
||||
#![cfg(all(any(target_os = "linux", target_os = "windows"), target_arch = "x86_64"))]
|
||||
|
||||
use super::{
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the routing of the FFN reads of a micro window.
|
||||
//! The routing of the FFN reads of a micro window.
|
||||
|
||||
use super::{
|
||||
ChunkFfnRow, Context, DetachedGrRead, Error, ForwardPhase, GrStage, MicroEnv, MoeExpertStage, MoeMicroProducts,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the native prompt GDN attention blocks of a micro window.
|
||||
//! The native prompt GDN attention blocks of a micro window.
|
||||
|
||||
use super::{
|
||||
ChunkAttentionRow, Context, DetachedGrRead, Error, GdnChunkDevice, GdnStage, GrMicroAttentionBank,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the row-by-row attention blocks of a micro window (device GDN owner or host stages).
|
||||
//! The row-by-row attention blocks of a micro window (device GDN owner or host stages).
|
||||
|
||||
use super::{
|
||||
BoundLayerKind, ChunkAttentionRow, DetachedGrRead, Error, ForwardPhase, GdnChunkDevice, GdnStage,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the native prompt QSA attention blocks of a micro window.
|
||||
//! The native prompt QSA attention blocks of a micro window.
|
||||
|
||||
use super::{
|
||||
ChunkAttentionRow, Context, Error, GrMicroAttentionBank, GrStage, MicroBlockRequest, MicroEnv, MicroRows,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Functions: `prepare_q6_layer_columns`, `q6_inputs`, `q6_roles`, `q6_project` and 1 more.
|
||||
//! Split out of `prefill_chunk` to keep its files under the line limit.
|
||||
//! Q6K projection of the attention rows of a layer: the validated residual input of each row goes through the layer's
|
||||
//! Q6K matrices (GDN or QSA roles), giving the projected columns per row for the retained GR bank.
|
||||
|
||||
use super::{BoundLayerKind, DenseWeightCache, Error, LayerId, ModelBinding, QwenChunkTxn, Result};
|
||||
use crate::model_binding::qwen4exp_input::{GdnMatrixKind, GdnMatrixRole, QsaMatrixKind, QsaMatrixRole};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
//! Groups the submodules `joint_chunk`, `prefill_chunk_cached_windowed`, `prefill_chunk_native_windowed` and 1 more.
|
||||
//! Split out of `prefill_chunk` to keep its files under the line limit.
|
||||
//! Chunk entry points of `QwenForward`: the joint target+draft prefill chunk in its cached, MMQ and native windowed
|
||||
//! forms, and the planned layer loop they share.
|
||||
|
||||
use super::{
|
||||
AttentionHandoff, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension, Error, ForwardPhase, GdnStage,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the inputs and the joint target+draft publication shared by the prefill chunk entry points.
|
||||
//! The inputs and the joint target+draft publication shared by the prefill chunk entry points.
|
||||
|
||||
use super::{
|
||||
ChunkMoePolicy, DenseWeightCache, Error, KarPleCache, ModelBinding, MoeWeightCache, OutputStage, QwenForward,
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
//! Methods of `QwenForward`: `test_chunk_on_loaded`, `prefill_chunk_mmq_joint`, `prefill_chunk_cached_joint`, `prepa...
|
||||
//! Split out of `qwen_forward` to keep its files under the line limit.
|
||||
//! Entry points of `QwenForward` for the cached prefill chunk: MMQ joint, cached joint and the private outer256
|
||||
//! windowed experiments (plain and retained-GR transport). Normal serving stays on outer64 with the host transport.
|
||||
|
||||
use super::{
|
||||
ChunkMoePolicy, MoeWeightCache, PrefillChunkInputs, PrefillChunkPlan, QwenChunkTxn, QwenForward, QwenSession,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `QwenForward`: `prefill_chunk_native_integer_iq3_windowed256_retained_gr_joint`, `prepare_prefill_chun...
|
||||
//! Split out of `qwen_forward` to keep its files under the line limit.
|
||||
//! Entry point of `QwenForward` for the native IntegerIQ3 prefill chunk: outer256 layers run in windows of at most 64
|
||||
//! rows over the retained-GR transport; the draft is warmed and published with the target only after all 48 layers
|
||||
//! completed.
|
||||
|
||||
use super::{
|
||||
AllocationTrace, ChunkMoePolicy, Error, MoeWeightCache, PrefillChunkInputs, PrefillChunkPlan, QwenChunkTxn,
|
||||
|
||||
+3
-2
@@ -1,5 +1,6 @@
|
||||
//! Methods of `ChunkEnv`: `new`, `with_boundary`, `native_prompt`. Methods of `ChunkRun`: `window`.
|
||||
//! Defines `MicroBank`, `MicroBank`, `NativeMoe` and 6 more.
|
||||
//! The planned prefill chunk: admission, the `ChunkEnv` every phase reads, the `ChunkRun` of the rows a run covers
|
||||
//! and the layer loop that ends in the output head. The phases are the child modules (setup, layer, window attention,
|
||||
//! FFN, experts).
|
||||
|
||||
use super::{
|
||||
AttentionHandoff, BoundLayerKind, ChunkMoePolicy, DenseWeightCache, Dimension, Error, ForwardPhase, GdnStage,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: one layer of the prefill chunk, its GDN device owner and its windows.
|
||||
//! One layer of the prefill chunk, its GDN device owner and its windows.
|
||||
|
||||
use super::window_experts::ExpertRun;
|
||||
use super::window_ffn::WindowOwners;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: admission, transaction begin, input rows and output head of one prefill chunk.
|
||||
//! Admission, transaction begin, input rows and output head of one prefill chunk.
|
||||
|
||||
use super::{
|
||||
ChunkEnv, ChunkMoePolicy, ChunkOpening, Context, DenseWeightCache, Error, InjectedResidual, InputStage,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the host GDN and QSA attention stages of one prefill row, shared by the FFN-row and micro-FFN paths.
|
||||
//! The host GDN and QSA attention stages of one prefill row, shared by the FFN-row and micro-FFN paths.
|
||||
|
||||
use super::{
|
||||
DenseWeightCache, ForwardPhase, GdnStage, LayerId, ModelBinding, Position, QsaAttentionStage, QsaIndexStage,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the attention reads of one window of a prefill layer.
|
||||
//! The attention reads of one window of a prefill layer.
|
||||
|
||||
use super::{
|
||||
ChunkEnv, ChunkRun, Error, GrStage, InjectedResidual, InputStage, LayerEntry, LayerId, MicroBank, QwenChunkTxn,
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
//! STRA-338 size: the expert execution and the batched FFN injection of one window of a prefill layer.
|
||||
//! The expert execution and the batched FFN injection of one window of a prefill layer.
|
||||
|
||||
use super::{
|
||||
ChunkEnv, ChunkMoePolicy, ChunkRun, Error, GrStage, InjectedResidual, LayerId, MoeExpertStage, MoeWeightCache,
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user