tenstorrent / pytorch2.0_ttnn

⭐️ TTNN Compiler for PyTorch 2.0 ⭐️ It enables running PyTorch2.0 models on Tenstorrent hardware
https://tenstorrent.github.io/tt-metal/latest/ttnn/
25 stars 5 forks source link

Fix converting `aten.clone` #125

Closed jdh8 closed 2 months ago

jdh8 commented 2 months ago

Ticket

None

Problem description

test_clone.py produced the following error

    def __call__(self, *function_args, **function_kwargs):
>       return self.function(*function_args, **function_kwargs)
E       TypeError: __call__(): incompatible function arguments. The following argument types are supported:
E           1. (self: ttnn._ttnn.operations.data_movement.clone_t, input_tensor: ttnn._ttnn.deprecated.tensor.Tensor, *, memory_config: Optional[ttnn._ttnn.deprecated.tensor.MemoryConfig] = None, dtype: Optional[ttnn._ttnn.deprecated.tensor.DataType] = None, queue_id: int = 0) -> ttnn._ttnn.deprecated.tensor.Tensor
E       
E       Invoked with: <ttnn._ttnn.operations.data_movement.clone_t object at 0x7fec66225d70>, ttnn.Tensor([[ 0.07422,  0.47656,  ...,  0.00000,  0.00000],
E                    [ 0.86719,  0.66406,  ...,  0.00000,  0.00000],
E                    ...,
E                    [ 0.00000,  0.00000,  ...,  0.00000,  0.00000],
E                    [ 0.00000,  0.00000,  ...,  0.00000,  0.00000]], shape=Shape([4[32], 4[32]]), dtype=DataType::BFLOAT16, layout=Layout::TILE), MemoryConfig(memory_layout=TensorMemoryLayout::INTERLEAVED,buffer_type=BufferType::DRAM,shard_spec=std::nullopt), <DataType.BFLOAT16: 0>
E       
E       Did you forget to `#include <pybind11/stl.h>`? Or <pybind11/complex.h>,
E       <pybind11/functional.h>, <pybind11/chrono.h>, etc. Some automatic
E       conversions are optional and require extra headers to be included
E       when compiling your pybind11 module.

../tt-metal/ttnn/ttnn/decorators.py:327: TypeError

What's changed

The test should pass now.

ayerofieiev-tt commented 2 months ago

@jdh8 is this with a wheel specified in requirements.txt or with latest main of tt-metal?

jdh8 commented 2 months ago

I just updated tt-metal 3 hours ago. I am at tenstorrent/tt-metal@e6693ec26cddc67309bca555db019b82401f533a.

ayerofieiev-tt commented 2 months ago

This is where Metal is right now https://github.com/tenstorrent/pytorch2.0_ttnn/blob/main/requirements.txt#L9

You PR does not update that, but updates an Op.

I am ok to update metal and lowerings, but need to do both or none. Latest wheel https://github.com/tenstorrent/tt-metal/releases/tag/v0.52.0-rc2

jdh8 commented 2 months ago

I'm closing this PR until we have time to update Metal