Closed dongjin-na closed 2 months ago
Faced this issue while implementing Dropout
It looks like the issue was with the pack_reconfig_data_format
function, where it was not reconfiguring all the necessary packer settings for uint8. I am just waiting on CI pipelines, which are a bit backed up, before I merge the fix https://github.com/tenstorrent/tt-metal/pull/11467.
Fix is in main: https://github.com/tenstorrent/tt-metal/pull/11467, give it a shot
Dear @rdjogoTT, I have checked this test on the latest main branch, which has passed. I appreciate your support.
Describe the bug The
typecast
operation inttnn
supports typecasting between various data types. It is possible to typecast from uint32 to uint8 using thepack_tile()
function.I have observed that when packing a UINT32 data type CB id as a UINT8 CB using the second parameter of the
unary_op_init_common
API within the compute kernel, only up to 7 bits are being packed.https://github.com/tenstorrent/tt-metal/blob/115107968b46ce686650a6b8371fbf6aca9b235a/tt_metal/include/compute_kernel_api/eltwise_unary/eltwise_unary.h#L20
(The reason for passing a UINT32 data type CB id as the second parameter is that some operations we implemented output two CBs with data types UINT32 and UINT8. We passed the UINT32 CB id among the two and discovered the issue in the process.)
I have added test code in the
pack_uint32_to_uint8
branch by slightly modifying ttnn’s typecast code. When operating correctly, a UINT32 CB filled with 255 should typecast to a UINT8 CB also filled with 255. However, in the problematic scenario, it typecasts to 127.Please confirm if this behavior is a bug or if there is an issue with how the kernel was written.
To Reproduce Steps to reproduce the behavior:
Expected behavior Test case should be passed.
Screenshots
Test script
Compute kernel
void MAIN { uint32_t per_core_block_cnt = get_compile_time_arg_val(0); uint32_t per_core_block_dim = get_compile_time_arg_val(1);
if UINT8_PACKING_ISSUE
else
endif
}
Please complete the following environment information: OS: Ubuntu 20.04 / 172.27.44.100 VM
Version of software (eg. commit)