M4: Bumblebee Qwen3 end-to-end on Emily.Backend - #11
Merged
Conversation
Qwen/Qwen3-0.6B greedy-decodes end-to-end through Bumblebee's causal-LM serving. Every Nx op on Qwen3's critical path — QK-norm, rotary embeddings, GQA, SwiGLU FFN, RMSNorm, tied embeddings, KV-cache put_slice in a defn while loop — runs correctly. Native put_slice/4 over MLX slice_update replaces the BinaryBackend round-trip on the autoregressive hot path, and fixes a latent dynamic start-indices crash plus an Nx-promotion bug where the MLX buffer dtype silently disagreed with Nx's shape metadata. Adds a ported-from-Bumblebee conformance test for the three Qwen3 architectures plus a greedy-decode smoke test against a 16-token checked-in reference, an opt-in full Qwen3-0.6B test (~1.5 GB checkpoint) gated behind :qwen3_full, and a standalone tokens/sec benchmark harness. Bumblebee is pinned to a main SHA until Qwen3 ships on Hex.
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
Qwen/Qwen3-0.6Bgreedy-decodes end-to-end through Bumblebee's causal-LM serving — every Nx op on Qwen3's critical path (QK-norm, rotary, GQA, SwiGLU, RMSNorm, tied embeddings, KV-cacheput_slicein adefn whileloop) runs correctly.put_slice/4overmx::slice_updatereplaces the BinaryBackend fallback on the autoregressive hot path; fixes a latent dynamic-start-indices crash and an Nx-type-promotion bug (MLX buffer dtype silently disagreed with Nx's shape metadata).:base,:for_causal_language_modeling,:for_sequence_classification) ported verbatim from Bumblebee's own tests, plus a greedy-decode smoke test pinned to a 16-token checked-in reference.mix test --only qwen3_fullruns a full Qwen3-0.6B test (~1.5 GB checkpoint); default--only conformancestays weights-light.bench/qwen3_tokens_per_sec.exs— standalone throughput harness. Dev-host baseline: ~13.8 tok/s at 16 new tokens underNx.Defn.Evaluator(pre-mlx::core::compile, which lands in M6).mainSHA (273805e9…) because Qwen3 isn't in any Hex release yet.Test plan
mix precommit(163 tests + 56 properties, 0 failures, credo --strict clean)mix test --only conformance(11 tests, 0 failures — DistilBERT + Qwen3 tiny-random + greedy smoke)mix test --only qwen3_full(1 test, 0 failures — real Qwen3-0.6B)MIX_ENV=test mix run bench/qwen3_tokens_per_sec.exs(end-to-end generation on Qwen3-0.6B)