You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
While debugging recently, I noticed that the result of reduce_scalar seemed strange, and I discovered unusual behavior.
The result of the reduce operation varies depending on the position of the values.
constexprauto cb_in0 = tt::CBIndex::c_0;
{
cb_reserve_back(cb_in0, 1);
float* ptr = reinterpret_cast<float*>(get_write_ptr(cb_in0));
memset(ptr, 0, 1024 * sizeof(float));
// this case result is 2.0
ptr[0] = 1.0019531;
ptr[16] = 1.0f;
// this case result is 2.0019531250// ptr[0] = 1.0019531;// ptr[1] = 1.0f;cb_push_back(cb_in0, 1);
}
{
constexprauto cb_in2 = tt::CBIndex::c_2;
cb_reserve_back(cb_in2, 1);
float* ptr = reinterpret_cast<float*>(get_write_ptr(cb_in2));
memset(ptr, 0, 1024 * sizeof(float));
for (int i = 0; i < 1024; i++) {
ptr[i] = 1;
}
cb_push_back(cb_in2, 1);
}
I prepared both the data and scalar values in the reader kernel for the reduce operation. And the scalar CB values are all filled with 1.0f.
The test was conducted by adding the values 1.0019531 and 1.0.
if ptr[0] = 1.0019531, ptr[16] = 1.0. than reduce result is 2.0.
if ptr[0] = 1.0019531, ptr[1] = 1.0. than reduce result is 2.0019531250
I think that the fact the position of the values affects the result is a bug.
If there were many values, it would be understandable that the calculation order could affect the result. However, since there are only two values, it’s odd that the order has an impact on the result.
Describe the bug
While debugging recently, I noticed that the result of
reduce_scalar
seemed strange, and I discovered unusual behavior.The result of the
reduce
operation varies depending on the position of the values.I prepared both the data and scalar values in the reader kernel for the
reduce
operation. And the scalar CB values are all filled with 1.0f.The test was conducted by adding the values 1.0019531 and 1.0.
if ptr[0] = 1.0019531, ptr[16] = 1.0. than reduce result is 2.0.
if ptr[0] = 1.0019531, ptr[1] = 1.0. than reduce result is 2.0019531250
I think that the fact the position of the values affects the result is a bug.
related kernel code:
To Reproduce
Steps to reproduce the behavior:
Expected behavior
I hope the issue with the result can be fixed.
Screenshots
If applicable, add screenshots to help explain your problem.
Please complete the following environment information:
Additional context
Add any other context about the problem here.
The text was updated successfully, but these errors were encountered: