[Bugfix][Examples][MammothModa2] Serve T2I via LLM-typed DiT stage (#7199) + benchmark harness and profiler wiring (#7293)

Signed-off-by: quan-yi-ai <82917002+quan-yi-ai@users.noreply.github.com>
Co-authored-by: Hongsheng Liu <liuhongsheng4@huawei.com>
This commit is contained in:
quan-yi-aiandHongsheng Liu authored and GitHub committed 2026-10-05 02:42:58 +08:00
1 parent b9cf74352a
commit 65f5a1d5b3
12 files changed
+933 -71

No files matched your search

+15
View File
@@ -25,3 +25,18 @@ def apply_declared_extra_args(
if not declared:
return
sampling_params.extra_args = {**(sampling_params.extra_args or {}), **declared}
def ar_grid_max_tokens(ar_width: int, ar_height: int) -> int | None:
"""Return the AR-stage ``max_tokens`` for MammothModa2-style visual-token grids.
The AR stage emits one visual token per grid cell, one EOL token per row,
and one final look-ahead token, so the generation budget is
``ar_height * (ar_width + 1) + 1``. Shared by the online serving path and
the offline example so a grid-contract change cannot desynchronize one
copy. Returns ``None`` when the grid is absent or non-positive, letting
callers keep their existing default.
"""
if ar_width <= 0 or ar_height <= 0:
return None
return ar_height * (ar_width + 1) + 1