Repository navigation
test(run-exit): assert file-backed offload, not pre-#6473 meta+hook shells - #6518
Merged
Merged
Conversation
…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]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.safetensorsbundles, 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), andhas_disk_offloaded_modulesintentionally 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_ATTRpath) 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: replacesassert 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)
mainc649fcb:pytest tests/test_run_exit_recovery_contract_5060.py[gptq-offload]mid-run fault:assert []; success control:a successful run must restore the disk-offloaded layers), 22 passedfilebacked.safetensorsafter a successful gptq-offload quantizeoffload backing file for model.embed_tokens was removed while the module is liveuvx [email protected] check tests/test_run_exit_recovery_contract_5060.pyProduct 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