-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Also add .so and tuning data for easier reproducibility.
- Loading branch information
1 parent
f08292c
commit b8d082c
Showing
29 changed files
with
4,692 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ mod.json | |
mod.params | ||
model.tar | ||
tuning*.json | ||
.nfs* |
Large diffs are not rendered by default.
Oops, something went wrong.
990 changes: 990 additions & 0 deletions
990
a100_squeezenet_tuned/tuning.2023-03-25T09:50+01:00.json
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
This is an extend version of the superresolution model. | ||
Instead of using a fixed 3 upscale ratio with an input of 224x224, | ||
we feed the model 640x480 inputs, similar to what would be a 480p video, | ||
and by changing the value in UPSCALE_FACTOR, we can simulate various resolution enanchement. | ||
|
||
For instance, a 6x upscaling would be close to a 4K output. | ||
A 4x would be similar to a FullHD output. | ||
A 12x would be a 8K output | ||
|
||
|
||
Original code available at https://raw.githubusercontent.com/pytorch/tutorials/main/advanced_source/super_resolution_with_onnxruntime.py | ||
Surrounding scripts released under GNU GPL v3. See [../LICENSE](../LICENSE). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
TUNING=$(ls tuning* --sort=time -1 | head -n1) | ||
|
||
set -x | ||
python3 -m tvm.driver.tvmc compile \ | ||
--target cuda | ||
--target-cuda-arch sm_80 \ | ||
--output model.tar \ | ||
--input-shape 'input:[1,1,640,480]' \ | ||
--tuning-records $TUNING \ | ||
super_resolution.onnx $@ \ | ||
|
||
#--output-shape 'input:[1,1,4096,3112]' \ | ||
|
||
tar -xvf model.tar |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
|
||
UPSCALE_FACTOR=$(cat UPSCALE_FACTOR) | ||
#DIR=$(basename "$PWD") | ||
DIR=a100_superresolution_${UPSCALE_FACTOR}_tuned | ||
CMD="../a100_superresolution_1_tuned/super_resolution_with_onnxruntime.py $UPSCALE_FACTOR" | ||
|
||
echo $CMD | ||
set -x | ||
sudo docker run --rm --gpus 1 \ | ||
-v $(pwd):/semla/modelzoo/$DIR \ | ||
-v $(pwd)/../a100_superresolution_1_tuned:/semla/modelzoo/a100_superresolution_1_tuned \ | ||
--workdir /semla/modelzoo/$DIR \ | ||
--entrypoint "/usr/bin/python3" \ | ||
semla/tvm_pytorch \ | ||
$CMD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
../a100_superresolution_1_tuned/convert.sh | ||
../a100_superresolution_1_tuned/tune.sh | ||
../a100_superresolution_1_tuned/compile.sh | ||
../a100_superresolution_1_tuned/fix_sizes.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#!/bin/bash | ||
wget https://github.com/onnx/models/raw/main/vision/super_resolution/sub_pixel_cnn_2016/model/super-resolution-10.onnx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/bin/bash | ||
|
||
UPSCALE_FACTOR=$(cat UPSCALE_FACTOR) | ||
W_OUTPUT=$(($UPSCALE_FACTOR * 640)) | ||
H_OUTPUT=$(($UPSCALE_FACTOR * 480)) | ||
MODEL_NAME=a100_superresolution_${UPSCALE_FACTOR}_tuned | ||
|
||
|
||
cat ../a100_superresolution_1_tuned/metadata.template.json \ | ||
| sed -e "s/W_OUTPUT/${W_OUTPUT}/g" \ | ||
| sed -e "s/H_OUTPUT/${H_OUTPUT}/g" \ | ||
| sed -e "s/MODEL_NAME/${MODEL_NAME}/g" \ | ||
| tee metadata.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"load_time": 1000000000, | ||
"exec_time": [1000000,2000000,4000000,8000000], | ||
"weights_size": 100000000, | ||
"workspace_size": 500000000, | ||
"input_name" : "input", | ||
"output_name" : "output", | ||
"input_shape": [1,1,640,480], | ||
"output_shape": [1,1,640,480], | ||
"input_type": "FP32", | ||
"output_type": "FP32", | ||
"device": "CUDA", | ||
"model" : "a100_superresolution_1_tuned", | ||
"architecture" : "CUDA_80" | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{ | ||
"load_time": 1000000000, | ||
"exec_time": [1000000,2000000,4000000,8000000], | ||
"weights_size": 100000000, | ||
"workspace_size": 500000000, | ||
"input_name" : "input", | ||
"output_name" : "output", | ||
"input_shape": [1,1,640,480], | ||
"output_shape": [1,1,W_OUTPUT,H_OUTPUT], | ||
"input_type": "FP32", | ||
"output_type": "FP32", | ||
"device": "CUDA", | ||
"model" : "MODEL_NAME", | ||
"architecture" : "CUDA_80" | ||
|
||
} |
Binary file not shown.
Binary file not shown.
Oops, something went wrong.