-
Notifications
You must be signed in to change notification settings - Fork 79
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 - fail when input tensor BFLOAT8_B and exponent is scalar float #8593
Comments
@npetrovic-tenstorrent @eyonland I tested this in the recent main , it is passing in grayskull and WHB0. When I repeated the test n times, I observed inconsistencies: out of 100 tests, sometimes 3 tests fail, while other times only 1 fails. To analyze this, I’ve hardcoded specific input and scale values that cause the failures in the code below for testing purposes.
During my analysis, I noticed that the Torch results are inconsistent across different runs, while the TT results are as expected. The expression pow(-x) produces a NaN in the TT results, but in the Torch reference values, we get an unexpectedly large value. Please see the attached image for reference. Note: In the image above, you can correlate the ######## print x in the code with the -------> print x in the image for clarity. Even though ref_value = torch.pow(x, y) and torch.pow(torch.tensor(-59.50000), y) are performing the same operation on the same values, the results differ, TT result returns NaN for negative numbers (which is the expected result), which contributes to the drop in PCC. It is observed on both WHB0 and GS . |
@eyonland @npetrovic-tenstorrent The reason for undefined behaviour is the bfloat conversion that we are doing for data generation Please find the below image for reference. |
#13874 - Please find the PR here |
PR merged to main. Hence closing this issue |
ttnn.pow operation fails in cases when the first argument is BFLOAT8_B tensor and second is float scalar:
To Reproduce
Steps to reproduce the behavior:
Checkout
main
branch and run unit testtest_eltwise_pow_float.py
(or others) using this command pattern:Expected behavior
There are three test cases presented in the unit test -two of them where the input tensor is BFLOAT8_B type fail:
tests/tt_eager/python_api_testing/non_working_unit_tests/grayskull/test_eltwise_pow_float.py
and they are expected to fail with errorGetting 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:
To do this you should:
Getting Started
page to setup the repo, environment variables andpython-env
source build/python_env/bin/activate
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_float_test.yaml --input-method cli --cli-input results_pow_float_broken
.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 uniquedata_seed
field.The text was updated successfully, but these errors were encountered: