30 Commits
Author SHA1 Message Date
Hanzo Dev 73f8f0c9d5 chore(notice): pin candle provenance and deviations; sweep product branding 2026-07-13 16:05:08 -07:00
Hanzo Dev 4af09134e6 chore(clippy): workspace clippy -D warnings + rustfmt clean
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.
2026-07-10 16:50:04 -07:00
Hanzo Dev d2bd48f332 feat(transformers): I-JEPA vision encoder (models/ijepa.rs)
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).
2026-07-08 04:47:31 -07:00
Hanzo Dev c0e86d45f1 fix(ci): wire quantized_glm4 — same unwired-module class as quantized_lfm2 2026-07-07 17:46:19 -07:00
Hanzo Dev eed7d425fa fix(ci): green the Check/Test/Clippy gates
- 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)
2026-07-07 17:36:51 -07:00
Hanzo Dev 1640627829 env: de-brand HANZO_ prefixes, delete one-off A/B fallback toggles
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).
2026-07-05 11:32:09 -07:00
hanzo-dev 6bb772d115 feat(quantized): no-copy mmap GGUF weight streaming (HANZO_GGUF_MMAP) — run >RAM models
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.
2026-06-27 22:59:28 -07:00
hanzo-dev be98e205c7 docs: Hanzo-brand refresh + fix fork-rename links
- Crate README + Cargo description: accurate multi-backend framing (was 'Minimalist ML framework.').
- Monochrome badges (drop blue); branding voice + GB10/DGX-Spark unified-memory + Hanzo AI (hanzo.ai).
- Fix candle->hanzo rename damage: self-refs github.com/huggingface/hanzo -> github.com/hanzoai/ml;
  doc-site links -> repo; restore blindly-mangled EXTERNAL author assets to real upstream
  (lmz/candle-*, Narsil/candle-examples, jbochi/candle-coedit-quantized, HF documentation-images/candle)
  so example downloads work again.
