diff --git a/tf_adapter/util/npu_attrs.cc b/tf_adapter/util/npu_attrs.cc index 1d619cd595cbb5ce62f398ba62d97440213c419c..28111ff74846f51fabe7b0593067ff2664ac4bed 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 1371ec0025ca5ce5c3bac2c986bb3f4713779444..c7834a873923e75bc9d7f088162bfab7aa9b257d 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__()