Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleSlim
提交
1bea8e18
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看板
未验证
提交
1bea8e18
编写于
4月 07, 2022
作者:
C
ceci3
提交者:
GitHub
4月 07, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix ptq-hpo on the windows platform (#1032)
* fix install * update Co-authored-by:
N
Guanghua Yu
<
742925032@qq.com
>
上级
dd85e83a
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
14 addition
and
2 deletion
+14
-2
paddleslim/auto_compression/compressor.py
paddleslim/auto_compression/compressor.py
+7
-1
paddleslim/quant/__init__.py
paddleslim/quant/__init__.py
+7
-1
未找到文件。
paddleslim/auto_compression/compressor.py
浏览文件 @
1bea8e18
...
@@ -18,9 +18,11 @@ import sys
...
@@ -18,9 +18,11 @@ import sys
import
numpy
as
np
import
numpy
as
np
import
inspect
import
inspect
from
collections
import
namedtuple
,
Iterable
from
collections
import
namedtuple
,
Iterable
import
platform
import
paddle
import
paddle
import
paddle.distributed.fleet
as
fleet
import
paddle.distributed.fleet
as
fleet
from
..quant.quant_post_hpo
import
quant_post_hpo
if
platform
.
system
().
lower
()
==
'linux'
:
from
..quant.quant_post_hpo
import
quant_post_hpo
from
..quant.quanter
import
convert
from
..quant.quanter
import
convert
from
..common.recover_program
import
recover_inference_program
from
..common.recover_program
import
recover_inference_program
from
..common
import
get_logger
from
..common
import
get_logger
...
@@ -231,6 +233,10 @@ class AutoCompression:
...
@@ -231,6 +233,10 @@ class AutoCompression:
def
compress
(
self
):
def
compress
(
self
):
### start compress, including train/eval model
### start compress, including train/eval model
if
self
.
_strategy
==
'ptq_hpo'
:
if
self
.
_strategy
==
'ptq_hpo'
:
if
platform
.
system
().
lower
()
!=
'linux'
:
raise
NotImplementedError
(
"post-quant-hpo is not support in system other than linux"
)
quant_post_hpo
(
quant_post_hpo
(
self
.
_exe
,
self
.
_exe
,
self
.
_places
,
self
.
_places
,
...
...
paddleslim/quant/__init__.py
浏览文件 @
1bea8e18
...
@@ -12,6 +12,7 @@
...
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# See the License for the specific language governing permissions and
# limitations under the License.
# limitations under the License.
import
platform
import
logging
import
logging
import
paddle
import
paddle
...
@@ -32,7 +33,12 @@ try:
...
@@ -32,7 +33,12 @@ try:
from
.quanter
import
quant_aware
,
convert
,
quant_post_static
,
quant_post_dynamic
from
.quanter
import
quant_aware
,
convert
,
quant_post_static
,
quant_post_dynamic
from
.quanter
import
quant_post
,
quant_post_only_weight
from
.quanter
import
quant_post
,
quant_post_only_weight
from
.quant_aware_with_infermodel
import
quant_aware_with_infermodel
,
export_quant_infermodel
from
.quant_aware_with_infermodel
import
quant_aware_with_infermodel
,
export_quant_infermodel
if
platform
.
system
().
lower
()
==
'linux'
:
from
.quant_post_hpo
import
quant_post_hpo
from
.quant_post_hpo
import
quant_post_hpo
else
:
_logger
.
warning
(
"post-quant-hpo is not support in system other than linux"
)
except
Exception
as
e
:
except
Exception
as
e
:
_logger
.
warning
(
e
)
_logger
.
warning
(
e
)
_logger
.
warning
(
_logger
.
warning
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录