Skip to content

fix(tests): run checkpoint and MoE suites in fresh checkouts - #3572

Merged
Qubitium merged 1 commit into
mainfrom
audit/recent-main-next
Nov 8, 2026
Merged

Qubitium merged 1 commit into
mainfrom
audit/recent-main-next

Conversation

@Qubitium

@Qubitium Qubitium commented Nov 8, 2026

Copy link
Copy Markdown
Collaborator

Problem

The recent checkpoint and MoE suites do not run reliably in a fresh checkout:

  • test_checkpoint_quantization.py launches its driver from tests/, so the child cannot import the local gptqmodel package unless it is installed or PYTHONPATH is set externally. In a fresh worktree, all 28 subprocess recovery cases failed at import before testing recovery.
  • test_moe_expert_batching.py leaves end_shared_input_capture() as a MagicMock. The telemetry consumer compares its expected_followers field with an integer, so eight batching cases fail before their assertions.

Fix

Prepend this checkout to the checkpoint driver's PYTHONPATH while retaining the caller's path. Set the MoE capture mocks to the empty/no-telemetry values matching these fixtures.

Validation

  • tests/test_moe_expert_batching.py tests/test_moe_bypass_batch_size.py: 30 passed.
  • Checkpoint recovery matrix: 15 passed before the remaining optional cases were interrupted after 7m28s; no failures observed. A separate representative recovery case passed in 32s.
  • uvx ruff check tests/test_checkpoint_quantization.py tests/test_moe_expert_batching.py: passed.
  • git diff --check: passed.

This PR changes test fixtures only.

@Qubitium
Qubitium marked this pull request as ready for review November 8, 2026 01:28
@Qubitium
Qubitium merged commit 8d1dcf5 into main Nov 8, 2026
6 checks passed
@Qubitium
Qubitium deleted the audit/recent-main-next branch November 8, 2026 01:28
Qubitium pushed a commit that referenced this pull request Nov 12, 2026
All but one test in this file fail on main. Two changes since the file was last
touched (#3572) moved the ground it stands on.

The mocked processor auto-creates attributes, so the capture-frontier restore
hook added in #3600 looks callable and returns a truthy mock, which makes
`_run_single_subset_pass` skip the forward pass every assertion is about. A real
processor without that hook returns None, so the fixture now says so explicitly.

#3600 also added a causal replay pass: with
`execution_config.fwd_replay_after_process` set, each chunk runs one capture
forward and one replay forward, so `_run_forward_batches` is called twice per
chunk instead of once. The expectations were doubled and the comments now say
why, instead of just carrying a different number. The flush counts are unchanged:
the replay pass does not call `torch_empty_cache`.

    tests/test_moe_expert_batching.py    9 passed

Before this change the file reported 8 failed, 1 passed on main.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant