Skip to content

support fp16 dtypes for input weight and bias #3931

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

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
5 changes: 3 additions & 2 deletions fbgemm_gpu/experimental/gen_ai/src/quantize/quantize.cu
Original file line number Diff line number Diff line change
Expand Up @@ -1109,8 +1109,9 @@ std::vector<at::Tensor> quantize_fp8_per_row(
"Invalid dim. The dim of input should be greater than or equal to 2");
TORCH_CHECK(
input.scalar_type() == torch::kBFloat16 ||
input.scalar_type() == torch::kFloat,
"Invalid datatype. input must be BF16 or FP32");
input.scalar_type() == torch::kFloat ||
input.scalar_type() == torch::kHalf,
"Invalid datatype. input must be BF16, FP16 or FP32");
TORCH_CHECK(
!stochastic_rounding || input.size(-1) % 4 == 0,
"input row dim must be 4's multiple when stochastic_rounding is True");
Expand Down
Loading