Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@
/tensorrt_llm/_torch/visual_gen/modules/attention.py @NVIDIA/trt-llm-torch-attention-devs @NVIDIA/trt-llm-torch-visual-gen-devs
/tensorrt_llm/media @NVIDIA/trt-llm-torch-visual-gen-devs
/tensorrt_llm/visual_gen @NVIDIA/trt-llm-torch-visual-gen-devs @NVIDIA/trt-llm-runtime-devs
/tests/integration/defs/examples/test_visual_gen.py @NVIDIA/trt-llm-torch-visual-gen-devs
/tests/integration/defs/examples/visual_gen/ @NVIDIA/trt-llm-torch-visual-gen-devs
/tests/integration/defs/visual_gen @NVIDIA/trt-llm-torch-visual-gen-devs
/tests/scripts/perf-sanity/visual_gen @NVIDIA/trt-llm-torch-visual-gen-devs
/tests/unittest/_torch/thop/parallel_hw_agnostic/test_fused_dit* @NVIDIA/trt-llm-torch-visual-gen-devs
Expand Down
54 changes: 37 additions & 17 deletions tests/integration/defs/.test_durations
Original file line number Diff line number Diff line change
Expand Up @@ -671,23 +671,43 @@
"examples/test_ray.py::test_llm_inference_async_ray": 131.85468882175226,
"examples/test_ray.py::test_llm_inference_distributed_ray[tep2]": 162.2443882352941,
"examples/test_ray.py::test_llm_inference_distributed_ray[tp2]": 68.63462352941177,
"examples/visual_gen/test_visual_gen.py::test_cosmos3_example": 268.35481163434906,
"examples/visual_gen/test_visual_gen.py::test_cosmos3_nano_t2v_lpips_against_golden": 273.255,
"examples/visual_gen/test_visual_gen.py::test_flux1_example": 221.66551968503938,
"examples/visual_gen/test_visual_gen.py::test_flux1_lpips_against_golden": 45.776666666666664,
"examples/visual_gen/test_visual_gen.py::test_flux2_example": 259.9329760638298,
"examples/visual_gen/test_visual_gen.py::test_flux2_lpips_against_golden": 97.27477777777779,
"examples/visual_gen/test_visual_gen.py::test_ltx2_cuda_graph_lpips_matches_eager": 250.33366666666666,
"examples/visual_gen/test_visual_gen.py::test_ltx2_example": 498.4825415282392,
"examples/visual_gen/test_visual_gen.py::test_ltx2_lpips_against_golden": 57.486583333333336,
"examples/visual_gen/test_visual_gen.py::test_qwen_image_example": 160.9602216358839,
"examples/visual_gen/test_visual_gen.py::test_qwenimage_cuda_graph_lpips_against_golden": 76.66260000000001,
"examples/visual_gen/test_visual_gen.py::test_qwenimage_lpips_against_golden": 54.41563636363636,
"examples/visual_gen/test_visual_gen.py::test_visual_gen_api_walkthrough": 300.98745974025974,
"examples/visual_gen/test_visual_gen.py::test_visual_gen_quickstart": 201.11261139896374,
"examples/visual_gen/test_visual_gen.py::test_wan21_t2v_lpips_against_golden": 16.938916666666668,
"examples/visual_gen/test_visual_gen.py::test_wan22_t2v_lpips_against_golden": 54.451727272727275,
"examples/visual_gen/test_visual_gen.py::test_wan_t2v_example": 647.1280441558441,
"examples/visual_gen/test_visual_gen_cosmos3.py::test_cosmos3_example": 268.35481163434906,
"examples/visual_gen/test_visual_gen_cosmos3.py::test_cosmos3_feature_accuracy_against_golden[fp8-blockwise]": 55.09,
"examples/visual_gen/test_visual_gen_cosmos3.py::test_cosmos3_feature_accuracy_against_golden[nvfp4]": 59.88,
"examples/visual_gen/test_visual_gen_cosmos3.py::test_cosmos3_nano_t2v_lpips_against_golden": 273.255,
"examples/visual_gen/test_visual_gen_flux.py::test_flux1_example": 221.66551968503938,
"examples/visual_gen/test_visual_gen_flux.py::test_flux1_lpips_against_golden": 97.557,
"examples/visual_gen/test_visual_gen_flux.py::test_flux2_example": 259.9329760638298,
"examples/visual_gen/test_visual_gen_flux.py::test_flux2_lpips_against_golden": 250.544,
"examples/visual_gen/test_visual_gen_flux.py::test_flux_accuracy_against_golden[flux1-cuda-graph]": 12.84,
"examples/visual_gen/test_visual_gen_flux.py::test_flux_accuracy_against_golden[flux1-fp8-blockwise]": 119.97,
"examples/visual_gen/test_visual_gen_flux.py::test_flux_accuracy_against_golden[flux1-nvfp4]": 57.85,
"examples/visual_gen/test_visual_gen_flux.py::test_flux_accuracy_against_golden[flux2-cuda-graph]": 24.02,
"examples/visual_gen/test_visual_gen_flux.py::test_flux_accuracy_against_golden[flux2-fp8-blockwise]": 258.78,
"examples/visual_gen/test_visual_gen_flux.py::test_flux_accuracy_against_golden[flux2-nvfp4]": 277.28,
"examples/visual_gen/test_visual_gen_ltx2.py::test_ltx2_cuda_graph_lpips_matches_eager": 250.33366666666666,
"examples/visual_gen/test_visual_gen_ltx2.py::test_ltx2_example": 498.4825415282392,
"examples/visual_gen/test_visual_gen_ltx2.py::test_ltx2_feature_accuracy_against_golden[cuda-graph]": 461.68,
"examples/visual_gen/test_visual_gen_ltx2.py::test_ltx2_feature_accuracy_against_golden[fp8-blockwise]": 481.07,
"examples/visual_gen/test_visual_gen_ltx2.py::test_ltx2_feature_accuracy_against_golden[nvfp4]": 496.24,
"examples/visual_gen/test_visual_gen_ltx2.py::test_ltx2_lpips_against_golden": 57.486583333333336,
"examples/visual_gen/test_visual_gen_qwen_image.py::test_qwen_image_example": 160.9602216358839,
"examples/visual_gen/test_visual_gen_qwen_image.py::test_qwenimage_cuda_graph_lpips_against_golden": 76.66260000000001,
"examples/visual_gen/test_visual_gen_qwen_image.py::test_qwenimage_feature_accuracy_against_golden[cuda-graph]": 141.8,
"examples/visual_gen/test_visual_gen_qwen_image.py::test_qwenimage_feature_accuracy_against_golden[fp8-blockwise]": 82.1,
"examples/visual_gen/test_visual_gen_qwen_image.py::test_qwenimage_feature_accuracy_against_golden[nvfp4]": 104.22,
"examples/visual_gen/test_visual_gen_qwen_image.py::test_qwenimage_lpips_against_golden": 54.41563636363636,
"examples/visual_gen/test_visual_gen_wan.py::test_visual_gen_api_walkthrough": 300.98745974025974,
"examples/visual_gen/test_visual_gen_wan.py::test_visual_gen_quickstart": 201.11261139896374,
"examples/visual_gen/test_visual_gen_wan.py::test_wan21_t2v_lpips_against_golden": 16.938916666666668,
"examples/visual_gen/test_visual_gen_wan.py::test_wan22_t2v_lpips_against_golden": 54.451727272727275,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_feature_accuracy_against_golden[wan21-cuda-graph]": 8.49,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_feature_accuracy_against_golden[wan21-fp8-blockwise]": 65.48,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_feature_accuracy_against_golden[wan21-nvfp4]": 156.43,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_feature_accuracy_against_golden[wan22-cuda-graph]": 31.14,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_feature_accuracy_against_golden[wan22-fp8-blockwise]": 182.16,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_feature_accuracy_against_golden[wan22-nvfp4]": 161.28,
"examples/visual_gen/test_visual_gen_wan.py::test_wan_t2v_example": 647.1280441558441,
"examples/visual_gen/test_visual_gen_multi_gpu.py::test_wan22_t2v_lpips_against_golden_multi_gpu[attn2d_2x2]": 834.184,
"examples/visual_gen/test_visual_gen_multi_gpu.py::test_wan22_t2v_lpips_against_golden_multi_gpu[cfg2_ulysses2]": 963.1505,
"examples/visual_gen/test_visual_gen_multi_gpu.py::test_wan22_t2v_lpips_against_golden_tp[cfg2_tp2]": 447.3106666666667,
Expand Down
29 changes: 25 additions & 4 deletions tests/integration/defs/examples/visual_gen/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,37 @@
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
"""Fixtures shared by VisualGen example tests."""

