Skip to content

Support x.view(dtype=torch.float32) in helion kernels #1171

@Chillee

Description

@Chillee

^

  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/runtime/kernel.py", line 292, in __call__
    return self.bind(args)(*args)
           ^^^^^^^^^^^^^^^
  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/runtime/kernel.py", line 173, in bind
    bound_kernel = BoundKernel(self, args)
                   ^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/runtime/kernel.py", line 358, in __init__
    self.host_function: HostFunction = HostFunction(
                                       ^^^^^^^^^^^^^
  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/_compiler/host_function.py", line 117, in __init__
    self.device_ir = lower_to_device_ir(self)
                     ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/_compiler/device_ir.py", line 1174, in lower_to_device_ir
    prepare_graph_lowerings(graph.graph)
  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/_compiler/inductor_lowering.py", line 106, in prepare_graph_lowerings
    prepare_node_lowering(graph_lowering, node)
  File "/tmp/horace/uv/install/6fbae45f965d50cba20076240d49c0af606f091cbea5976d1cc16bb095b35930/lib/python3.12/site-packages/helion/_compiler/inductor_lowering.py", line 195, in prepare_node_lowering
    raise InductorLoweringError(
helion.exc.InductorLoweringError: Lowering aten.view.dtype returned <class 'torch._inductor.ir.TensorBox'>, expected TensorBox(StorageBox(...)): TensorBox(
  ReinterpretView(
    StorageBox(
      InputBuffer(name='view_input0', layout=FixedLayout('cuda:0', torch.float32, size=[1], stride=[1]))
    ),
    FixedLayout('cuda:0', torch.int32, size=[1], stride=[1]),
    origins=OrderedSet([])
  )
)

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions