Repository navigation
Report live and peak GPU allocations - #8
Merged
MONZikWasTaken merged 3 commits intoNov 20, 2026
Merged
Conversation
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.
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.
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_bytescounter 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_bytesstays 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 towgpu::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.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.