feat(engine): stage D2 - mistral sliding-window attention (#79)#103
Merged
lgsunnyvale merged 1 commit intoJul 20, 2026
Merged
Conversation
Enable MODEL_MISTRAL on the dense forward path: support gate allows uniform sliding window (and null-window v0.2+), llama-shaped weights descriptor, tiny_mistral fixture (W=8), GPU degenerate/boundary tests, and parity id for Mistral-7B-Instruct-v0.1-4bit-mlx.
Owner
Author
TODO: mistral real-checkpoint parity on 32 GB+ MacManual item from the test plan is still open:
Blocked on hardware, not on the D2 diff. The canonical id is Do this later on a 32 GB+ Apple Silicon Mac (local or cloud MacStadium / EC2 Mac / similar): MLXD_MLX_SERVE_BIN=/path/to/scripts/mlx_lm_server_wrapper.sh \
MLXD_PARITY_CKPT_MISTRAL=$HOME/.cache/mlxd/models/mlx-community--Mistral-7B-Instruct-v0.1-4bit-mlx \
MLXD_PARITY_MAX_TOKENS=16 \
scripts/parity_family.sh mistralNotes for whoever picks this up:
|
lgsunnyvale
approved these changes
Jul 20, 2026
lgsunnyvale
deleted the
engine-inference-core-stage-d2-mistral-sliding-window-attention
branch
July 20, 2026 05:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Stage D2 enablement for
MODEL_MISTRAL(issue #79 / epic #55): llama-shaped dense path plus uniform sliding-window attention on every layer. Noforward.cchanges - D0 F7 mask/trim already covers the mistral config shape.weights_expected_namesllama-shaped set (21 untied / 20 tied)gen_tiny_ckptmistral recipe (sliding_window=8, omit pattern when 0) + committed fixturessliding_window=4096Cycle 0 audit
Confirmed against HF
mlx-community/Mistral-7B-Instruct-v0.1-4bit-mlx/config.json:model_typesliding_windowtie_word_embeddingsrope_thetarope_scalingConfig / forward delta vs llama
has_qk_normattention_biashas_sliding_windowsliding_window_patternrope_thetaR1 decisions
forward.cchanges unless RED proved a hole (none did).REJECT_ALLOW_SLIDING_WINDOW.sliding_window_patternwhen 0 (get_dim_intrejects 0); gemma3 still emits pattern=2.mlx-community/Mistral-7B-Instruct-v0.1-4bit-mlx. Short-context parity is family enablement; window-boundary correctness owned bytiny_mistralGPU tests (CI will not exceed 4096 tokens). Chat mode not forced preemptively (no dry-run evidence yet).Test plan
make test(43 passed)./tests/test_emodel_gate(windowed + null pass; llama/qwen3 SW rejects held)./tests/test_weights/./tests/test_model_config(mistral expected names + tiny fixture)./tests/test_forward_mistral_gpu(load/map/shape, short incremental, degenerate window, boundary incremental==full)make test-gpu(mistral + D0/kvcache/llama green; pre-existingtest_weights_gpudeepseek GGUF assert unrelated)make test-parity-scriptmistral absent-dir skip green (wrapper-skip-absent-mistral)scripts/parity_family.sh mistralwhen checkpoint presentCloses #79