Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TTNN pow breaks when exponent is tensor #8594

Open
npetrovic-tenstorrent opened this issue May 17, 2024 · 0 comments
Open

TTNN pow breaks when exponent is tensor #8594

npetrovic-tenstorrent opened this issue May 17, 2024 · 0 comments
Labels
bug Something isn't working GS WH

Comments

@npetrovic-tenstorrent
Copy link
Contributor

npetrovic-tenstorrent commented May 17, 2024

ttnn.pow operation fails in cases when both arguments are tensors - input and exponent. It seems to expect either float or int for exponent instead of tensor, but documentation claims tensor exponent support:

1. (input: tt::tt_metal::Tensor, exponent: float, output_mem_config: tt_lib.tensor.MemoryConfig = tt::tt_metal::MemoryConfig(memory_layout=TensorMemoryLayout::INTERLEAVED,buffer_type=BufferType::DRAM,shard_spec=std::nullopt)) -> tt::tt_metal::Tensor
2. (input: tt::tt_metal::Tensor, exponent: int, output_mem_config: tt_lib.tensor.MemoryConfig = tt::tt_metal::MemoryConfig(memory_layout=TensorMemoryLayout::INTERLEAVED,buffer_type=BufferType::DRAM,shard_spec=std::nullopt)) -> tt::tt_metal::Tensor

To Reproduce
Steps to reproduce the behavior:
Checkout main branch and run unit test test_eltwise_pow.py (or others) using this command pattern:

pytest tests/ttnn/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_pow.py

Expected behavior
There are three test cases presented in the unit test and they all fail: tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_pow.py and they are expected to fail with error

TypeError: pow(): incompatible function arguments. The following argument types are supported:

Getting Additional info for the operation under test and its behavior
To get additional information and results for different combinations of input shapes, types, layouts and memory configs for which this operation was tested you can also run locally sweep test:

tests/ttnn/python_api_testing/sweep_tests/test_configs/ci_sweep_tests_broken/grayskull/ttnn_eltwise_pow_test.yaml

To do this you should:

  1. Follow the Getting Started page to setup the repo, environment variables and python-env
  2. Activate source build/python_env/bin/activate
  3. Run sweeps by using pytest tests/ttnn/python_api_testing/sweep_tests/run_sweep_test.py --input-path tests/ttnn/python_api_testing/sweep_tests/test_configs/ci_sweep_tests_broken/grayskull/ttnn_eltwise_pow_test.yaml --input-method cli --cli-input results_pow_broken
  4. After the run is completed all test sweeps results should be available inside specified output directory (in this case ./result-sweeps). There you will find .csv which holds all executed sweeps, among which you can also find the ones that failed and were recreated by the unit test, which you can get by searching unique data_seed field.
@npetrovic-tenstorrent npetrovic-tenstorrent added the bug Something isn't working label May 17, 2024
@npetrovic-tenstorrent npetrovic-tenstorrent changed the title [Bug Report] ... TTNN pow breaks when exponent is tensor May 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working GS WH
Projects
None yet
Development

No branches or pull requests

1 participant