Skip to content

Commit

Permalink
#6365: Add ttnn host tests (#8210)
Browse files Browse the repository at this point in the history
* #0: Rebased main

* #6576: remove pytest in pyproject.toml

* #0: Rebased main

* #6576: Add softlink of tt_lib/build

* #6576: Record ARCH_NAME while wheel building

* #6576: Fix spelling

* #6365: Add ttnn host tests

* #6365: Do not use program cache call in host test because it requires device and allclose on the zero tensor

---------

Co-authored-by: swimdi <[email protected]>
  • Loading branch information
tt-rkim and swimdi authored May 27, 2024
1 parent bbd5d5e commit c3c844c
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion tests/end_to_end_tests/test_ttnn.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,19 @@
import ttnn.operations.binary


@pytest.mark.eager_host_side
def test_ttnn_import_host(reset_seeds):
torch_input_tensor = torch.zeros(2, 4, dtype=torch.float32)

tensor = ttnn.from_torch(torch_input_tensor, dtype=ttnn.bfloat16)
torch_output_tensor = ttnn.to_torch(tensor)

assert torch.allclose(torch_input_tensor, torch_output_tensor)


@pytest.mark.eager_package_silicon
@pytest.mark.skip("Tries to open device twice")
def test_ttnn_import(reset_seeds):
def test_ttnn_import_sliicon(reset_seeds):
with ttnn.manage_device(device_id=0) as device:
pass

Expand Down

0 comments on commit c3c844c

Please sign in to comment.