test(models): take mlx_test_guard in every batched-decode harness test
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
调研方向
Start with tests/model_loader_stdout_guard.rs and inspect the 54 unguarded test functions listed in the issue across src/. Add the guard coverage integration test and ensure each listed test takes mlx_test_guard() as its first statement. Run cargo test --test mlx_test_guard_coverage, then follow the issue's three-run CUDA verification command; done means the gate passes and all three CUDA runs complete without the abort.
由索引模型根据 Issue 内容生成。
描述
Problem
In PR #3516 the Spark-X2.5 test model_owned_batched_multistep aborted the lib test binary in cudaStreamEndCapture (SIGABRT) about one parallel run in three, until it took crate::models::embedding_test_support::mlx_test_guard() (src/models/spark2_5_tests.rs:518). The guard is not taken inside batched_decode_harness, so every caller must take it, and many do not.
Current Behavior
A sweep of #[test] functions that call crate::models::batched_decode_harness::* finds 34 that take the guard and 54 that do not. The seven unguarded model-owned multistep tests (the pattern that crashed):
src/models/afmoe_tests.rs:998,src/models/deepseek_v4_tests.rs:2073,src/models/inkling/tiny_tests.rs:364,src/models/iquestloopcoder_tests.rs:948,src/models/kolibri1_tests.rs:620,src/models/plamo3_tests.rs:501,src/vision/inkling_vl.rs:454
The other 47 are native batched-decode harness tests (arcee, bailing_moe, bitnet, dbrx, deepseek_v2/v3/v32, dots1, ernie4_5_moe, exaone_moe, gemma2, gemma4, glm4_moe, glm4_moe_lite, gpt2, gpt_bigcode, gpt_neox, hunyuan_moe, klear, llama3, minicpm, minicpm3, minimax, minimax_m3, minimax_m3_vl, mistral4, mixtral_style, mla_rope, nanochat, nemotron, olmo, olmo3, openelm, phi, phi3, phi3small, phixtral, qwen3, qwen3_moe x3, solar_open, stablelm, telechat3, xing4_0 x2); the new test below prints the exact list.
Proposed Solution
Add let _guard = crate::models::embedding_test_support::mlx_test_guard(); as the first statement of each of the 54 tests, as Spark-X2.5 does. Do not move the guard into the harness: it is a non-reentrant Mutex, so the 34 callers that already hold it would deadlock.
Acceptance Criteria
- New integration test
tests/mlx_test_guard_coverage.rs, modeled ontests/model_loader_stdout_guard.rs, scanssrc/for#[test]functions whose body callsbatched_decode_harness::withoutmlx_test_guard(), and fails with the list (fails on current main with 54 entries) - All 54 tests take the guard and the new test passes
- The full CUDA lib suite passes three consecutive default-parallelism runs without a
cudaStreamEndCaptureabort
Verification
cargo test --test mlx_test_guard_coverage
for i in 1 2 3; do make test-fast-cuda || break; done
Test-only change; do it in one PR with one gate run at the end.
- 主要语言
- Rust
- 星标
- 505
- 派生
- 81
- 平均合并
- 14 小时 2 分钟
- 30 天内合并 PR
- 448
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
lablup/mlxcel 的其他 Issue
-
area:core priority:high status:ready type:security
难度 2/5 1-3 小时 新手友好度 82/100
维护者通常 1 天内回复
-
priority:medium status:ready type:security
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
-
area:models modeltype:text priority:medium status:in-progress type:bug
难度 4/5 3-5 天 新手友好度 57/100
维护者通常 1 天内回复
-
area:models modeltype:omni priority:medium status:ready type:bug
难度 4/5 3-5 天 新手友好度 48/100
维护者通常 1 天内回复
-
area:models platform:linux priority:medium status:ready type:bug
难度 4/5 3-5 天 新手友好度 45/100
维护者通常 1 天内回复
相似的 Issue
-
psmux-resurrect: restoring a session with a numeric name puts its windows into the wrong session (`new-window -t 4` is read as window 4)可能已有人在做 @ealwanlee 今天认领。 未关闭
难度 2/5 1-3 小时 新手友好度 88/100
psmux/psmux-plugins#47 ·
-
automated issue report
难度 1/5 1 小时以内 新手友好度 76/100
ratatui/awesome-ratatui#598 ·
维护者通常 1 天内回复
-
release
难度 1/5 1 小时以内 新手友好度 75/100
github/gh-aw-mcpg#17603 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
C-Bug S-Needs-Triage
难度 2/5 1-3 小时 新手友好度 76/100
bevyengine/bevy#26718 ·
维护者通常 2 天内回复