Open zxd1997066 opened 3 months ago
With the guilty commit, the output format of Concat in the model changed from contiguous to channels_last, which caused the order of the for loops in codegen kennels to change, the innermost for loop became the channel dimension, which caused two issues in this model:
for(long x1=static_cast<long>(0L); x1<static_cast<long>(48L); x1+=static_cast<long>(16L))
{
auto tmp0 =
[&]
{
__at_align__ std::array<unsigned char, 64> tmpbuf;
#pragma GCC unroll 16
for (long x1_inner = 0; x1_inner < 16; x1_inner++)
{
tmpbuf[x1_inner] = in_ptr0[static_cast<long>((58L*(static_cast<long>((x1 + x1_inner)) % static_cast<long>(2L))) + (116L*x0) + (c10::div_floor_integer((x1 + x1_inner), 2L)))];
}
return at::vec::Vectorized<unsigned char>::loadu(tmpbuf.data(), 16);
}
()
;
auto tmp1 = at::vec::convert<float>(tmp0);
auto tmp2 = static_cast<float>(0.0);
auto tmp3 = at::vec::Vectorized<float>(tmp2);
auto tmp4 = tmp1 - tmp3;
auto tmp5 = static_cast<float>(0.013786641880869865);
auto tmp6 = at::vec::Vectorized<float>(tmp5);
auto tmp7 = tmp4 * tmp6;
tmp7.store(out_ptr0 + static_cast<long>(x1 + (116L*x0)));
}
#pragma omp simd simdlen(8)
for(long x1=static_cast<long>(48L); x1<static_cast<long>(58L); x1+=static_cast<long>(1L))
{
auto tmp0 = in_ptr0[static_cast<long>((58L*(static_cast<long>(x1) % static_cast<long>(2L))) + (116L*x0) + (c10::div_floor_integer(x1, 2L)))];
auto tmp1 = c10::convert<float>(tmp0);
auto tmp2 = static_cast<float>(0.0);
auto tmp3 = decltype(tmp1)(tmp1 - tmp2);
auto tmp4 = static_cast<float>(0.013786641880869865);
auto tmp5 = decltype(tmp3)(tmp3 * tmp4);
out_ptr0[static_cast<long>(x1 + (116L*x0))] = tmp5;
}
auto tmp0 =
[&]
{
__at_align__ std::array<float, 16> tmpbuf;
#pragma GCC unroll 16
for (long x1_inner = 0; x1_inner < 16; x1_inner++)
{
tmpbuf[x1_inner] = in_ptr2[static_cast<long>(29L + (58L*(static_cast<long>((x1 + x1_inner)) % static_cast<long>(2L))) + (116L*x0) + (c10::div_floor_integer((x1 + x1_inner), 2L)))];
}
return at::vec::Vectorized<float>::loadu(tmpbuf.data(), 16);
}
()
;
Try masked vectorization for tail case.
🐛 Describe the bug
shufflenet_v2_x1_0 QAT performance regression
SW info
Reference SW info (nightly)