Skip to content

test: fix two stale tests that keep make verify-test red - #3720

Closed
Jaeyeong-CHOI wants to merge 1 commit into
lablup:mainfrom
Jaeyeong-CHOI:test/fix-stale-step3p7-padded-prefill-and-guard
Closed

Jaeyeong-CHOI wants to merge 1 commit into
lablup:mainfrom
Jaeyeong-CHOI:test/fix-stale-step3p7-padded-prefill-and-guard

Conversation

@Jaeyeong-CHOI

Copy link
Copy Markdown
Contributor

Summary

Refs #3652.

make verify-test on main fails two platform-independent tests (nightly run 46937282079 at 4d8a05c4; still failing at beedecbb1). Both are test-only staleness left by recent merges, not product bugs, and this PR changes only the two tests.

tests/step3p7_parity.rs: text_decode_delegates_sequence_local_native_batching

The test was written against model-owned Step 3.5 state. #3648 (00aa0a8dd) moved Step3p5Model onto scheduler-owned LayerState and enabled padded prefill, and Step3p7VlModel delegates both to its backbone. #3648 updated the in-crate tests (--lib) but not this integration test, which now fails twice in a row:

  1. assert!(!wrapper.supports_padded_prefill()) fails, because Step3p5Model::supports_padded_prefill is now kv_cache_layer_modes.supports_padded_prefill(..), true for the test's default KV mode.
  2. With that line fixed, the by-id prefill (forward_with_embeddings_and_sequence_id(.., Some(id), ..)) panics with Step 3.5 state is scheduler-owned: sequence seq-0 must be forwarded through forward_layer_state with its pool layer state (refuse_scheduler_owned_sequence_id), which is the intended refusal for a scheduler-owned family.

Changes:

  • The padded-prefill line now asserts that the wrapper's answer equals its backbone's (assert_eq!(wrapper.supports_padded_prefill(), wrapper.backbone.supports_padded_prefill())), the same form as the sequence_state_layout check below it. The test is about delegation, and the backbone's own value is already pinned for Step 3.5 in src/models/sliding_window_layer_state_tests.rs.
  • After the capability checks, the wrapper is wrapped in mlxcel::models::pooled_model::Pooled, the adapter refactor: move remaining sliding-window families to scheduler-owned state #3648 moved the in-crate model tests onto (mixed_cache_batched_decode_tests::contracts, vlm_mimo_v2_forward_tests). Its by-id calls resolve each sequence to pool layer state and call the wrapper's forward_layer_state, and its sync_sequence_storage mirrors the layer lengths into the test's paged shadow. The rest of the test body is unchanged: it still checks that every paged shadow layer is non-empty after prefill and that the two-row native batched decode matches each row decoded alone (max abs error at most 1e-5). The capability checks above still run on the bare wrapper. The paged-shadow assertion message says "scheduler-owned" instead of "model-owned".

src/vision/encoders/nemotron_h_nano_omni_tests.rs: pos_embed_resample_runs_in_f32

Added by #3681, the test evaluates MLX arrays (through the file's raw_bytes helper, which calls eval and array_to_raw_bytes) without holding the MLX test guard, so tests/mlx_test_guard_coverage.rs (mlx_evaluating_lib_tests_take_mlx_test_guard, #3660) rejects it. The test now takes let _guard = crate::models::embedding_test_support::mlx_test_guard(); as its first statement.

The file's other four tests stay without the guard. The scanner flags a test only when it reaches an eval or host-readback call (EVAL_CALLS, directly or through a same-file helper) before taking the guard, and those four only build lazy graphs and read shapes (array_shape) or loader results.

Checks

Verification

NVIDIA GB10 (sm_121), CUDA 13, Rust 1.97.1, --profile test-fast --features cuda.

Before (main at beedecbb1, and the same at 517ede2d7):

