Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
distiller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
llvm
distiller
Commits
408fb1bd
Commit
408fb1bd
authored
4 years ago
by
Guy Jacob
Browse files
Options
Downloads
Patches
Plain Diff
Shell script for batch-running post-train quantization command line examples
parent
32a7e4bf
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/quantization/post_train_quant/run_all_ptq_cmdline_samples.sh
+42
-0
42 additions, 0 deletions
...ntization/post_train_quant/run_all_ptq_cmdline_samples.sh
with
42 additions
and
0 deletions
examples/quantization/post_train_quant/run_all_ptq_cmdline_samples.sh
0 → 100644
+
42
−
0
View file @
408fb1bd
#!/bin/bash
# This script was used to generate the results shown in post-training quantization command line readme at:
# <distiller_root>/examples/quantization/post_train_quant/command_line.md
# Note that the readme shows only a subset of the tests run by this script, especially the 6-bits tests.
# This scripts also runs the conversion to "native" PyTorch post-train quant feature.
#
# IMPORTANT:
# * It is assumed that the script is run from the following directory:
# <distiller_root>/examples/classifier_compression
# Some of the paths used are relative to this directory.
model
=
"resnet50"
dataset_path
=
"
$MACHINE_HOME
/datasets/imagenet"
stats_file
=
"../quantization/post_train_quant/stats/
${
model
}
_quant_stats.yaml"
out_dir
=
"logs/
${
model
}
_ptq_pytorch_convert_latest"
num_workers
=
22
base_args
=
"--arch
${
model
}
${
dataset_path
}
--pretrained -j
${
num_workers
}
--evaluate --quantize-eval --qe-stats-file
${
stats_file
}
-o
${
out_dir
}
"
for
engine
in
distiller pytorch
;
do
convert_flag
=
""
if
[
"
$engine
"
=
pytorch
]
;
then
convert_flag
=
"--qe-convert-pytorch"
fi
for
n_bits
in
8 6
;
do
for
acts_mode
in
sym asym_u
;
do
for
wts_mode
in
sym asym_u
;
do
for
per_ch
in
per_tensor per_channel
;
do
per_ch_flag
=
""
if
[
"
$per_ch
"
=
per_channel
]
;
then
per_ch_flag
=
"--qe-per-channel"
fi
exp_name
=
"acts_
${
acts_mode
}
_wts_
${
wts_mode
}
_
${
per_ch
}
_
${
engine
}
"
set
-x
python compress_classifier.py
${
base_args
}
--qe-mode-acts
${
acts_mode
}
--qe-mode-wts
${
wts_mode
}
--qe-bits-acts
${
n_bits
}
--qe-bits-wts
${
n_bits
}
${
per_ch_flag
}
${
convert_flag
}
--name
${
exp_name
}
set
+x
done
done
done
done
done
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment