Skip to content

[BUG] DeepSeek V4.1 Flash rejects the loader checkpoint-selection hand-off: all 16 model-loading module_tree nodes red #6381

Done

Description

@Qubitium

Summary

tests/module_tree/test_deepseek_v41_flash.py is red on origin/main (0dd8e8abf): 7 failed, 9 errors, 4 passed, 5 skipped. All 16 non-passing nodes fail with the same exception:

TypeError: Unsupported DeepSeek V4.1 Flash load arguments: _gptqmodel_checkpoint_selection

This is a product regression, not a stale test or a missing checkpoint. The fixture builds a self-contained synthetic checkpoint in tmp_path; no /monster/data/model asset is involved.

Reproduction

cd tests
CUDA_VISIBLE_DEVICES="" PYTHONPATH=<clone>:<clone>/tests python -m pytest \
  module_tree/test_deepseek_v41_flash.py -q -rs -p no:cacheprovider

Root cause

#6272 (commit 968e74c81, "refactor(loader): one immutable checkpoint selection for every consumer") introduced INTERNAL_CHECKPOINT_SELECTION_KWARG = "_gptqmodel_checkpoint_selection" in gptqmodel/utils/hf.py:65. The public entry points now resolve one CheckpointSelection and hand it to the model definition:

  • GPTQModel.from_quantized pops it from caller kwargs (gptqmodel/models/auto.py:1364) and passes it to model_definition.from_quantized(...) (auto.py:1423).
  • The generic BaseQModel.from_quantized consumes it (gptqmodel/models/loader.py:3312) and reuses the record.

DeepSeekV41FlashQModel is the only model definition that overrides from_quantized (gptqmodel/models/definitions/deepseek_v41_flash.py:65). #6272 did not update it, so the internal hand-off reaches its strict keyword check (deepseek_v41_flash.py:96-98) and is rejected as an unsupported user argument. Every V4.1 load raises before touching the checkpoint.

Evidence:

  • rg -ln "def from_quantized" gptqmodel/models/definitions/ returns only deepseek_v41_flash.py.
  • Parent of #6272 (633c2f1e8): 20 passed, 5 skipped with the identical test file (no diff in tests/module_tree/test_deepseek_v41_flash.py between 633c2f1e8 and 0dd8e8abf).
  • HEAD (0dd8e8abf): 7 failed, 9 errors, 4 passed, 5 skipped.
  • All 16 failures/errors carry the same TypeError; no other exception type appears in the run.

Affected nodes (16)

9 ERROR (the model fixture):

  • test_v41_module_plan_accounts_for_loaded_decoder_weights
  • test_v41_attention_variants_and_chunked_cache
  • test_v41_engram_hash_uses_request_history_and_stops_at_images
  • test_v41_mtp_forward_is_explicit_and_disabled_during_calibration
  • test_v41_sparse_attention_uses_only_the_window_and_selected_values
  • test_v41_vision_uses_published_alignment_and_routing
  • test_v41_partial_forward_does_not_advance_cache
  • test_v41_generation_uses_its_cache
  • test_v41_packed_projection_matches_independent_weights_and_retains_packed_storage

7 FAILED:

  • test_v41_public_load_uses_package_classes
  • test_v41_load_reports_missing_source_projection
  • test_v41_gptq_export_preserves_engram_and_mtp
  • test_v41_q4nx_rejects_shared_expert_projection
  • test_v41_marlin_backend_requires_cuda
  • test_v41_q4nx_indexed_projection_load_save[128]
  • test_v41_q4nx_index_requires_marker_in_payload[128]

The other 4 passing nodes and 5 CUDA-only skips never load a model.

Fix direction

DeepSeekV41FlashQModel.from_quantized must pop the internal kwarg and reuse the handed-off selection (checkpoint_selection.hub_kwargs) rather than rebuilding it from forwarded kwargs, so the config, shards, and tokenizer all read the checkpoint the caller selected. A regression test should load a nested checkpoint via GPTQModel.load(parent, subfolder="nested"); it fails both when the kwarg is rejected and when it is silently ignored.

A PR follows.

Activity

  1. added a commit that references this issue on Nov 29, 2026
    390a032
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions