Note: Please write your bug report in English to ensure it can be understood and addressed by the development team.
I am trying to write a simple pointwise kernel, but am running into issues even running the exp kernel example.
[0s] Starting autotuning process, this may take a while...
[0s] Starting PatternSearch with initial_population=100, copies=5, max_generations=20
Helion compiler triton codegen error for @helion.kernel(config=helion.Config(block_sizes=[1, 128], flatten_loops=[True], indexing=['block_ptr', 'pointer'], l2_groupings=[4], load_eviction_policies=['first'], loop_orders=[[1, 0]], num_stages=8, num_warps=32, pid_type='flat', range_flattens=[None], range_multi_buffers=[None], range_num_stages=[0], range_unroll_factors=[0], range_warp_specializes=[]), static_shapes=True)
Traceback (most recent call last):
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 1337, in run_node
result = lowering.codegen(self, n)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 755, in codegen
return self.api_func._codegen(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/language/memory_ops.py", line 277, in _
return strategy.codegen_load(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/indexing_strategy.py", line 203, in codegen_load
return PointerIndexingStrategy().codegen_load(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/indexing_strategy.py", line 153, in codegen_load
indexing = SubscriptIndexing.create(state, fake_tensor, subscript, extra_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/indexing_strategy.py", line 703, in create
expand = tile_strategy.expand_str(output_size, output_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/tile_dispatch.py", line 163, in expand_str
compacted_shapes = self._compact_shape(shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/tile_dispatch.py", line 133, in _compact_shape
compacted_shapes = strategy.compact_shape(compacted_shapes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/tile_strategy.py", line 525, in compact_shape
assert shape.block_ids[0] == self.block_ids[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 448, in compile_config
triton_code = self.to_triton_code(
^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 419, in to_triton_code
root = generate_ast(self.host_function, config, emit_repro_caller)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/generate_ast.py", line 463, in generate_ast
codegen.add_statement(codegen.visit(stmt))
^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/ast_extension.py", line 277, in visit
return visitor(node)
^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/generate_ast.py", line 290, in visit_For
codegen_call_with_graph(
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 1410, in codegen_call_with_graph
return GraphInterpreter(graph, cg).run(*new_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/torch/fx/interpreter.py", line 174, in run
self.env[node] = self.run_node(node)
^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 1380, in run_node
raise InductorLoweringError(
helion.exc.InductorLoweringError: Error in codegen for node load (<function load at 0x7d93a127f740>):
While processing:
File "/home/naren/Downloads/pointwise_silu_repro (2)/python/test.py", line 19, in helion_silu
out[tile] = torch.exp(x[tile])
^^^^^^^
While executing %load : [num_users=1] = call_function[target=helion.language.memory_ops.load](args = (%x, [%block_size_0, %block_size_1], None, None), kwargs = {})
Original traceback:
File "/home/naren/Downloads/pointwise_silu_repro (2)/python/test.py", line 19, in helion_silu
out[tile] = torch.exp(x[tile])
Use tlparse to see full graph. (https://github.com/pytorch/tlparse?tab=readme-ov-file#tlparse-parse-structured-pt2-logs)
Traceback (most recent call last):
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 1337, in run_node
result = lowering.codegen(self, n)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 755, in codegen
return self.api_func._codegen(
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/language/memory_ops.py", line 277, in _
return strategy.codegen_load(
^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/indexing_strategy.py", line 203, in codegen_load
return PointerIndexingStrategy().codegen_load(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/indexing_strategy.py", line 153, in codegen_load
indexing = SubscriptIndexing.create(state, fake_tensor, subscript, extra_mask)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/indexing_strategy.py", line 703, in create
expand = tile_strategy.expand_str(output_size, output_idx)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/tile_dispatch.py", line 163, in expand_str
compacted_shapes = self._compact_shape(shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/tile_dispatch.py", line 133, in _compact_shape
compacted_shapes = strategy.compact_shape(compacted_shapes)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/tile_strategy.py", line 525, in compact_shape
assert shape.block_ids[0] == self.block_ids[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/naren/Downloads/pointwise_silu_repro (2)/python/test.py", line 25, in <module>
helion_silu(*example_inputs)
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 292, in __call__
return self.bind(args)(*args)
^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 636, in __call__
self.autotune(args, force=False)
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 519, in autotune
config = self.settings.autotuner_fn(self, args, **kwargs).autotune(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/autotuner/base_cache.py", line 234, in autotune
config = self.autotuner.autotune()
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/autotuner/base_search.py", line 536, in autotune
best = self._autotune()
^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/autotuner/pattern_search.py", line 64, in _autotune
self.parallel_benchmark_population(self.population, desc="Initial population")
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/autotuner/base_search.py", line 717, in parallel_benchmark_population
self.parallel_benchmark([m.config for m in members], desc=desc),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/autotuner/base_search.py", line 459, in parallel_benchmark
fns = [self.kernel.compile_config(c, allow_print=False) for c in configs]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/autotuner/base_search.py", line 459, in <listcomp>
fns = [self.kernel.compile_config(c, allow_print=False) for c in configs]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 448, in compile_config
triton_code = self.to_triton_code(
^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/runtime/kernel.py", line 419, in to_triton_code
root = generate_ast(self.host_function, config, emit_repro_caller)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/generate_ast.py", line 463, in generate_ast
codegen.add_statement(codegen.visit(stmt))
^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/ast_extension.py", line 277, in visit
return visitor(node)
^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/generate_ast.py", line 290, in visit_For
codegen_call_with_graph(
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 1410, in codegen_call_with_graph
return GraphInterpreter(graph, cg).run(*new_args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/torch/fx/interpreter.py", line 174, in run
self.env[node] = self.run_node(node)
^^^^^^^^^^^^^^^^^^^
File "/home/naren/Downloads/pointwise_silu_repro (2)/.venv/lib/python3.11/site-packages/helion/_compiler/inductor_lowering.py", line 1380, in run_node
raise InductorLoweringError(
helion.exc.InductorLoweringError: Error in codegen for node load (<function load at 0x7d93a127f740>):
While processing:
File "/home/naren/Downloads/pointwise_silu_repro (2)/python/test.py", line 19, in helion_silu
out[tile] = torch.exp(x[tile])
^^^^^^^
While executing %load : [num_users=1] = call_function[target=helion.language.memory_ops.load](args = (%x, [%block_size_0, %block_size_1], None, None), kwargs = {})
Original traceback:
File "/home/naren/Downloads/pointwise_silu_repro (2)/python/test.py", line 19, in helion_silu
out[tile] = torch.exp(x[tile])
Use tlparse to see full graph. (https://github.com/pytorch/tlparse?tab=readme-ov-file#tlparse-parse-structured-pt2-logs)
Note: Please write your bug report in English to ensure it can be understood and addressed by the development team.
I am trying to write a simple pointwise kernel, but am running into issues even running the exp kernel example.
Describe the bug
I am trying to run simple kernel examples and am hitting issues loading and storing tiles
I can work around these issues with explicit
hl.loadandhl.storecalls but then I hit triton code gen issues.To Reproduce
Steps to reproduce the behavior.
Run this script: https://helionlang.com/examples/exp.html
or alternatively
Expected behavior
I am able to run this example
Versions
PyTorch/Triton/Helion versions and any other relevant library version.
Additional context
Is the issue that I am using the nightly torch stack?