Skip to content

Commit 5bcff0e

Browse files
Add test for DESurrogateHybrid autotuner
Add test_de_surrogate_hybrid following the same pattern as test_differential_evolution_search. Uses small population (5) and few generations (3) for quick verification. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 7eb8801 commit 5bcff0e

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/test_autotuner.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@
3131
from helion._testing import import_path
3232
from helion._testing import skipIfCpu
3333
from helion._testing import skipIfRocm
34+
from helion.autotuner import DESurrogateHybrid
3435
from helion.autotuner import DifferentialEvolutionSearch
3536
from helion.autotuner import PatternSearch
3637
from helion.autotuner.base_search import BaseSearch
@@ -381,6 +382,21 @@ def test_differential_evolution_search(self):
381382
fn = bound_kernel.compile_config(best)
382383
torch.testing.assert_close(fn(*args), args[0] @ args[1], rtol=1e-2, atol=1e-1)
383384

385+
@skipIfRocm("too slow on rocm")
386+
@skip("too slow")
387+
def test_de_surrogate_hybrid(self):
388+
args = (
389+
torch.randn([512, 512], device=DEVICE),
390+
torch.randn([512, 512], device=DEVICE),
391+
)
392+
bound_kernel = examples_matmul.bind(args)
393+
random.seed(123)
394+
best = DESurrogateHybrid(
395+
bound_kernel, args, population_size=5, max_generations=3
396+
).autotune()
397+
fn = bound_kernel.compile_config(best)
398+
torch.testing.assert_close(fn(*args), args[0] @ args[1], rtol=1e-2, atol=1e-1)
399+
384400
@skip("too slow")
385401
def test_pattern_search(self):
386402
args = (

0 commit comments

Comments
 (0)