Skip to content

Commit 0081fcb

Browse files
authored
enable bf16 h2d scales for dynamic scaling (#215)
1 parent 0fee3ff commit 0081fcb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

neural_compressor/torch/algorithms/fp8_quant/_core/scale_handler.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def register_scale(patched_mod, name, scale, scale_format):
3636

3737
def create_scale_tensor(orig_tensor, scale_format):
3838
if is_runtime_scale_patching() and scale_format in ScaleFormat.__members__.values():
39-
return orig_tensor.to("cpu").to(torch.float)
39+
return orig_tensor.to("cpu")
4040
if scale_format == ScaleFormat.CONST:
4141
if isinstance(orig_tensor, torch.Tensor):
4242
return torch.nn.Parameter(orig_tensor, requires_grad=False)

0 commit comments

Comments
 (0)