"""Shared fixtures for VisualGen example integration tests."""
import shutil

import pytest
from defs.examples.visual_gen.visual_gen_test_utils import _prepare_vbench_repo
from defs.trt_test_alternative import check_call


@pytest.fixture(scope="session")
def _visual_gen_deps(llm_venv):
"""Install optional media dependencies once per VisualGen test session."""
"""Install the Python and system media dependencies once per session."""
llm_venv.run_cmd(["-m", "pip", "install", "av"])
check_call(["apt-get", "update", "-y"], shell=False)
check_call(["apt-get", "install", "-y", "ffmpeg"], shell=False)
if shutil.which("ffmpeg") is None:
check_call(["apt-get", "update", "-y"], shell=False)
check_call(["apt-get", "install", "-y", "ffmpeg"], shell=False)


@pytest.fixture(scope="session")
def _visual_gen_lpips_scorer():
"""Reuse one lazily initialized AlexNet LPIPS model for media tests."""
from defs.examples.visual_gen.visual_gen_test_utils import ReusableLPIPSScorer

scorer = ReusableLPIPSScorer()
try:
yield scorer
finally:
scorer.close()


@pytest.fixture(scope="session")
def vbench_repo_root(llm_venv):
Comment thread
zhaoyuanh-nvidia marked this conversation as resolved.
"""Prepare the pinned VBench checkout and return its repository root."""
return _prepare_vbench_repo(llm_venv)
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"image": "cosmos3_nano_fp8_blockwise_lpips_golden.png",
"model": "Cosmos3-Nano",
"source": "TensorRT-LLM VisualGen",
"prompt": "A serene mountain landscape with snow-capped peaks and a flowing river",
"height": 720,
"width": 1280,
"num_frames": 1,
"num_inference_steps": 35,
"guidance_scale": 6.0,
"frame_rate": 24.0,
"seed": 42,
"feature_config": {
"quantization": "FP8_BLOCK_SCALES",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "dbdfc83e3a6a038138f4c8e039fa09be8ab11cb308f1534405624523afed73a5"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"image": "cosmos3_nano_nvfp4_lpips_golden.png",
"model": "Cosmos3-Nano",
"source": "TensorRT-LLM VisualGen",
"prompt": "A serene mountain landscape with snow-capped peaks and a flowing river",
"height": 720,
"width": 1280,
"num_frames": 1,
"num_inference_steps": 35,
"guidance_scale": 6.0,
"frame_rate": 24.0,
"seed": 42,
"feature_config": {
"quantization": "NVFP4",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "36a2927030c28eac1bcfee0361d13723b655b4d0db4a818537e71366360df85f"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "flux1_cuda_graph_lpips_golden.png",
"model": "FLUX.1-dev",
"source": "TensorRT-LLM VisualGen",
"prompt": "a tiny astronaut hatching from an egg on the moon",
"height": 256,
"width": 256,
"num_inference_steps": 4,
"guidance_scale": 3.5,
"seed": 42,
"feature_config": {
"quantization": "none",
"cuda_graph": true
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "43c916aef97133281424e7e7f04bc6e58493e6e9535f5e5234f3fef51f0ab857"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "flux1_fp8_blockwise_lpips_golden.png",
"model": "FLUX.1-dev",
"source": "TensorRT-LLM VisualGen",
"prompt": "a tiny astronaut hatching from an egg on the moon",
"height": 256,
"width": 256,
"num_inference_steps": 4,
"guidance_scale": 3.5,
"seed": 42,
"feature_config": {
"quantization": "FP8_BLOCK_SCALES",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "9e71a2e12d8bd28278f95f02c1836033dccac4717578c30b6bbc27a3b4011022"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "flux1_nvfp4_lpips_golden.png",
"model": "FLUX.1-dev",
"source": "TensorRT-LLM VisualGen",
"prompt": "a tiny astronaut hatching from an egg on the moon",
"height": 256,
"width": 256,
"num_inference_steps": 4,
"guidance_scale": 3.5,
"seed": 42,
"feature_config": {
"quantization": "NVFP4",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "f34c21a23a8140f842a53a11937c08d6f034057daa89fb5825638a9b3a322566"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "flux2_cuda_graph_lpips_golden.png",
"model": "FLUX.2-dev",
"source": "TensorRT-LLM VisualGen",
"prompt": "a tiny astronaut hatching from an egg on the moon",
"height": 256,
"width": 256,
"num_inference_steps": 4,
"guidance_scale": 3.5,
"seed": 42,
"feature_config": {
"quantization": "none",
"cuda_graph": true
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "0beac87c89fced52e5845b8de7b8dfa6837cca308de032a87f8dcf4d86c3dfee"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "flux2_fp8_blockwise_lpips_golden.png",
Comment thread
zhaoyuanh-nvidia marked this conversation as resolved.
"model": "FLUX.2-dev",
"source": "TensorRT-LLM VisualGen",
"prompt": "a tiny astronaut hatching from an egg on the moon",
"height": 256,
"width": 256,
"num_inference_steps": 4,
"guidance_scale": 3.5,
"seed": 42,
"feature_config": {
"quantization": "FP8_BLOCK_SCALES",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "8255196070843fe4a3d812f0880afcbfda5903537403581207c38bbf0ef615f5"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"image": "flux2_nvfp4_lpips_golden.png",
"model": "FLUX.2-dev",
"source": "TensorRT-LLM VisualGen",
"prompt": "a tiny astronaut hatching from an egg on the moon",
"height": 256,
"width": 256,
"num_inference_steps": 4,
"guidance_scale": 3.5,
"seed": 42,
"feature_config": {
"quantization": "NVFP4",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "b290d7891340e259fa05f0b027ea543850aef453573c0384a7c4744d6d91d53b"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"video": "ltx2_cuda_graph_lpips_golden_video.mp4",
"model": "LTX-2 BF16 two-stage",
"source": "TensorRT-LLM VisualGen",
"prompt": "A woman with long brown hair and light skin smiles at the camera while standing in a sunlit park, her hair gently blowing in the breeze as she tilts her head slightly to the side.",
"negative_prompt": "worst quality, inconsistent motion, blurry, jittery, distorted",
"height": 512,
"width": 768,
"num_frames": 49,
"num_inference_steps": 8,
"guidance_scale": 4.0,
"frame_rate": 24.0,
"seed": 42,
"feature_config": {
"quantization": "none",
"cuda_graph": true
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "55b92e45eed7a6e795b669c2d3340a4e6094410cfe9af53163456fa4f84c36c2"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"video": "ltx2_fp8_blockwise_lpips_golden_video.mp4",
"model": "LTX-2 BF16 two-stage",
"source": "TensorRT-LLM VisualGen",
"prompt": "A woman with long brown hair and light skin smiles at the camera while standing in a sunlit park, her hair gently blowing in the breeze as she tilts her head slightly to the side.",
"negative_prompt": "worst quality, inconsistent motion, blurry, jittery, distorted",
"height": 512,
"width": 768,
"num_frames": 49,
"num_inference_steps": 8,
"guidance_scale": 4.0,
"frame_rate": 24.0,
"seed": 42,
"feature_config": {
"quantization": "FP8_BLOCK_SCALES",
"cuda_graph": false
},
"torch_compile": false,
"deterministic_algorithms": true,
"lpips_net": "alex",
"lpips_threshold": 0.05,
"diffusers_version": "0.39.0",
"torch_version": "2.12.0a0+5aff3928d8.nv26.05",
"tensorrt_llm_version": "1.3.0rc21",
"tensorrt_llm_commit": "b2131b181f5be6717cd302a0b53c22c6a70c65b3",
"container_image": "urm.nvidia.com/sw-tensorrt-docker/tensorrt-llm@sha256:475999862b896593159f10f486e16a748e7b7abb5cee558932a59ea6fc690d6b",
"sha256": "fced64c757f3a7f1d6b6f1f0c68c40181fc11e880c9f272e62522182393b2484"
}
Loading
Loading