spark_model/forward/mod.rs
1// SPDX-License-Identifier: AGPL-3.0-only
2//! Vendor-agnostic per-layer forward orchestration.
3//!
4//! This module hosts the per-layer kernel-launch sequences that any
5//! end-to-end inference driver (CUDA, Metal, AMD ROCm, …) needs to call.
6//! It depends only on the `GpuBackend` trait + kernel-name strings + a
7//! `QuantWeights` trait that lets concrete weight types plug in without
8//! the forward path knowing which quantisation format they speak.
9//!
10//! Goal: when a future hardware-target driver lands, its `examples/{vendor}_qwen35_inference`
11//! shrinks to tokenizer + weight load + token loop — the per-layer
12//! orchestration is *here*, written once.
13//!
14//! Out of scope: the production decode forward in
15//! `crate::model::trait_impl::decode_a` is heavily coupled to CUDA-graph
16//! capture / NCCL / paged-KV machinery; this module is intentionally
17//! simpler so a single-token decoder example can call it directly.
18
19pub mod quant_weights;
20pub mod qwen3_5;
21
22pub use quant_weights::QuantWeights;