diff --git a/tests/integration/test_lists/test-db/l0_a10.yml b/tests/integration/test_lists/test-db/l0_a10.yml index b3b8bdb0e9fa..7c0d6ddcfe48 100644 --- a/tests/integration/test_lists/test-db/l0_a10.yml +++ b/tests/integration/test_lists/test-db/l0_a10.yml @@ -28,14 +28,10 @@ l0_a10: - unittest/_torch/modeling/test_multimodal_encoder_mixin.py - unittest/_torch/sampler/test_trtllm_sampler.py - unittest/_torch/sampler/test_token_ban.py - - unittest/_torch/executor/test_kv_cache_estimation.py - - unittest/_torch/executor/test_kv_cache_budget_split.py - - unittest/_torch/executor/test_kv_pool_rebalance.py - unittest/_torch/executor/test_disagg_index_mapper_early_release.py - unittest/_torch/executor/test_kv_cache_compression_manager.py - unittest/_torch/executor/test_kv_cache_v2_capacity_only.py - unittest/_torch/executor/test_error_classification.py - - unittest/_torch/modules/dwdp/test_dwdp_fixup_moe_backends.py - unittest/_torch/modules/moe/test_communication_factory.py # NOTE: this is a CPU-only test, but we do not have a dedicated job for this (and therefore no # test list either). @@ -54,12 +50,6 @@ l0_a10: - unittest/disaggregated/test_bounce.py - unittest/disaggregated/test_mamba_transfer.py - unittest/tools - - unittest/usage/test_collectors.py - - unittest/usage/test_config.py - - unittest/usage/test_llmapi_config_telemetry_docs.py - - unittest/usage/test_opt_out.py - - unittest/usage/test_reporter.py - - unittest/usage/test_schema.py - unittest/usage/test_transport.py - unittest/usage/test_e2e_capture.py - disaggregated/test_disaggregated.py::test_disaggregated_single_gpu[TinyLlama-1.1B-Chat-v1.0] @@ -104,12 +94,8 @@ l0_a10: - test_e2e.py::test_trtllm_bench_invalid_token_pytorch[TinyLlama-1.1B-Chat-v1.0-TinyLlama-1.1B-Chat-v1.0] # visual_gen - unittest/_torch/visual_gen/test_profiler.py - - unittest/_torch/visual_gen/test_visual_gen_params.py - - unittest/visual_gen/test_output.py - unittest/visual_gen/test_iteration_stats.py - unittest/visual_gen/test_media_encoding.py - - unittest/_torch/visual_gen/test_tensor_payload.py - - unittest/_torch/visual_gen/test_flux_infer.py - unittest/_torch/visual_gen/test_qwen_image_infer.py - unittest/_torch/visual_gen/test_qwen_image_pipeline.py # llmapi @@ -151,7 +137,6 @@ l0_a10: # helper-script unit tests (CPU-only, ~3s) - unittest/scripts - unittest/kv_cache_manager_v2_tests # 4 min - - unittest/dynamo - unittest/api_stability - unittest/bindings - condition: diff --git a/tests/integration/test_lists/test-db/l0_b200.yml b/tests/integration/test_lists/test-db/l0_b200.yml index 9662d6a9947f..d0fb994e99e9 100644 --- a/tests/integration/test_lists/test-db/l0_b200.yml +++ b/tests/integration/test_lists/test-db/l0_b200.yml @@ -111,7 +111,6 @@ l0_b200: # ------------- MoE components tests --------------- - unittest/_torch/modules/test_moe_load_balancer.py - unittest/_torch/modules/test_moe_routing.py - - unittest/_torch/modules/test_moe_host_sharer.py - unittest/_torch/modules/fused_moe/test_deepgemm_fused_gather_finalize.py - unittest/_torch/modules/fused_moe/test_deepgemm_fused_expand_quant.py # ------------- MoE: test_moe_backend (by backend) --------------- @@ -195,11 +194,7 @@ l0_b200: - kv_cache/test_prefix_aware_scheduling.py::TestServePrefixAwareScheduling::test_multi_round_qa_shared_prefix_smoke # ------------- Visual Gen tests --------------- - unittest/_torch/visual_gen/test_media_decode.py - - unittest/_torch/visual_gen/test_visual_gen_args.py - - unittest/_torch/visual_gen/test_visual_gen_params.py - - unittest/_torch/visual_gen/test_visual_gen_utils.py - unittest/_torch/visual_gen/test_warmup.py - - unittest/_torch/visual_gen/test_teacache.py - unittest/_torch/visual_gen/test_cache_dit.py - unittest/_torch/visual_gen/test_quant_ops.py - unittest/_torch/visual_gen/test_attention_cute_dsl.py @@ -207,7 +202,6 @@ l0_b200: - unittest/_torch/visual_gen/test_attention_trtllm_sage.py - unittest/_torch/visual_gen/test_attention_integration.py - unittest/_torch/visual_gen/test_attention_perf.py - - unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py - unittest/_torch/visual_gen/test_trtllm_serve_e2e.py - unittest/_torch/visual_gen/test_model_loader.py - unittest/_torch/visual_gen/test_flux_transformer.py diff --git a/tests/integration/test_lists/test-db/l0_cpu.yml b/tests/integration/test_lists/test-db/l0_cpu.yml index bf67c89236da..e4e5d9465a05 100644 --- a/tests/integration/test_lists/test-db/l0_cpu.yml +++ b/tests/integration/test_lists/test-db/l0_cpu.yml @@ -12,6 +12,7 @@ l0_cpu: backend: generic orchestrator: mpi tests: + - unittest/_torch/attention - unittest/_torch/cute_dsl/test_kimi_k3_kda_ptx_patch.py - unittest/_torch/distributed - unittest/_torch/executor @@ -24,9 +25,26 @@ l0_cpu: - unittest/_torch/ray_orchestrator/single_gpu/test_cache_transceiver_comm.py - unittest/_torch/speculative/hw_agnostic - unittest/_torch/test_model_config.py - - unittest/_torch/thop/parallel_hw_agnostic/test_custom_ops.py + - unittest/_torch/thop/parallel_hw_agnostic + - unittest/_torch/visual_gen/multi_gpu/test_attn2d_attention.py + - unittest/_torch/visual_gen/multi_gpu/test_visual_gen_mapping.py + - unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py + - unittest/_torch/visual_gen/test_attention_integration.py + - unittest/_torch/visual_gen/test_cache_dit.py + - unittest/_torch/visual_gen/test_flux_infer.py + - unittest/_torch/visual_gen/test_ltx2_pipeline.py + - unittest/_torch/visual_gen/test_ltx2_transformer.py + - unittest/_torch/visual_gen/test_teacache.py + - unittest/_torch/visual_gen/test_tensor_payload.py + - unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py + - unittest/_torch/visual_gen/test_visual_gen_args.py + - unittest/_torch/visual_gen/test_visual_gen_params.py + - unittest/_torch/visual_gen/test_visual_gen_utils.py + - unittest/_torch/weight_sharing + - unittest/api_stability - unittest/bindings - unittest/disaggregated + - unittest/dynamo - unittest/executor/test_base_worker.py ISOLATION - unittest/executor/test_fatal_error_health_check.py - unittest/executor/test_ipc.py @@ -35,6 +53,7 @@ l0_cpu: - unittest/executor/test_event_loop_error_broadcast.py - unittest/executor/test_stats_serializer.py - unittest/inputs + - unittest/kv_cache_manager_v2_tests - unittest/llmapi/apps/test_chat_utils.py - unittest/llmapi/apps/test_harmony_channel_validation.py - unittest/llmapi/apps/test_tool_parsers.py @@ -57,6 +76,9 @@ l0_cpu: - unittest/models/test_quant_config_utils.py - unittest/others - unittest/quantization/test_mode.py + - unittest/scaffolding - unittest/scripts - unittest/tools + - unittest/usage - unittest/utils/test_logger.py + - unittest/visual_gen/test_output.py diff --git a/tests/integration/test_lists/test-db/l0_dgx_b200.yml b/tests/integration/test_lists/test-db/l0_dgx_b200.yml index 92267dafe500..2445af72e4e3 100644 --- a/tests/integration/test_lists/test-db/l0_dgx_b200.yml +++ b/tests/integration/test_lists/test-db/l0_dgx_b200.yml @@ -219,7 +219,6 @@ l0_dgx_b200: - unittest/_torch/visual_gen/multi_gpu/test_ulysses_async.py - unittest/_torch/visual_gen/multi_gpu/test_ulysses_sage_attention.py - unittest/_torch/visual_gen/multi_gpu/test_visual_gen_mapping.py - - unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py - unittest/_torch/visual_gen/multi_gpu/test_wan_async_ulysses.py - unittest/_torch/visual_gen/multi_gpu/test_wan_pipeline_parallel.py - unittest/_torch/visual_gen/multi_gpu/test_wan_tp.py diff --git a/tests/integration/test_lists/test-db/l0_dgx_b300.yml b/tests/integration/test_lists/test-db/l0_dgx_b300.yml index 736319d8409f..03e7d9f29ed8 100644 --- a/tests/integration/test_lists/test-db/l0_dgx_b300.yml +++ b/tests/integration/test_lists/test-db/l0_dgx_b300.yml @@ -93,7 +93,6 @@ l0_dgx_b300: backend: pytorch tests: # ------------- MoE components tests (multi-GPU) --------------- - - unittest/_torch/modules/test_moe_host_sharer.py # ------------- MoE: multi-GPU module tests (DEP parallel, per backend per quant) --------------- # CUTLASS backend: FP8, NVFP4, W4A8_MXFP4_MXFP8, W8A16 - unittest/_torch/modules/moe/test_moe_module.py::test_configurable_moe_multi_gpu[parallel=DEP-comm=DEEPEP-e60_k4_h2048_i1408-seq=8-dtype=torch.bfloat16-backend=CUTLASS-quant=FP8-routing=Renormalize] diff --git a/tests/integration/test_lists/test-db/l0_gb300_multi_gpus.yml b/tests/integration/test_lists/test-db/l0_gb300_multi_gpus.yml index 273aa9bc72ad..efe49cc75d67 100644 --- a/tests/integration/test_lists/test-db/l0_gb300_multi_gpus.yml +++ b/tests/integration/test_lists/test-db/l0_gb300_multi_gpus.yml @@ -32,7 +32,6 @@ l0_gb300_multi_gpus: # ------------- MoE components tests --------------- - unittest/_torch/modules/test_moe_load_balancer.py - unittest/_torch/modules/test_moe_routing.py - - unittest/_torch/modules/test_moe_host_sharer.py - unittest/_torch/modeling -k "modeling_llama" - unittest/_torch/modeling -k "modeling_mixtral" - unittest/_torch/modeling -k "modeling_gpt_oss" diff --git a/tests/integration/test_lists/test-db/l0_h100.yml b/tests/integration/test_lists/test-db/l0_h100.yml index fb57eb7c1a8f..9fc436b33c02 100644 --- a/tests/integration/test_lists/test-db/l0_h100.yml +++ b/tests/integration/test_lists/test-db/l0_h100.yml @@ -35,7 +35,6 @@ l0_h100: # ------------- MoE components tests --------------- - unittest/_torch/modules/test_moe_load_balancer.py - unittest/_torch/modules/test_moe_routing.py - - unittest/_torch/modules/test_moe_host_sharer.py - unittest/_torch/modules/fused_moe/test_deepgemm_fused_gather_finalize.py - unittest/_torch/modules/fused_moe/test_deepgemm_fused_expand_quant.py # ------------- MoE: test_moe_backend (by backend) --------------- @@ -103,11 +102,6 @@ l0_h100: - unittest/others/test_kv_cache_transceiver.py::test_kv_cache_transceiver_single_process[PYTHON-mla-ctx_fp16_gen_fp16] - unittest/llmapi/test_llm_telemetry.py - unittest/scaffolding - - unittest/usage/test_collectors.py - - unittest/usage/test_config.py - - unittest/usage/test_opt_out.py - - unittest/usage/test_reporter.py - - unittest/usage/test_schema.py - unittest/usage/test_transport.py - unittest/usage/test_e2e_capture.py - accuracy/test_llm_api_pytorch.py::TestGemma3_1BInstruct::test_auto_dtype diff --git a/tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml b/tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml index f7372a8c4224..bacee43d87ec 100644 --- a/tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml +++ b/tests/integration/test_lists/test-db/l0_rtx_pro_6000.yml @@ -15,7 +15,6 @@ l0_rtx_pro_6000: tests: # ------------- PyTorch tests --------------- - unittest/_torch/modeling -k "modeling_out_of_tree" - - unittest/_torch/modules/moe/test_cute_dsl_b12x_moe_backend.py # - unittest/_torch/modeling -k "modeling_qwen" # https://nvbugs/5234573 - unittest/_torch/attention/test_attention_mla.py # SM120 W4A16 / W4A8 mixed-dtype GEMM coverage (paired with FinegrainedMixedDtypeGemm diff --git a/tests/unittest/_torch/attention/sparse/dsa/test_dsa_indexer.py b/tests/unittest/_torch/attention/sparse/dsa/test_dsa_indexer.py index 66578c3d7707..b322004baef1 100644 --- a/tests/unittest/_torch/attention/sparse/dsa/test_dsa_indexer.py +++ b/tests/unittest/_torch/attention/sparse/dsa/test_dsa_indexer.py @@ -2136,6 +2136,7 @@ def test_compute_cu_seqlen_bounds_with_cache_compressed_kv(): ], ids=["small_single", "small_multi", "large_chunked", "mixed", "exact_size", "non_zero_start"], ) +@pytest.mark.cpu_only def test_split_prefill_chunks(max_chunk_size, seq_lens, start_idx, expected_specs): """ Test split_prefill_chunks covering: @@ -3278,6 +3279,7 @@ def test_indexer_topk_multi_request_with_different_cache(enable_indexer_skip): ) +@pytest.mark.cpu_only class TestPrepareRestoreAttnMetadataForDraftReplay: """Tests for prepare_attn_metadata_for_draft_replay and restore_attn_metadata_after_draft_replay.""" diff --git a/tests/unittest/_torch/attention/test_attention_mla.py b/tests/unittest/_torch/attention/test_attention_mla.py index c8e0690593e0..5c1d66b903ac 100644 --- a/tests/unittest/_torch/attention/test_attention_mla.py +++ b/tests/unittest/_torch/attention/test_attention_mla.py @@ -362,10 +362,12 @@ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: num_generation_steps = [10] # tokens_per_block = 32 for blackwell -tokens_per_block = 32 if torch.cuda.get_device_capability() >= (10, 0) else 64 +cuda_capability = torch.cuda.get_device_capability() if torch.cuda.device_count( +) > 0 else (0, 0) +tokens_per_block = 32 if cuda_capability >= (10, 0) else 64 kv_cache_dtype_list = [torch.bfloat16] -if torch.cuda.get_device_capability() in [(8, 9), (9, 0), (10, 0), (12, 0)]: +if cuda_capability in [(8, 9), (9, 0), (10, 0), (12, 0)]: kv_cache_dtype_list.append(torch.float8_e4m3fn) scenarios = [ Scenario(kv_cache_dtype=kv_cache_dtype, @@ -388,6 +390,7 @@ def repeat_kv(hidden_states: torch.Tensor, n_rep: int) -> torch.Tensor: (100, "chunked_prefill"), ], ) +@pytest.mark.cpu_only def test_mla_chunked_prefill_dispatch_by_sm(sm_version, expected_path, monkeypatch): import tensorrt_llm._torch.modules.mla as mla_module @@ -544,8 +547,7 @@ def test_attention_mla_flashinfer(scenario: Scenario, v2_kv_cache: bool): """Test FlashInfer MLA computation for both context and generation phases""" pytest.importorskip("flashinfer") - if (not torch.cuda.is_available() - or torch.cuda.get_device_capability() != (10, 0)): + if (not torch.cuda.is_available() or cuda_capability != (10, 0)): pytest.skip("FlashInfer MLA test only runs on SM100 (Blackwell)") num_heads = scenario.num_heads @@ -868,8 +870,8 @@ def yarn_get_mscale(scale=1, mscale=1): mapping=mapping, ) if backend_name == "TRTLLM": - gen_metadata_kwargs["enable_flash_mla"] = ( - torch.cuda.get_device_capability() == (9, 0)) + gen_metadata_kwargs["enable_flash_mla"] = (cuda_capability == ( + 9, 0)) attn_metadata = AttentionCls.Metadata(**gen_metadata_kwargs) attn_metadata.prepare() for layer_idx in range(num_layers): diff --git a/tests/unittest/_torch/attention/test_attention_op_sync.py b/tests/unittest/_torch/attention/test_attention_op_sync.py index cfd56978b848..d1fe94562f55 100644 --- a/tests/unittest/_torch/attention/test_attention_op_sync.py +++ b/tests/unittest/_torch/attention/test_attention_op_sync.py @@ -42,6 +42,8 @@ import typing from dataclasses import fields +import pytest + from tensorrt_llm._torch.attention_backend.fmha.fallback import ( _THOP_EXCLUDED_FIELDS, _THOP_LITERALS, @@ -50,6 +52,9 @@ from tensorrt_llm._torch.attention_backend.interface import AttentionForwardArgs from tensorrt_llm._torch.attention_backend.trtllm import TrtllmAttention, TrtllmAttentionMetadata +pytestmark = pytest.mark.cpu_only + + # Roots used as the LHS of attribute chains at the call site. Match the # names inside ``FallbackFmha.forward``. _SOURCE_CLASSES = { diff --git a/tests/unittest/_torch/executor/test_dual_pool_kv_cache.py b/tests/unittest/_torch/executor/test_dual_pool_kv_cache.py index 06e0231a1a0b..5c86f87d8df1 100644 --- a/tests/unittest/_torch/executor/test_dual_pool_kv_cache.py +++ b/tests/unittest/_torch/executor/test_dual_pool_kv_cache.py @@ -35,6 +35,9 @@ from tensorrt_llm.llmapi.llm_args import CapacitySchedulerPolicy, KvCacheConfig, TorchLlmArgs from tensorrt_llm.mapping import Mapping +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- diff --git a/tests/unittest/_torch/executor/test_kv_cache_budget_split.py b/tests/unittest/_torch/executor/test_kv_cache_budget_split.py index 109460a5a57b..1cf44999e676 100644 --- a/tests/unittest/_torch/executor/test_kv_cache_budget_split.py +++ b/tests/unittest/_torch/executor/test_kv_cache_budget_split.py @@ -21,6 +21,9 @@ from tensorrt_llm._torch.pyexecutor._util import CacheCost, KvCacheCreator from tensorrt_llm.llmapi.llm_args import KvCacheConfig +pytestmark = pytest.mark.cpu_only + + GB = 1 << 30 diff --git a/tests/unittest/_torch/executor/test_kv_cache_estimation.py b/tests/unittest/_torch/executor/test_kv_cache_estimation.py index 5c75c9186bd7..dacc6ac64efe 100644 --- a/tests/unittest/_torch/executor/test_kv_cache_estimation.py +++ b/tests/unittest/_torch/executor/test_kv_cache_estimation.py @@ -21,6 +21,9 @@ from tensorrt_llm._torch.pyexecutor.kv_cache_manager_v2 import KVCacheManagerV2 from tensorrt_llm.llmapi.llm_args import KvCacheConfig, MultimodalConfig +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- diff --git a/tests/unittest/_torch/executor/test_kv_cache_v2_multimodal_runs.py b/tests/unittest/_torch/executor/test_kv_cache_v2_multimodal_runs.py index 6bb5c46d2b31..6995d556398c 100644 --- a/tests/unittest/_torch/executor/test_kv_cache_v2_multimodal_runs.py +++ b/tests/unittest/_torch/executor/test_kv_cache_v2_multimodal_runs.py @@ -11,6 +11,9 @@ gen_multimodal_cache_key_tokens, ) +pytestmark = pytest.mark.cpu_only + + _HASH_INTS = (1, 2, 3, 4, 5, 6, 7, 8) _OTHER_HASH_INTS = (8, 7, 6, 5, 4, 3, 2, 1) diff --git a/tests/unittest/_torch/executor/test_kv_cache_v2_scheduler.py b/tests/unittest/_torch/executor/test_kv_cache_v2_scheduler.py index 0a7c67e9e702..22dc0638d01c 100644 --- a/tests/unittest/_torch/executor/test_kv_cache_v2_scheduler.py +++ b/tests/unittest/_torch/executor/test_kv_cache_v2_scheduler.py @@ -25,6 +25,9 @@ from tensorrt_llm._torch.pyexecutor.llm_request import LlmRequestState from tensorrt_llm.llmapi.llm_args import CapacitySchedulerPolicy, ContextChunkingPolicy +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # State value constants # --------------------------------------------------------------------------- diff --git a/tests/unittest/_torch/executor/test_kv_pool_rebalance.py b/tests/unittest/_torch/executor/test_kv_pool_rebalance.py index ed0cc5636e7b..13ea630b3a9a 100644 --- a/tests/unittest/_torch/executor/test_kv_pool_rebalance.py +++ b/tests/unittest/_torch/executor/test_kv_pool_rebalance.py @@ -34,6 +34,9 @@ from tensorrt_llm._torch.pyexecutor.py_executor import PyExecutor from tensorrt_llm.runtime.kv_cache_manager_v2 import OutOfPagesError +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # # Helpers # --------------------------------------------------------------------------- # diff --git a/tests/unittest/_torch/executor/test_kvcache_aware_router.py b/tests/unittest/_torch/executor/test_kvcache_aware_router.py index 900151c7ac1d..1f173ed0da83 100644 --- a/tests/unittest/_torch/executor/test_kvcache_aware_router.py +++ b/tests/unittest/_torch/executor/test_kvcache_aware_router.py @@ -19,12 +19,17 @@ from unittest.mock import MagicMock, Mock +import pytest + from tensorrt_llm._torch.pyexecutor.scheduler.adp_router import ( ADPRouter, KVCacheAwareADPRouter, RankState, ) +pytestmark = pytest.mark.cpu_only + + # ---- Helpers ---- diff --git a/tests/unittest/_torch/modules/dwdp/test_dwdp_fixup_moe_backends.py b/tests/unittest/_torch/modules/dwdp/test_dwdp_fixup_moe_backends.py index d5392e6890c8..a845ab192455 100644 --- a/tests/unittest/_torch/modules/dwdp/test_dwdp_fixup_moe_backends.py +++ b/tests/unittest/_torch/modules/dwdp/test_dwdp_fixup_moe_backends.py @@ -31,6 +31,7 @@ import unittest from unittest.mock import MagicMock +import pytest import torch import torch.nn as nn @@ -40,6 +41,8 @@ _scatter_shards_to_full, ) +pytestmark = pytest.mark.cpu_only + def _make_mock_comm(all_shards): """Create a mock MPI comm whose allgather() returns ``all_shards``. diff --git a/tests/unittest/_torch/modules/moe/test_cute_dsl_b12x_moe_backend.py b/tests/unittest/_torch/modules/moe/test_cute_dsl_b12x_moe_backend.py index 1feac564b176..b98bb563a947 100644 --- a/tests/unittest/_torch/modules/moe/test_cute_dsl_b12x_moe_backend.py +++ b/tests/unittest/_torch/modules/moe/test_cute_dsl_b12x_moe_backend.py @@ -35,6 +35,9 @@ from tensorrt_llm._torch.modules.fused_moe.fused_moe_cutlass import CutlassFusedMoE from tensorrt_llm.models.modeling_utils import QuantAlgo, QuantConfig +pytestmark = pytest.mark.cpu_only + + _FUSED_MOE_MODULE = "tensorrt_llm._torch.modules.fused_moe.fused_moe_cute_dsl_b12x" diff --git a/tests/unittest/_torch/modules/test_moe_host_sharer.py b/tests/unittest/_torch/modules/test_moe_host_sharer.py index 0ed0ee609bb8..a725572373e2 100644 --- a/tests/unittest/_torch/modules/test_moe_host_sharer.py +++ b/tests/unittest/_torch/modules/test_moe_host_sharer.py @@ -1,12 +1,15 @@ import unittest import numpy as np +import pytest import torch from mpi4py import MPI from tensorrt_llm._torch.modules.fused_moe.moe_load_balancer import \ HostMoeTensorSharer +pytestmark = pytest.mark.cpu_only + class TestHostMoeTensorSharer(unittest.TestCase): """Tests for HostMoeTensorSharer functionality""" diff --git a/tests/unittest/_torch/visual_gen/multi_gpu/test_attn2d_attention.py b/tests/unittest/_torch/visual_gen/multi_gpu/test_attn2d_attention.py index dfb4061af984..dcdc4a023a45 100644 --- a/tests/unittest/_torch/visual_gen/multi_gpu/test_attn2d_attention.py +++ b/tests/unittest/_torch/visual_gen/multi_gpu/test_attn2d_attention.py @@ -831,6 +831,7 @@ def support_fused_qkv(cls): assert "head_dim" in str(e) or "num_heads" in str(e), f"Unexpected RuntimeError: {e}" +@pytest.mark.cpu_only class TestAttn2DAttentionInitGuards: """Attention2DAttention.__init__ rejects invalid inner backends.""" diff --git a/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_mapping.py b/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_mapping.py index c73762ae3c7a..df49725f1395 100644 --- a/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_mapping.py +++ b/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_mapping.py @@ -77,6 +77,7 @@ def _run_multi_gpu(world_size, test_fn): # ============================================================================= +@pytest.mark.cpu_only class TestConstruction: def test_single_gpu_defaults(self): vgm = VisualGenMapping(world_size=1, rank=0) @@ -191,6 +192,7 @@ def test_ring_and_attn2d_raises(self): ) +@pytest.mark.cpu_only class TestFlattenCfgRanks: """flatten_cfg_ranks is pure layout arithmetic: one rank list per combined coordinate of every non-(cfg, ulysses) mesh dim, cfg outermost / ulysses @@ -217,6 +219,7 @@ def test_cfg2_attn2d_2x2_u1(self): assert vgm.flatten_cfg_ranks() == [[0, 4], [1, 5], [2, 6], [3, 7]] +@pytest.mark.cpu_only class TestSingleGPURanksAndGroups: def test_ranks_are_zero(self): vgm = VisualGenMapping(world_size=1, rank=0) @@ -248,6 +251,7 @@ def test_attn2d_row_col_groups_none_without_attn2d(self): assert vgm.attn2d_col_group is None +@pytest.mark.cpu_only class TestToLlmMapping: def test_single_gpu(self): vgm = VisualGenMapping(world_size=1, rank=0) diff --git a/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py b/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py index fddadb291d60..2944922b0b7f 100644 --- a/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py +++ b/tests/unittest/_torch/visual_gen/multi_gpu/test_visual_gen_multinode.py @@ -15,6 +15,9 @@ from tensorrt_llm.visual_gen.args import VisualGenArgs from tensorrt_llm.visual_gen.visual_gen import DiffusionRemoteClient, _detect_external_launch +pytestmark = pytest.mark.cpu_only + + # ============================================================================= # _detect_external_launch() # ============================================================================= diff --git a/tests/unittest/_torch/visual_gen/sparse_attention/test_skip_softmax.py b/tests/unittest/_torch/visual_gen/sparse_attention/test_skip_softmax.py index 993ab9af0c5a..f4b757d49ba2 100644 --- a/tests/unittest/_torch/visual_gen/sparse_attention/test_skip_softmax.py +++ b/tests/unittest/_torch/visual_gen/sparse_attention/test_skip_softmax.py @@ -18,6 +18,8 @@ from tensorrt_llm.visual_gen.args import AttentionConfig, VisualGenArgs from tensorrt_llm.visual_gen.sparse_attention import SkipSoftmaxAttentionConfig +pytestmark = pytest.mark.cpu_only + def _ckpt_sparse_attention_config( *, diff --git a/tests/unittest/_torch/visual_gen/test_attention_integration.py b/tests/unittest/_torch/visual_gen/test_attention_integration.py index a8babe53afb8..a372db9641f2 100644 --- a/tests/unittest/_torch/visual_gen/test_attention_integration.py +++ b/tests/unittest/_torch/visual_gen/test_attention_integration.py @@ -276,6 +276,7 @@ def generate_rope_embeddings( # ============================================================================ +@pytest.mark.cpu_only class TestSeparateQkvSequenceParallelGuard: def test_ring_with_separate_qkv_raises(self): vgm = VisualGenMapping(world_size=2, rank=0, ring_size=2) diff --git a/tests/unittest/_torch/visual_gen/test_cache_dit.py b/tests/unittest/_torch/visual_gen/test_cache_dit.py index 0301bb76b28a..e836cad6f995 100644 --- a/tests/unittest/_torch/visual_gen/test_cache_dit.py +++ b/tests/unittest/_torch/visual_gen/test_cache_dit.py @@ -241,6 +241,7 @@ def __init__(self, boundary_ratio: float | None, timestep_values: list[float]): self.transformer = torch.nn.Linear(1, 1) +@pytest.mark.cpu_only class TestSplitWan22InferenceSteps: def test_counts_high_noise_at_default_boundary(self): pipeline = _MiniWan22Pipeline( diff --git a/tests/unittest/_torch/visual_gen/test_flux_infer.py b/tests/unittest/_torch/visual_gen/test_flux_infer.py index 87dd0f6a3d99..a50435a095ea 100644 --- a/tests/unittest/_torch/visual_gen/test_flux_infer.py +++ b/tests/unittest/_torch/visual_gen/test_flux_infer.py @@ -10,6 +10,8 @@ from tensorrt_llm._torch.visual_gen.models.flux import Flux2Pipeline, FluxPipeline +pytestmark = pytest.mark.cpu_only + @pytest.mark.parametrize("pipeline_cls", [FluxPipeline, Flux2Pipeline]) def test_infer_forwards_num_images_per_prompt( diff --git a/tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py b/tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py index 282fc81cf8c0..d0bb3fe43a69 100644 --- a/tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py +++ b/tests/unittest/_torch/visual_gen/test_ltx2_pipeline.py @@ -478,6 +478,7 @@ def test_attention_backend_comparison(self, ltx2_bf16_checkpoint_exists): class TestLTX2BatchSupport: """Test batch support logic without loading the full pipeline.""" + @pytest.mark.cpu_only def test_video_pixel_shape_batch_propagation(self): """VideoPixelShape(batch=N) propagates through VideoLatentShape.""" from tensorrt_llm._torch.visual_gen.models.ltx2.ltx2_core.types import ( @@ -494,6 +495,7 @@ def test_video_pixel_shape_batch_propagation(self): torch_shape = video_shape.to_torch_shape() assert torch_shape[0] == batch_size + @pytest.mark.cpu_only def test_prompt_normalization(self): """forward() normalizes str prompt to List[str] and computes batch_size.""" # Simulate the normalization logic from forward() @@ -507,6 +509,7 @@ def test_prompt_normalization(self): prompt = [prompt] assert len(prompt) == expected_batch + @pytest.mark.cpu_only def test_negative_prompt_expansion(self): """Negative prompt is expanded to match batch_size.""" # Simulate the negative prompt expansion logic from forward() @@ -548,6 +551,7 @@ def test_latent_shape_matches_batch(self): class TestTwoStageLoRAHelpers: """Test LoRA delta loading and application without checkpoints.""" + @pytest.mark.cpu_only def test_bf16_weight_snapshot_gate_uses_cuda_free_memory(self, monkeypatch): from tensorrt_llm._torch.visual_gen.models.ltx2.pipeline_ltx2_two_stages import ( _should_save_bf16_weights, @@ -570,6 +574,7 @@ def _raise_mem_query_error(device=None): monkeypatch.setattr(torch.cuda, "is_available", lambda: False) assert not _should_save_bf16_weights() + @pytest.mark.cpu_only def test_bf16_weight_snapshot_saved_when_requested(self): from tensorrt_llm._torch.visual_gen.models.ltx2.pipeline_ltx2_two_stages import ( _apply_lora_deltas, @@ -808,6 +813,7 @@ def test_lora_strength_scaling(self): os.unlink(tmp_path) +@pytest.mark.cpu_only class TestTwoStagePipelineVariantResolution: """Test that LTX2Pipeline.resolve_variant selects the correct class.""" @@ -875,6 +881,7 @@ def test_resolve_variant_requires_both_paths(self): assert result is LTX2Pipeline +@pytest.mark.cpu_only class TestLTX2ForceOneStageEnv: """Test force-one-stage env-var behavior during LTX2 variant selection.""" @@ -1709,6 +1716,7 @@ def test_two_stage_with_quantization(self, ltx2_two_stage_assets_exist, quant_al torch.cuda.empty_cache() +@pytest.mark.cpu_only class TestTwoStageCommonWarmupShapes: """Test LTX2TwoStagesPipeline.common_warmup_shapes property.""" diff --git a/tests/unittest/_torch/visual_gen/test_ltx2_transformer.py b/tests/unittest/_torch/visual_gen/test_ltx2_transformer.py index 2cceb839f9a0..226623d4207b 100644 --- a/tests/unittest/_torch/visual_gen/test_ltx2_transformer.py +++ b/tests/unittest/_torch/visual_gen/test_ltx2_transformer.py @@ -585,6 +585,7 @@ class TestLTX2QuantExcludeModuleRemapping(unittest.TestCase): pre-quantized FP8 checkpoints are properly excluded from quantization. """ + @pytest.mark.cpu_only def test_remap_qkv_fusion(self): """to_q/to_k/to_v should produce a qkv_proj entry.""" from tensorrt_llm._torch.visual_gen.models.ltx2.transformer_ltx2 import LTXModel @@ -597,6 +598,7 @@ def test_remap_qkv_fusion(self): remapped = LTXModel._remap_exclude_modules(exclude) self.assertIn("transformer_blocks.0.attn1.qkv_proj", remapped) + @pytest.mark.cpu_only def test_remap_ff(self): """ff.net.0.proj / ff.net.2 should produce up_proj / down_proj.""" from tensorrt_llm._torch.visual_gen.models.ltx2.transformer_ltx2 import LTXModel @@ -609,6 +611,7 @@ def test_remap_ff(self): self.assertIn("transformer_blocks.0.ff.up_proj", remapped) self.assertIn("transformer_blocks.0.ff.down_proj", remapped) + @pytest.mark.cpu_only def test_remap_audio_ff(self): """audio_ff.net.* should produce audio_ff.up_proj / down_proj.""" from tensorrt_llm._torch.visual_gen.models.ltx2.transformer_ltx2 import LTXModel @@ -621,6 +624,7 @@ def test_remap_audio_ff(self): self.assertIn("transformer_blocks.0.audio_ff.up_proj", remapped) self.assertIn("transformer_blocks.0.audio_ff.down_proj", remapped) + @pytest.mark.cpu_only def test_remap_preserves_originals(self): """Original entries (to_out.0, to_q for cross-attn) must survive.""" from tensorrt_llm._torch.visual_gen.models.ltx2.transformer_ltx2 import LTXModel diff --git a/tests/unittest/_torch/visual_gen/test_qwen_image_pipeline_config.py b/tests/unittest/_torch/visual_gen/test_qwen_image_pipeline_config.py index db0f9a6db398..71ca19766751 100644 --- a/tests/unittest/_torch/visual_gen/test_qwen_image_pipeline_config.py +++ b/tests/unittest/_torch/visual_gen/test_qwen_image_pipeline_config.py @@ -52,6 +52,8 @@ VisualGenArgs, ) +pytestmark = pytest.mark.cpu_only + def _write_minimal_qwen_checkpoint(tmp_path: Path) -> Path: """Create the minimum diffusers layout needed by PipelineLoader config code.""" diff --git a/tests/unittest/_torch/visual_gen/test_teacache.py b/tests/unittest/_torch/visual_gen/test_teacache.py index 2b6aa73519ad..5f8f3386105d 100644 --- a/tests/unittest/_torch/visual_gen/test_teacache.py +++ b/tests/unittest/_torch/visual_gen/test_teacache.py @@ -30,6 +30,8 @@ from tensorrt_llm._torch.visual_gen.pipeline import BasePipeline from tensorrt_llm.visual_gen.args import TeaCacheConfig +pytestmark = pytest.mark.cpu_only + class _PipelineConfigShim: """Minimal pipeline_config shim that delegates all reads back to a DiffusionModelConfig. diff --git a/tests/unittest/_torch/visual_gen/test_tensor_payload.py b/tests/unittest/_torch/visual_gen/test_tensor_payload.py index 4ad482b886fd..6338f58989d0 100644 --- a/tests/unittest/_torch/visual_gen/test_tensor_payload.py +++ b/tests/unittest/_torch/visual_gen/test_tensor_payload.py @@ -22,6 +22,8 @@ ) from tensorrt_llm.visual_gen.output import VisualGenOutput +pytestmark = pytest.mark.cpu_only + def _safetensors_load(data: bytes) -> dict: from safetensors.torch import load as load_safetensors diff --git a/tests/unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py b/tests/unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py index 69d17ea523ef..eb343951e3a3 100644 --- a/tests/unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py +++ b/tests/unittest/_torch/visual_gen/test_trtllm_serve_endpoints.py @@ -32,6 +32,9 @@ from tensorrt_llm.serve.visual_gen_utils import VIDEO_STORE from tensorrt_llm.visual_gen.output import VisualGenMetrics, VisualGenOutput +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # Helpers # --------------------------------------------------------------------------- diff --git a/tests/unittest/_torch/visual_gen/test_utils.py b/tests/unittest/_torch/visual_gen/test_utils.py index 384196e43e59..09705a5602c7 100644 --- a/tests/unittest/_torch/visual_gen/test_utils.py +++ b/tests/unittest/_torch/visual_gen/test_utils.py @@ -43,6 +43,7 @@ def _cleanup_mpi_env(): # ============================================================================= +@pytest.mark.cpu_only class TestSequenceSharderInactive: def test_shard_gather_identity_when_size_one(self): s = SequenceSharder(size=1, rank=0, group=None) @@ -63,6 +64,7 @@ def test_shard_rope_passthrough_when_inactive(self): assert s.shard_rope(rope, seq_len=4, seq_dim=1) is rope +@pytest.mark.cpu_only class TestSequenceSharderShardSlices: """Active sharder: block slice math without ``gather``.""" @@ -86,6 +88,7 @@ def test_not_divisible_raises(self): s.shard(x, dim=1) +@pytest.mark.cpu_only class TestSequenceSharderShardRope: def test_shard_rope_bsd_layout(self): s = SequenceSharder(size=2, rank=1, group=None) @@ -112,6 +115,7 @@ def test_shard_rope_explicit_seq_dim_handles_square_layout(self): assert oc.shape == (2, 4, S) +@pytest.mark.cpu_only class TestSequenceSharderFromVgm: def test_from_vgm_none(self): s = SequenceSharder.from_vgm(None) @@ -177,6 +181,7 @@ def _run_dist(world_size: int, entry: Callable[[int, int, int], None]): mp.spawn(entry, args=(world_size, port), nprocs=world_size, join=True) +@pytest.mark.cpu_only class TestSequenceSharderDistributed: def test_shard_gather_pad_unpad_four_ranks(self): _run_dist(4, _spawn_entry_combined) diff --git a/tests/unittest/_torch/visual_gen/test_vanilla_key_padding_mask.py b/tests/unittest/_torch/visual_gen/test_vanilla_key_padding_mask.py index 723126d97475..2cdf9919069b 100644 --- a/tests/unittest/_torch/visual_gen/test_vanilla_key_padding_mask.py +++ b/tests/unittest/_torch/visual_gen/test_vanilla_key_padding_mask.py @@ -13,6 +13,8 @@ from tensorrt_llm._torch.visual_gen.attention_backend import VanillaAttention +pytestmark = pytest.mark.cpu_only + def test_padded_kv_with_mask_matches_unpadded(): torch.manual_seed(42) diff --git a/tests/unittest/_torch/visual_gen/test_visual_gen_args.py b/tests/unittest/_torch/visual_gen/test_visual_gen_args.py index 13532eaa3458..49fffdfd9ff2 100644 --- a/tests/unittest/_torch/visual_gen/test_visual_gen_args.py +++ b/tests/unittest/_torch/visual_gen/test_visual_gen_args.py @@ -22,6 +22,8 @@ VisualGenArgs, ) +pytestmark = pytest.mark.cpu_only + class TestVisualGenArgsStrictValidation: """extra='forbid' rejects unknown fields at every nesting level.""" diff --git a/tests/unittest/_torch/visual_gen/test_visual_gen_params.py b/tests/unittest/_torch/visual_gen/test_visual_gen_params.py index cfa43240458b..9d1f95d83d71 100644 --- a/tests/unittest/_torch/visual_gen/test_visual_gen_params.py +++ b/tests/unittest/_torch/visual_gen/test_visual_gen_params.py @@ -18,6 +18,8 @@ import pytest +pytestmark = pytest.mark.cpu_only + def _wan_mock(is_wan22_14b=False, is_wan22_5b=False, name_or_path="", num_heads=12): """Create a mock with attributes needed by WanPipeline/WanI2V properties.""" diff --git a/tests/unittest/_torch/visual_gen/test_visual_gen_utils.py b/tests/unittest/_torch/visual_gen/test_visual_gen_utils.py index d6bf720b12f2..ea2a96e6f12a 100644 --- a/tests/unittest/_torch/visual_gen/test_visual_gen_utils.py +++ b/tests/unittest/_torch/visual_gen/test_visual_gen_utils.py @@ -29,6 +29,8 @@ ) from tensorrt_llm.visual_gen import VisualGenParams +pytestmark = pytest.mark.cpu_only + class _StubExtraParamSpec: def __init__(self, default: Any = None) -> None: diff --git a/tests/unittest/_torch/weight_sharing/test_gms_source_identity_gate.py b/tests/unittest/_torch/weight_sharing/test_gms_source_identity_gate.py index 99f21b4bd9b9..e67260daa657 100644 --- a/tests/unittest/_torch/weight_sharing/test_gms_source_identity_gate.py +++ b/tests/unittest/_torch/weight_sharing/test_gms_source_identity_gate.py @@ -29,6 +29,8 @@ from tensorrt_llm._torch.weight_sharing import SourceIdentityMismatchError from tensorrt_llm.llmapi.llm_args import LoadFormat +pytestmark = pytest.mark.cpu_only + class _FakeCheckpointLoader: """Minimal checkpoint-loader stub exposing `checkpoint_format`.""" diff --git a/tests/unittest/_torch/weight_sharing/test_mx_source_identity_gate.py b/tests/unittest/_torch/weight_sharing/test_mx_source_identity_gate.py index e2658ca86d21..a5cf9c87c717 100644 --- a/tests/unittest/_torch/weight_sharing/test_mx_source_identity_gate.py +++ b/tests/unittest/_torch/weight_sharing/test_mx_source_identity_gate.py @@ -21,6 +21,7 @@ from types import SimpleNamespace +import pytest from _source_identity_fakes import FakeMapping from _source_identity_fakes import make_identity as _identity @@ -29,6 +30,8 @@ _build_mx_source_metadata, ) +pytestmark = pytest.mark.cpu_only + def _new_loader(local_identity): """Construct a loader while bypassing the heavy base initializer.""" diff --git a/tests/unittest/_torch/weight_sharing/test_source_identity.py b/tests/unittest/_torch/weight_sharing/test_source_identity.py index 6d574f351a61..da3671d7397a 100644 --- a/tests/unittest/_torch/weight_sharing/test_source_identity.py +++ b/tests/unittest/_torch/weight_sharing/test_source_identity.py @@ -41,6 +41,8 @@ check_weight_sharing_compatibility, ) +pytestmark = pytest.mark.cpu_only + def test_identical_configs_match(): a = identity_from(FakeModelConfig()) diff --git a/tests/unittest/api_stability/test_llm_api.py b/tests/unittest/api_stability/test_llm_api.py index 259eab8b62cc..e6b59903e80a 100644 --- a/tests/unittest/api_stability/test_llm_api.py +++ b/tests/unittest/api_stability/test_llm_api.py @@ -14,6 +14,8 @@ from tensorrt_llm.sampling_params import (BatchedLogitsProcessor, LogitsProcessor, SamplingParams) +pytestmark = pytest.mark.cpu_only + class TestSamplingParams(ApiStabilityTestHarness): TEST_CLASS = SamplingParams diff --git a/tests/unittest/dynamo/test_imports.py b/tests/unittest/dynamo/test_imports.py index 8e29ff34127a..888da5ddb1fd 100644 --- a/tests/unittest/dynamo/test_imports.py +++ b/tests/unittest/dynamo/test_imports.py @@ -34,6 +34,9 @@ import pytest +pytestmark = pytest.mark.cpu_only + + # Each entry is (module_path, symbol_name). The test ID shows both. DYNAMO_IMPORTS = [ # -- top-level -- diff --git a/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_manager_v2.py b/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_manager_v2.py index 48c10a006fc0..7668e9fb8a5e 100755 --- a/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_manager_v2.py +++ b/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_manager_v2.py @@ -28,6 +28,8 @@ from statistics import median from typing import TYPE_CHECKING, Any, Iterator, NamedTuple, cast, get_type_hints +import pytest + if not TYPE_CHECKING and find_spec("kv_cache_manager_v2") is not None: from kv_cache_manager_v2 import ( DEFAULT_BEAM_INDEX, @@ -4302,6 +4304,7 @@ def test_shrink_touched_pool(self) -> None: allocator.release(s) +@pytest.mark.cpu_only class TestBlockKeyHashing(unittest.TestCase): """Verify Hasher.update produces bit-identical digests to the per-token reference (no GPU needed).""" diff --git a/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_salting.py b/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_salting.py index 4c2dc9615686..17c404d2139e 100644 --- a/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_salting.py +++ b/tests/unittest/kv_cache_manager_v2_tests/test_kv_cache_salting.py @@ -19,6 +19,11 @@ from importlib.util import find_spec from typing import TYPE_CHECKING, cast +import pytest + +pytestmark = pytest.mark.cpu_only + + if not TYPE_CHECKING and find_spec("kv_cache_manager_v2") is not None: from kv_cache_manager_v2 import TokenId, sequence_to_blockchain_keys from kv_cache_manager_v2._block_radix_tree import Block, BlockRadixTree, ReuseScope diff --git a/tests/unittest/scaffolding/test_bench.py b/tests/unittest/scaffolding/test_bench.py index 95dc29862fd5..8d51b7764ef6 100644 --- a/tests/unittest/scaffolding/test_bench.py +++ b/tests/unittest/scaffolding/test_bench.py @@ -17,6 +17,8 @@ ConcurrentStrategy, ConstantRateStrategy, LoadGenerationStrategy, PoissonRateStrategy, SynchronousStrategy, ThroughputStrategy) +pytestmark = pytest.mark.cpu_only + OUTPUT_STR = "Yes." diff --git a/tests/unittest/scaffolding/test_mcp_worker.py b/tests/unittest/scaffolding/test_mcp_worker.py index 7faabff62769..4716782c3118 100644 --- a/tests/unittest/scaffolding/test_mcp_worker.py +++ b/tests/unittest/scaffolding/test_mcp_worker.py @@ -26,6 +26,9 @@ ) from tensorrt_llm.scaffolding.worker import MCPWorker, Worker +pytestmark = pytest.mark.cpu_only + + # ============================================================ # MCP Server Definition (based on websearch.py) # ============================================================ diff --git a/tests/unittest/scaffolding/test_parallel_process.py b/tests/unittest/scaffolding/test_parallel_process.py index e277b9d97acd..c5088056aff5 100644 --- a/tests/unittest/scaffolding/test_parallel_process.py +++ b/tests/unittest/scaffolding/test_parallel_process.py @@ -4,9 +4,13 @@ from enum import Enum from typing import List +import pytest + from tensorrt_llm.scaffolding import (Controller, ParallelProcess, ScaffoldingLlm, Task, TaskStatus, Worker) +pytestmark = pytest.mark.cpu_only + class DummyTask(Task): diff --git a/tests/unittest/scaffolding/test_task_collection.py b/tests/unittest/scaffolding/test_task_collection.py index aa5fd483e807..6e35833a9565 100644 --- a/tests/unittest/scaffolding/test_task_collection.py +++ b/tests/unittest/scaffolding/test_task_collection.py @@ -2,6 +2,8 @@ from enum import Enum from typing import List +import pytest + from tensorrt_llm.scaffolding import (AssistantMessage, ChatTask, Controller, DropKVCacheTask, DropKVCacheWorkerTag, ParallelProcess, ScaffoldingLlm, Task, @@ -9,6 +11,8 @@ Worker, drop_kv_cache_scope, sub_request_node, with_task_collection) +pytestmark = pytest.mark.cpu_only + class DummyTask(Task): diff --git a/tests/unittest/usage/test_collectors.py b/tests/unittest/usage/test_collectors.py index a8b8d0038991..4053e631b40a 100644 --- a/tests/unittest/usage/test_collectors.py +++ b/tests/unittest/usage/test_collectors.py @@ -17,8 +17,13 @@ import json from unittest.mock import MagicMock, patch +import pytest + from tensorrt_llm.usage import schema, usage_lib +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # System info tests # --------------------------------------------------------------------------- diff --git a/tests/unittest/usage/test_config.py b/tests/unittest/usage/test_config.py index 9083aba69825..f3714ae728f9 100644 --- a/tests/unittest/usage/test_config.py +++ b/tests/unittest/usage/test_config.py @@ -16,6 +16,8 @@ import pytest +pytestmark = pytest.mark.cpu_only + class TestTelemetryConfigLocation: """Verify TelemetryConfig and UsageContext live in tensorrt_llm.usage.config.""" diff --git a/tests/unittest/usage/test_llmapi_config_capture.py b/tests/unittest/usage/test_llmapi_config_capture.py index 37bf95636560..dae4be48512b 100644 --- a/tests/unittest/usage/test_llmapi_config_capture.py +++ b/tests/unittest/usage/test_llmapi_config_capture.py @@ -18,6 +18,8 @@ from pathlib import Path from typing import Any, Literal, Optional, Union +import pytest + from tensorrt_llm.llmapi.llm_args import ( CudaGraphConfig, Field, @@ -29,6 +31,8 @@ from tensorrt_llm.usage import usage_lib from tensorrt_llm.usage.llmapi_config import collect_llm_api_config_payloads +pytestmark = pytest.mark.cpu_only + class _NestedConfig(StrictBaseModel): marked: int = Field(default=7, telemetry={"kind": "value"}) diff --git a/tests/unittest/usage/test_llmapi_config_telemetry_docs.py b/tests/unittest/usage/test_llmapi_config_telemetry_docs.py index 1d0dbf89918f..059fad4224ef 100644 --- a/tests/unittest/usage/test_llmapi_config_telemetry_docs.py +++ b/tests/unittest/usage/test_llmapi_config_telemetry_docs.py @@ -21,6 +21,10 @@ from pathlib import Path from types import ModuleType +import pytest + +pytestmark = pytest.mark.cpu_only + def _repo_root() -> Path: return Path(__file__).resolve().parents[3] diff --git a/tests/unittest/usage/test_opt_out.py b/tests/unittest/usage/test_opt_out.py index f88fe8126c5a..67b15b8f9c46 100644 --- a/tests/unittest/usage/test_opt_out.py +++ b/tests/unittest/usage/test_opt_out.py @@ -21,6 +21,9 @@ from tensorrt_llm.usage import usage_lib +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # Opt-out tests # --------------------------------------------------------------------------- diff --git a/tests/unittest/usage/test_reporter.py b/tests/unittest/usage/test_reporter.py index 130b08a54b68..53b74bf3dfce 100644 --- a/tests/unittest/usage/test_reporter.py +++ b/tests/unittest/usage/test_reporter.py @@ -20,10 +20,14 @@ from types import SimpleNamespace from unittest.mock import MagicMock, patch +import pytest from pydantic import BaseModel, Field from tensorrt_llm.usage import usage_lib +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # Console notification tests # --------------------------------------------------------------------------- diff --git a/tests/unittest/usage/test_schema.py b/tests/unittest/usage/test_schema.py index 1603b3550762..f22a9ccfe3db 100644 --- a/tests/unittest/usage/test_schema.py +++ b/tests/unittest/usage/test_schema.py @@ -21,6 +21,9 @@ from tensorrt_llm.usage import schema, schemas +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # Features JSON payload structure tests # --------------------------------------------------------------------------- diff --git a/tests/unittest/usage/test_transport.py b/tests/unittest/usage/test_transport.py index 878d9a18ae88..bdbce27b39f7 100644 --- a/tests/unittest/usage/test_transport.py +++ b/tests/unittest/usage/test_transport.py @@ -27,6 +27,7 @@ # --------------------------------------------------------------------------- +@pytest.mark.cpu_only class TestSendToGxt: def test_send_fail_silent(self): """_send_to_gxt never raises on network error.""" @@ -105,6 +106,7 @@ def test_send_to_gxt_catches_url_error(self, monkeypatch): # --------------------------------------------------------------------------- +@pytest.mark.cpu_only class TestHttpsHandler: def test_opener_has_https_handler(self): """Opener includes HTTPSHandler for HTTPS endpoints.""" @@ -133,6 +135,7 @@ def mock_build_opener(*handlers): # --------------------------------------------------------------------------- +@pytest.mark.cpu_only class TestMalformedServerUrl: """Verify _send_to_gxt handles malformed server URLs without crashing.""" diff --git a/tests/unittest/visual_gen/test_output.py b/tests/unittest/visual_gen/test_output.py index a4e0540d624e..73dbb32ce9dd 100644 --- a/tests/unittest/visual_gen/test_output.py +++ b/tests/unittest/visual_gen/test_output.py @@ -18,6 +18,9 @@ ) from tensorrt_llm.visual_gen import VisualGenMetrics, VisualGenOutput +pytestmark = pytest.mark.cpu_only + + # --------------------------------------------------------------------------- # VisualGenOutput shape and re-exports # ---------------------------------------------------------------------------