Repository navigation
Enable Spark-X2.5 export and runner support for MLX - #23523
dongjiang1989 wants to merge 1 commit into
Conversation
This PR needs a
|
|
cc @nil-is-all PTAL, thanks |
|
@dongjiang1989 could you rebase and ping for review? A branch update with main should resolve CI failures |
nil-is-all
left a comment
There was a problem hiding this comment.
README and .yaml look good and simple enough to run. Hyperparams in test python file match 7B and 4B models.
Rebase and updated. |
ad09b3f to
d3f0b2d
Compare
|
@claude review this code |
|
Claude finished @metascroy's task in 4m 49s —— View job This needs changes: the MLX attention swap drops Spark-X2.5's headwise output gate, so MLX exports give wrong output from the first token; it also ignores the 512-token sliding window, and the EOS/BOS metadata appears to have been copied from LFM2. Detailed reviewPR Review: #23523SummaryThis PR adds an MLX 4-bit export config, a Code Quality
Testing
RecommendationRequest Changes The MLX export is numerically wrong for this architecture: the output gate is missing at every layer, and sliding layers ignore the window past 512 tokens. The EOS/BOS metadata also appears to be copied from LFM2. Smoke generation doesn't catch either problem, so please validate the fix against eager logits. |
d3f0b2d to
addd6b5
Compare
|
@nil-is-all @metascroy Fix claude review. Please re-check it, thanks |
|
@claude review this code |
|
Claude finished @metascroy's task in 3m 15s —— View job The headwise output gate is fixed now, but this still needs changes. On the real export path the sliding-window fix never takes effect, so Spark-X2.5 MLX exports still attend to the full history past 512 tokens. Other Detailed reviewPR Review: #23523SummaryThe new commit adds three things to
Code Quality
Testing
RecommendationRequest Changes On the actual export path, sliding layers still ignore the window: |
712517e to
9fcaf85
Compare
|
@claude review this code |
|
Thx @nil-is-all Fixed. Please review it 😄 |
Thx for the ping. Could you update the out-of-date branch? |
|
@claude review this code |
|
Claude finished @metascroy's task in 2m 14s —— View job This still needs changes: Detailed reviewPR Review: #23523SummaryThis revision adds checks that reject unsupported options, takes the sliding window from the eager Code Quality
Testing
RecommendationRequest Changes The conflict markers break MLX export for every model and must be removed. After that, fix the tests so they actually run (pass real rope freqs and the correct per-layer |
d9603af to
1221f15
Compare
|
@metascroy @nil-is-all all nits updated. Please review it, Thx |
f8a7d22 to
68a1787
Compare
|
@dongjiang1989 re-running the Arm and Vulkan CI tests which failed, but could you check the MLX failures and lint? |
775caa0 to
13c40b8
Compare
|
@nil-is-all Could you grant me permission to automatically trigger CI runs on PR updates? |
Unfortunately this is restricted to repo maintainers. Could you resolve the branch conflicts and give a ping on here or discord to retrigger CI? |
|
Branch updated with latest upstream main (no conflicts). @nil-is-all could a maintainer approve the CI workflow runs? They're still gated behind "Awaiting Approval". Thanks! |
0d109e6 to
c3d67d9
Compare
Add MLX backend support for Spark-X2.5 (1.7B and 4B) on Apple Silicon: sliding-window attention via RingBufferKVCache, headwise attention output gate, and per-layer RoPE parameters in MLXAttentionMHA, plus a 4-bit export config, make spark_x2_5-mlx target, README instructions, and numerical tests comparing MLX against eager attention. Signed-off-by: dongjiang1989 <dongjiang1989@126.com>
c3d67d9 to
5566688
Compare
Summary
Add MLX backend support for Spark-X2.5 models (1.7B and 4B variants), enabling efficient inference on Apple Silicon.
make spark_x2_5-mlxto build the shared Llama C++ runner with MLX enabledSpark-X2.5 is a compact, efficient language model series with hybrid attention (3 sliding-window + 1 full-attention layer), supporting context windows up to 1M tokens and 200+ languages.
Test plan
pytest -q examples/models/spark_x2_5/test_spark_x2_5_mlx.pymake -n spark_x2_5-mlxmake spark_x2_5-mlxspark_x2_5_1_7b_mlx_4w.ptespark_x2_5_4b_mlx_4w.ptellama_mainsmoke generation with MLX exportscc @mergennachin @iseeyuan @lucylq @helunwencser @tarun292 @kimishpatel @jackzhxng @nil-is-all @metascroy