tenstorrent / tt-metal

:metal: TT-NN operator library, and TT-Metalium low level kernel programming model.
Apache License 2.0
471 stars 74 forks source link

ttnn.sub_bw binary inconsistent documentation regarding the input tensors layout #14141

Closed amalbasaTT closed 2 weeks ago

amalbasaTT commented 3 weeks ago

ttnn.sub_bw binary doesn't support ROW_MAJOR layout despite what it says in the documentation. When any/all of the input tensors have ROW_MAJOR layout, the FATAL error "Inputs to eltwise binary must be tilized" is thrown.

To Reproduce Steps to reproduce the behavior: Sweep test for sub_bw is located in 'tests/sweep_framework/sweeps/eltwise/binary_backward/sub_bw/sub_bw.py'

  1. Checkout branch amalbasaTT/backward_ops-sweeps-4
  2. Go to 'tests/sweep_framework/sweeps/eltwise/binary_backward/sub_bw/sub_bw.py'
  3. Remove next lines of code from the invalidate_vector function:
    if test_vector["input_layout"] == ttnn.ROW_MAJOR_LAYOUT:
        return True, "Inputs to eltwise binary must be tilized"
  4. Generate new parameter vectors and run the sweep test
    python3 tests/sweep_framework/sweeps_parameter_generator.py --elastic cloud --module-name eltwise.binary_backward.sub_bw.sub_bw
    python3 tests/sweep_framework/sweeps_runner.py --elastic cloud --module-name eltwise.binary_backward.sub_bw.sub_bw 
  5. See error. Results can be found on elastic cloud as explained here: https://github.com/tenstorrent/tt-metal/tree/main/tests/sweep_framework

Expected behavior For vectors with input_layout being ROW_MAJOR_LAYOUT, test will fail with the message "inputs to eltwise binary must be tilized"

KalaivaniMCW commented 2 weeks ago

Doc has been updated with layout info

image