@@ -343,6 +343,41 @@ def _application(input, scale, output):
343343 assert torch .allclose (output , expected )
344344
345345
346+ @pytest .mark .parametrize ("device" , get_available_devices ())
347+ def test_aot_with_static_non_power_of_two_innermost_sizes (device ):
348+ def _arrangement (input , output ):
349+ return input .tile ((3 ,)), output .tile ((3 ,))
350+
351+ def _application (input , output ):
352+ output = input # noqa: F841
353+
354+ tensors = (
355+ Tensor (1 , dtype = ninetoothed .float32 ),
356+ Tensor (1 , dtype = ninetoothed .float32 ),
357+ )
358+
359+ kernel_name = (
360+ f"static_non_power_of_two_innermost_sizes{ _generate_kernel_name_suffix ()} "
361+ )
362+ output_dir = ninetoothed .generation .CACHE_DIR
363+
364+ kernel = ninetoothed .make (
365+ _arrangement ,
366+ _application ,
367+ tensors ,
368+ caller = device ,
369+ kernel_name = kernel_name ,
370+ output_dir = output_dir ,
371+ )
372+
373+ input = torch .randn ((3 ,), dtype = torch .float32 , device = device )
374+ output = torch .empty_like (input )
375+
376+ kernel (input , output )
377+
378+ assert torch .allclose (input , output )
379+
380+
346381def test_overflow_terms ():
347382 terms = ninetoothed .aot ._overflow_terms (("input" , "scale" ), (2 , 0 ))
348383
0 commit comments