Repository navigation
feat: add XLA Mamba1 and Falcon-Mamba support - #3413
Conversation
|
ROCm interim at exact HEAD FAILED: Server concurrency, Mamba2 regression, and capacity-4096 compile/memory checks are still pending; this is not full acceptance. Evidence and exact commands: |
|
ROCm results at exact HEAD
Evidence, exact commands, scripts, model oracle IDs and Please resolve the remaining clippy error on the implementation side. Reproducer: |
dcbb6be to
079b5f0
Compare
|
Fixed the remaining clippy error in Validated at the fix SHA on gfx1151: library 551 passed / 21 ignored, registered goldens, fmt and clippy pass. CPU/HIP mixer probes (12 cases), real Mamba and synthetic FalconMamba HF/CLI 40/40, B4/N8 batches, cancellation/recycling, four concurrent server text references, capacity-4096 compilation, five hybrid HIP tests, and Mamba2 synthetic/real-model regressions pass. Real Nemotron-H-4B oracle 40/40 and B4/N8 regression also pass after the refreshed shared emitter/shim changes. All builds/GPU operations were serialized under the ROCm guard. Evidence: |
Pass the existing shared config reference directly to the prefill emitter so the test target passes clippy with warnings denied. Library tests (551 passed), fmt and focused clippy pass on ROCm. Refs #3413
Add chunk-bounded f32 Mamba1 and Falcon-Mamba recurrence, checkpoint layouts, threaded state handling, HF probes, and a whole-model golden. Refs #3348
Pass the existing shared config reference directly to the prefill emitter so the test target passes clippy with warnings denied. Library tests (551 passed), fmt and focused clippy pass on ROCm. Refs #3413
3a1688f to
946054f
Compare
Add original-HF Falcon-H1 execution with parallel attention/Mamba2 followed by a separately normalized MLP. Preserve HF muP placement, optional SSM normalization, independent head widths/biases, and dual KV/recurrent state across prefill, single decode, and ragged decode. Integration retains #3411 MoE and #3413 Mamba1 behavior. Fix plain CLI completion display losing trailing whitespace: an explicit flush mode preserves raw text while default chat and structured reasoning/tool/Harmony/Muse cleanup remain unchanged. The portable replay compares actual stdout with concurrent non-streaming HTTP and SSE responses; earlier CUDA HTTP evidence compared raw token decoding, not displayed stdout. Validation at integrated runtime source `8c7b4412d37b91807f8d688ba2f3febbc7a7e41f` (base `2e46fc09`): - Full XLA crate: 560 passed / 22 ignored; byte-exact goldens, every-family layouts, fmt, and narrow clippy pass. Environment-docs checker + 15 Python tests pass after classifying two test-only controls. - All 7 display tests and 146 filter tests pass; all 5 CUDA hybrid tests and all 6 Mamba2 tests pass. - CPU/CUDA synthetic norm/ragged/recycle gates and real HF40/40 pass; CUDA CLI40/40 passes. - Strict displayed stdout: 4/4 nonstream + 4/4 SSE text/count matches, including Germany's exact trailing whitespace; overlapping requests and server cleanup verified. External HIP acceptance at `852129eb` passed numerical, real 40-token CLI, batching/recycling, regression, and release architecture gates. Strict displayed CLI/SSE parity was 3/4 because Germany ended in `" \n"`; all four raw token decodes matched. That evidence predates this fix and merged shared recurrent plumbing. Request a final-head ROCm replay with explicit `hip`, `gfx1151`, and `f32` under the ROCm guard; no new HIP run is claimed. Oracle, provenance, logs, portable replay, and instructions are in `spike/openxla/falcon_h1_reference` and `FINDINGS_falcon_h1.md`; bilingual reports document the exact evidence boundaries. HTTP exposes text/counts, not output IDs. Hosted CI is canceled under the local-validation policy. Refs #3346
Summary
[L,D,N]stateCorrectness and integration fixes
bias/conv_biasaliases while giving canonicaluse_bias/use_conv_biaskeys precedencerms_norm = falseconfigs and require every active block or mixer epsilon to be finite and positivelog_aandbxinside the mixer chunk loop, so capacity 4096 never creates a full[4096,D,N]producerMLXCEL_FREEZE_MAMBA1and remove the duplicate Nemotron-H allowlist entry that caused the hosted environment-variable documentation jobs to failIntegrated validation
The executable source for the final integrated checks is
abd1520fd669624cb668bd558b98e332d0955093, based on merged PR #3411. The final branch adds only the bilingual reports after that source commit.cargo fmt --all -- --checkcargo clippy -p mlxcel-xla --lib -- -D warningscargo test -p mlxcel-xla --lib -- --test-threads=4(555 passed, 21 ignored)cargo test -p mlxcel-xla --lib validation::tests::registered_fixtures_are_byte_exact -- --exact --test-threads=1(Mamba1, Mamba2, and Nemotron-H registered goldens byte-exact)python3 scripts/ci/check_env_var_docs.py(396 discovered, 265 documented, 131 allowlisted)python3 -m unittest discover -s tests -p 'test_check_env_var_docs.py' -v(15 passed)state-spaces/mamba-130m-hf@1e76775f628fbf1350fbe4dbb3d971ba64af25a1on IREE local-task: whole prefill, split prefill, and decode match the independent Transformers 5.12.1 CPU fp32 reference; worst max-abs1.488e-4, same argmaxFalconMambaForCausalLMon IREE local-task: whole prefill, split prefill, and decode match the independent reference; worst max-abs3.725e-7, same argmaxD=1536,N=16: no[4096,D,N]tensor; 3,116-line / 320-KiB StableHLO; direct CPU compile 10.64 s at 228.2 MiB peak RSS; run 0.862 sExact integrated CUDA acceptance
On NVIDIA GB10, source
abd1520fd669624cb668bd558b98e332d0955093passed the capacity-4096 CUDA probe undergpu-lock:3.651e-7, recurrent state1.141e-8, convolution state1.371e-6/tmp/epic564-plan/3348-cuda-cap4096-integrated-abd1520f-time.log/tmp/issue3348-cap4096-integrated-abd1520fThis establishes correctness and compile footprint, not a throughput claim.
ROCm acceptance and source boundary
External ROCm gfx1151 acceptance passed at exact source
3a1688f7daaf9bae8bea09997b804e6509357c25:All ROCm device/build work used the ROCm guard. Server checks compare rendered text because the HTTP API does not expose token IDs. Optimized
test-fastbinaries make no performance claim. Full commands and provenance are in the ROCm acceptance record.The later rebase onto PR #3411 did not change the blobs for the Mamba1 scan, parser, recurrent emitter, or Python oracle. It added disjoint Nemotron-H MoE integration and the CI allowlist correction. Full library, golden, lint, environment-variable, and CUDA gates were rerun on the integrated source; ROCm was not rerun after this source-neutral integration, so the exact-SHA evidence boundary is retained here.
Reports
TECHNICAL_REPORTS/3413-mamba1-falcon-mamba-selective-scan-20261125.en.mdTECHNICAL_REPORTS/3413-mamba1-falcon-mamba-selective-scan-20261125.ko.mdCloses #3348