Skip to main content

Crate fuel

Crate fuel 

Source
Expand description

§Fuel

Fuel is a DAG-first, lazy-only ML framework for Rust. This crate is the public facade for the framework: it re-exports the public surface that fuel-core used to carry, from the crates that own those items now (fuel-tensor, fuel-ir, fuel-hardware, fuel-dispatch, fuel-backend-contract, fuel-cpu-backend, fuel-loaders, fuel-kv-pool, fuel-transformers), so use fuel::... resolves exactly as it did when fuel re-exported fuel-core (GAP-348, the fuel-core dissolution; fuel-core itself no longer exists). Feature flags are forwarded to the owning crates (see this crate’s manifest).

See docs/restructure-migration-design.md §Stage 1.

Re-exports§

pub use fuel_kv_pool as kv_block_pool;

Modules§

cuda_backend
Thin re-export layer for CUDA backend types, plus the bridge that turns a [fuel_cuda_backend::CudaDevice] into a crate::Device.
decode_shape
The identity a held decode plan is baked against.
error
Error types, re-exported from fuel-ir.
factories
Backend factory registry — Step 12 of the backend-agnostic refactor.
hf_config
Shared resolution rules for HuggingFace config.json parsing.
inference_context
Persistent inference state for the pipelined executor (Phase 7.6 step 9c, sub-phase E.3.0).
judge
The Judge — Phase 6b’s empirical profiler.
kv_block_pool_device
Device-backed KV block pool — the thin integration layer that binds the pure KvBlockPool host-side allocator to real device Storage (multi-session serving, Increment 2, Part 2).
lazy
Phase 6a bridge: a lazy-computation-graph tensor that wraps fuel_graph::NodeHandle and presents it through an API compatible with fuel-core’s eager Tensor.
lazy_based
Based (Stanford Hazy Research) decoder ported to the lazy-graph API.
lazy_beit
BEiT (BERT pre-training of Image Transformers) ported to the lazy-graph API.
lazy_bert
BERT encoder ported to the lazy-graph API.
lazy_bigcode
BigCode (StarCoder-1) decoder ported to the lazy-graph API.
lazy_blip
BLIP image-captioning composition — lazy port.
lazy_blip_text
BLIP text decoder — lazy port.
lazy_blip_vision
BLIP vision encoder — lazy port.
lazy_chatglm
ChatGLM2 / ChatGLM3 (THUDM) decoder ported to the lazy-graph API.
lazy_chinese_clip
Chinese-CLIP — lazy port.
lazy_clip
CLIP (Contrastive Language-Image Pre-Training) ported to the lazy-graph API.
lazy_colpali
ColPali — lazy port.
lazy_conv3d
Conv3D for Qwen3-VL temporal patch embedding, decomposed into two parallel Conv2Ds.
lazy_convmixer
ConvMixer (Trockman & Kolter 2022 “Patches Are All You Need?”) ported to the lazy-graph API.
lazy_convnext
ConvNeXt image classifier ported to the lazy-graph API.
lazy_csm
CSM (Conversational Speech Model) — lazy port.
lazy_dac
Descript Audio Codec (DAC) — lazy port.
lazy_debertav2
DeBERTa-v2 / v3 — lazy port.
lazy_deepseek2
DeepSeek-V2 (Multi-head Latent Attention + MoE) ported to the lazy-graph API.
lazy_depth_anything_v2
Depth Anything V2 — lazy port.
lazy_dinov2
DINOv2 vision transformer (Meta AI) ported to the lazy-graph API.
lazy_dinov2reg4
DINOv2-reg4 (Darcet et al. 2023, “Vision Transformers Need Registers”) ported to the lazy-graph API.
lazy_distilbert
DistilBERT (distilled BERT) ported to the lazy-graph API.
lazy_efficientnet
EfficientNet (Tan & Le 2019, “EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks”) ported to the lazy-graph API. All eight depth variants B0–B7 are reachable through width/depth multipliers on the seven-stage MBConv schedule.
lazy_efficientvit
EfficientViT-MSRA — lazy port.
lazy_encodec
EnCodec — lazy port (decoder + RVQ).
lazy_eva2
EVA-02 — lazy port.
lazy_falcon
Falcon (7B and similar) decoder ported to the lazy-graph API.
lazy_fastvit
FastViT — lazy port.
lazy_flux
Flux (Black Forest Labs) — rectified-flow MMDiT image diffusion, ported to the lazy-graph API.
lazy_gemma
Gemma (v1) decoder ported to the lazy-graph API.
lazy_gemma2
Gemma 2 (Google DeepMind 2024) ported to the lazy-graph API.
lazy_gemma3
Gemma 3 decoder ported to the lazy-graph API.
lazy_gemma4_audio
Gemma 4 audio encoder (Conformer) ported to the lazy-graph API.
lazy_gemma4_mm_embed
Gemma4 multimodal embedder — lazy port.
lazy_gemma4_text
Gemma 4 text decoder ported to the lazy-graph API.
lazy_gemma4_vision
Gemma 4 vision tower (ViT-style image encoder) ported to the lazy-graph API.
lazy_glm4
GLM-4 (new architecture) decoder ported to the lazy-graph API.
lazy_glm4_new
GLM-4 (new architecture, ChatGLM-4-style) ported to the lazy-graph API.
lazy_granite
Granite decoder ported to the lazy-graph API.
lazy_granitemoehybrid
Granite-MoE Hybrid (IBM Granite long-context) ported to the lazy-graph API.
lazy_helium
Helium decoder ported to the lazy-graph API.
lazy_hiera
Hiera — lazy port (hierarchical ViT without bells-and-whistles).
lazy_jina_bert
Jina-BERT (jinaai/jina-embeddings-v2-base-en) ported to the lazy-graph API.
lazy_kv_cache
LazyKvCache — functional KV cache backed by Tensor.
lazy_latent_cache
LatentCache — a general N-slot decode cache backed by Tensor, the structural generalization of [fuel_transformers::models::lazy_kv_cache:: LazyKvCache] that unblocks latent / pruned KV compression.
lazy_lfm2
LFM2 (Liquid Foundation Model 2) decoder ported to the lazy-graph API.
lazy_llama2c
Llama2-C decoder ported to the lazy-graph API.
lazy_llama_full
LLaMA-3 long-context RoPE scaling on top of the lazy LlamaModel.
lazy_llava
LLaVA (Large Language and Vision Assistant) ported to the lazy-graph API.
lazy_lstm
Lazy LSTM — PyTorch-shape multi-layer LSTM unrolled at graph-build time.
lazy_mamba
Mamba (v1) decoder ported to the lazy-graph API.
lazy_mamba2
Mamba-2 decoder ported to the lazy-graph API.
lazy_marian
Marian NMT (Helsinki-NLP / Opus MT) ported to the lazy-graph API.
lazy_metavoice
MetaVoice main TTS LM — lazy port.
lazy_metavoice_speaker_encoder
MetaVoice speaker encoder — lazy port.
lazy_mimi
Mimi — top-level Encodec model.
lazy_mimi_conv
Mimi streaming-capable 1-D convolution primitive (sub-port 1 of port-mimi-conv.md).
lazy_mimi_conv_transpose
Mimi streaming-capable 1-D transposed convolution primitive (sub-port 2 of port-mimi-conv.md).
lazy_mimi_conv_wrappers
Mimi learnable down-/up-sampling wrappers (sub-port 3 of port-mimi-conv.md).
lazy_mimi_encodec
Mimi Encodec — top-level neural audio codec.
lazy_mimi_quantization
Mimi residual vector quantizer — lazy port.
lazy_mimi_resampler
Mimi resampler — lazy port.
lazy_mimi_seanet
Mimi SeaNet — lazy port.
lazy_mimi_transformer
Mimi ProjectedTransformer — lazy port.
lazy_mistral
Mistral decoder ported to the lazy-graph API.
lazy_mixformer
MixFormer (Phi-1 / Phi-1.5 / Phi-2-preview) decoder ported to the lazy-graph API.
lazy_mixtral
Mixtral (sparse Mixture-of-Experts) decoder ported to the lazy-graph API.
lazy_mmdit
MMDiT (Multimodal Diffusion Transformer) ported to the lazy-graph API.
lazy_mobileclip
MobileCLIP — lazy port.
lazy_mobilenetv4
MobileNetV4 — lazy port.
lazy_mobileone
MobileOne (Vasu et al. 2022, “MobileOne: An Improved One Millisecond Mobile Backbone”) ported to the lazy-graph API.
lazy_modernbert
ModernBERT (Warner et al. 2024 “Smarter, Better, Faster, Longer”) ported to the lazy-graph API.
lazy_moondream
Moondream vision-language model ported to the lazy-graph API.
lazy_mpt
MPT (Mosaic Pretrained Transformer) decoder ported to the lazy-graph API.
lazy_musicgen
MusicGen (Facebook / Meta AI) — lazy port.
lazy_nomic_bert
NomicBert (nomic-embed-text-v1.x) ported to the lazy-graph API.
lazy_nvembed_v2
NV-Embed v2 (NVIDIA 2024) ported to the lazy-graph API.
lazy_olmo
OLMo decoder ported to the lazy-graph API.
lazy_olmo2
OLMo2 decoder ported to the lazy-graph API.
lazy_openclip_text
OpenCLIP text transformer — lazy port.
lazy_paddleocr_vl
PaddleOCR-VL top-level composition: text + vision + tile glue.
lazy_paddleocr_vl_text
PaddleOCR-VL text language model ported to the lazy-graph API.
lazy_paddleocr_vl_vision
PaddleOCR-VL vision tower ported to the lazy-graph API.
lazy_paligemma
PaliGemma multimodal model ported to the lazy-graph API.
lazy_parler_tts
Parler-TTS audio token decoder — lazy port.
lazy_persimmon
Persimmon decoder ported to the lazy-graph API.
lazy_phi
Phi (Phi-1.5 / Phi-2) decoder ported to the lazy-graph API.
lazy_phi3
Phi-3 decoder ported to the lazy-graph API.
lazy_pixtral
Pixtral (Mistral AI vision-language model) ported to the lazy-graph API.
lazy_quantized_gemma3
GGUF-quantized Gemma 3 ported to the lazy-graph API.
lazy_quantized_glm4
GGUF-quantized GLM-4 ported to the lazy-graph API.
lazy_quantized_lfm2
GGUF-quantized LFM2 (Liquid Foundation Model 2) ported to the lazy-graph API.
lazy_quantized_llama
GGUF-quantized LLaMA (LLaMA-2 / LLaMA-3 / LLaMA-3.1) ported to the lazy-graph API.
lazy_quantized_phi3
GGUF-quantized Phi-3 ported to the lazy-graph API.
lazy_quantized_qwen2
GGUF-quantized Qwen2 ported to the lazy-graph API.
lazy_quantized_qwen3
GGUF-quantized Qwen3 ported to the lazy-graph API.
lazy_quantized_qwen3_moe
GGUF-quantized Qwen3-MoE ported to the lazy-graph API.
lazy_quantized_smollm3
GGUF-quantized SmolLM3 ported to the lazy-graph API.
lazy_quantized_t5
GGUF-quantized T5 ported to the lazy-graph API.
lazy_quantized_whisper
GGUF-quantized Whisper speech-recognition model.
lazy_qwen2
Qwen2 (non-MoE) decoder ported to the lazy-graph API.
lazy_qwen3
Qwen3 decoder ported to the lazy-graph API.
lazy_qwen2_moe
Qwen2-MoE decoder ported to the lazy-graph API.
lazy_qwen3_5
Qwen3.5 (the Gated DeltaNet / full-attention hybrid; HF model_type qwen3_5) config and weight loader. ROADMAP row 40, stage 1.
lazy_qwen3_5_attn
The gated full-attention token mixer of Qwen3.5, composed from base lazy ops. ROADMAP row 115 (docs/design-notes/2026-10-30-qwen35-composed-forward-row-115.md, section 3).
lazy_qwen3_5_decode
Cached decode for Qwen3.5: ROADMAP row 115, step 5. The keys and values of each full-attention layer and the (S, conv window) of each Gated DeltaNet layer are carried between calls as host data, so a call over T new tokens costs T tokens of compute, not the whole prefix.
lazy_qwen3_5_forward
The Qwen3.5 decoder stack from the composed mixers: ROADMAP row 115, step 4 (docs/design-notes/2026-10-30-qwen35-composed-forward-row-115.md).
lazy_qwen3_5_gdn
The Gated DeltaNet recurrence of Qwen3.5, composed from base lazy ops. ROADMAP row 115, step 1 (docs/design-notes/2026-10-30-qwen35-composed-forward-row-115.md).
lazy_qwen3_5_gguf
GGUF qwen35 loader: Qwen3_5Config from the qwen35.* metadata and Qwen3_5Weights from the tensors, K-quant weights kept quantized (ROADMAP row 118, milestone M1 of docs/design-notes/2026-11-14-qwen35-27b-plan.md).
lazy_qwen3_moe
Qwen3-MoE decoder ported to the lazy-graph API.
lazy_qwen3_vl
Qwen3-VL multimodal composition (vision + text + DeepStack).
lazy_qwen3_vl_text
Qwen3-VL text language model ported to the lazy-graph API.
lazy_qwen3_vl_vision
Qwen3-VL vision tower (lazy-graph port).
lazy_recurrent_gemma
Recurrent Gemma decoder ported to the lazy-graph API.
lazy_repvgg
RepVGG (Ding et al. 2021, “RepVGG: Making VGG-style ConvNets Great Again”) ported to the lazy-graph API.
lazy_resnet
ResNet (He et al. 2015 “Deep Residual Learning for Image Recognition”) ported to the lazy-graph API.
lazy_rwkv5
RWKV v5 (“Eagle”) decoder ported to the lazy-graph API.
lazy_rwkv6
RWKV v6 (“Finch”) decoder ported to the lazy-graph API.
lazy_rwkv7
RWKV v7 “Goose” decoder ported to the lazy-graph API.
lazy_rwkv_tokenizer
Byte-pair tokenizer for RWKV models.
lazy_sam
Segment Anything Model (SAM) — ViT-B image encoder, lazy port.
lazy_sd3_text_encoder
Stable Diffusion 3 / 3.5 triple-CLIP text-encoder composer ported to the lazy-graph API.
lazy_sd3_vae
Stable Diffusion 3 VAE decoder ported to the lazy-graph API.
lazy_sd_samplers
Stable-Diffusion noise schedulers ported to the lazy-graph API.
lazy_sd_samplers_euler
Euler-ancestral discrete Stable-Diffusion scheduler — lazy-graph port.
lazy_sd_samplers_sd3
Stable Diffusion 3 / 3.5 flow-match Euler sampler with Skip Layer Guidance — lazy-graph port.
lazy_sd_samplers_unipc
UniPC scheduler ported to the lazy-graph API.
lazy_sd_text_encoder
Stable Diffusion 1.5 CLIP text encoder ported to the lazy-graph API.
lazy_sd_unet
Stable Diffusion 1.5 UNet (denoising network) ported to the lazy-graph API.
lazy_sd_vae
Stable Diffusion 1.5 VAE decoder ported to the lazy-graph API.
lazy_segformer
SegFormer — lazy port.
lazy_siglip
SigLIP (Sigmoid Loss for Language-Image Pre-Training) ported to the lazy-graph API.
lazy_smollm3
SmolLM3 decoder ported to the lazy-graph API.
lazy_snac
SNAC — lazy port (decoder + per-stride RVQ).
lazy_stablelm
StableLM decoder ported to the lazy-graph API.
lazy_starcoder2
StarCoder2 decoder ported to the lazy-graph API.
lazy_stella_v5
Stella-en-v5 (Dunzhang 2024) ported to the lazy-graph API.
lazy_t5
T5 (Text-To-Text Transfer Transformer) ported to the lazy-graph API.
lazy_tiny_vit
TinyViT (MobileSAM image encoder) ported to the lazy-graph API.
lazy_training_augmentations
Training augmentations: LR schedulers and gradient clipping.
lazy_training_augmentations_extras
Training augmentations: gradient accumulation, mixed-precision casts, and in-place parameter updates.
lazy_trocr
TrOCR — lazy port.
lazy_vgg
VGG-13 / VGG-16 / VGG-19 (Simonyan & Zisserman 2014, “Very Deep Convolutional Networks for Large-Scale Image Recognition”) ported to the lazy-graph API.
lazy_vit
Vision Transformer (ViT) ported to the lazy-graph API.
lazy_voxtral
Voxtral (Mistral AI) speech-language model ported to the lazy-graph API.
lazy_whisper
Whisper speech recognition model ported to the lazy-graph API.
lazy_whisper_audio
Whisper audio preprocessing — pure host-side STFT + log-mel.
lazy_wuerstchen
Wuerstchen v2 cascaded latent diffusion model — lazy port.
lazy_xlm_roberta
XLM-RoBERTa (multilingual BERT variant) ported to the lazy-graph API.
lazy_yi
Yi decoder ported to the lazy-graph API.
lazy_yolov3
YOLOv3 object detector ported to the lazy-graph API.
lazy_yolov8
YOLOv8 object detector ported to the lazy-graph API.
lazy_z_image
Z-Image text-to-image diffusion model ported to the lazy-graph API.
metal_backend
Thin re-export layer for Metal backend types, plus the bridge that turns a [fuel_metal_backend::MetalDevice] into a crate::Device.
nf4
bitsandbytes NF4 weight materialization helpers.
persistent_decode
The shared persistent-decode rebind driver (GAP-029 increment 2b).
pipelined_bridge
Bridge from fuel-core’s user-facing Tensor::realize_* API to fuel-storage’s PipelinedExecutor (Phase 7.6 step 9c, sub-phases E.1 + E.2).
planner
Load-time planning driver.
probe
Top-level multi-backend probe collector for Phase 6b.
quantized
Quantized (ggml/gguf block-format) support for fuel-core.
safetensors
Safetensors file reading — the mmap/view surface.
sampling
Sampling controls for decode loops (ROADMAP row 133, slice 1: the pure host sampler).
scheduling
Orchestrator for the Phase 6b probe → judge → dispatch pipeline.
test_utils
Test helpers. The eager-Tensor helpers (test_device!, assert_tensor_eq, to_vec{0,1,2,3}_round) were removed in B6; what remains is host-slice and lazy infrastructure that the lazy_* port tests use.
topology
SystemTopology — single source of truth for what backends exist, what devices they target, which backends share Storage substrate, and what transfer paths connect devices.
transfer_cost
Transfer-cost model for the multi-backend DAG planner.
utils
Hardware / build-feature probes.

