Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
580ce0a3
Unverified
Commit
580ce0a3
authored
Dec 05, 2020
by
liuzhe-lz
Committed by
GitHub
Dec 05, 2020
Browse files
Integration test (#3088)
parent
e12f6113
Changes
39
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
39 additions
and
29 deletions
+39
-29
Dockerfile
Dockerfile
+15
-13
archive-del/deployment/pypi/.gitignore
archive-del/deployment/pypi/.gitignore
+0
-0
archive-del/deployment/pypi/Makefile
archive-del/deployment/pypi/Makefile
+0
-0
archive-del/deployment/pypi/clean.ps1
archive-del/deployment/pypi/clean.ps1
+0
-0
archive-del/deployment/pypi/install.ps1
archive-del/deployment/pypi/install.ps1
+0
-0
archive-del/deployment/pypi/setup.py
archive-del/deployment/pypi/setup.py
+0
-0
archive-del/deployment/pypi/upload.ps1
archive-del/deployment/pypi/upload.ps1
+0
-0
archive-doc/deployment/docker/README.md
archive-doc/deployment/docker/README.md
+0
-0
archive-doc/deployment/docker/README_zh_CN.md
archive-doc/deployment/docker/README_zh_CN.md
+0
-0
archive-doc/deployment/pypi/README.md
archive-doc/deployment/pypi/README.md
+0
-0
archive-doc/deployment/pypi/README_zh_CN.md
archive-doc/deployment/pypi/README_zh_CN.md
+0
-0
examples/model_compress/BNN_quantizer_cifar10.py
examples/model_compress/BNN_quantizer_cifar10.py
+1
-1
examples/model_compress/DoReFaQuantizer_torch_mnist.py
examples/model_compress/DoReFaQuantizer_torch_mnist.py
+2
-2
examples/model_compress/L1_torch_cifar10.py
examples/model_compress/L1_torch_cifar10.py
+1
-1
examples/model_compress/QAT_torch_quantizer.py
examples/model_compress/QAT_torch_quantizer.py
+1
-1
examples/model_compress/amc/amc_search.py
examples/model_compress/amc/amc_search.py
+1
-1
examples/model_compress/amc/amc_train.py
examples/model_compress/amc/amc_train.py
+3
-3
examples/model_compress/auto_pruners_torch.py
examples/model_compress/auto_pruners_torch.py
+4
-4
examples/model_compress/lottery_torch_mnist_fc.py
examples/model_compress/lottery_torch_mnist_fc.py
+1
-1
examples/model_compress/model_prune_torch.py
examples/model_compress/model_prune_torch.py
+10
-2
No files found.
deployment/docker/
Dockerfile
→
Dockerfile
View file @
580ce0a3
...
...
@@ -3,12 +3,15 @@
FROM
nvidia/cuda:9.2-cudnn7-runtime-ubuntu18.04
ARG
NNI_RELEASE
LABEL
maintainer='Microsoft NNI Team<nni@microsoft.com>'
ENV
DEBIAN_FRONTEND=noninteractive
RUN
apt-get
-y
update
&&
\
apt-get
-y
install sudo
\
RUN
apt-get
-y
update
RUN
apt-get
-y
install
\
sudo
\
apt-utils
\
git
\
curl
\
...
...
@@ -26,28 +29,27 @@ RUN apt-get -y update && \
python3-dev
\
python3-pip
\
python3-tk
\
libcupti-dev
&&
\
apt-get clean
&&
\
rm
-rf
/var/lib/apt/lists/
*
libcupti-dev
RUN
apt-get clean
RUN
rm
-rf
/var/lib/apt/lists/
*
#
# generate python script
#
RUN
cp
/usr/bin/
python3 /usr/bin/python
RUN
ln
-s
python3 /usr/bin/python
#
# update pip
#
RUN
python3
-m
pip
install
--upgrade
pip
==
20.
0.2
setuptools
==
41.0.0
RUN
python3
-m
pip
install
--upgrade
pip
==
20.
2.4
setuptools
==
50.3.2
# numpy 1.14.3 scipy 1.1.0
RUN
python3
-m
pip
--no-cache-dir
install
\
numpy
==
1.14.3
scipy
==
1.1.0
RUN
python3
-m
pip
--no-cache-dir
install
numpy
==
1.14.3
scipy
==
1.1.0
#
# Tensor
f
low
1.15
# Tensor
F
low
#
RUN
python3
-m
pip
--no-cache-dir
install
tensorflow
-gpu
==
1.15.0
RUN
python3
-m
pip
--no-cache-dir
install
tensorflow
==
2.3.1
#
# Keras 2.1.6
...
...
@@ -73,7 +75,8 @@ RUN python3 -m pip --no-cache-dir install pandas==0.23.4 lightgbm==2.2.2
#
# Install NNI
#
RUN
python3
-m
pip
--no-cache-dir
install
nni
COPY
dist/nni-${NNI_RELEASE}-py3-none-manylinux1_x86_64.whl .
RUN
python3
-m
pip
install
nni-
${
NNI_RELEASE
}
-py3-none-manylinux1_x86_64
.whl
#
# install aml package
...
...
@@ -81,7 +84,6 @@ RUN python3 -m pip --no-cache-dir install nni
RUN
python3
-m
pip
--no-cache-dir
install
azureml
RUN
python3
-m
pip
--no-cache-dir
install
azureml-sdk
ENV
PATH=/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/root/.local/bin:/usr/bin:/bin:/sbin
WORKDIR
/root
deployment/pypi/.gitignore
→
archive-del/
deployment/pypi/.gitignore
View file @
580ce0a3
File moved
deployment/pypi/Makefile
→
archive-del/
deployment/pypi/Makefile
View file @
580ce0a3
File moved
deployment/pypi/clean.ps1
→
archive-del/
deployment/pypi/clean.ps1
View file @
580ce0a3
File moved
deployment/pypi/install.ps1
→
archive-del/
deployment/pypi/install.ps1
View file @
580ce0a3
File moved
deployment/pypi/setup.py
→
archive-del/
deployment/pypi/setup.py
View file @
580ce0a3
File moved
deployment/pypi/upload.ps1
→
archive-del/
deployment/pypi/upload.ps1
View file @
580ce0a3
File moved
deployment/docker/README.md
→
archive-doc/
deployment/docker/README.md
View file @
580ce0a3
File moved
deployment/docker/README_zh_CN.md
→
archive-doc/
deployment/docker/README_zh_CN.md
View file @
580ce0a3
File moved
deployment/pypi/README.md
→
archive-doc/
deployment/pypi/README.md
View file @
580ce0a3
File moved
deployment/pypi/README_zh_CN.md
→
archive-doc/
deployment/pypi/README_zh_CN.md
View file @
580ce0a3
File moved
examples/model_compress/BNN_quantizer_cifar10.py
View file @
580ce0a3
...
...
@@ -5,7 +5,7 @@ import torch
import
torch.nn
as
nn
import
torch.nn.functional
as
F
from
torchvision
import
datasets
,
transforms
from
nni.compression.torch
import
BNNQuantizer
from
nni.
algorithms.
compression.
py
torch
.quantization
import
BNNQuantizer
class
VGG_Cifar10
(
nn
.
Module
):
...
...
examples/model_compress/DoReFaQuantizer_torch_mnist.py
View file @
580ce0a3
import
torch
import
torch.nn.functional
as
F
from
torchvision
import
datasets
,
transforms
from
nni.compression.torch
import
DoReFaQuantizer
from
nni.
algorithms.
compression.
py
torch
.quantization
import
DoReFaQuantizer
class
Mnist
(
torch
.
nn
.
Module
):
...
...
@@ -86,4 +86,4 @@ def main():
if
__name__
==
'__main__'
:
main
()
\ No newline at end of file
main
()
examples/model_compress/L1_torch_cifar10.py
View file @
580ce0a3
...
...
@@ -3,7 +3,7 @@ import torch
import
torch.nn
as
nn
import
torch.nn.functional
as
F
from
torchvision
import
datasets
,
transforms
from
nni.compression.torch
import
L1FilterPruner
from
nni.
algorithms.
compression.
py
torch
.pruning
import
L1FilterPruner
from
models.cifar10.vgg
import
VGG
...
...
examples/model_compress/QAT_torch_quantizer.py
View file @
580ce0a3
import
torch
import
torch.nn.functional
as
F
from
torchvision
import
datasets
,
transforms
from
nni.compression.torch
import
QAT_Quantizer
from
nni.
algorithms.
compression.
py
torch
.quantization
import
QAT_Quantizer
class
Mnist
(
torch
.
nn
.
Module
):
...
...
examples/model_compress/amc/amc_search.py
View file @
580ce0a3
...
...
@@ -8,7 +8,7 @@ import time
import
torch
import
torch.nn
as
nn
from
torchvision.models
import
resnet
from
nni.compression.torch
import
AMCPruner
from
nni.
algorithms.
compression.
py
torch
.pruning
import
AMCPruner
from
data
import
get_split_dataset
from
utils
import
AverageMeter
,
accuracy
...
...
examples/model_compress/amc/amc_train.py
View file @
580ce0a3
...
...
@@ -15,9 +15,9 @@ import torch.optim as optim
from
tensorboardX
import
SummaryWriter
from
torchvision.models
import
resnet
from
nni.compression.torch.pruning.amc.lib.net_measure
import
measure_model
from
nni.compression.torch.pruning.amc.lib.utils
import
get_output_folder
from
nni.compression.torch
import
ModelSpeedup
from
nni.
algorithms.
compression.
py
torch.pruning.amc.lib.net_measure
import
measure_model
from
nni.
algorithms.
compression.
py
torch.pruning.amc.lib.utils
import
get_output_folder
from
nni.compression.
py
torch
import
ModelSpeedup
from
data
import
get_dataset
from
utils
import
AverageMeter
,
accuracy
,
progress_bar
...
...
examples/model_compress/auto_pruners_torch.py
View file @
580ce0a3
...
...
@@ -14,10 +14,10 @@ from torchvision import datasets, transforms
from
models.mnist.lenet
import
LeNet
from
models.cifar10.vgg
import
VGG
from
models.cifar10.resnet
import
ResNet18
,
ResNet50
from
nni.compression.torch
import
L1FilterPruner
,
L2FilterPruner
,
FPGMPruner
from
nni.compression.torch
import
SimulatedAnnealingPruner
,
ADMMPruner
,
NetAdaptPruner
,
AutoCompressPruner
from
nni.compression.torch
import
ModelSpeedup
from
nni.compression.torch.utils.counter
import
count_flops_params
from
nni.
algorithms.
compression.
py
torch
.pruning
import
L1FilterPruner
,
L2FilterPruner
,
FPGMPruner
from
nni.
algorithms.
compression.
py
torch
.pruning
import
SimulatedAnnealingPruner
,
ADMMPruner
,
NetAdaptPruner
,
AutoCompressPruner
from
nni.compression.
py
torch
import
ModelSpeedup
from
nni.compression.
py
torch.utils.counter
import
count_flops_params
def
get_data
(
dataset
,
data_dir
,
batch_size
,
test_batch_size
):
...
...
examples/model_compress/lottery_torch_mnist_fc.py
View file @
580ce0a3
...
...
@@ -6,7 +6,7 @@ import torch.nn.functional as F
import
torch.utils.data
import
torchvision.datasets
as
datasets
import
torchvision.transforms
as
transforms
from
nni.compression.torch
import
LotteryTicketPruner
from
nni.
algorithms.
compression.
py
torch
.pruning
import
LotteryTicketPruner
class
fc1
(
nn
.
Module
):
...
...
examples/model_compress/model_prune_torch.py
View file @
580ce0a3
...
...
@@ -9,8 +9,16 @@ from torchvision import datasets, transforms
from
models.cifar10.vgg
import
VGG
import
nni
from
nni.compression.torch
import
LevelPruner
,
SlimPruner
,
FPGMPruner
,
L1FilterPruner
,
\
L2FilterPruner
,
AGPPruner
,
ActivationMeanRankFilterPruner
,
ActivationAPoZRankFilterPruner
from
nni.algorithms.compression.pytorch.pruning
import
(
LevelPruner
,
SlimPruner
,
FPGMPruner
,
L1FilterPruner
,
L2FilterPruner
,
AGPPruner
,
ActivationMeanRankFilterPruner
,
ActivationAPoZRankFilterPruner
)
prune_config
=
{
'level'
:
{
...
...
Prev
1
2
Next
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment