Repository navigation
Description
Found while running the CUDA gate for #3133 on spark-102 (GB10, 121 GB unified memory, main fab141b). Two test-only defects keep make verify-test-cuda from completing. Fix both in one PR, run the gate once at the end, and keep pushes to a minimum.
1. OOM in tests/maskless_padded_prefill_parity.rs
The binary (from #3097/#3103) loads several real checkpoints in one process. The gate was SIGKILLed twice by the kernel OOM killer here (journalctl -k shows global_oom), so later binaries never ran. With a 1 s MemAvailable sampler: olmo3_* alone (17 GB checkpoint) never drops below 88 GB; glm4v_moe_* alone (glm-4.5v-4bit, 58 GB) goes from 101 GB to 13 GB (about 51 GB at load, about 37 GB more in the three forward arms). In the gate it survived glm4v_moe and died in olmo3 right after, so earlier tests' memory is not returned (no MLX cache limit is applied).
Suggested fix: call mlxcel_core::memory::clear_cache() (src/lib/mlxcel-core/src/memory.rs:248) after each model is dropped in assert_maskless_padded_prefill_matches_within and loaded_gate (around line 233), and make glm4v_moe opt-in like mistral4 (MLXCEL_TEST_MISTRAL4=1, line 219) or gated on available memory. Optionally investigate the 37 GB forward cost.
- The whole binary completes on a 121 GB GB10 with MemAvailable staying well above zero.
- glm4v_moe still runs where enabled, and the skip prints its opt-in variable.
2. Flaky coordinator_names_peers_that_did_not_commit
It failed once with resolved 1 peer(s) but --pp-auto requested 2 stages at plan_for's .expect("plan") (src/distributed/stage_assignment_tests.rs:73), and passed 5/5 alone. reserve_port() (line 38) binds 127.0.0.1:0 and drops the listener, so live and dead (lines 492-493) can get the same port, and cluster_init.rs:203 dedups them to one peer. About ten other tests in the file call it twice in a row.
- Ports come from a helper that holds every listener until all are allocated, so they are distinct; all call sites use it.
- A unit test asserts the helper returns N distinct ports, and the
stage_assignmenttests pass.
Verification
cargo test --features cuda --test maskless_padded_prefill_parity -- --test-threads=1
cargo test --features cuda --lib distributed::stage_assignment -- --test-threads=1
make verify-test-cuda
Activity
fix(tests): let make verify-test-cuda finish on a 121 GB GB10 (lablup…