Expand description
Block assembly-line API for RLX model builders.
Re-exports§
pub use blocks::RopeTablesStage;pub use blocks::BertEncoderLayerSpec;pub use blocks::BertEncoderLayerStage;pub use blocks::BertQkvStyle;pub use blocks::ClsTokenPoolStage;pub use blocks::NomicEncoderLayerSpec;pub use blocks::NomicEncoderLayerStage;pub use blocks::Qwen3DecodeLayerSpec;pub use blocks::Qwen3DecoderSpec;pub use blocks::Qwen3DecoderStage;pub use blocks::VitSelfAttnSpec;pub use blocks::dinov2_layer_fused;pub use blocks::nomic_vision_layer_fused;pub use escape::Emit;pub use stream::DualStreamStage;pub use stream::LoadStreamStage;pub use stream::StoreStreamStage;pub use stream::dual_stream_stage;pub use stream::id as stream_id;
Modules§
- blocks
- escape
- Tier-2 escape hatch — custom HIR emission when blocks are not enough yet.
- prelude
- Common imports for model flow authors.
- stream
- Named tensor streams — dual-/multi-stream models without IR in recipes.
Structs§
- Backend
Overrides - Per-backend hint table (env-style toggles without touching IR).
- Block
AsLayer - Bridge existing [
BlockStage] impls toLayerStagewith hidden-only artifacts. - Built
Model - Result of assembling a model flow.
- Compile
Profile - Tier-1 compile configuration. Load from
*.rlx.tomlor use Rust presets. - CpuBackend
Profile - Decode
Bindings - KV-cache decode inputs bound by
crate::blocks::BindDecodeInputsStage. - Flow
Extension Plan - Names of HIR extensions to apply when building this flow (empty = all registered).
- Flow
State - Cross-stage shared handles (RoPE tables, zero-beta, tied embed, …).
- Flow
Value - Output of a block stage. Model authors see shape + opaque id only.
- Fusion
Profile - GdnInput
Slots - Handles for a [
Op::GatedDeltaNet] / carry scan. - Gguf
Packed Linear - One packed linear weight: quantized bytes + bias.
- Gguf
Packed Params - Compatibility shim: packed GGUF matmul weights (used by some model loaders).
- KvCache
Contract - KV cache tensor shapes exposed by attention blocks (associated type stand-in).
- Layer
Stack - Stack transformer sub-blocks into one named layer stage.
- MapWeights
- In-memory weight map for tests and tooling.
- Metal
Backend Profile - Model
Execution Config - Shader-component-style bundle: one object for specialize + compile + cache.
- Model
Flow - Block assembly-line builder — tier-0 model author surface.
- Pass
Profile - Plugin
Stage - Named plugin stage (alias over tier-2 custom emission).
- Precision
Profile - Side
Outputs - Collects extra graph outputs emitted by side-effect stages (e.g. KV taps).
- Stage
Artifacts - Outputs a layer stage may publish beyond the main hidden tensor.
Enums§
- Execution
Preset - Named compile presets (fusion policy, precision, pass toggles).
- Flow
Stage - One stage in a model flow. Model authors compose these — not HIR ops.
- Fusion
Policy Kind - Fusion
Target Kind - Layer
Composition - Static description of a layer stack for cache keys and recipes.
- Mixed
Precision Kind - Precision
Kind
Traits§
- Attention
Stage - Attention block interface: hidden in, hidden out, plus cache contract.
- FfnStage
- FFN block interface (SwiGLU / MLP).
- Layer
Stage - Layer block with an explicit artifact contract (for new blocks and plugins).
- Model
Recipe - Assemble a
ModelFlowfrom config — use for arch-specific presets (LLaMA, Qwen, FLUX, …). - Norm
Stage - Normalization block interface.
- Weight
Source - Abstract weight source for block emission. Keeps
rlx-flowindependent of safetensors / GGUF file formats.