Skip to content

Commit

Permalink
Merge pull request amd#95 from gguasti/unified_public
Browse files Browse the repository at this point in the history
Unified public
  • Loading branch information
cyndwith committed Aug 27, 2024
1 parent 3a8ea56 commit 35d3f6c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 deletions.
18 changes: 7 additions & 11 deletions onnx-benchmark/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,7 @@ Author: AMD-Xilinx
- [3.3.8 File of parameters](#338-file-of-parameters)
- [4 Additional features](#4-additional-features)
- [4.1 Auto quantization](#41-auto-quantization)
<<<<<<< HEAD
- [4.2 Tricks](#42-tricks)
=======
- [4.2 tricks](#42-tricks)
>>>>>>> b02f64fa (Merge branch 'VitisAI:main' into main_ci_add)


# <a name='Title'></a>RYZENAI-ONNX-CNNs-BENCHMARK
Expand Down Expand Up @@ -83,7 +79,6 @@ conda env config vars set VAIP_CONFIG_HOME="C:\Program Files\RyzenAI\1.2.0\voe-4
conda deactivate
conda activate ryzen-ai-1.2.0
conda env config vars list
<<<<<<< HEAD
```

In case of PHOENIX device:
Expand All @@ -101,8 +96,6 @@ Downgrade onnx to 1.16.1 to resolve an issue with the 1.16.2 release
https://github.com/onnx/onnx/issues/6267
```
pip install onnx==1.16.1
=======
>>>>>>> b02f64fa (Merge branch 'VitisAI:main' into main_ci_add)
```

In case of PHOENIX device:
Expand All @@ -116,6 +109,13 @@ conda activate ryzen-ai-1.2.0
conda env config vars list
```

Downgrade onnx to 1.16.1 to resolve an issue with the 1.16.2 release
https://github.com/onnx/onnx/issues/6267
```
pip install onnx==1.16.1
```


---

# 3 <a name='ONNXBenchmark'></a>ONNX Benchmark
Expand Down Expand Up @@ -269,9 +269,5 @@ Prior to quantization, the user is required to download some images, for example
python performance_benchmark.py -m ".\models\resnet50\resnet50_fp32.onnx" -e VitisAIEP --calib <images folder> --num_calib 10
```

<<<<<<< HEAD
## 4.2 Tricks
=======
## 4.2 tricks
>>>>>>> b02f64fa (Merge branch 'VitisAI:main' into main_ci_add)
Once executed in the GUI, the equivalent command line is copied to the clipboard, making it easy to paste into the terminal.
21 changes: 0 additions & 21 deletions onnx-benchmark/utilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -469,28 +469,8 @@ def ggquantize(args):
newopset = 17
original_model = onnx.load(input_model_path)
opset_version = original_model.opset_import[0].version
<<<<<<< HEAD

# temporary fix: after conversion the opset is not updated to 17 but to 1
if opset_version<11:
if opset_version==1 :
ggprint(f'[WARNING] The model opset version is 1, which seems unlikely. This might be the result of a previous opset conversion.')
else:
ggprint(f'The model OPSET is {opset_version} and should be updated to {newopset}')
user_response = ask_update()
if user_response == 'y':
output_updated = f"{base_name}_opset17{extension}"
converted_model = version_converter.convert_version(original_model, newopset)
#print(f"The model after conversion:\n{converted_model}")
onnx.save(converted_model, output_updated)
print(f'The update model was saved with name {output_updated}')
# verify opset
updated_model = onnx.load(output_updated)
ggprint(f"Updated model opset version: {updated_model.opset_import[0].version}")
input_model_path = output_updated
else:
ggprint("You chose not to update")
=======
if opset_version<11:
ggprint(f'The model OPSET is {opset_version} and should be updated to {newopset}')
user_response = ask_update()
Expand All @@ -503,7 +483,6 @@ def ggquantize(args):
input_model_path = output_updated
else:
print("You chose not to update")
>>>>>>> b02f64fa (Merge branch 'VitisAI:main' into main_ci_add)
# free memory
del original_model
gc.collect()
Expand Down

0 comments on commit 35d3f6c

Please sign in to comment.