Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Fix integration tests (#2234)
Browse files Browse the repository at this point in the history
  • Loading branch information
chicm-ms authored Mar 25, 2020
1 parent 4e2c0aa commit c2e4901
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 37 deletions.
2 changes: 1 addition & 1 deletion examples/model_compress/model_prune_torch.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
'op_types': ['Conv2d']
}]
},
'l1': {
'l1filter': {
'dataset_name': 'cifar10',
'model_name': 'vgg16',
'pruner_class': L1FilterPruner,
Expand Down
19 changes: 9 additions & 10 deletions test/config/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,16 +77,15 @@ testCases:
kwargs:
expected_result_file: expected_metrics.json

# to be enabled
#- name: metrics-dict
# configFile: test/config/metrics_test/config_dict_metrics.yml
# config:
# maxTrialNum: 1
# trialConcurrency: 1
# validator:
# class: MetricsValidator
# kwargs:
# expected_result_file: expected_metrics_dict.json
- name: metrics-dict
configFile: test/config/metrics_test/config_dict_metrics.yml
config:
maxTrialNum: 1
trialConcurrency: 1
validator:
class: MetricsValidator
kwargs:
expected_result_file: expected_metrics_dict.json

- name: nnicli
configFile: test/config/examples/sklearn-regression.yml
Expand Down
19 changes: 9 additions & 10 deletions test/config/pr_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,15 @@ testCases:
kwargs:
expected_result_file: expected_metrics.json

# to be enabled
#- name: metrics-dict
# configFile: test/config/metrics_test/config_dict_metrics.yml
# config:
# maxTrialNum: 1
# trialConcurrency: 1
# validator:
# class: MetricsValidator
# kwargs:
# expected_result_file: expected_metrics_dict.json
- name: metrics-dict
configFile: test/config/metrics_test/config_dict_metrics.yml
config:
maxTrialNum: 1
trialConcurrency: 1
validator:
class: MetricsValidator
kwargs:
expected_result_file: expected_metrics_dict.json

- name: nnicli
configFile: test/config/examples/sklearn-regression.yml
Expand Down
24 changes: 8 additions & 16 deletions test/scripts/model_compression.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,14 @@ echo ""
echo "===========================Testing: pruning and speedup==========================="
cd ${CWD}/../examples/model_compress

echo "testing slim pruning and speedup..."
python3 model_prune_torch.py --pruner_name slim --pretrain_epochs 1 --prune_epochs 1
python3 model_speedup.py --example_name slim --model_checkpoint ./checkpoints/pruned_vgg19_cifar10_slim.pth \
--masks_file ./checkpoints/mask_vgg19_cifar10_slim.pth

echo "testing l1 pruning and speedup..."
python3 model_prune_torch.py --pruner_name l1 --pretrain_epochs 1 --prune_epochs 1
python3 model_speedup.py --example_name l1filter --model_checkpoint ./checkpoints/pruned_vgg16_cifar10_l1.pth \
--masks_file ./checkpoints/mask_vgg16_cifar10_l1.pth

echo "testing apoz pruning and speedup..."
python3 model_prune_torch.py --pruner_name apoz --pretrain_epochs 1 --prune_epochs 1
python3 model_speedup.py --example_name apoz --model_checkpoint ./checkpoints/pruned_vgg16_cifar10_apoz.pth \
--masks_file ./checkpoints/mask_vgg16_cifar10_apoz.pth

for name in level fpgm mean_activation
for name in fpgm slim l1filter apoz
do
echo "testing $name pruning and speedup..."
python3 model_prune_torch.py --pruner_name $name --pretrain_epochs 1 --prune_epochs 1
python3 model_speedup.py --example_name $name
done

for name in level mean_activation
do
echo "testing $name pruning..."
python3 model_prune_torch.py --pruner_name $name --pretrain_epochs 1 --prune_epochs 1
Expand Down

0 comments on commit c2e4901

Please sign in to comment.