[misc]: surface GenerationResult.peak_memory_mb in the MiniMax H3 examples - #1785
Open
KyleNeverGivesUp wants to merge 1 commit into
Open
[misc]: surface GenerationResult.peak_memory_mb in the MiniMax H3 examples#1785KyleNeverGivesUp wants to merge 1 commit into
KyleNeverGivesUp wants to merge 1 commit into
Conversation
Contributor
Merge Protections🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI
🔴 PR merge requirementsWaiting for
This rule is failing.
|
…mples Every generation already computes its own peak. The worker calls torch.cuda.max_memory_allocated() at multiproc_executor.py:699 and the value reaches the caller as GenerationResult.peak_memory_mb, but both H3 examples print only the generation time and drop it. On a memory-constrained device that number is the one that decides whether a configuration runs at all, and it is what a reader has to reproduce to check any memory claim about this model. Right now they cannot: the field is populated, handed over, and discarded. examples/inference/optimizations/spark_benchmark.py already prints it, so this only brings the H3 examples in line. Two lines each, guarded on the value being present, so nothing changes for a backend that does not report it.
KyleNeverGivesUp
force-pushed
the
surface-peak-memory-h3-examples
branch
from
August 31, 2026 00:59
f74fdc9 to
c414acf
Compare
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.
Problem
Every generation already computes its own peak. The worker calls
torch.cuda.max_memory_allocated()atfastvideo/worker/multiproc_executor.py:699and the value reaches the caller asGenerationResult.peak_memory_mb. Both MiniMax H3 examples receive it and print only the generation time.On a memory-constrained device that number is the one that decides whether a configuration runs at all. It is also what a reader has to reproduce in order to check any memory claim about this model, and right now they cannot: the field is populated, handed over, and dropped on the floor.
examples/inference/optimizations/spark_benchmark.pyalready prints it, so this only brings the H3 examples in line with an existing convention.What this changes
Two lines in each example, guarded on the value being present so nothing changes for a backend that does not report one.
basic_minimax_h3_t2v.pyprints it for the first request and for each--repeatsiteration, next to the generation-time line those iterations already emit.basic_fasth3.pyprints it inside the same per-run block that already reports wall time, generation time and denoise time.Why it matters right now
Two open PRs report peak memory on one GB10 and neither is reproducible without a local patch to these files:
Every one of those numbers was read from a three-line local edit that has never been committed. With this change a reader can run the same command and see the same line.
Testing
No test parses the output of either example, so nothing is invalidated.
grep -rn "Generation time:" fastvideo/tests/returns nothing.Checked on one GB10, 768x1344, 124 frames, MiniMax H3 r16:
which matches
torch.cuda.max_memory_allocated()as reported by the worker for the same run.