Skip to content

test(models): fix silently-skipping tests, auto eval batch OOM, refresh Qwen2.5 slow baselines (#4398) - #4445

Merged
Qubitium merged 1 commit into
mainfrom
fix/models-suite-followups-4398
Nov 16, 2026
Merged

Qubitium merged 1 commit into
mainfrom
fix/models-suite-followups-4398

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

The remaining findings of #4398 (items 1-2 shipped in #4433):

  1. Two tests never ran: test_internlm2_5 always skipped on transformers > 4.44.2 with an opaque reason, and test_llama3_2_gptq_cuda was gated by GPTQMODEL_RUN_LLAMA3_2_GPTQ_CUDA_E2E (an env-var switch, banned by AGENTS.md).
  2. Evalution's batch_size="auto" picked 384-768 on a 32 GiB card and OOM'd, then retried at 8 in nearly every test (granitemoe_swa 12.8 min).
  3. Qwen2.5-0.5B-Instruct slow-mode baselines were stale: quantized gsm8k scored 0.3466 against a stored 0.2963 (116.97% > 110% ceiling) and the native fallback could not rescue it.

Addresses items 3-5 of #4398.

What Changed

  • tests/eval.py: resolve_eval_batch_size() derives a conservative auto batch from free/total VRAM and the checkpoint config (fp32 logits + KV cache + activations), spends 25% of available memory, caps at 16, and falls back to the known-safe 8. tests/models/model_test.py resolves it before eval and, on OOM, halves the attempted batch instead of jumping to 8 (which could increase it).
  • tests/conftest.py, tests/pytest.ini: registered gptq_cuda_e2e / gptq_cuda_eval_only opt-in markers; the default skip message names the marker. tests/models/test_llama3_2_gptq_cuda.py no longer reads environment variables.
  • tests/models/test_internlm2_5.py: gate through the definition's require_pkgs (check_versions), so the skip reason names installed vs required versions and the test runs automatically once the pin is lifted.
  • tests/models/test_qwen2_5.py: refresh slow-mode baselines from a measured Marlin run; floor_pct/ceil_pct thresholds are unchanged.
  • New tests/test_eval_batch_size.py (chooser + evaluate() wiring).

Tests

PYTHONPATH=/root/work-4398b /root/venv/bin/python -m pytest tests/test_eval_batch_size.py -q
11 passed
PYTHONPATH=/root/work-4398b /root/venv/bin/python -m pytest \
  tests/test_eval_batch_size.py tests/test_eval_loader_args.py \
  tests/test_evalution_suite_stream_defaults.py -q
18 passed
PYTHONPATH=/root/work-4398b /root/venv/bin/python -m pytest tests/models/test_qwen2_5.py -q
1 passed (fast mode, end-to-end, 769.70s)
PYTHONPATH=/root/work-4398b /root/venv/bin/python -m pytest tests/models/test_llama3_2_gptq_cuda.py \
  tests/models/test_internlm2_5.py -q -rs
3 skipped as expected; `-m gptq_cuda_e2e --collect-only` selects 1 / deselects 1
/root/venv/bin/python -m ruff check <changed files>
All checks passed!

Qwen2.5-0.5B-Instruct slow-mode re-measurement (Qwen/Qwen2.5-0.5B-Instruct revision 7ae557604adf67be50417f59c2c2f167def9a775, Marlin, NVIDIA GB10): gsm8k_platinum_cot 0.35814722911497104, arc acc 0.2901023890784983, arc acc_norm 0.31399317406143346, mmlu_stem 0.39930225182366. A second evaluation of the saved checkpoint reproduced gsm8k exactly and the evaluation half passed all four updated baselines at 100.00%. The new chooser resolves Qwen2.5-0.5B on a 32 GiB card to 8 (previously 384-768).

Pre-existing failure tests/test_model.py::test_hide_unsupported_quantization_config_for_eval_temporarily_clears_gguf_bits reproduces identically on pristine main.

Not executed: the full slow-mode pytest pass (the redundant native-fallback pass was stopped after collecting the quantized metrics; the evaluation half was verified directly from the saved checkpoint) and the opt-in Llama-3.2-1B CUDA E2E quantization (marker selection/skip behavior verified).

Logic Flow Documentation

Not applicable — test-harness selection and thresholds only; the new resolve_eval_batch_size() decision is documented in its docstring and pinned by unit tests.

Review Requirements

  • Reviewed; no runtime env-var switches for product behavior (the test opt-in is a pytest marker).
  • Acceptance thresholds unchanged; only measured baselines move.

Refs #4398.

- test_internlm2_5 now gates on the model definition's transformers pin via
  check_versions, so the skip reason names the installed and required
  versions and the test runs automatically once the pin is lifted.
- test_llama3_2_gptq_cuda opts in through registered pytest markers
  (gptq_cuda_e2e / gptq_cuda_eval_only) instead of environment variables.
- tests/eval.py resolves batch_size="auto" from available VRAM and the
  checkpoint config (logits, KV cache, activations), capped at 16, and the
  OOM retry halves the attempted batch instead of jumping to 8. Adds unit
  coverage for the chooser and the evaluate() wiring.
- Refresh Qwen2.5-0.5B-Instruct slow-mode baselines from a measured Marlin
  run on the public model revision; acceptance thresholds are unchanged.
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