Skip to content

fix(engine): raise WeightLoadError when the checkpoint cannot be read - #518

Merged
jason-fxz merged 2 commits into
mainfrom
fix/weight-load-error
Sep 18, 2026
Merged

jason-fxz merged 2 commits into
mainfrom
fix/weight-load-error

Conversation

@jason-fxz

Copy link
Copy Markdown
Collaborator

Wrap the checkpoint reads (dense weights, expert banks, PLE table) so a broken or mismatched FTW fails as WeightLoadError: <cause> on /health and in the log, telling the user the weights could not be loaded rather than leaving a bare KeyError; OOM, MemoryError and PinFailed pass through unchanged.

@jason-fxz
jason-fxz merged commit 6410c97 into main Sep 18, 2026
JUNQINGV587 added a commit to JUNQINGV587/FreeToken that referenced this pull request Sep 19, 2026
- FlashML-org#521 fix(kernel): pin tvm-ffi jit arch to the bound gpu (kernel/utils.py)
- FlashML-org#518 fix(engine): raise WeightLoadError when the checkpoint cannot be read
  (engine.py) -- this PR is the upstream squash of our own 73f8661 +
  e912542, and it supersedes them (same intent plus the load_expert_banks
  wrap). Resolution: take the upstream side for the conflicting hunks.
- FlashML-org#524 fix(install): resolve sglang-kernel from PyPI, not the sglang index
  (install.sh, pyproject.toml)

Our delta in these four files before the merge was exactly 'lacking these
three upstream commits', so no fork-specific change is dropped.
This was referenced Sep 19, 2026
trcwebdesign pushed a commit to trcwebdesign/FreeToken that referenced this pull request Sep 21, 2026
…FlashML-org#518)

* fix(engine): raise WeightLoadError when the checkpoint cannot be read

* fix(engine): wrap the FTW index read and pass host allocation failures through
danielamadori pushed a commit to danielamadori/DFlash-FreeToken that referenced this pull request Sep 22, 2026
…FlashML-org#518)

* fix(engine): raise WeightLoadError when the checkpoint cannot be read

* fix(engine): wrap the FTW index read and pass host allocation failures through

(cherry picked from commit 6410c97)
CraigStone-Dev pushed a commit to CraigStone-Dev/FreeToken that referenced this pull request Sep 24, 2026
…b1f0)

Reapply of the PR FlashML-org#337 net diff (fb7f732..badf5f4) onto current upstream main
(v0.1.3 + 4). Upstream moved 16 commits past the old merge base; conflicts were
limited to:

- engine/engine.py: the new _weight_load_context() wrapper (WeightLoadError,
  FlashML-org#518) now wraps load_expert_banks; the disk_tier= argument is passed inside it.
  The v0 precondition ValueError and the no-disk-index NotImplementedError stay
  outside the wrapper, so their error types/messages are unchanged.
- models/nvfp4_banks.py: upstream dropped the direct index-json read in favour
  of loader.safetensors_weight_map (index json, or shard headers when the
  checkpoint ships none); the json import is gone, itertools stays (used by the
  disk-skip pieces).
- moe/disk_tier.py: Nvfp4DiskIndex now resolves its weight map through the same
  loader.safetensors_weight_map helper as the NVFP4 reader, keeping the
  index-reads-the-same-rows-invariant the previous rebase established.

Everything else (O_DIRECT fetch workers, MAP_PRIVATE banks, pin_prefix/release,
mincore tail check, FT_DISK_TIER_VERIFY probes, CLI, tests) applied clean.
lucaspirola pushed a commit to lucaspirola/FreeToken that referenced this pull request Sep 28, 2026
…FlashML-org#518)

* fix(engine): raise WeightLoadError when the checkpoint cannot be read

* fix(engine): wrap the FTW index read and pass host allocation failures through
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