Skip to content

Commit 4af40c0

Browse files
committed
[None][ci] tighten VisualGen CBTS routing
Move remaining public VisualGen config imports to the public args module so _torch.visual_gen.config stays internal to VisualGen. Place scheduled VisualGen example tests and golden data under examples/visual_gen, move the media unit test under unittest/visual_gen, and update test-db plus waive references to those paths. Keep VisualGen perf sanity with the shared perf tests. Match VG CBTS blocks by the shared visual_gen namespace plus the perf-sanity entry, and keep public tensorrt_llm/visual_gen changes on baseline fallback. Signed-off-by: Zhenhua Wang <zhenhuaw@nvidia.com>
1 parent 84b349f commit 4af40c0

24 files changed

Lines changed: 87 additions & 100 deletions

jenkins/scripts/cbts/rules/README.md

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -162,33 +162,31 @@ still force VG stages.
162162
Block selection — entry-pattern based only:
163163
VisualGen has no `condition.terms.backend` of its own; VG entries
164164
live in `backend: pytorch` and `backend: tensorrt` blocks. A block
165-
"belongs to VG" iff any of its `tests:` entries matches one of the
166-
three stable VG path families:
167-
168-
- `unittest/_torch/visual_gen/...` (28 entries)
169-
- `examples/test_visual_gen.py...` (1 entry)
170-
- `visual_gen/test_visual_gen_benchmark.py` (1 entry)
165+
"belongs to VG" iff any of its `tests:` entries lives under a dedicated
166+
`visual_gen/` test path or is the VisualGen perf-sanity entry under
167+
`perf/`.
171168

172169
For each matched block, `block_filters` keeps only the VG entries.
173170
Non-VG siblings in the same block stay governed by other rules.
174171

175-
Outward-facing fallback: unlike AutoDeploy, VG is imported eagerly
176-
(top-level `from tensorrt_llm._torch.visual_gen.config import ...`
177-
in `commands/serve.py`, `commands/utils.py`,
178-
`serve/openai_server.py`). The 5 files that define / re-export the
179-
public API symbols (`VisualGenArgs`, `ParallelConfig`, `VisualGen`,
180-
`VisualGenParams`) are listed in `_VG_OUTWARD_FILES`; touching any
181-
of them claims the changed files but emits `scope=None` so Selector
182-
falls back to baseline. This protects trtllm-serve / trtllm-bench
183-
startup paths from VG signature drift slipping through pre-merge.
172+
Outward-facing fallback: unlike AutoDeploy, VG public symbols are
173+
imported eagerly by non-VG startup paths such as `commands/serve.py`,
174+
`commands/utils.py`, and `serve/openai_server.py`. The public API
175+
package prefix (`tensorrt_llm/visual_gen/`) is listed in
176+
`_VG_OUTWARD_PREFIXES`; touching any non-doc file under it claims the
177+
changed files but emits `scope=None` so Selector falls back to baseline.
178+
This protects trtllm-serve / trtllm-bench startup paths from VG
179+
signature drift slipping through pre-merge.
184180

185181
Outcomes:
186182

