Skip to content
Merged
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
11 changes: 6 additions & 5 deletions cpp/tensorrt_llm/thop/fp8Op.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,12 @@ std::tuple<Tensor, Tensor> e4m3_quantize_helper(Tensor input, at::optional<Tenso

if (scales.has_value())
{
// static quantization will use float scales by default.
scales_ = scales.value().clone();
CHECK_TH_CUDA(scales_);
CHECK_TYPE(scales_, torch::kFloat32);
e4m3_static_quantize(input, quantized_input, scales_, stream, quantize_mode);
// static quantization will use float scales by default and output scales_ will be ignored.
scales_
Comment thread
Tracin marked this conversation as resolved.
= torch::empty_like(scales.value(), torch::dtype(input.dtype()).device(torch::kCUDA).requires_grad(false));
CHECK_TH_CUDA(scales.value());
CHECK_TYPE(scales.value(), torch::kFloat32);
e4m3_static_quantize(input, quantized_input, scales.value(), stream, quantize_mode);
}
else
{
Expand Down
Loading