Repository navigation
Avoid full-heap collection after every compiled forward binding - #243
Closed
voipmonitor wants to merge 1 commit into
Closed
voipmonitor wants to merge 1 commit into
voipmonitor wants to merge 1 commit into
Conversation
Compiled-forward loading retains an expanding catalog of guards and kernel owners. Full collection after each binding rescans those live objects. Use generation-zero collection after per-forward capture-state release in single-rank and tensor-parallel preparation. Keep full collection at phase boundaries and escalation below 8 GiB available host memory. This removes repeated full-heap scans during preparation without changing captured arithmetic or native execution. No isolated preparation speedup is claimed. Seventy-two CPU tests pass for low-memory promoted-cycle reclamation, compiled guard ownership, distributed artifact sharing, and cached-catalog owner release. GPU preparation has not been rerun on this branch. Design-Signed-Off-By: Codex (GPT-6); design-review=cfcf
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.
Loading a large compiled-forward catalog repeatedly collects the full Python heap after binding each forward. Retained forward owners grow throughout that loop, so every full collection rescans objects that must remain alive for warmup, capture, and native execution.
Use generation-zero collection after each forward in the single-rank and tensor-parallel loading paths. Keep full collection at phase boundaries, including the end of tensor-parallel warmup. The existing memory-pressure rule still promotes a young-generation collection to a full collection when available host memory falls below 8 GiB. Guard validation, kernel ownership, and explicit capture-state release retain their existing behavior.
This removes repeated full-heap scans during preparation. It does not change captured arithmetic or native inference, and no isolated end-to-end preparation speedup is claimed.
Validation: 72 focused CPU tests passed, covering reclamation of promoted cycles under memory pressure, retained compiled guards, distributed artifact sharing, and cached-catalog owner release. Run
python -m pytest -q tests/preparation/test_host_memory.py tests/preparation/test_aot_group.py tests/preparation/test_forward_artifact_sharing.py. GPU preparation has not been rerun on this branch.