Skip to content

ignition: accept F16 and I16 dtypes in safetensors checkpoint inspection - #717

Open
nepenth wants to merge 1 commit into
NVIDIA:mainfrom
nepenth:fix/checkpoint-f16-i16-dtypes
Open

nepenth wants to merge 1 commit into
NVIDIA:mainfrom
nepenth:fix/checkpoint-f16-i16-dtypes

Conversation

@nepenth

@nepenth nepenth commented Dec 4, 2026 •

Copy link
Copy Markdown

Summary

Adds "F16": 2 and "I16": 2 to _DTYPE_BYTES in ignition/preparation/checkpoint.py so safetensors header inspection accepts FP16 (F16) and signed 16-bit integer (I16) tensors.

Motivation

EXL3 quantized safetensors checkpoints (e.g., Mia-AiLab/Inkling-2-Small-EXL3-2.55bpw) store Hadamard sign vectors (*.suh, *.svh) as F16 and packed trellis weights (*.trellis) as I16. Without F16 and I16 in _DTYPE_BYTES, _read_header() rejects those shards during ignition export checkpoint inspection with invalid shape, dtype, or offsets.

Testing

  • Added tests/preparation/test_checkpoint_dtypes.py::test_read_header_accepts_f16_and_i16 verifying _read_header() parses F16 and I16 tensors and computes exact byte lengths.
  • Verified end-to-end multi-host TP2 ignition export of a 72-shard EXL3 safetensors checkpoint containing F16 and I16 tensors on 2x NVIDIA GB10.

Signed-off-by: nepenth <16943149+nepenth@users.noreply.github.com>
@flare-autobot

Copy link
Copy Markdown
Collaborator

A case file has been opened for 717.
Case File Intake Report

Future reviews will auto-run 90 minutes after code updates are pushed.

  • Re-review sooner: Call @flare-autobot after push.
  • Opt-out: Include #autobot:ignore in the PR or any comment.

@flare-autobot flare-autobot added area:preparation Ignition checkpoint loading, tuning, compilation, capture, and export. enhancement New feature or request triage:review Proposed change needs code review; this does not imply merge readiness. labels Dec 4, 2026
@flare-autobot

Copy link
Copy Markdown
Collaborator

Autobot Review

Full Review · Value Proposition · Case File

Recommendation: Ready To Merge

The diff is exactly what the description claims: two new entries in _DTYPE_BYTES ("F16": 2, "I16": 2) plus a 17-line test. Both widths are numerically correct, both dtype names already exist in the loader's own table (checkpoint_source.py:527-530), so _DTYPE_BYTES ⊆ tensor_dtype keys and no downstream KeyError is possible; the change is strictly permissive with no verified code defect.

  • Blockers: 0 · Should fix: 0 · Subtract/Simplify: 3 · Nits: 3
Walkthrough
  • ignition/preparation/checkpoint.py:97-98 — adds "F16": 2 and "I16": 2 to the safetensors dtype→element-width table; the dict is rewrapped onto two lines, which is why the diff is +2/−2 rather than +1/−1.
  • checkpoint.py:142 — the membership reject (dtype not in _DTYPE_BYTES) that previously raised invalid shape, dtype, or offsets for {name} before any byte math now admits F16/I16, matching the published safetensors spec.
  • checkpoint.py:146-158 — unchanged: nbytes = prod(shape) * _DTYPE_BYTES[dtype], the exact-range check, and the sorted coverage sweep still decide extent and tiling, so the new entries only feed correct widths and cannot loosen validation.
  • tests/preparation/test_checkpoint_dtypes.py:11-27 — new test writes struct.pack("<Q", len(header)) + header + b"\x00"*48, so F16 [8] → 16 and I16 [4,4] → 32 tile [0,16)+[16,48) exactly against data_start = 8+len(header); it would fail at checkpoint.py:144 on the pre-PR table, so it genuinely exercises the change.
  • .github/workflows/python-cpu.yml:33 — pytest tests/ -q runs on every pull_request, so the new test is CI-covered without extra wiring.
Merge Risk: Low · up to 634ef86
Pre-merge checks: ✅ 3 passed · ⚠️ 1 warnings

Have your agent review the Full Review for complete verified findings, file:line citations, and suggested changes.

Want a frontier second opinion? If these findings look noisy, request a one-time SuperAgent Review on 634ef86 (~3–4 min; re-adjudicates existing findings without re-running discovery).

To opt out, include #autobot:ignore in your post or comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:preparation Ignition checkpoint loading, tuning, compilation, capture, and export. enhancement New feature or request triage:review Proposed change needs code review; this does not imply merge readiness.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants