Skip to content

Commit

Permalink
compile float model as well
Browse files Browse the repository at this point in the history
Signed-off-by: yiliu30 <yi4.liu@intel.com>
  • Loading branch information
yiliu30 committed Oct 15, 2024
1 parent 8a7b4df commit 338ba27
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
2 changes: 2 additions & 0 deletions examples/3.x_api/pytorch/cv/static_quant/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,9 @@ def eval_func(model):
new_model = opt_model
else:
new_model = model
# For fair comparison, we also compile the float model
new_model.eval()
new_model = torch.compile(new_model)
if args.performance:
benchmark(val_loader, new_model, args)
return
Expand Down
4 changes: 4 additions & 0 deletions examples/3.x_api/pytorch/cv/static_quant/run_quant.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ function main {

# init params
function init_params {
batch_size=16
tuned_checkpoint="saved_results"
for var in "$@"
do
Expand All @@ -22,6 +23,9 @@ function init_params {
;;
--input_model=*)
input_model=$(echo $var |cut -f2 -d=)
;;
--batch_size=*)
batch_size=$(echo $var |cut -f2 -d=)
;;
--output_model=*)
tuned_checkpoint=$(echo $var |cut -f2 -d=)
Expand Down

0 comments on commit 338ba27

Please sign in to comment.