Macros§

bail
Returns early from a function with a formatted error message.

Structs§

Device
A device on which tensors can be created and computations performed.
Layout
Describes the memory layout of a tensor: shape, strides, and start offset.
Shape
A shape represents the dimensions of a tensor.
Storage
Owns a typed contiguous buffer on one device. The boxed DynBackendStorage is the actual byte holder; Storage is a thin wrapper that gives the eager-dispatch op methods (matmul, conv, unary, binary, …) somewhere to live.
StridedIndex
An iterator over offset position for items of an N-dimensional arrays stored in a flat buffer using some potential strides.

Enums§

D
Dimension indexing from the right (end) of a shape.
DType
The different types of elements allowed in tensors.
DTypeParseError
Error returned when a string cannot be parsed as a DType.
DeviceLocation
Identifies a physical device location (CPU or a specific GPU).
Error
The main error type for the fuel library.
HostBuffer
Host-addressable tensor storage holding a typed vector of elements.
HostBufferRef
A borrowed reference to host tensor storage.
StridedBlocks

Traits§

Context
Attach more context to an error.
FloatDType
IntDType
NdArray
Trait for host array-like values that describe their shape and yield CPU storage.
WithDType
Local marker subtrait — inherits every method from fuel_ir::dtype::WithDType but is defined in this crate so that the orphan/coherence rules treat it as a local trait.

Type Aliases§

CpuStorage
Backwards-compatibility alias. New code should use HostBuffer.
CpuStorageRef
Backwards-compatibility alias. New code should use HostBufferRef.
Result
A specialized Result type for fuel operations.