From d1020c40eeecea296b9c9cefaf365fee939d92f3 Mon Sep 17 00:00:00 2001 From: lanluo-nvidia Date: Fri, 23 Jan 2026 23:46:46 -0800 Subject: [PATCH] test --- tests/py/dynamo/llm/test_llm_models.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/py/dynamo/llm/test_llm_models.py b/tests/py/dynamo/llm/test_llm_models.py index 3899d5dd93e..f133d4016a2 100644 --- a/tests/py/dynamo/llm/test_llm_models.py +++ b/tests/py/dynamo/llm/test_llm_models.py @@ -1,5 +1,7 @@ +import importlib import os import sys +import unittest import pytest import torch @@ -9,13 +11,17 @@ sys.path.append(os.path.join(os.path.dirname(__file__), "../../../../tools/llm")) import argparse -from run_llm import compile_torchtrt -from torchtrt_ext import register_sdpa - @pytest.mark.unit @pytest.mark.parametrize("precision", ["FP16", "BF16", "FP32"]) +@unittest.skipIf( + not importlib.util.find_spec("modelopt"), + "ModelOpt is required to run this test", +) def test_llm_decoder_layer(precision): + from run_llm import compile_torchtrt + from torchtrt_ext import register_sdpa + if torch_tensorrt.ENABLED_FEATURES.tensorrt_rtx and precision == "BF16": pytest.skip("TensorRT-RTX does not support bfloat16, skipping test") with torch.inference_mode():