Skip to content

fix(models): load flint checkpoints nested under language_model - #2

Merged
jason-fxz merged 2 commits into
mainfrom
fix/flint-language-model-prefix
Nov 16, 2026
Merged

jason-fxz merged 2 commits into
mainfrom
fix/flint-language-model-prefix

Conversation

@jason-fxz

@jason-fxz jason-fxz commented Nov 16, 2026 •

Copy link
Copy Markdown
Collaborator

Flint's mlx-vlm conversions put the text model under language_model.. Loading them failed with every key reported missing, and the nvfp4 conversion also crashed on its weight_scale_2 global scales.

Fix

  • Flint: mlx_layout takes only the text-model roots (model., lm_head) out from under language_model., and the quant section's entries are renamed to match. A tensor stored under both names is refused. The conversions also store an all-zero router expert_bias: it is dropped when zero and refused otherwise.
  • Any family: an MLX nvfp4 module's weight_scale_2 becomes its output_scale. This is the dequantization-side global scale, as in ModelOpt. It applies only where the quant section declares the module nvfp4; anywhere else it is refused.

Now loads

Checked with a header-only dry run. These 7 repos go from FAIL to PASS, and nothing else changes across 67 candidate repos:

  • mlx-community/flint-{oQ4e, oQ8e}
  • nativ-community/flint-{4bit, 6bit, 8bit, bf16, nvfp4}

Tested

Apple M4, 24 GB, macOS 15.3.

  • New tiny-Flint parity cases:
    • a prefixed conversion, on both attention backends, in bf16 and under MoE offload;
    • nvfp4, fused and offloaded;
    • the three refusals.
  • uv run pytest tests/ -q (1858 passed, 66 skipped) and uv run pre-commit run --all-files pass.
  • RecursiveSI/flint-int4 real load (ftm serve --model <dir> --max-seq-len 4096) gives the same greedy output as main. The prefixed conversions were checked only with the dry run.

@jason-fxz jason-fxz changed the title Fix/flint language model prefix fix(models): load flint checkpoints nested under language_model Nov 16, 2026
@jason-fxz
jason-fxz merged commit be202ae into main Nov 16, 2026
1 check passed
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