Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use non-reference blocking parameters for fp32 weights in quantized inference kernel #1224

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions fbgemm_gpu/codegen/embedding_forward_quantized_split_template.cu
Original file line number Diff line number Diff line change
Expand Up @@ -928,9 +928,15 @@ Tensor int_nbit_split_embedding{{ "_nobag" if nobag else "" }}_codegen_forward_{
if (max_float32_D > 0) {
auto max_fp32_128b_rows = nbit::div_round_up(nbit::padded_row_size_in_bytes(max_float32_D, SparseType::FP32, row_alignment), 128);
TORCH_CHECK(max_fp32_128b_rows <= 32);
// FP32 is used for numerical validations and tiny embeddings tables.
// We haven't carefully tuned the perf of FP32 embeddings.
X(1, 1, 0, 32);
if (max_fp32_128b_rows > 0) {
X(2, 4, 0, 4);
}
if (max_fp32_128b_rows > 4) {
X(2, 2, 4, 16);
}
if (max_fp32_128b_rows > 16) {
X(1, 1, 16, 32);
}
}
}));
#undef X
Expand Down