-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
- Loading branch information
1 parent
a728de2
commit 24b210a
Showing
18 changed files
with
496 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
73 changes: 73 additions & 0 deletions
73
tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_bitwise_not.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
# SPDX-FileCopyrightText: © 2023-24 Tenstorrent Inc. | ||
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import pytest | ||
import torch | ||
from functools import partial | ||
import tt_lib as ttl | ||
|
||
|
||
from tests.tt_eager.python_api_testing.sweep_tests import ( | ||
comparison_funcs, | ||
generation_funcs, | ||
) | ||
from tests.tt_eager.python_api_testing.sweep_tests.run_pytorch_ci_tests import ( | ||
run_single_pytorch_test, | ||
) | ||
from models.utility_functions import skip_for_grayskull | ||
|
||
mem_configs = [ | ||
ttl.tensor.MemoryConfig(ttl.tensor.TensorMemoryLayout.INTERLEAVED, ttl.tensor.BufferType.DRAM), | ||
ttl.tensor.MemoryConfig(ttl.tensor.TensorMemoryLayout.INTERLEAVED, ttl.tensor.BufferType.L1), | ||
] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"scalar", | ||
(1, 1), | ||
) | ||
@pytest.mark.parametrize( | ||
"input_shapes", | ||
[ | ||
[[1, 1, 32, 32]], | ||
[[4, 3, 32, 32]], | ||
[[2, 2, 32, 32]], | ||
], | ||
) | ||
@pytest.mark.parametrize( | ||
"dst_mem_config", | ||
mem_configs, | ||
) | ||
@skip_for_grayskull("#TODO: GS implementation needs to be done") | ||
class TestBitwiseNot: | ||
def test_run_bitwise_not_op( | ||
self, | ||
scalar, | ||
input_shapes, | ||
dst_mem_config, | ||
device, | ||
): | ||
datagen_func = [ | ||
generation_funcs.gen_func_with_cast( | ||
partial(generation_funcs.gen_rand, low=-2147483647, high=2147483647), torch.int | ||
) | ||
] | ||
test_args = generation_funcs.gen_default_dtype_layout_device(input_shapes)[0] | ||
test_args.update( | ||
{ | ||
"value": scalar, | ||
"dtype": [(ttl.tensor.DataType.INT32)], | ||
} | ||
) | ||
test_args.update({"output_mem_config": dst_mem_config}) | ||
comparison_func = comparison_funcs.comp_equal | ||
|
||
run_single_pytorch_test( | ||
"eltwise-bitwise_not", | ||
input_shapes, | ||
datagen_func, | ||
comparison_func, | ||
device, | ||
test_args, | ||
) |
72 changes: 72 additions & 0 deletions
72
tests/tt_eager/python_api_testing/sweep_tests/pytests/tt_dnn/test_bitwise_xor.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# SPDX-FileCopyrightText: © 2023-24 Tenstorrent Inc. | ||
|
||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
import pytest | ||
import torch | ||
import random | ||
from functools import partial | ||
import tt_lib as ttl | ||
|
||
|
||
from tests.tt_eager.python_api_testing.sweep_tests import ( | ||
comparison_funcs, | ||
generation_funcs, | ||
) | ||
from tests.tt_eager.python_api_testing.sweep_tests.run_pytorch_ci_tests import ( | ||
run_single_pytorch_test, | ||
) | ||
from models.utility_functions import skip_for_grayskull | ||
|
||
mem_configs = [ | ||
ttl.tensor.MemoryConfig(ttl.tensor.TensorMemoryLayout.INTERLEAVED, ttl.tensor.BufferType.DRAM), | ||
ttl.tensor.MemoryConfig(ttl.tensor.TensorMemoryLayout.INTERLEAVED, ttl.tensor.BufferType.L1), | ||
] | ||
|
||
|
||
@pytest.mark.parametrize( | ||
"scalar", | ||
{random.randint(-100, 100) for _ in range(10)}, | ||
) | ||
@pytest.mark.parametrize( | ||
"input_shapes", | ||
[ | ||
[[1, 1, 32, 32]], | ||
[[4, 3, 32, 32]], | ||
[[2, 2, 32, 32]], | ||
], | ||
) | ||
@pytest.mark.parametrize( | ||
"dst_mem_config", | ||
mem_configs, | ||
) | ||
@skip_for_grayskull("#TODO: GS implementation needs to be done") | ||
class TestBitwiseXor: | ||
def test_run_bitwise_xor_op( | ||
self, | ||
scalar, | ||
input_shapes, | ||
dst_mem_config, | ||
device, | ||
): | ||
datagen_func = [ | ||
generation_funcs.gen_func_with_cast(partial(generation_funcs.gen_rand, low=0, high=2147483647), torch.int) | ||
] | ||
test_args = generation_funcs.gen_default_dtype_layout_device(input_shapes)[0] | ||
test_args.update( | ||
{ | ||
"value": scalar, | ||
"dtype": [(ttl.tensor.DataType.INT32)], | ||
} | ||
) | ||
test_args.update({"output_mem_config": dst_mem_config}) | ||
comparison_func = comparison_funcs.comp_equal | ||
|
||
run_single_pytorch_test( | ||
"eltwise-bitwise_xor", | ||
input_shapes, | ||
datagen_func, | ||
comparison_func, | ||
device, | ||
test_args, | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.