Skip to content

Commit 54dced4

Browse files
committed
simplify
1 parent dea3b47 commit 54dced4

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

onnxruntime/contrib_ops/webgpu/quantization/dp4a_matmul_nbits.cc

+2-6
Original file line numberDiff line numberDiff line change
@@ -76,14 +76,10 @@ Status DP4AMatMulQuantizeProgram::GenerateShaderCode(ShaderHelper& shader) const
7676
let scale = max(max_temp[0], max_temp[1]);
7777
let norm_a = a_values[local_row][local_col]/scale;
7878
output[global_idx] = pack4x8snorm(vec4<f32>(norm_a));
79-
if (local_idx == 0u)
79+
if (local_col == 0u)
8080
{
8181
// 127 is the max value of signed int8 [-127,127] used by pack4x8snorm for 1.0f.
82-
scales[workgroup_idx * 2] = scale/127;
83-
} else if (local_idx == 32u)
84-
{
85-
// 127 is the max value of signed int8 [-127,127] used by pack4x8snorm for 1.0f.
86-
scales[workgroup_idx * 2 + 1] = scale/127;
82+
scales[workgroup_idx * 2 + local_row] = scale/127;
8783
}
8884
)MAIN_FN";
8985
return Status::OK();

0 commit comments

Comments
 (0)