8000 Qwen3.5 GGUF support, repo @revision/:variant specs, benchmark_generate, and qwen3.5-4b-gguf modeltests by janpfeifer · Pull Request #99 · gomlx/go-huggingface · GitHub
[go: up one dir, main page]

Skip to content

Qwen3.5 GGUF support, repo @revision/:variant specs, benchmark_generate, and qwen3.5-4b-gguf modeltests - #99

Merged
janpfeifer merged 7 commits into
mainfrom
bench-dolly-browse
Dec 3, 2026
Merged

janpfeifer merged 7 commits into
mainfrom
bench-dolly-browse

Conversation

@janpfeifer
Copy link
Copy Markdown
Contributor

Summary

Note: Depends on companion gomlx PR gomlx/gomlx#511 (WithLinearTiledKVHeads and linear.Core optimizations).

  • Qwen3.5 GGUF support (models/transformer, tokenizers/hftokenizer):
    • Extracts attention.key_length (HeadDim), rope.dimension_count (partial RoPE PartialRotaryFactor), full_attention_interval, and ssm.* (conv_kernel, state_size, group_count, time_step_rank, inner_size) metadata in applyGGUFMetadata, and recognizes "qwen35" in CreateGoMLXModel and detectCausalMask.
    • Keeps blk.{N}.attn_qkv.{weight,bias} fused as linear_attn/in_proj_qkv on Gated DeltaNet layers, maps attn_gate, ssm_alpha, ssm_beta, ssm_out, ssm_conv1d, ssm_a, ssm_dt.bias, and ssm_norm, reshapes 2D ssm_conv1d.weight to [convDim, 1, K], converts ssm_a (-exp(A_log)) to A_log (log(-ssm_a)), and sets RMSNormOffset(0.0) + WithLinearTiledKVHeads(true) for GGUF Qwen3.5.
    • Adds qwen35 and qwen2 pre-tokenizer (Split + ByteLevel(use_regex=false) + NFC) handling in hftokenizer.NewFromGGUF.
  • Inline <owner>/<repo>[@<revision>][:<variant>] repo specs (hub, models/gguf, models/transformer, cmd/hubinfo, examples/msmarco/benchmark_embed):
    • Adds hub.ParseRepoSpec, Repo.Revision(), Repo.Variant(), Repo.WithVariant(...), and gguf.SelectGGUFFileForVariant.
  • Benchmarks & Examples (examples/dolly/benchmark_generate, examples/msmarco/benchmark_embed):
    • Added -save and -teacher_forced benchmarking flags and renamed examples/dolly/browse → examples/dolly/benchmark_generate across docs.
    • Omitted the non-comparable metrics table for warmup runs in examples/msmarco/benchmark_embed.
  • modeltests & Docs (modeltests/, README.md, docs/ModelTests.md):
    • Extended modeltests/internal/generators/yzma with -task=generate and added golden modeltests/testdata/qwen3.5-4b-gguf/spec.json (Q4_0, generated from llama.cpp).
    • Updated README.md with Models Known to Work and How To Specify A Model.

Verification

  • go test -short -p 1 ./... passes.
  • TestGGUFQwen35EndToEnd & TestGGUFQwen35RealParity (0.99090 logit cosine similarity and exact tokenization vs Qwen/Qwen3.5-4B Safetensors) pass.
  • GOEXPERIMENT=simd go test -v -p=1 ./modeltests -modeltests -run TestModels/qwen3.5-4b-gguf -backends="cuda;xla:cuda;go":
    • tokenize: PASS
    • cuda: PASS (infer=13.7s, Peak RSS=3.0 GiB, kvcache_parity=8/8, tf=283/288 toks)
    • xla:cuda: PASS (infer=1m18s, Peak RSS=7.8 GiB, kvcache_parity=8/8, tf=283/288 toks)
    • go: PASS (infer=1m, Peak RSS=9.3 GiB, kvcache_parity=8/8, tf=286/288 toks)

@janpfeifer
janpfeifer merged commit 294ee88 into main Dec 3, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

0