You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(ml8): native 4-bit token_embd via GGML_OP_ML8_GET_ROWS + role-uniform tiering
Adds a native ml8-4 token embedding path so token_embd can be 4-bit (centroid
LUT in an F8_E4M3 sidecar) instead of fp8 — reclaiming size on the largest
tensor. The generic get_rows aborts on ML8_4 (no LUT slot), so this introduces
a dedicated custom op:
GGML_OP_ML8_GET_ROWS (ggml_ml8_get_rows(w, centroids, ids))
- ggml op def + name/symbol tables + asserts (op count 102->103)
- CPU compute: LUT-dequant gather (ggml-cpu/ops.cpp) + dispatch + n_tasks
- CUDA/HIP kernel + host dispatch (ml8.cu/.cuh) — pure gather, no AITER needed;
+ ggml-cuda.cu compute dispatch + supports_op
- loader op-swap GET_ROWS -> ML8_GET_ROWS for ML8_4 token_embd (keeps it on GPU)
+ synthetic probe case
- build_inp_embd routes ML8_4 token_embd through the new op via the registry
- qwen35: register token_embd centroids; tied LM head shares token_embd's LUT
(no separate output.centroids in a tied GGUF)
Role-uniform tier override (ML8_TIER_OVERRIDE / role_targets) lets a role be
moved uniformly between ml8(4-bit) and fp8(8-bit) — the "tread shaping". The
qwen35 FFN fused path now dispatches up/down per-tensor: ml8_4 stays inline
(byte-identical), a role-uniform fp8 tier routes through build_lora_mm. The
data-free ml8-4 embed calibration pass + converter emit token_embd as ML8_4.
Validated on dense Qwen3.5-0.8B (token_embd=ml8, ssm_out/ffn_down/attn_v=fp8,
--awq none): PPL 19.7179 / 498MB — beats the uniform-ml8 clean q3 (19.9387 /
558MB) on BOTH axes; smaller than UD-Q4_K_XL (546MB) but +0.78 PPL behind.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
0 commit comments