Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
- Batched (B > 1) DFlash bursts on Qwen 3.5 / 3.6 / 3.8 targets (`qwen3_5`, `qwen3_5_moe` and their VL wrappers) now emit the same greedy tokens as one request at a time. A round whose rows accepted different draft counts used to zero the shorter rows' rejected K/V instead of excluding it, and the zeroed keys kept diluting those rows' attention; every round is now clamped to the shortest row's accept before tokens are emitted, and a ragged rollback panics (#2353).
- Qwen3-Next, the Qwen 3.5 family (`qwen3_5`, `qwen3_5_moe` and their VL wrappers) and Kimi Linear now L2-normalize the gated-delta q/k with the reference eps, `x / sqrt(sum(x^2) + 1e-6)`, through a shared `normalize_qk` that mirrors mlx-lm (#2361). They passed `1e-6` straight to `rms_norm`, which adds it to `mean(x^2)` and so made it `head_k_dim` times too large, which shrank rows with a small q/k norm. Kimi K3 already used the right value and is bit-identical. Teacher-forced traces on Qwen3.5-4B and Qwen3-Next-80B show no disagreement at decided positions and perplexity moving by under 1%.

### Known limitations

- A temperature 0 run that goes through a block verification path (`--prompt-lookup` or a draft model) can leave the plain-decode stream near a logit tie. A verify block builds the K/V of every row after the first with a different arithmetic path than a one-token decode step (the projections run at `M = block width`), so the logits differ at rounding scale and the argmax can flip where the reference's top two logits are tied or nearly tied; the rest of the stream then follows the flipped token. This is the temperature 0 contract, not a defect: every emitted token is the argmax of the logits the path computed, and two paths that compute slightly different logits legitimately disagree on a tie. Plain decode is unaffected, `MLXCEL_TRACE_DECODE_STEP=1` and fp16 KV storage are unaffected, and a quantized `--kv-cache-mode` changes which stream a run lands on. Investigation, measurements and repro commands: [temperature 0: plain decode versus block-built KV history](docs/temperature-0-block-history-flip.md) (#2778, does not block 0.8.0; release notes must not claim that temperature 0 speculative output matches plain decode).

## [v0.7.0] - 2026-09-09

### llama-server b10621 compatibility, complete
Expand Down
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -227,6 +227,10 @@ mlxcel rm mlx-community/Qwen3.5-0.8B-4bit --yes
# Object detection with an RT-DETRv2 checkpoint.
mlxcel detect -m models/rt-detr-v2 -i image.jpg --format json

# Text-to-image and image editing with a Diffusers-style checkpoint (no model
# family is registered yet; see docs/image-generation.md).
mlxcel generate-image -m models/flux2-klein -p "a watercolor fox" -o fox.png

# Inspect the hardware-specific kernel tuning matrix without profiling it.
mlxcel tune --dry-run

Expand Down Expand Up @@ -350,6 +354,7 @@ Install with `pip install ./python`. See [Python client](docs/python-client.md)
- [Tensor and pipeline parallelism](docs/distributed.md)
- [OpenAI Responses API](docs/responses-api.md)
- [Embeddings and reranking](docs/embeddings.md)
- [Image generation](docs/image-generation.md)
- [Audio API](docs/audio-api.md)
- [Nemotron VoiceChat (full-duplex speech)](docs/nemotron-voicechat.md)
- [TurboQuant KV cache](docs/turbo-kv-cache.md)
Expand Down
2 changes: 2 additions & 0 deletions docs/environment-variables.md
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ The OpenAI audio endpoints (`/v1/audio/speech`, `/v1/audio/transcriptions`, `/v1
| Variable | Values | Default | CLI flag | Notes |
|----------|--------|---------|----------|-------|
| `LLAMA_ARG_EMBEDDING_MODEL`, `MLXCEL_EMBEDDING_MODEL` | path or `owner/name` repo-id | unset | `--embedding-model` | A second checkpoint served on `/v1/embeddings` next to the chat model in `-m`; resolved like `-m`. The CLI flag wins over both variables, and `LLAMA_ARG_EMBEDDING_MODEL` wins over the `MLXCEL_` alias. Combining it with an embedding checkpoint in `-m` is a startup error. |
| `MLXCEL_IMAGE_MODEL` | path or `owner/name` repo-id | unset | `--image-model` | An image-generation checkpoint served on `/v1/images/generations` and `/v1/images/edits` next to the chat model in `-m`; resolved like `-m`. The CLI flag wins. A load failure is a startup error. See [Image generation](image-generation.md). |
| `LLAMA_ARG_RERANKER_MODEL`, `MLXCEL_RERANKER_MODEL` | path or `owner/name` repo-id | unset | `--reranker-model` | A checkpoint served on `/v1/rerank` next to the chat model in `-m`; resolved like `-m`. The CLI flag wins over both variables, and `LLAMA_ARG_RERANKER_MODEL` wins over the `MLXCEL_` alias. Generative rerankers require this setting because they cannot be distinguished from chat checkpoints. |
| `MLXCEL_EMBEDDING_BATCH_SIZE` | unsigned integer | `16` | `--embedding-batch-size` | Texts per forward pass. Text inputs are sorted by token length and cut into micro-batches of this size, each right-padded to its longest member. |
| `MLXCEL_EMBEDDING_MAX_LENGTH` | unsigned integer | derived | `--embedding-max-length` | Lowers the token cap derived from `sentence_bert_config.json`, `tokenizer_config.json` and `config.json` (hard cap 8192). |
Expand Down Expand Up @@ -824,6 +825,7 @@ normal end-user operation.
| `MLXCEL_TEST_OP_PARITY_SEED` | Operand seed for `tests/metal_block_vs_chain_op_parity.rs`. Defaults to 1165. The diagnostic compares one `T = K` call against `K` single-position calls byte for byte, and when a kernel pair differs by only a byte or two out of ten thousand, whether *any* byte differs is itself draw-dependent, so a single seed can report `equal` for a shape that is genuinely on a different kernel. Sweeping this separates that from a real equality. Test-only. |
| `MLXCEL_MTP_DRAFT_PROFILE` | `1`/`true`/`yes`/`on` to enable; unset or anything else to disable | **off** | Evaluate each MTP drafter-step component before the next begins, so the `MTP drafter step profile` log line's split is real GPU time rather than graph-build time (issue #1185, Phase 0). MLX is lazily evaluated and a drafter step synchronizes only once, at the `eval` before the sampled id is read back to the host, so with this **off** roughly 98% of the measured component time lands in `readback_ms` and the other four buckets measure graph construction. The log line says so and reports `dominant="unattributed"` rather than naming a winner. With it **on** the split is trustworthy but the extra syncs break pipelining and inflate the step cost: measured on a Qwen3.8-27B 4-bit target plus its bf16 MTP drafter on an M1 Ultra, 11.83 ms per step profiled against 10.45 ms unprofiled, so quote the unprofiled number as the step cost and the profiled one only for attribution. The profiled split on that pairing is layers 68.2%, LM head 19.7%, id upload 6.0%, readback 5.8%, fused sample 0.1%. Read once per process. Applies to the Qwen 3.5 MTP drafter; other drafters do not implement `Drafter::draft_profile` yet and their log line is omitted. |
| `MLXCEL_TEST_CHAIN_BLOCK` | Verify-block width used by `tests/qwen38_mtp_chain_parity.rs`'s `block_verify_chain_matches_single_token_chain` and `adapter_chain_with_perfect_drafts_matches_classic_chain`. Defaults to 3, the published drafter width; values below 2 are ignored. The byte-identity those tests pin is width-dependent, because MLX changes quantized-matmul kernel above `get_qmv_batch_limit` (12 for the 27B operand sizes on an M1 Ultra), so this is how that boundary gets measured on a given GPU without editing the source. Test-only. |
| `MLXCEL_TEST_QWEN3_DIR` | Path to a Qwen3 checkpoint for the opt-in `real_qwen3_hidden_states_reproduce_the_generation_logits` test in `src/imagegen/qwen3_text_encoder_tests.rs`. Defaults to `$HOME/.cache/mlxcel/models/mlx-community/Qwen3-0.6B-4bit`; without `config.json` the test skips. Select it with `--ignored` to compare all-layer encoder hidden states with ordinary generation logits. Test-only: no production code path reads it. |
| `MLXCEL_TEST_VIDEO` | Turns the graceful skip in an ffmpeg-backed video test into a hard test failure. Only the exact string `1` enables it. The gated tests are the ffmpeg-backed ones in `src/multimodal/video_tests.rs` plus `process_videos_pixel_values_match_input_color` in `src/vision/processors/gemma4_tests.rs`, which decodes a synthetic clip through the same `load_video` entry point before running it through the Gemma 4 processor. All of them are `#[ignore]`, so selecting them at all needs `--include-ignored`; this variable then asserts that the host can actually run them instead of skipping when `ffmpeg`/`ffprobe` is missing. `make verify-test-video` sets both, and `nightly-verify.yml` runs that target after installing ffmpeg. Test-only: no production code path reads it. |
| `MLXCEL_REQUIRE_PINNED_CHECKPOINTS` | Turns the graceful skip in a pinned-checkpoint contract test into a hard test failure. Only the exact string `1` enables it, which is narrower than the truthy parsing most variables on this page accept; unset leaves skips as skips. Currently gates `pinned_post_tower_weight_roots_and_shapes_match_published_contract` (`src/vision/encoders/muse_glimmer_fusion_pinned_tests.rs`) and `pinned_weight_index_classifies_each_source_weight_once` (`src/loading/vlm_muse_glimmer_tests.rs`), both of which validate the pinned Muse Glimmer checkpoint under `models/mlx/muse-glimmer-30b` against a published contract. Test-only: it has no effect outside `cargo test` and no production code path reads it. |

Expand Down
Loading