- Legit external HF refs (safetensors, tokenizers, meta-llama, openai/whisper, etc.) left intact.
2026-06-27 22:02:38 +00:00
hanzo-dev ad531713d0 release: ml 0.11.8 — fused MoE expert-combine + f32-direct quantize (MoE prefill at llama parity)
moe_combine_{f16,bf16,f32} replaces the broadcast_mul+sum expert-combine (fast_sum 487->8ms);
f32-direct activation quantize kills a 178ms cast. Qwen3-30B-A3B-Q4_K_M prefill 939->1167 T/s
(+19.5% isolated A/B, 1.11x of llama.cpp-HIP on the same gfx1151), decode flat. nbad=0
(moe_combine_numeric f16/bf16/f32 + existing MoE oracles). Stacks on the 0.11.7 fused GEMM.
2026-06-25 22:10:05 +00:00
hanzo-dev 41b0476653 release: ml 0.11.7 — fused expert-grouped WMMA MoE prefill GEMM
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.
2026-06-25 19:20:31 +00:00
hanzo-dev a675897162 release: ml 0.11.6 — ROCm SotA kernels (Q6_K dp4a decode 4.9x, WMMA flash-attn, native Q4_K/Q6_K prefill, launcher ABI fix) 2026-06-24 23:32:06 +00:00
Hanzo Dev 4619988cf4 release: ml 0.11.5 (unified dp4a decode core + Q6_K dp4a path; carries vulkan paged-attn API) 2026-06-22 18:51:02 -07:00
Hanzo Dev bf257c38d4 release: ml 0.11.4 (unify workspace)
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
2026-06-22 17:52:56 -07:00
Hanzo Dev fde936c975 release: ml 0.11.3 2026-06-22 04:48:08 -07:00
Hanzo Dev 6d8fe06911 release: ml 0.11.2 2026-06-21 23:15:13 -07:00
Hanzo Dev 2f80e0c1f4 release: ml 0.11.1 2026-06-21 22:00:57 -07:00
hanzo-dev 8adc454171 debrand: scrub all remaining candle framework references -> hanzo (zero candle refs) 2026-06-21 19:46:52 +00:00
893ad5a35b fix(cuda/cudnn): graceful fallback when a forced conv fwd-algo lacks workspace (#10)
* 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>
2026-06-16 21:04:31 -07:00
Hanzo Dev a299b220ec debrand: remove orphaned candle-* crate dirs; candle_ idents + CANDLE_ env -> hanzo_/HANZO_
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.
2026-06-04 13:11:09 -07:00
Hanzo Dev 1687aea1af wip: checkpoint before merging origin/main (recoverable via reset --soft HEAD~1) 2026-06-03 20:33:41 -07:00
Hanzo DevandClaude Opus 4.8 ccaac461ee Release 0.9.2: real semver (drop alpha), publish to crates.io
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>
2026-06-01 14:14:26 -07:00
Hanzo DevandClaude Opus 4.8 e3be5106f6 CI green: workspace clippy lints + fix criterion::black_box deprecation
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>
2026-06-01 12:00:31 -07:00
Hanzo DevandClaude Opus 4.8 b9cf30fa4e Scrub all remaining candle brand refs -> hanzo/hanzoai (docs, CI, tests, comments)
Complete the de-brand across ALL tracked files: CHANGELOG/READMEs, .github
workflows (candle-pyo3 -> hanzo-ml-pyo3 etc.), doc comments, peripheral-crate
tests/examples (candle_onnx -> hanzo_onnx, candle_flash_attn -> hanzo_flash_attn,
candle_metal_kernels -> hanzo_metal_kernels, candle_rocm_kernels ->
hanzo_rocm_kernels), the CandleAlgo cudnn alias -> HanzoAlgo, temp-file prefixes,
URLs (huggingface/candle -> hanzoai/ml, docs.rs/candle-* -> docs.rs/hanzo-*),
EricLBuehler -> hanzoai, and the repository metadata. `git grep candle` now
returns 0. Core build verified: cargo check -p hanzo-ml --features vulkan green,
Qwen3-0.6B forward argmax matches CPU (rel 4.3e-6).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-01 11:48:33 -07:00
Hanzo DevandClaude Opus 4.8 a19e5d696a Remove the legacy candle-* crates; hanzo-only, no candle identifiers left
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>
2026-06-01 10:55:40 -07:00
Hanzo DevandClaude Opus 4.8 e73fcb08b5 Vulkan: fused SwiGLU (silu_mul) op + use it in Qwen3 MLP; drop candle_ doc refs
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>
2026-06-01 10:29:50 -07:00
Zach Kelling cfcb6108c0 Run cargo fmt for consistent formatting
Apply rustfmt across the entire codebase for CI compliance.
2026-01-17 17:27:31 -08:00
Zach Kelling 8327b0ca87 Complete publishing of core Hanzo ML crates v0.9.2-alpha.2
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
2026-01-16 17:37:11 -08:00
Zach Kelling 216fae85f9 Update licenses to BSD-3-Clause OR Apache-2.0
- 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
2026-01-16 17:31:20 -08:00
Zach Kelling fe8fedbfac Update to candle 0.9.2-alpha.2 with full hanzo naming and latest upstream changes
- Updated all crate versions to 0.9.2-alpha.2
- Synced source code with latest upstream candle changes
- Added hanzo-ug crate as wrapper for ug functionality
- Fixed all import statements to use hanzo-* naming
- Updated dependencies to latest versions:
  * cudarc: 0.16.3 -> 0.18.2
  * gemm: 0.17.0 -> 0.18.2
  * safetensors: 0.4.1 -> 0.6.0
  * ug: 0.4.0 -> 0.5.0
  * criterion: 0.5.1 -> 0.7.0
- Added float8 support for enhanced precision
- Updated Metal backend to use objc2-metal/objc2-foundation
- All core crates now compile and build successfully

Core working crates:
- hanzo-ml (main ML framework)
- hanzo-nn (neural network layers)
- hanzo-transformers (transformer models)
- hanzo-datasets (data loading utilities)
- hanzo-ug (unified GPU backend)
- hanzo-kernels (CUDA kernels)
- hanzo-metal-kernels (Metal kernels)
- hanzo-flash-attn (flash attention)
- hanzo-onnx (ONNX support)
2026-01-16 17:17:01 -08:00
Zach Kelling 14b44c718f Restructure crates 2026-01-16 13:01:08 -08:00