Skip to content

test: realign six stale doubles, oracles and expectations (#4769) - #4850

Closed
Qubitium wants to merge 1 commit into
mainfrom
test/stale-doubles-and-oracles
Closed

Qubitium wants to merge 1 commit into
mainfrom
test/stale-doubles-and-oracles

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Six files from #4769 section A ("the test is wrong") assert behaviour the product no longer has, or build a double that predates an attribute the code now reads. Each one is red on main and green here.

Partially addresses #4769. What is left, and why, is in Scope.

What Changed

File What was stale Fix
tests/test_local_model_paths.py GPTQModel.load probes log_kv_cache_estimate() on the loaded model (#4510), so the object() sentinel raised AttributeError one _sentinel_model() helper (SimpleNamespace with the method), used at all 14 sites
tests/test_diffusion_gemma_support.py post_quantize reads self.quantize_config.activation_mode set quantize_config on the bare wrapper; skip the defusion test when defuser_version_too_old() reports an unsupported defuser (the conversion no-ops)
tests/test_gsq_method_adapters.py asserted packed.bias.dtype is torch.float16 FP8 keeps the bias wide (FP32) on purpose (#4575/#4681), which the same file already asserts at line 191
tests/test_jamba_support.py expected simple_layer_modules without mamba.x_proj, and asserted x_proj is left dense #4245 declared mamba.x_proj in the plan; skip the smoke test when mamba-ssm is absent (JambaQModel.require_pkgs)
tests/test_serialization.py asserted offload_to_disk_path is written into the checkpoint meta #4327 stopped writing the machine-local path; assert it is absent
tests/test_model.py AWQ fixture packed nibbles in natural order pack in the interleave dequantize_model reverses (AWQ_REVERSE_ORDER), which is what a real AWQ GEMM checkpoint stores

No product code changed.

Tests

cd tests
python -m pytest test_local_model_paths.py test_diffusion_gemma_support.py \
    test_gsq_method_adapters.py test_jamba_support.py -q -ra
# 65 passed, 2 skipped in 26.32s
#   skips: defuser 0.0.25 predates the supported floor; mamba-ssm not installed

python -m pytest test_model.py -q -k dequantize_model_awq
# 1 passed, 28 deselected

python -m pytest test_serialization.py -q
# 6 passed, 2 failed
#   the two failures are test_gptq_v1_serialization and
#   test_save_keeps_live_model_inference, which fail identically on the
#   unmodified base (verified by stashing the change) and are not in #4769

ruff check on all six files: All checks passed.

Red / green

Before (same commands, unmodified main @ 9cd6f78):

test_local_model_paths.py     5 failed   AttributeError: 'object' object has no attribute 'log_kv_cache_estimate'
test_diffusion_gemma_support  2 failed   AttributeError: 'DiffusionGemmaQModel' object has no attribute 'quantize_config'
test_gsq_method_adapters      2 failed   assert torch.float32 == torch.float16
test_jamba_support            2 failed   At index 3 diff: ['mamba.x_proj'] != ['mamba.out_proj']
test_serialization            1 failed   'offload_to_disk_path' not found in {...}
test_model                    1 failed   torch.equal(weight_out, expected) -> 95/128 elements differ

After: 65 passed, 2 skipped (four files) + 1 passed (model) + the serialization node green.

The AWQ fixture fix was derived, not guessed: packing the fixture's columns by argsort(AWQ_REVERSE_ORDER) within each 8-column group reproduces the expected weight exactly (torch.equal true), while natural order and the forward permutation both mismatch.

Scope

Fixed here — the six files above (11 test nodes).

Not taken, with reasons:

  • test_exl3_workspace_release.py, test_offload_base_modules_restored.py (_inflight_layer): the bare object.__new__(ModuleLooper) doubles are missing more than [TEST] Suite triage at b225a4383 (RTX 4090 + R9700): pre-existing red tests (also red at 12c1273c2) — stale doubles/oracles/expectations, plus env-only failures #4769 lists. loop() also reaches self._dangling_threads_lock (module_looper.py:645/655), so seeding only _inflight_layer still raises. These need the doubles to run the loop's real bookkeeping, which is a design change to the tests rather than a one-line realign.
  • test_fallback.py sym zero point: 108 parameters fail here, not the 24 in the report, so the sym=True zero-point fix alone would not turn the file green. It needs a separate pass over each strategy.
  • Environment only (section C): defuser 0.0.25, missing mamba-ssm/einops/bitblas, offline Hub. Two are now explicit skips; the rest are untouched.
  • Model-sized or keyword-brittle: test_dynamic.py::test_skip_module (greedy 0.5B output), test_norm_lifecycle.py (6 real quantize runs), test_bits_new.py (env-var driven, which AGENTS.md forbids).
  • Not reproduced here: test_vptq_memory_4391.py passes on this host (torch 2.15 allocates 2 temporaries), matching the report's own note.

Logic Flow Documentation

Not applicable: test-only realignment.

Model Support / Module Plan

Not applicable.

Review Requirements

  • Reviewed this PR.
  • Matches existing project structure; each fix stays inside the test that was wrong.
  • No monkeypatching added beyond the fake model the file already used.
  • Minimal surface: 61 insertions, 24 deletions across six test files.
  • Regression considered: the skipped cases were verified to fail only for the missing dependency; the two serialization failures are pre-existing and out of scope.

Notes

  • The test_local_model_paths.py helper replaced all 14 object() sentinels, not only the five that failed, so the next load-path probe does not break the file again.
  • The two new skips use the repository's own gates (defuser_version_too_old, JambaQModel.require_pkgs) rather than a bare importorskip.

Each of these tests asserts behaviour the product no longer has, or builds a
double that predates an attribute the code now reads:

* test_local_model_paths: GPTQModel.load probes log_kv_cache_estimate() on the
  result, so a bare object() no longer works as the fake model.
* test_diffusion_gemma_support: post_quantize reads
  quantize_config.activation_mode; skip the defusion test when the installed
  defuser predates DEFUSER_MIN_VERSION (it no-ops).
* test_gsq_method_adapters: FP8 keeps the bias wide (FP32) on purpose.
* test_jamba_support: #4245 declared mamba.x_proj in the quantization plan;
  skip the smoke test when mamba-ssm is missing (JambaQModel.require_pkgs).
* test_serialization: #4327 stopped writing the machine-local
  offload_to_disk_path into the checkpoint meta.
* test_model: the AWQ fixture packed nibbles in natural order instead of the
  interleave that dequantize_model reverses.
@Qubitium

Copy link
Copy Markdown
Collaborator Author

Superseded by #4846, which landed the same six-file #4769 realignment on main as e1903175. This branch predates that merge and is now conflicting; closing rather than re-merging duplicate test changes.

@Qubitium Qubitium closed this Nov 17, 2026
@Qubitium

Copy link
Copy Markdown
Collaborator Author

Closing as superseded: all six files in this PR were fixed on main by #4846 ("test: fix stale doubles/oracles in the suite-triage red list (#4769)"), which landed first and is the merged implementation for #4769. Keeping this branch open would only add a conflicting duplicate of the same test realignments.

Verified on current origin/main: tests/test_local_model_paths.py uses the _loaded_model_stub() helper, tests/test_diffusion_gemma_support.py gates on defuser_version_too_old(), tests/test_gsq_method_adapters.py asserts the FP32 FP8 bias, tests/test_jamba_support.py expects mamba.x_proj, tests/test_serialization.py asserts the meta path is absent, and tests/test_model.py::test_dequantize_model_awq packs in AWQ_REVERSE_ORDER.

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