Skip to content

[misc]: surface GenerationResult.peak_memory_mb in the MiniMax H3 examples - #1785

Open
KyleNeverGivesUp wants to merge 1 commit into
hao-ai-lab:mainfrom
KyleNeverGivesUp:surface-peak-memory-h3-examples
Open

[misc]: surface GenerationResult.peak_memory_mb in the MiniMax H3 examples#1785
KyleNeverGivesUp wants to merge 1 commit into
hao-ai-lab:mainfrom
KyleNeverGivesUp:surface-peak-memory-h3-examples

Conversation

@KyleNeverGivesUp

Copy link
Copy Markdown
Contributor

Problem

Every generation already computes its own peak. The worker calls torch.cuda.max_memory_allocated() at fastvideo/worker/multiproc_executor.py:699 and the value reaches the caller as GenerationResult.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.py already 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.

Generation time: 902.31s
Peak memory: 70880.0 MB

basic_minimax_h3_t2v.py prints it for the first request and for each --repeats iteration, next to the generation-time line those iterations already emit. basic_fasth3.py prints 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:

Generation time: 902.31s
Peak memory: 70880.0 MB

which matches torch.cuda.max_memory_allocated() as reported by the worker for the same run.

@mergify mergify Bot added type: misc Cleanup, config, dependencies scope: inference Inference pipeline, serving, CLI labels Aug 29, 2026
@mergify

mergify Bot commented Aug 29, 2026

Copy link
Copy Markdown
Contributor

Merge Protections

🔴 1 of 1 protections blocking · waiting on 👀 reviews and 🤖 CI

Protection Waiting on
🔴 PR merge requirements 👀 reviews and 🤖 CI

🔴 PR merge requirements

Waiting for

  • #approved-reviews-by>=1
  • check-success=full-suite-passed
This rule is failing.
  • #approved-reviews-by>=1
  • check-success=full-suite-passed
  • check-success=fastcheck-passed
  • check-success~=pre-commit
  • title~=(?i)^\[(feat|feature|bugfix|fix|refactor|perf|ci|doc|docs|misc|chore|kernel|new.?model|skill|skills|infra)\]

…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
KyleNeverGivesUp force-pushed the surface-peak-memory-h3-examples branch from f74fdc9 to c414acf Compare August 31, 2026 00:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: inference Inference pipeline, serving, CLI type: misc Cleanup, config, dependencies

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant