Skip to content

test(run-exit): assert file-backed offload, not pre-#6473 meta+hook shells - #6518

Merged
Qubitium merged 1 commit into
mainfrom
test/run-exit-recovery-filebacked
Dec 1, 2026
Merged

Qubitium merged 1 commit into
mainfrom
test/run-exit-recovery-filebacked

Conversation

@Qubitium

@Qubitium Qubitium commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Fixes #6517

What was wrong

tests/test_run_exit_recovery_contract_5060.py [gptq-offload] nodes still asserted the Accelerate-era offload layout (meta shells with _hf_hook, module.safetensors bundles, and "no disk-offloaded modules after a successful run"). Since #6473/#6494 offload is file-backed: modules stay ordinary CPU modules whose tensors view <run root>/<module>/filebacked.safetensors (docs/in-session-model-after-offload.md), and has_disk_offloaded_modules intentionally stays true for them (#4807). Test-only change; no product code touched.

Change

  • _assert_disk_shells_retain_backing: no meta leaves; every file-backed module (FILE_BACKED_ATTR path) has its backing file present inside the run root.
  • _assert_completed_layer_usable: a completed layer is either quantized or file-backed (was: meta + _hf_hook).
  • test_successful_run_control: replaces assert not has_disk_offloaded_modules(...) with "no meta leaves", "gptq-offload produced file-backed modules" (so the branch is exercised), and the backing-file check.

Evidence (CPU tiny Llama fixture, CUDA host)

Check Result
main c649fcb: pytest tests/test_run_exit_recovery_contract_5060.py 2 failed ([gptq-offload] mid-run fault: assert []; success control: a successful run must restore the disk-offloaded layers), 22 passed
This branch, same command 24 passed (214 s)
Mutation: delete one module's filebacked.safetensors after a successful gptq-offload quantize new assertion fails: offload backing file for model.embed_tokens was removed while the module is live
uvx [email protected] check tests/test_run_exit_recovery_contract_5060.py pass

Product behaviour checked by the passing nodes: after both a successful and a faulted gptq-offload run the model has no meta tensors, all CPU, no capture hooks, and runs an ordinary grad-enabled forward.

Skips: none in this file.

🤖 Generated with Claude Code

…hells (#6517)

Since #6473 offload_to_disk leaves finalized modules as file-backed CPU
views of the run directory: no meta placeholders and no offload hooks.
The gptq-offload nodes still looked for meta modules carrying _hf_hook
and required has_disk_offloaded_modules() to be false after success, so
they failed on a correct model.

Assert the documented state instead: no meta leaves, every file-backed
module's backing file exists under the run root, and the gptq-offload
control actually produced file-backed modules.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@Qubitium
Qubitium marked this pull request as ready for review December 1, 2026 02:39
@Qubitium
Qubitium merged commit 2a7e9a1 into main Dec 1, 2026
6 checks passed
@Qubitium
Qubitium deleted the test/run-exit-recovery-filebacked branch December 1, 2026 02:39
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.

test_run_exit_recovery_contract_5060 [gptq-offload] fails on main: asserts pre-#6473 meta+hook disk shells

1 participant