2828from helion ._testing import RefEagerTestDisabled
2929from helion ._testing import TestCase
3030from helion ._testing import import_path
31+ from helion ._testing import skipIfCpu
3132from helion ._testing import skipIfRocm
3233from helion .autotuner import DifferentialEvolutionSearch
3334from helion .autotuner import PatternSearch
@@ -317,6 +318,7 @@ def add(a, b):
317318 )
318319 torch .testing .assert_close (add (* args ), sum (args ))
319320
321+ @skipIfCpu ("fails on Triton CPU backend" )
320322 def test_run_finite_search (self ):
321323 @helion .kernel (
322324 configs = [
@@ -348,6 +350,7 @@ def add(a, b):
348350 torch .testing .assert_close (add (* args ), sum (args ))
349351
350352 @skipIfRocm ("too slow on rocm" )
353+ @skipIfCpu ("TritonError: Error from Triton code" )
351354 def test_random_search (self ):
352355 args = (
353356 torch .randn ([512 , 512 ], device = DEVICE ),
@@ -437,6 +440,7 @@ def diff_count(flat):
437440 ]
438441 self .assertEqual (sorted (pair_neighbors ), sorted (expected ))
439442
443+ @skipIfCpu ("fails on Triton CPU backend" )
440444 def test_accuracy_check_filters_bad_config_wrong_output (self ) -> None :
441445 bad_config = helion .Config (block_sizes = [1 ], num_warps = 8 )
442446 good_config = helion .Config (block_sizes = [1 ], num_warps = 4 )
@@ -510,6 +514,7 @@ def make_bad_config_produce_wrong_output(
510514 run_mode ("fork" , expect_error = False )
511515 run_mode ("spawn" , expect_error = True )
512516
517+ @skipIfCpu ("fails on Triton CPU backend" )
513518 def test_accuracy_check_filters_bad_config_wrong_arg_mutation (self ) -> None :
514519 bad_config = helion .Config (block_sizes = [1 ], num_warps = 8 )
515520 good_config = helion .Config (block_sizes = [1 ], num_warps = 4 )
@@ -592,6 +597,7 @@ def wrong_fn(*fn_args, **fn_kwargs):
592597 run_mode ("fork" , expect_error = False )
593598 run_mode ("spawn" , expect_error = True )
594599
600+ @skipIfCpu ("fails on Triton CPU backend" )
595601 def test_autotune_baseline_fn (self ) -> None :
596602 """Test that custom baseline function is used for accuracy checking."""
597603 config1 = helion .Config (block_sizes = [32 ], num_warps = 4 )
@@ -632,6 +638,7 @@ def add(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
632638 # Verify the result is correct
633639 torch .testing .assert_close (result , args [0 ] + args [1 ])
634640
641+ @skipIfCpu ("fails on Triton CPU backend" )
635642 def test_autotune_baseline_fn_filters_bad_config (self ) -> None :
636643 """Test that custom baseline function correctly filters incorrect configs."""
637644 bad_config = helion .Config (block_sizes = [1 ], num_warps = 8 )
@@ -730,6 +737,7 @@ def add(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
730737 ):
731738 add (* args )
732739
740+ @skipIfCpu ("fails on Triton CPU backend" )
733741 def test_max_generations (self ):
734742 """Autotuner max generation respects explicit kwargs then setting override."""
735743
@@ -773,6 +781,7 @@ def add(a, b):
773781 result = add (* args )
774782 torch .testing .assert_close (result , sum (args ))
775783
784+ @skipIfCpu ("fails on Triton CPU backend" )
776785 def test_autotune_effort_quick (self ):
777786 """Test that quick effort profile uses correct default values."""
778787 # Get the quick profile defaults
@@ -908,6 +917,7 @@ def add(a, b):
908917 return search .samples [0 ]
909918
910919 @skipIfRocm ("accuracy difference" )
920+ @skipIfCpu ("fails on Triton CPU backend" )
911921 def test_autotune_random_seed_from_env_var (self ) -> None :
912922 # same env var value -> same random sample
913923 with patch .dict (
@@ -932,6 +942,7 @@ def test_autotune_random_seed_from_env_var(self) -> None:
932942 self .assertNotEqual (first , second )
933943
934944 @skipIfRocm ("accuracy difference" )
945+ @skipIfCpu ("fails on Triton CPU backend" )
935946 def test_autotune_random_seed_from_settings (self ) -> None :
936947 # same autotune_random_seed setting -> same random sample
937948 first = self ._autotune_and_record (autotune_random_seed = 4242 )
0 commit comments