mirror of
https://github.com/hanzoai/engine.git
synced 2026-11-20 14:17:52 +00:00
V4_CAPTURE_DIR env in quantized_deepseek4.rs: during prefill, capture the HC carrier stream-sum at layers [1,11,21,31,41] ([seq,5,4096] bf16) + the post-final-norm hidden ([seq,4096]) and write one safetensors per sample + index.jsonl. Example v4_cache_dump: JSONL corpus -> teacher-forced prefill dumps. MEASURED: 300 open-perfectblend samples, 125k tokens in 18.7min = 111.5 tok/s; hiddens verified finite, carrier rms ~860 matching the layer-trace physics. Feeds DeepSpec's convert_engine_dump.py -> dspark_v4flash_quant.py training (real-hiddens 50-step smoke: loss 3.03->2.6 decreasing).
289 lines
6.2 KiB
TOML
289 lines
6.2 KiB
TOML
[package]
|
|
name = "hanzo"
|
|
readme = "README.md"
|
|
authors = ["Hanzo AI"]
|
|
version.workspace = true
|
|
edition.workspace = true
|
|
rust-version.workspace = true
|
|
description.workspace = true
|
|
repository.workspace = true
|
|
keywords.workspace = true
|
|
categories.workspace = true
|
|
license.workspace = true
|
|
homepage.workspace = true
|
|
documentation = "https://docs.rs/hanzo"
|
|
|
|
[dependencies]
|
|
hanzo-engine.workspace = true
|
|
hanzo-macros.workspace = true
|
|
anyhow.workspace = true
|
|
thiserror.workspace = true
|
|
tokio.workspace = true
|
|
hanzo-ml.workspace = true
|
|
hanzo-nn.workspace = true
|
|
serde_json.workspace = true
|
|
serde.workspace = true
|
|
schemars.workspace = true
|
|
image.workspace = true
|
|
indexmap.workspace = true
|
|
either.workspace = true
|
|
futures.workspace = true
|
|
reqwest.workspace = true
|
|
rand.workspace = true
|
|
clap.workspace = true
|
|
walkdir.workspace = true
|
|
tracing.workspace = true
|
|
tracing-subscriber.workspace = true
|
|
|
|
# ========== Getting Started ==========
|
|
|
|
[[example]]
|
|
name = "text_generation"
|
|
path = "examples/getting_started/text_generation/main.rs"
|
|
|
|
[[example]]
|
|
name = "dspark_qwen3"
|
|
path = "examples/dspark_qwen3/main.rs"
|
|
|
|
[[example]]
|
|
name = "streaming"
|
|
path = "examples/getting_started/streaming/main.rs"
|
|
|
|
[[example]]
|
|
name = "multimodal_basic"
|
|
path = "examples/getting_started/multimodal/main.rs"
|
|
|
|
[[example]]
|
|
name = "gguf"
|
|
path = "examples/getting_started/gguf/main.rs"
|
|
|
|
[[example]]
|
|
name = "gguf_locally"
|
|
path = "examples/getting_started/gguf_locally/main.rs"
|
|
|
|
[[example]]
|
|
name = "embedding"
|
|
path = "examples/getting_started/embedding/main.rs"
|
|
|
|
# ========== Models ==========
|
|
|
|
[[example]]
|
|
name = "text_models"
|
|
path = "examples/models/text_models/main.rs"
|
|
|
|
[[example]]
|
|
name = "multimodal_models"
|
|
path = "examples/models/multimodal_models/main.rs"
|
|
|
|
[[example]]
|
|
name = "multimodal_multiturn"
|
|
path = "examples/models/multimodal_multiturn/main.rs"
|
|
|
|
[[example]]
|
|
name = "audio"
|
|
path = "examples/models/audio/main.rs"
|
|
|
|
[[example]]
|
|
name = "multimodal"
|
|
path = "examples/models/multimodal/main.rs"
|
|
|
|
[[example]]
|
|
name = "diffusion"
|
|
path = "examples/models/diffusion/main.rs"
|
|
|
|
[[example]]
|
|
name = "speech"
|
|
path = "examples/models/speech/main.rs"
|
|
|
|
[[example]]
|
|
name = "asr"
|
|
path = "examples/models/asr/main.rs"
|
|
|
|
# ========== Quantization ==========
|
|
|
|
[[example]]
|
|
name = "isq"
|
|
path = "examples/quantization/isq/main.rs"
|
|
|
|
[[example]]
|
|
name = "imatrix"
|
|
path = "examples/quantization/imatrix/main.rs"
|
|
|
|
[[example]]
|
|
name = "uqff"
|
|
path = "examples/quantization/uqff/main.rs"
|
|
|
|
[[example]]
|
|
name = "uqff_multimodal"
|
|
path = "examples/quantization/uqff_multimodal/main.rs"
|
|
|
|
[[example]]
|
|
name = "topology"
|
|
path = "examples/quantization/topology/main.rs"
|
|
|
|
[[example]]
|
|
name = "mixture_of_quant_experts"
|
|
path = "examples/quantization/mixture_of_quant_experts/main.rs"
|
|
|
|
# ========== Advanced ==========
|
|
|
|
[[example]]
|
|
name = "tools"
|
|
path = "examples/advanced/tools/main.rs"
|
|
|
|
[[example]]
|
|
name = "agent"
|
|
path = "examples/advanced/agent/main.rs"
|
|
|
|
[[example]]
|
|
name = "agent_streaming"
|
|
path = "examples/advanced/agent_streaming/main.rs"
|
|
|
|
[[example]]
|
|
name = "web_search"
|
|
path = "examples/advanced/web_search/main.rs"
|
|
|
|
[[example]]
|
|
name = "search_callback"
|
|
path = "examples/advanced/search_callback/main.rs"
|
|
|
|
[[example]]
|
|
name = "tool_callback"
|
|
path = "examples/advanced/tool_callback/main.rs"
|
|
|
|
[[example]]
|
|
name = "mcp_client"
|
|
path = "examples/advanced/mcp_client/main.rs"
|
|
|
|
[[example]]
|
|
name = "grammar"
|
|
path = "examples/advanced/grammar/main.rs"
|
|
|
|
[[example]]
|
|
name = "json_schema"
|
|
path = "examples/advanced/json_schema/main.rs"
|
|
|
|
[[example]]
|
|
name = "llguidance"
|
|
path = "examples/advanced/llguidance/main.rs"
|
|
|
|
[[example]]
|
|
name = "logits_processor"
|
|
path = "examples/advanced/logits_processor/main.rs"
|
|
|
|
[[example]]
|
|
name = "file_logging"
|
|
path = "examples/advanced/file_logging/main.rs"
|
|
|
|
[[example]]
|
|
name = "batching"
|
|
path = "examples/advanced/batching/main.rs"
|
|
|
|
[[example]]
|
|
name = "batching_embeddings"
|
|
path = "examples/advanced/batching_embeddings/main.rs"
|
|
|
|
[[example]]
|
|
name = "paged_attn"
|
|
path = "examples/advanced/paged_attn/main.rs"
|
|
|
|
[[example]]
|
|
name = "auto_device_map"
|
|
path = "examples/advanced/auto_device_map/main.rs"
|
|
|
|
[[example]]
|
|
name = "multi_model"
|
|
path = "examples/advanced/multi_model/main.rs"
|
|
|
|
[[example]]
|
|
name = "lora"
|
|
path = "examples/advanced/lora/main.rs"
|
|
|
|
[[example]]
|
|
name = "xlora"
|
|
path = "examples/advanced/xlora/main.rs"
|
|
|
|
[[example]]
|
|
name = "anymoe"
|
|
path = "examples/advanced/anymoe/main.rs"
|
|
|
|
[[example]]
|
|
name = "anymoe_lora"
|
|
path = "examples/advanced/anymoe_lora/main.rs"
|
|
|
|
[[example]]
|
|
name = "error_handling"
|
|
path = "examples/advanced/error_handling/main.rs"
|
|
|
|
[[example]]
|
|
name = "perplexity"
|
|
path = "examples/advanced/perplexity/main.rs"
|
|
|
|
[[example]]
|
|
name = "embeddings"
|
|
path = "examples/advanced/embeddings/main.rs"
|
|
|
|
[[example]]
|
|
name = "code_execution"
|
|
path = "examples/advanced/code_execution/main.rs"
|
|
|
|
[[example]]
|
|
name = "code_execution_approval"
|
|
path = "examples/advanced/code_execution_approval/main.rs"
|
|
|
|
[[example]]
|
|
name = "code_execution_files"
|
|
path = "examples/advanced/code_execution_files/main.rs"
|
|
|
|
# ========== Cookbook ==========
|
|
|
|
[[example]]
|
|
name = "cookbook_rag"
|
|
path = "examples/cookbook/rag/main.rs"
|
|
|
|
[[example]]
|
|
name = "cookbook_structured"
|
|
path = "examples/cookbook/structured/main.rs"
|
|
|
|
[[example]]
|
|
name = "cookbook_multiturn"
|
|
path = "examples/cookbook/multiturn/main.rs"
|
|
|
|
[[example]]
|
|
name = "cookbook_agent"
|
|
path = "examples/cookbook/agent/main.rs"
|
|
|
|
[package.metadata.docs.rs]
|
|
no-default-features = true
|
|
|
|
[features]
|
|
# NVIDIA CUDA GPU support
|
|
cuda = ["hanzo-engine/cuda"]
|
|
# Vulkan GPU support (AMD APU via hanzo-ml vulkan backend)
|
|
vulkan = ["hanzo-engine/vulkan"]
|
|
rocm = ["hanzo-engine/rocm"]
|
|
# cuDNN acceleration (requires cuda)
|
|
cudnn = ["hanzo-engine/cudnn"]
|
|
# Apple Metal GPU support (macOS/iOS)
|
|
metal = ["hanzo-engine/metal"]
|
|
# Flash Attention 2 kernels (requires cuda)
|
|
flash-attn = ["cuda", "hanzo-engine/flash-attn"]
|
|
# Apple Accelerate framework for BLAS operations
|
|
accelerate = ["hanzo-engine/accelerate"]
|
|
# Intel MKL acceleration for BLAS operations
|
|
mkl = ["hanzo-engine/mkl"]
|
|
# Multi-GPU support via NCCL (requires cuda)
|
|
nccl = ["hanzo-engine/nccl"]
|
|
# Use ring instead of aws-lc-rs for TLS
|
|
ring = ["hanzo-engine/ring"]
|
|
# Python code execution tool
|
|
code-execution = ["hanzo-engine/code-execution"]
|
|
|
|
[[example]]
|
|
name = "deepseek_v4_gguf"
|
|
path = "examples/deepseek_v4_gguf/main.rs"
|
|
|
|
[[example]]
|
|
name = "v4_cache_dump"
|
|
path = "examples/v4_cache_dump/main.rs"
|