Machine-applicable idiom fixes only (redundant refs, map keys()/values()
iteration, Option::filter), plus a rustfmt wrap in quantized/metal.rs.
Behavior-identical; greens the -D warnings + fmt --check CI gate.
ViT encoder as exposed by transformers.IJepaModel: no CLS token, learned
per-patch position embeddings, per-patch last_hidden_state after a final
LayerNorm, plus a mean-pooled convenience. Module tree mirrors the published
facebook/ijepa_vith14_1k layout so the checkpoint loads with no key remap.
Falsifiable parity gate vs transformers.IJepaModel (fp32 CPU):
tiny 2-layer fixture (committed, no network): per-patch max_abs 7.15e-7
real ViT-H/14 (#[ignore], 2.5GB ckpt): per-patch rel 7.83e-5, cosine 1.0
pooled rel 1.78e-6, cosine 1.0
Encoder only; the latent predictor is not in IJepaModel (follow-up).
- declare quantized_lfm2 in models/mod.rs (file existed, module never wired; broke the quantized-lfm2 example on cargo test)
- trainer.rs metal arm: anyhow::anyhow! instead of String.into() (E0277 on --features metal)
- clippy -D warnings sweep: .clamp() in dsv4_qat, FRAC_1_SQRT_2 in hanzo-3d test, doc-list indents, rename misnamed run_unary_benchmark, cfg-gated allows for rocm-only field/dim reads, drop redundant trim
- workspace clippy allows: needless_range_loop + too_many_arguments (quant-kernel idioms)
- rust-ci: install cc on the clippy runner (image ships without a C toolchain)
De-complect env config to one-way + minimal per the CTO directive:
- DELETE dev A/B fallback toggles (forced the OLD/slow path; production always
wants fast): HANZO_Q{2,3,4,5,6}K/IQ*_FALLBACK, HANZO_IQ_DEQUANT_FALLBACK,
HANZO_MOE_{QMMQ,ROUTE,GATEUP,COMBINE}_FALLBACK, HANZO_DBG_PATH, DEQUANTIZE_ALL(_F16).
Removed each env::var check + fallback branch, kept the fast path. Runtime HW/type
auto-select is preserved: RocmQuantType::dp4a_active now == dp4a_capable (no env),
the scalar core still serves non-dp4a types.
- DE-BRAND runtime knobs to bare names: MOE_TILE_M, MOE_STATS, CUDA_FAST_MMQ, MIN_LEN,
ML_CUDA_UMA_THRESHOLD, VK_Q4K_{LEGACY,DP4A,TILED2D,COOPMAT}, GGUF_MMAP, CUDA_FLASH_BF16,
FLASH_ATTN_BUILD_DIR, ROCM_VERSION, ROCM_GFX_ARCH (dropped redundant HANZO_ROCM_ARCH),
NVCC_CCBIN, HANZO_TEST_{GGUF,BLESS}->TEST_*.
- FIX the VK_DP4A_DECODE two-ways inconsistency: ONE bare name VK_DP4A_DECODE_OFF (the
doc naming a phantom HANZO_VK_DP4A_DECODE was corrected).
- Bit-exact oracle tests force the scalar core via a test-only programmatic flag
(hanzo_ml::set_force_scalar_matvec), never env, never set in production.
Only HANZO_ names left are the license identity vars. cargo check -p hanzo-ml green
(default + rocm).
QMmap<T> QuantizedType impl holds Arc<Mmap>+offset and serves &[T] reinterpreted in-place
inside the mapping (no to_vec); same dequant/matmul kernels run over mmap'd pages, OS demand-
pages + evicts under pressure (antirez 'RAM as a speed spectrum'). from_mmap/type_align table-
generated from for_each_quant! (can't drift). Flag-gated via VarBuilder::from_gguf_mmap /
HANZO_GGUF_MMAP=1; default resident path byte-identical. Bounds-checked offsets + alignment
fallback. CPU bit-identical + no-copy proven (gguf_mmap_test 2/2); cuda/transformers compile.
Follow-on: CUDA-UMA register/prefetch the mmap region (no VRAM copy) + per-expert mlock cache.
Routes MoE prefill (rows>1) through a fused expert-grouped iu8 WMMA GEMM (qmmq_core<WTYPE,MOE>) instead of the per-slot dp4a matvec: tokens grouped by expert, each expert weight staged once and amortized over its token tile (llama mul_mat_id strategy). Decode keeps the capture-clean dp4a matvec. Qwen3-30B-A3B-Q4_K_M prefill 363->936 T/s (2.58x, 0.34x->0.89x of llama-HIP), decode 41->50 (+22%). Bit-exact nbad=0 (Q4_K/Q6_K/Q8_0 MoE oracle); dense path codegens byte-identical (if constexpr MOE elides). HANZO_MOE_QMMQ_FALLBACK=1 to force the matvec path.
Bring remaining workspace crates from 0.11.3 to 0.11.4 to match
hanzo-ml + hanzo-rocm-kernels (already 0.11.4 on main). Integrates:
- vulkan gather u32 index fix
- on-GPU f16/bf16 cast (kills 4200+ CPU round-trips/run)
- vulkan paged-attn kernels + public dispatch API
- librocdxg/rocm-rs upstream fork docs
* fix(cuda/cudnn): fall back to heuristic algo when a forced fwd-algo has no workspace
When a caller pins a CudnnFwdAlgo (e.g. Winograd/Gemm) that cuDNN does not support
for a given conv shape, get_workspace_size errors and the whole conv fails. Fall back
to pick_algorithm() instead of erroring. No behavior change for the default (None) path.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
* chore(release): bump workspace to 0.11.0 (clean minor; was mixed 0.10.2/0.10.3 patches)
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
---------
Co-authored-by: hanzo-dev <z@zoo.ngo>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Delete 7 stale orphaned candle-* dirs (superseded by hanzo-* crates, not
workspace members). Rename candle_nn/candle_core/candle_flash_attn idents and
CANDLE_* env vars to hanzo equivalents. Engine cargo check clean.
Bump all hanzo crates 0.9.2-alpha.N -> 0.9.2. Vendor the bindgen_cuda git fork
as hanzo-bindgen-cuda (MIT, attribution kept; lib name = bindgen_cuda) so the
CUDA kernel crate is publishable, and repoint hanzo-kernels at it. Add missing
license/description metadata for rocm-kernels/ug/flash-attn. Published: hanzo-
bindgen-cuda 0.1.7, hanzo-kernels/-metal-kernels/-rocm-kernels/-ug, and the core
hanzo-ml / hanzo-nn / hanzo-transformers 0.9.2.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Make `cargo clippy --workspace --tests --examples --benches -- -D warnings`
pass (CI gate): allow a small set of stylistic lints in inherited model/bench
code via [workspace.lints.clippy] (+ [lints] workspace=true on members), and
replace the deprecated `criterion::black_box` with `std::hint::black_box` in the
benches. Rustfmt + clippy both clean locally; hanzo-ml --features vulkan green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Delete the 15 orphaned candle-* duplicate crate dirs (candle-core/-nn/-pyo3/
-transformers/-datasets/-examples/-onnx/-ug/-kernels/-metal-kernels/-flash-attn
/-flash-attn-v3/-book/-wasm-tests/-wasm-examples) and their [workspace.dependencies]
entries -- they were superseded by the hanzo-* crates and depended on by nothing.
Migrate tensor-tools off `candle` to `hanzo-ml`. Rename the remaining candle
import identifiers in member source to their hanzo equivalents: candle_ug ->
hanzo_ug, candle_flash_attn -> hanzo_flash_attn, candle_transformers ->
hanzo_transformers, candle_datasets -> hanzo_datasets; and the user-facing error
strings candle -> hanzo. No functional `candle_*` identifiers remain in member
crates (only upstream docs.rs/github attribution URLs and historical version
notes are kept). cargo check -p hanzo-ml --features vulkan + hanzo-transformers
both green.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Op fusion: silu(gate) * up was two dispatches (silu, then mul) per MLP per layer.
Add a fused silu_mul kernel + CustomOp2 (cpu_fwd composes; vulkan_fwd one dispatch)
and use it in Qwen3MLP when the activation is SiLU. Cuts a dispatch + an
intermediate buffer per layer (28/forward for Qwen3-0.6B). Verified: forward
argmax matches CPU, rel 4.3e-6; allops pass.
Also: the hanzo crates' source was already 100% hanzo_ml/hanzo_nn; replaced the
last candle_core/candle_nn refs (stale doc-comment examples) so there are no
candle names left in hanzo-ml/hanzo-nn/hanzo-transformers source.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Successfully published:
✅ hanzo-ug - Unified GPU backend wrapper
✅ hanzo-ml - Main ML framework (core tensor operations)
✅ hanzo-nn - Neural network layers and operations
✅ hanzo-transformers - Transformer models and architectures
✅ hanzo-datasets - Data loading and preprocessing utilities
All crates available on crates.io with BSD-3-Clause OR Apache-2.0 licensing
Removed unpublished dependencies (hanzo-kernels, hanzo-metal-kernels, hanzo-flash-attn)
Core ML functionality works without specialized CUDA/Metal kernels
Advanced GPU features can be added later via separate kernel crates
- Added LICENSE-BSD file with BSD-3-Clause license
- Updated all crate licenses from MIT OR Apache-2.0 to BSD-3-Clause OR Apache-2.0
- Maintains compatibility with Apache-licensed upstream code
- Preferred license is now BSD-3-Clause for new Hanzo work