From 627fed607353faf1359d5d6dde6434bae7093024 Mon Sep 17 00:00:00 2001 From: guopeian Date: Tue, 8 Oct 2024 11:21:51 +0800 Subject: [PATCH] hif8 --- tf_adapter/util/npu_attrs.cc | 2 +- tf_adapter_2.x/python/npu_device/configs/npu_config.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index 1d619cd59..28111ff74 100644 --- a/tf_adapter/util/npu_attrs.cc +++ b/tf_adapter/util/npu_attrs.cc @@ -2022,7 +2022,7 @@ Status NpuAttrs::SetNpuOptimizerAttr(const GraphOptimizationPassOptions &options if (params.count("precision_mode_v2") > 0) { precision_mode_v2 = params.at("precision_mode_v2").s(); const static std::vector kPrecisionModeV2List = {"fp16", "origin", "cube_fp16in_fp32out", - "mixed_float16", "mixed_bfloat16"}; + "mixed_float16", "mixed_bfloat16", "cube_hif8", "mixed_hif8"}; NPU_REQUIRES_OK(CheckValueAllowed(precision_mode_v2, kPrecisionModeV2List)); init_options_["precision_mode_v2"] = precision_mode_v2; init_options_["ge.exec.precision_mode_v2"] = precision_mode_v2; diff --git a/tf_adapter_2.x/python/npu_device/configs/npu_config.py b/tf_adapter_2.x/python/npu_device/configs/npu_config.py index 1371ec002..c7834a873 100644 --- a/tf_adapter_2.x/python/npu_device/configs/npu_config.py +++ b/tf_adapter_2.x/python/npu_device/configs/npu_config.py @@ -78,6 +78,6 @@ class NpuConfig(NpuBaseConfig): self.experimental = NpuExperimentalConfig() self.precision_mode_v2 = OptionValue(None, ['fp16', 'origin', 'cube_fp16in_fp32out', 'mixed_float16', - 'mixed_bfloat16']) + 'mixed_bfloat16', 'cube_hif8', 'mixed_hif8']) super(NpuConfig, self).__init__() -- Gitee