Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
88dd7e09
P
PaddleSlim
项目概览
PaddlePaddle
/
PaddleSlim
1 年多 前同步成功
通知
51
Star
1434
Fork
344
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
53
列表
看板
标记
里程碑
合并请求
16
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleSlim
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
53
Issue
53
列表
看板
标记
里程碑
合并请求
16
合并请求
16
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
未验证
提交
88dd7e09
编写于
10月 21, 2022
作者:
C
ceci3
提交者:
GitHub
10月 21, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix onnx_format in ptq_hpo (#1417)
上级
8ae19458
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
8 addition
and
2 deletion
+8
-2
paddleslim/auto_compression/compressor.py
paddleslim/auto_compression/compressor.py
+1
-0
paddleslim/quant/post_quant_hpo.py
paddleslim/quant/post_quant_hpo.py
+7
-2
未找到文件。
paddleslim/auto_compression/compressor.py
浏览文件 @
88dd7e09
...
...
@@ -674,6 +674,7 @@ class AutoCompression:
hist_percent
=
config
.
hist_percent
,
batch_size
=
[
1
],
batch_num
=
config
.
batch_num
,
onnx_format
=
config
.
onnx_format
,
runcount_limit
=
config
.
max_quant_count
)
else
:
...
...
paddleslim/quant/post_quant_hpo.py
浏览文件 @
88dd7e09
...
...
@@ -78,6 +78,7 @@ class QuantConfig(object):
activation_bits
=
8
,
weight_quantize_type
=
'channel_wise_abs_max'
,
optimize_model
=
False
,
onnx_format
=
False
,
is_use_cache_file
=
False
,
cache_dir
=
"./temp_post_training"
):
"""QuantConfig init"""
...
...
@@ -106,6 +107,7 @@ class QuantConfig(object):
self
.
activation_bits
=
activation_bits
self
.
weight_quantize_type
=
weight_quantize_type
self
.
optimize_model
=
optimize_model
self
.
onnx_format
=
onnx_format
self
.
is_use_cache_file
=
is_use_cache_file
self
.
cache_dir
=
cache_dir
...
...
@@ -291,7 +293,8 @@ def quantize(cfg):
hist_percent
=
hist_percent
,
\
bias_correction
=
bias_correct
,
\
batch_size
=
batch_size
,
\
batch_nums
=
batch_num
)
batch_nums
=
batch_num
,
onnx_format
=
g_quant_config
.
onnx_format
)
global
g_min_emd_loss
try
:
...
...
@@ -356,6 +359,7 @@ def quant_post_hpo(
batch_size
=
[
10
,
30
],
### uniform sample in list.
batch_num
=
[
10
,
30
],
### uniform sample in list.
optimize_model
=
False
,
onnx_format
=
False
,
is_use_cache_file
=
False
,
cache_dir
=
"./temp_post_training"
,
runcount_limit
=
30
):
...
...
@@ -403,6 +407,7 @@ def quant_post_hpo(
optimize_model(bool, optional): If set optimize_model as True, it applies some
passes to optimize the model before quantization. So far, the place of
executor must be cpu it supports fusing batch_norm into convs.
onnx_format(bool): Whether to export the quantized model with format of ONNX. Default is False.
is_use_cache_file(bool): This param is deprecated.
cache_dir(str): This param is deprecated.
runcount_limit(int): max. number of model quantization.
...
...
@@ -429,7 +434,7 @@ def quant_post_hpo(
model_filename
,
params_filename
,
save_model_filename
,
save_params_filename
,
scope
,
quantizable_op_type
,
is_full_quantize
,
weight_bits
,
activation_bits
,
weight_quantize_type
,
optimize_model
,
is_use_cache_file
,
cache_dir
)
onnx_format
,
is_use_cache_file
,
cache_dir
)
cs
=
ConfigurationSpace
()
hyper_params
=
[]
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录