Skip to content

Report live and peak GPU allocations - #8

Merged
MONZikWasTaken merged 3 commits into
getflyhigh:mainfrom
NimaJafariComp:feat/live-memory-report
Nov 20, 2026
Merged

MONZikWasTaken merged 3 commits into
getflyhigh:mainfrom
NimaJafariComp:feat/live-memory-report

Conversation

@NimaJafariComp

@NimaJafariComp NimaJafariComp commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

I wanted to know what FlyHigh actually keeps allocated when anime smoothing is on, and what gets released when a stream stops. The existing tensor_bytes counter only goes up, so it couldn't answer either question.

This adds live and peak allocation totals to engine.report().memory, with a breakdown for frame textures, network buffers, cadence scratch, and other tracked resources. A reused buffer counts once, and a buffer stays counted while an execution plan still holds it. tensor_bytes stays unchanged. The new report is also available in the C and browser APIs. Low-level Rust callers now get a tracked buffer handle that dereferences to wgpu::Buffer.

On my M5 in Chromium, I tested a 1080p stream at 480p inference with six input slots and four output slots. Realtime used about 193 MiB, video mode used 419 MiB, and enabling cadence brought that to 445 MiB. Each stream returned to 3 KiB live after I freed it, with the peak preserved. These are engine-tracked allocations, not driver-reported VRAM usage.

I built and tested the browser module with WebGPU and ran the native tests for peak tracking, arena reuse, and stream teardown.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

The new stream test fails to compile against the existing EngineReport because the memory breakdown is missing.
Track allocation lifetimes through stream slots, the tensor arena, and plan bindings. Keep the cumulative counter for existing hosts and split out cadence scratch so its cost can be isolated from the three video pair plans.

Verified with native stream and arena tests and the browser WASM build on Apple M5. Opening and freeing realtime, video, and cadence streams at 1920x1080 returned the portable-f16 engine to its 3 KiB baseline.
@MONZikWasTaken
MONZikWasTaken merged commit fd207a1 into getflyhigh:main Nov 20, 2026
6 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.

2 participants