Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature]Add paddleslim ACT. #3457

Merged
merged 12 commits into from
Aug 28, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/PaddlePaddle/mirrors-yapf.git
sha: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
rev: 0d79c0c469bab64f7229c9aca2b1186ef47f0e37
hooks:
- id: yapf
files: \.py$
- repo: https://github.com/pre-commit/pre-commit-hooks
sha: a11d9314b22d8f8c7556443875b731ef05965464
rev: a11d9314b22d8f8c7556443875b731ef05965464
hooks:
- id: check-merge-conflict
- id: check-symlinks
Expand All @@ -16,7 +16,7 @@ repos:
- id: trailing-whitespace
files: \.md$
- repo: https://github.com/Lucas-C/pre-commit-hooks
sha: v1.0.1
rev: v1.0.1
hooks:
- id: forbid-crlf
files: \.md$
Expand Down
1 change: 1 addition & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@
* [量化](./docs/deployment/slim/quant/quant_cn.md)
* [蒸馏](./docs/deployment/slim/distill/distill_cn.md)
* [裁剪](./docs/deployment/slim/prune/prune_cn.md)
* [自动压缩](./docs/deployment/slim/act/readme.md)

* [常见问题汇总](./docs/faq/faq/faq_cn.md)

Expand Down
1 change: 1 addition & 0 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -442,6 +442,7 @@ Note that:
* [Quantization](./docs/deployment/slim/quant/quant.md)
* [Distillation](./docs/deployment/slim/distill/distill.md)
* [Pruning](./docs/deployment/slim/prune/prune.md)
* [Auto Compression](./docs/deployment/slim/act/readme.md)

* [FAQ](./docs/faq/faq/faq.md)

Expand Down
26 changes: 26 additions & 0 deletions deploy/slim/act/configs/ppliteseg/ppliteseg_ptq.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Global:
model_dir: ./liteseg_tiny_scale1.0
model_filename: model.pdmodel
params_filename: model.pdiparams

QuantPost:
batch_size: 32
batch_nums: 50 # can't be none
algo: 'mse'
hist_percent: 0.999
recon_level: None
regions: None
bias_correction: False # it is correction
epochs: 20
lr: 0.1
simulate_activation_quant: False
skip_tensor_list: None

TrainConfig:
epochs: 20
eval_iter: 180
learning_rate: 0.0005
optimizer_builder:
optimizer:
type: SGD
weight_decay: 4.0e-05
26 changes: 26 additions & 0 deletions deploy/slim/act/configs/ppliteseg/ppliteseg_qat.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
Global:
model_dir: ./liteseg_tiny_scale1.0
model_filename: model.pdmodel
params_filename: model.pdiparams

Distillation:
alpha: 1.0
loss: l2
node:
- conv2d_94.tmp_0 # change to the name of the output of the last conv in the model.pdmodel in netron

QuantAware:
onnx_format: True
quantize_op_types:
- conv2d
- depthwise_conv2d

TrainConfig:
epochs: 20
eval_iter: 180
learning_rate: 0.0005
optimizer_builder:
optimizer:
type: SGD
weight_decay: 4.0e-05

Loading