187183
- No VG source files in the diff → rule returns `None`.
188-
- VG source touched, all internal → `scope=visualgenonly`; sanity
189-
off (VG changes don't affect wheel sanity); perfsanity on iff a
190-
matched block lives in `l0_perf` or `*perf_sanity*`.
191-
- VG source touched, any outward-facing file → `scope=None`
184+
- VG source touched, all internal (`examples/visual_gen/**` or
185+
`tensorrt_llm/_torch/visual_gen/**`) → `scope=visualgenonly`;
186+
sanity off (VG changes don't affect wheel sanity); perfsanity on iff
187+
a matched block lives in `l0_perf` or `*perf_sanity*`.
188+
- VG source touched, any outward-facing path under
189+
`tensorrt_llm/visual_gen/``scope=None`
192190
(fallback).
193191
- VG source touched but no VG block found anywhere (defensive) →
194192
`scope=None` (fallback).

jenkins/scripts/cbts/rules/visual_gen_rule.py

Lines changed: 17 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -20,21 +20,18 @@
2020
Block selection — entry-pattern based only:
2121
VisualGen does NOT have its own `condition.terms.backend`; VG test
2222
entries live in `backend: pytorch` and `backend: tensorrt` blocks.
23-
A block "belongs to VG" iff any of its `tests:` entries matches one
24-
of the three stable VG entry path families:
25-
- `unittest/_torch/visual_gen/...` (28 entries)
26-
- `examples/test_visual_gen.py...` (1 entry)
27-
- `visual_gen/test_visual_gen_benchmark.py` (1 entry)
23+
A block "belongs to VG" iff any of its `tests:` entries lives under a
24+
dedicated `visual_gen/` test path or is the VisualGen perf-sanity entry.
2825
2926
Outward-facing fallback:
3027
Unlike AutoDeploy, VG is imported eagerly (module-level) by non-VG
3128
code: `commands/serve.py`, `commands/utils.py`, and
3229
`serve/openai_server.py` import `VisualGenArgs` / `ParallelConfig` /
3330
`VisualGen` / `VisualGenParams` at top level. A signature change to
3431
those symbols can break trtllm-serve startup, which would affect
35-
non-VG tests. The 5 files that define / re-export those symbols are
36-
listed in `_VG_OUTWARD_FILES`; touching any of them forces fallback
37-
even if the rest of the diff is VG-internal.
32+
non-VG tests. The public API package prefix is listed in
33+
`_VG_OUTWARD_PREFIXES`; touching any file under it forces fallback even
34+
if the rest of the diff is VG-internal.
3835
"""
3936

4037
from __future__ import annotations
@@ -55,27 +52,17 @@
5552
"tensorrt_llm/visual_gen/",
5653
)
5754

58-
# Files inside _VG_SRC_PREFIXES that are imported eagerly by non-VG
59-
# code (top-level `from ... import VisualGenArgs / ParallelConfig /
60-
# VisualGen / VisualGenParams`). Touching any of these can break
61-
# trtllm-serve / trtllm-bench startup paths, so the rule defers to
62-
# baseline rather than narrowing.
63-
_VG_OUTWARD_FILES: frozenset[str] = frozenset(
64-
{
65-
"tensorrt_llm/_torch/visual_gen/config.py",
66-
"tensorrt_llm/visual_gen/__init__.py",
67-
"tensorrt_llm/visual_gen/args.py",
68-
"tensorrt_llm/visual_gen/params.py",
69-
"tensorrt_llm/visual_gen/visual_gen.py",
70-
}
71-
)
55+
# Public VisualGen API package imported eagerly by non-VG code. Touching
56+
# any non-doc file under this prefix can break trtllm-serve / trtllm-bench
57+
# startup paths, so the rule defers to baseline rather than narrowing.
58+
_VG_OUTWARD_PREFIXES: tuple[str, ...] = ("tensorrt_llm/visual_gen/",)
7259

73-
# Substrings that mark a test entry as VG. Cover all three path
74-
# families that appear in test-db YAMLs (audited 2026-05).
60+
# Substrings that mark a test entry as VG. VG tests are expected to live
61+
# under dedicated visual_gen test directories, except the perf-sanity
62+
# frontend which stays with the shared perf tests.
7563
_VG_ENTRY_PATTERNS: tuple[str, ...] = (
76-
"unittest/_torch/visual_gen/",
77-
"examples/test_visual_gen.py",
78-
"visual_gen/test_visual_gen_benchmark.py",
64+
"visual_gen/",
65+
"perf/test_visual_gen_perf_sanity.py",
7966
)
8067

8168

@@ -122,19 +109,19 @@ def apply(self, pr: PRInputs) -> Optional[RuleResult]:
122109
if not claimed:
123110
return None
124111

125-
# Outward-facing VG files break the "self-contained subsystem"
112+
# Outward-facing VG paths break the "self-contained subsystem"
126113
# assumption — they are imported eagerly by trtllm-serve /
127114
# trtllm-bench. Claim the files (so they don't go unhandled and
128115
# silently fallback) but emit scope=None so Selector falls back
129116
# to baseline coverage instead of narrowing to VG-only stages.
130-
outward = claimed & _VG_OUTWARD_FILES
117+
outward = {f for f in claimed if f.startswith(_VG_OUTWARD_PREFIXES)}
131118
if outward:
132119
return RuleResult(
133120
handled_files=claimed,
134121
affected_stages=set(),
135122
scope=None,
136123
reason=(
137-
f"visualgen: {len(outward)} outward-facing VG file(s) "
124+
f"visualgen: {len(outward)} outward-facing VG path(s) "
138125
f"touched ({sorted(outward)[0]}{'...' if len(outward) > 1 else ''}); "
139126
"fallback to baseline"
140127
),

tensorrt_llm/bench/benchmark/visual_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,8 +199,8 @@ def visual_gen_command(
199199
"""Benchmark VisualGen (image/video generation) models offline."""
200200
import yaml
201201

202-
from tensorrt_llm._torch.visual_gen.config import VisualGenArgs
203202
from tensorrt_llm.visual_gen import VisualGen, VisualGenParams
203+
from tensorrt_llm.visual_gen.args import VisualGenArgs
204204

205205
if prompt is None and prompt_file is None:
206206
raise click.UsageError("Either --prompt or --prompt_file must be specified.")

tensorrt_llm/commands/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
import click
88
from click.core import ParameterSource
99

10-
from tensorrt_llm._torch.visual_gen.config import ParallelConfig
1110
from tensorrt_llm.llmapi.utils import download_hf_partial
11+
from tensorrt_llm.visual_gen.args import ParallelConfig
1212

1313
logger = logging.getLogger(__name__)
1414

tests/integration/defs/examples/golden/visual_gen_lpips/flux1_lpips_golden.json renamed to tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux1_lpips_golden.json

File renamed without changes.

tests/integration/defs/examples/golden/visual_gen_lpips/flux2_lpips_golden.json renamed to tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/flux2_lpips_golden.json

File renamed without changes.

tests/integration/defs/examples/golden/visual_gen_lpips/ltx2_lpips_golden_video.json renamed to tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/ltx2_lpips_golden_video.json

File renamed without changes.

tests/integration/defs/examples/golden/visual_gen_lpips/visual_gen_lpips_golden_media.zip renamed to tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/visual_gen_lpips_golden_media.zip

File renamed without changes.

tests/integration/defs/examples/golden/visual_gen_lpips/wan21_t2v_lpips_golden_video.json renamed to tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan21_t2v_lpips_golden_video.json

File renamed without changes.

tests/integration/defs/examples/golden/visual_gen_lpips/wan22_t2v_lpips_golden_video.json renamed to tests/integration/defs/examples/visual_gen/golden/visual_gen_lpips/wan22_t2v_lpips_golden_video.json

File renamed without changes.

0 commit comments

Comments
 (0)