Skip to content

PTQ-Level Efficiency, QAT-Level Accuracy | 训练后量化的效率,量化感知训练的精度

update the hpu check (#318)

Yi Liue1791cd46e97
diff --git a/auto_round/utils.py b/auto_round/utils.py
index e5497c3d9..3be834f8d 100644
--- a/auto_round/utils.py
+++ b/auto_round/utils.py
@@ -890,11 +890,11 @@ TORCH_VERSION_AT_LEAST_2_4 = torch_version_at_least("2.4.0")
def check_hpu_compile_mode():
assert (
- os.environ["PT_HPU_LAZY_MODE"] == "0"
+ os.getenv["PT_HPU_LAZY_MODE"] == "0"
), "Please set `PT_HPU_LAZY_MODE=0` to use HPU compile mode"
# Note: this is a temporary solution, will be removed in the future
assert (
- os.environ["PT_ENABLE_INT64_SUPPORT"] == "1"
+ os.getenv["PT_ENABLE_INT64_SUPPORT"] == "1"
), "Please set `PT_ENABLE_INT64_SUPPORT=1` to use HPU compile mode"