Skip to content
Draft
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
8 changes: 8 additions & 0 deletions changelog.d/mlx-upstream-2026-10-30.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
### MLX core updated to upstream MLX main (2026-10-30)

The provider and cluster worker now build on upstream MLX main `1ba7f969`, merged into the Layr-Labs MLX fork.

- `libs/mlx` and the copy nested in `libs/mlx-swift` that Cmlx compiles move from `72dffa2d` to `47c5eb0e`. `libs/mlx-swift` moves from `c633d221` to `86718def` (nested mlx-c `2ac897e3` to `ba493a03`), and `libs/mlx-swift-lm` stays at `67110e7b`.
- Release builds compile MLX with `NDEBUG`, so they no longer run its asserts or Metal shader logging, nor the graph check on every dispatch and the allocation tracking that upstream added in this update, which cost about 10% of decode speed when left on.
- From upstream, a stalled JACCL collective checks its Thunderbolt RDMA queue pair about every 100 ms and fails once the queue pair is in an error state.
- On two M5 Ultra serving Qwen3.8 27B and GLM-5.3-Flash tensor-parallel, decode speed is unchanged within run-to-run noise, the answers to 12 fixed greedy prompts per model are byte-identical to the previous build's, and concurrent requests still decode the same tokens as alone.
13 changes: 13 additions & 0 deletions docs/architecture/inference.md
Original file line number Diff line number Diff line change
Expand Up @@ -4665,6 +4665,19 @@ row count. One row still takes qmv, whose bits differ from qmv_wide's, so a path
that must equal a single row keeps it in a launch of single rows, as before.
Single-Mac serving leaves the switch off and keeps MLX main's kernels.

Attention needs no switch, but it has its own condition. Since the 2026-10-30
core (upstream MLX main `1ba7f969`), MLX runs an attention call on `sdpa_split`
(upstream #4723) when it has up to eight query tokens, 33 to 128 rows per KV
head (tokens times query heads per KV head), at least 128 keys and no array
mask or sinks (`has_fused_kernel` and `use_split` in
`libs/mlx-swift/Source/Cmlx/mlx/mlx/backend/metal/scaled_dot_product_attention.cpp`
hold the full condition). `sdpa_split` picks its number of key blocks, and so
its rounding, from the batch size. The cluster's
`MLXFast.scaledDotProductAttention` calls carry one sequence each (one row's
prompt chunk, verify window or decode column), so a row's attention bits do not
depend on its batchmates. A change that stacks several sequences into one call
has to keep that property.

The arithmetic is one per process, resolved at start from the GPU family and the
weight's packing only, never from timing: its form (MLX qmv's scaled inputs, or
dequantized weights, each weight `s * q + b` rounded once and then one fused
Expand Down
2 changes: 1 addition & 1 deletion libs/mlx
Submodule mlx updated 170 files
2 changes: 1 addition & 1 deletion libs/mlx-swift
Submodule mlx-swift updated 57 files
+6 −0 Package.swift
+2 −0 Source/Cmlx/include-framework/Cmlx.h
+1 −1 Source/Cmlx/include-framework/Metal.hpp
+23 −0 Source/Cmlx/include-framework/mlx-allocator.h
+194 −0 Source/Cmlx/include-framework/mlx-backend-common-process_allocation_cap.h
+4 −0 Source/Cmlx/include-framework/mlx-backend-cuda-cuda.h
+9 −0 Source/Cmlx/include-framework/mlx-backend-metal-device.h
+2 −2 Source/Cmlx/include-framework/mlx-backend-metal-resident.h
+38 −0 Source/Cmlx/include-framework/mlx-config.h
+10 −0 Source/Cmlx/include-framework/mlx-fast.h
+10 −3 Source/Cmlx/include-framework/mlx-io-load.h
+34 −35 Source/Cmlx/include-framework/mlx-ops.h
+1 −1 Source/Cmlx/include-framework/mlx-random.h
+4 −38 Source/Cmlx/include-framework/mlx-utils.h
+1 −1 Source/Cmlx/mlx
+1 −1 Source/Cmlx/mlx-c
+4 −2 Source/Cmlx/mlx-generated/binary_ops.cpp
+25 −3 Source/Cmlx/mlx-generated/compiled_preamble.cpp
+13 −6 Source/Cmlx/mlx-generated/conv.cpp
+51 −37 Source/Cmlx/mlx-generated/cuda/cuda_jit_sources.h
+9 −4 Source/Cmlx/mlx-generated/fft.cpp
+56 −47 Source/Cmlx/mlx-generated/fp_quantized.cpp
+69 −61 Source/Cmlx/mlx-generated/fp_quantized_nax.cpp
+2 −2 Source/Cmlx/mlx-generated/gated_delta_update_nax.cpp
+7 −7 Source/Cmlx/mlx-generated/gated_delta_update_nax_vjp.cpp
+3 −2 Source/Cmlx/mlx-generated/gemm.cpp
+3 −2 Source/Cmlx/mlx-generated/gemm_nax.cpp
+8 −6 Source/Cmlx/mlx-generated/gemv.cpp
+4 −2 Source/Cmlx/mlx-generated/metal/binary_ops.h
+9 −4 Source/Cmlx/mlx-generated/metal/fft/readwrite.h
+7 −4 Source/Cmlx/mlx-generated/metal/fp8.h
+49 −43 Source/Cmlx/mlx-generated/metal/fp_quantized.h
+62 −57 Source/Cmlx/mlx-generated/metal/fp_quantized_nax.h
+10 −8 Source/Cmlx/mlx-generated/metal/gated_delta_update.h
+2 −2 Source/Cmlx/mlx-generated/metal/gated_delta_update_nax.h
+7 −7 Source/Cmlx/mlx-generated/metal/gated_delta_update_nax_vjp.h
+31 −16 Source/Cmlx/mlx-generated/metal/gated_delta_update_vjp.h
+0 −1 Source/Cmlx/mlx-generated/metal/gated_delta_update_vjp.metal
+8 −6 Source/Cmlx/mlx-generated/metal/gemv.h
+46 −39 Source/Cmlx/mlx-generated/metal/quantized.h
+35 −29 Source/Cmlx/mlx-generated/metal/quantized_nax.h
+20 −0 Source/Cmlx/mlx-generated/metal/scaled_dot_product_attention.metal
+9 −6 Source/Cmlx/mlx-generated/metal/scan.h
+157 −13 Source/Cmlx/mlx-generated/metal/sdpa_vector.h
+367 −19 Source/Cmlx/mlx-generated/metal/steel/attn/kernels/steel_attention.h
+25 −0 Source/Cmlx/mlx-generated/metal/steel/attn/kernels/steel_attention.metal
+399 −15 Source/Cmlx/mlx-generated/metal/steel/attn/kernels/steel_attention_nax.h
+10 −4 Source/Cmlx/mlx-generated/metal/steel/conv/loaders/loader_channel_l.h
+4 −3 Source/Cmlx/mlx-generated/metal/steel/gemm/transforms.h
+46 −39 Source/Cmlx/mlx-generated/quantized.cpp
+35 −29 Source/Cmlx/mlx-generated/quantized_nax.cpp
+13 −8 Source/Cmlx/mlx-generated/scan.cpp
+367 −19 Source/Cmlx/mlx-generated/steel_attention.cpp
+399 −15 Source/Cmlx/mlx-generated/steel_attention_nax.cpp
+7 −4 Source/Cmlx/mlx-generated/unary_ops.cpp
+9 −3 fork.yaml
+2 −0 tools/update-mlx-xcodeproj.sh
Loading