Skip to content

fix(models): correct phi4 package metadata and drop dead GGUF eval hiding - #6377

Merged
Qubitium merged 2 commits into
mainfrom
fix/model-meta-bugs
Nov 29, 2026
Merged

Qubitium merged 2 commits into
mainfrom
fix/model-meta-bugs

Conversation

@Qubitium

Copy link
Copy Markdown
Collaborator

Summary

Two independent pre-existing bugs found by the origin/main = 0dd8e8ab sweep.

Fixes #6365, #6366

#6365 — test_phi4_model_definition_requires_required_packages

The test was stale, not the definition. #4620 replaced Microsoft's remote-code phi4mm path with the package-owned native port. The removed speech_conformer_encoder was the only backoff importer, and nothing on the native path imports optimum; backoff is not installed in the CPU test environment, so restoring either requirement would reject a valid install. Phi4MMGPTQ.require_pkgs stays empty, now with a comment documenting why. The port's optional torchvision/scipy imports are already reported by LocalModelLoader with the gptqmodel[vision]/gptqmodel[audio] install hint (verified by blocking the import), so no load-time version check is needed.

  • Red: tests/test_model.py::test_phi4_model_definition_requires_required_packages ('backoff>=2.2.1' in [])
  • Green: same node passes.

#6366 — test_hide_unsupported_quantization_config_for_eval_temporarily_clears_gguf_bits

_hide_unsupported_quantization_config_for_eval and _hide_unsupported_quantization_config_for_lm_eval had no callers. The only reason to keep them was the assumption that Transformers cannot evaluate a GGUF quantization config, but Transformers 5.23 now constructs GgufConfig from it and AutoModelForCausalLM.from_pretrained loads and forwards such a checkpoint through GgufHfQuantizer (verified with a tiny Llama checkpoint: load + forward pass). The hiding branch was unreachable even if called, so the helpers, the unused contextmanager import, and the two tests that only exercised them are removed.

  • Red: tests/test_model.py::test_hide_unsupported_quantization_config_for_eval_temporarily_clears_gguf_bits on base; the node is intentionally deleted with the dead code, so it no longer exists on the branch.

Verification

  • tests/test_model.py — 25 passed, 2 skipped.
  • tests/test_require_pkgs.py — 13 passed.
  • tests/test_phi4_local_port.py — 83 passed.
  • tests/module_tree/test_phi4_local_port.py — 13 passed.
  • Other require_pkgs references (test_smolvlm_support.py, test_ported_fp32_load_6136.py, test_qwen2_5_omni_lm_head.py, test_qwen3_omni_key_map_4881.py, test_gguf_load_policy_env_removal.py, test_lazy_turtle_conversion_cache.py, test_loader_tokenizer_flag_4941.py, test_local_model_paths.py, module_tree/test_nemotron_h_puzzle_local_port.py) — passed.
  • tests/models/test_cohere_compass.py has 2 failures (auto.AutoConfig attribute, native rope KeyError: 'full_attention'); both reproduce on unmodified origin/main and are unrelated.
  • /root/venv/bin/ruff check gptqmodel/models/auto.py gptqmodel/models/definitions/phi4.py tests/test_model.py — all checks passed.

agent added 2 commits November 29, 2026 12:03
The phi4mm definition was ported off Microsoft's remote code in #4620.
The removed `speech_conformer_encoder` was the only `backoff` user, and
nothing on the package-owned native path imports `optimum`; `backoff`
is not installed in the CPU test environment, so restoring either
requirement would reject a valid install.

Keep `require_pkgs` empty and make the test assert that, with the
reasoning documented next to the declaration. The port's optional
torchvision/scipy imports already fail with LocalModelLoader's
`gptqmodel[vision]`/`gptqmodel[audio]` install hint, so they do not
need a load-time version check.
`_hide_unsupported_quantization_config_for_eval` and its lm-eval
wrapper had no callers. The only reason to keep them was the assumption
that Transformers cannot evaluate a GGUF quantization config, but
Transformers 5.23 constructs `GgufConfig` from it and
`AutoModelForCausalLM.from_pretrained` now loads and forwards such a
checkpoint through `GgufHfQuantizer`. The hiding branch was therefore
unreachable even if called.

Remove both helpers, their now-unused `contextmanager` import, and the
two tests that only exercised the deleted context managers.
@Qubitium
Qubitium marked this pull request as ready for review November 29, 2026 12:24
@Qubitium
Qubitium merged commit 778ad65 into main Nov 29, 2026
6 checks passed
@Qubitium
Qubitium deleted the fix/model-meta-bugs branch November 29, 2026 12:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant