Skip to content

Commit d9fda99

Browse files
linoybuHolyFalafel
andauthored
[SW-224612] Set scale calculation to run on cguid as default in dynamic quant (#257)
* [SW-224612] Set scale calculation to run on cguid as default * Update common.py * CGUID calculation only in dynamic --------- Co-authored-by: Danny <[email protected]>
1 parent 4677fdd commit d9fda99

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright (c) 2024 Intel Corporation
1+
# Copyright (c) 2025 Intel Corporation
22
#
33
# Licensed under the Apache License, Version 2.0 (the "License");
44
# you may not use this file except in compliance with the License.
@@ -202,7 +202,7 @@ def is_runtime_scale_patching():
202202
#TODO [SW-224612]: Use cguid to calc scales and remove the check
203203
@lru_cache
204204
def is_calc_scale_with_cguid():
205-
return os.getenv("CALC_SCALE_WITH_CGUID", "False").lower() in ["true", "1"]
205+
return os.getenv("CALC_SCALE_WITH_CGUID", "True").lower() in ["true", "1"]
206206

207207
#TODO [SW-224612]: Use cguid to calc scales and remove the check
208208
@lru_cache

neural_compressor/torch/algorithms/fp8_quant/_core/scale_methods/scales_method.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ def __init__(self, round_scale_method, params, device_for_scale, fullscale=None,
3434
self.scale = None
3535
self.is_dynamic = is_dynamic
3636
#TODO [SW-224612]: Use cguid to calc scales and remove check
37-
self.calc_scale_with_cguid = is_calc_scale_with_cguid()
37+
self.calc_scale_with_cguid = is_calc_scale_with_cguid() if is_dynamic else False
3838
logger.trace("%s %s", self.__class__.__name__, self.__dict__)
3939

4040
def __repr__(self):

0 commit comments

Comments
 (0)