Skip to content

Release chained QRF forests after their draws - #402

Merged
MaxGhenis merged 1 commit into
mainfrom
qrf-release-models
Jul 12, 2026
Merged

Release chained QRF forests after their draws#402
MaxGhenis merged 1 commit into
mainfrom
qrf-release-models

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

What

Frees each fitted forest immediately after its draws complete in the chained QRF imputation, instead of retaining every _TargetModel's forests for the stage's full lifetime.

Why

Build M's base rebuild jetsams at ~79–80GB of dirty RSS inside the QRF fit stage (four kills; stage identified by native-frame sampling: quantile_forest/_tree under libomp). With max_samples_leaf=None, each fitted forest retains full leaf-sample populations; the chained stage accumulates dozens of them concurrently. Draw-then-release collapses the concurrent-model footprint to one forest at a time. Draws are unchanged (same seeded order, same models — only their lifetime shortens); populace-fit suite passes.

Companion to #401 (bounded predict); together they bound both sides of the QRF stage's working set.

The chained-equations predict conditions on drawn values, never on the
fitted models, so each target's forests can be freed the moment its
draws complete: predict(release_models=True). Draws are bit-identical;
only model lifetime changes. With max_samples_leaf=None every forest
retains its full leaf-sample store, so the 40-output PUF tax-detail
stage's resident peak drops from the sum of forty forests to the
largest one. Only that stage is flipped: the housing/rent stage
predicts twice (PUF-half re-imputation) and keeps default lifetime.
A released model refuses further predicts loudly.

Build M's base jetsammed four times at ~80GB dirty RSS in exactly this
stage (OpenMP forest frames, working set oscillating at the kill line).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@MaxGhenis
MaxGhenis force-pushed the qrf-release-models branch from 30d9576 to fcc5775 Compare July 12, 2026 21:06
@MaxGhenis
MaxGhenis merged commit 4a3eaf9 into main Jul 12, 2026
4 checks passed
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