Free host memory only when releasing an iGPU model #37

Merged
Breadway merged 2 commits from fix/ram-69-igpu-unload-delta into main 2026-10-12 00:58:07 +08:00
Owner

Fixes the iGPU unload-delta drift found while reviewing #35.

The bug

With igpu = true, inventory() attributes a loaded model's whole size to host RAM and reports no device memory, but operation() still split the projection into host and device using size_vram_bytes. The fallback projected relief into device memory that does not exist on an iGPU, so the projected effect disagreed with the measured effect.

The fix

On an igpu endpoint the whole model size is projected as host relief and device relief is zero. A discrete or CPU endpoint is unchanged. A test asserts the projection against the two-model fixture.

Verification

  • cargo fmt --all --check
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo build --workspace --locked
  • cargo test --workspace --locked

All pass.

Closes #36

Fixes the iGPU unload-delta drift found while reviewing #35. ## The bug With `igpu = true`, `inventory()` attributes a loaded model's whole size to host RAM and reports no device memory, but `operation()` still split the projection into host and device using `size_vram_bytes`. The fallback projected relief into device memory that does not exist on an iGPU, so the projected effect disagreed with the measured effect. ## The fix On an `igpu` endpoint the whole model size is projected as host relief and device relief is zero. A discrete or CPU endpoint is unchanged. A test asserts the projection against the two-model fixture. ## Verification - cargo fmt --all --check - cargo clippy --workspace --all-targets --locked -- -D warnings - cargo build --workspace --locked - cargo test --workspace --locked All pass. Closes #36
fix: free host memory only when releasing an iGPU model
All checks were successful
CPU checks / check (push) Successful in 56s
c1e9afb66a
The unload projection split the model's bytes into host and device using
size_vram_bytes even for an endpoint marked igpu, where those bytes are really
host RAM. The fallback attributed part of the relief to device memory that does
not exist, so the projected effect disagreed with the measured effect.

- On an igpu endpoint the whole model size is projected as host relief and device
  relief is zero; a discrete or CPU endpoint is unchanged.
- A test asserts the iGPU projection against the two-model fixture.
fix: state the whole model in the iGPU release note
All checks were successful
CPU checks / check (push) Successful in 59s
531ec0d1f5
The note still used the host-only split, so on an iGPU it said about 1.0 GiB
while the projected host relief was the whole 4.0 GiB: the operation contradicted
itself, and the executor's disagreement suffix no longer fired to correct it. One
figure now drives both the delta and the note, and the test asserts the note
names the whole model.
Breadway deleted branch fix/ram-69-igpu-unload-delta 2026-10-12 00:58:07 +08:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Breadway/breadram!37
No description provided.