cargo test --locked --profile test-fast --features cuda --test step3p7_parity --test mlx_test_guard_coverage --no-fail-fast -- --test-threads=1
  • mlx_test_guard_coverage: 5 passed, 1 failed (mlx_evaluating_lib_tests_take_mlx_test_guard: src/vision/encoders/nemotron_h_nano_omni_tests.rs:276 pos_embed_resample_runs_in_f32).
  • step3p7_parity: 7 passed, 1 failed (assertion failed: !wrapper.supports_padded_prefill() at tests/step3p7_parity.rs:519).
  • With only the padded-prefill line changed (tested on 517ede2d7), step3p7_parity still fails, now with the scheduler-owned refusal panic (src/models/model_owned.rs:179) quoted above.

After (this branch):

cargo test --locked --profile test-fast --features cuda --test step3p7_parity --test mlx_test_guard_coverage --test vlm_wrapper_capability_delegation --no-fail-fast -- --test-threads=1
  • mlx_test_guard_coverage: 6 passed, 0 failed.
  • step3p7_parity: 8 passed, 0 failed.
  • vlm_wrapper_capability_delegation: 3 passed, 0 failed.

Related lib tests:

cargo test --locked --profile test-fast --features cuda --lib -- --test-threads=1 nemotron_h_nano_omni sliding_window_layer_state_tests:: step3p7 pooled_model

74 passed, 0 failed.

Gates on this branch:

  • cargo fmt --all -- --check: pass.
  • cargo clippy --locked --workspace --all-targets --features cuda -- -D warnings: pass.
  • python3 scripts/ci/check_used_by.py and bash scripts/ci/check_used_by_test.sh: pass.
  • make verify-test-cuda (cargo test --workspace --profile test-fast --features cuda --no-fail-fast -- --test-threads=1): exit 0, 207 test binaries, 18,880 passed, 0 failed, 567 ignored. The three tests above pass inside it: text_decode_delegates_sequence_local_native_batching, mlx_evaluating_lib_tests_take_mlx_test_guard and vision::encoders::nemotron_h_nano_omni::tests::pos_embed_resample_runs_in_f32.

The branch is one commit on beedecbb1 and merges onto it without conflicts.

Limits

  • Verified on CUDA only, not on Metal. Both fixes are backend-independent: the guard scanner is a text scan, and neither the Step 3.5 refusal nor the Pooled routing depends on the backend.
  • The nightly run had three more failures, which this PR does not address: cache::turbo::codebook::tests::device_boundary_indices_match_host_at_the_edges, cache::turbo::quant::device_tests::device_pack_handles_boundary_ties_and_extremes and models::gemma3::gemma3_tests::quantized_snapshot::a_truncated_quantized_restore_reproduces_a_cold_prefill_of_the_prefix. All three pass in the CUDA gate above, and they were not run on Metal here.

step3p7_parity::text_decode_delegates_sequence_local_native_batching
was written against model-owned Step 3.5 state. lablup#3648 moved
Step3p5Model to scheduler-owned layer state and enabled padded prefill,
so the test failed first on `!supports_padded_prefill()` and then on the
by-id forward, which a scheduler-owned family refuses. Assert that the
wrapper's padded-prefill answer is its backbone's, as the neighbouring
sequence_state_layout check does, and drive the by-id part through
Pooled, the adapter lablup#3648 put the in-crate tests on, so the wrapper is
exercised through forward_layer_state on pool layer state.

nemotron_h_nano_omni_tests::pos_embed_resample_runs_in_f32 (lablup#3681)
evaluates MLX arrays without holding mlx_test_guard(), which
mlx_test_guard_coverage rejects (lablup#3660). Take the guard as its first
statement.

Refs lablup#3652
@Jaeyeong-CHOI

Copy link
Copy Markdown
Contributor Author

Closing: both fixes are already on main. #3686 added mlx_test_guard() to pos_embed_resample_runs_in_f32 and reworked the Step3p7 padded-prefill assertion, and #3765 guarded the remaining MLX-building tests in nemotron_h_nano_omni_tests.rs. What is left of this branch is a one-word difference in an assertion message, and it now conflicts with main.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority:medium Medium priority status:review Under review type:test Test related changes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants