docs/How_To_Update_ONNX_Dev_Notes.md
This note is only for ONNX Runtime developers.
If you need to update the ONNX submodule to a different version, follow the steps below.
Currently, ONNXRUNTIME supports two ways to install ONNX cpp dependencies, one is through cmake/deps.txt, and the other one is by vcpkg. And both of them are guarded by CI. It is recommended to test vcpkg within Windows machines.
cd cmake/external/onnx
git remote update
git reset --hard <commit_id>
cd ..
git add onnx
(Change the <commit_id> to yours. If you are not sure, use 'origin/main'. Like 'git reset --hard origin/main')
./build.sh --config RelWithDebInfo --use_cuda --cuda_home /usr/local/cuda-12.6/ --cudnn_home /usr/local/cuda-12.6/ --build_wheel --parallel --skip_tests
Alternatively, directly run Terrapin to upload ONNX package (need SHA512):
C:\local\Terrapin\TerrapinRetrievalTool.exe -b https://vcpkg.storage.devpackages.microsoft.io/artifacts/ -a true -u Environment -p https://github.com/onnx/onnx/archive/866d145a8168e36f34741534df4c94d8e7588379.tar.gz -s 80e3a5db347bf3046a6fb8721f308c054c923aa5649ab704f0265e83bba6edac9f7e402dde2be3d9c01d3b291f5eb284eaba2df6986744161ece887e0c2fc845 -d "C:\Users\titaiwang\onnxruntime\build\Windows\vcpkg\downloads\onnx-onnx-866d145a8168e36f34741534df4c94d8e7588379.tar.gz.25136.part"
./build.sh --config RelWithDebInfo --use_cuda --cuda_home /usr/local/cuda-12.6/ --cudnn_home /usr/local/cuda-12.6/ --build_wheel --parallel --skip_tests --use_vcpkg
We need to update the auto-generated ONNX kernels markdowns and requirements.txt.
We can either use the following command lines to generate them, or go to CI (AzureDevOps published Artifacts) to download and upload the generated markdowns from CI to update them (suggested).
If you want to do the command lines:
# under onnxruntime root
python tools/python/gen_opkernel_doc.py --output_path docs/OperatorKernels.md
# Install dependencies at the parent JS level
cd /path/to/onnxruntime/js
npm install
# Install dependencies at the web level
cd /path/to/onnxruntime/js/web
npm install
# Build the doc
npm run build:doc
Update Python requirements files with the updated ONNX version (e.g., onnx==1.16.0) or commit hash if building from source (e.g., git+http://github.com/onnx/onnx.git@targetonnxcommithash#egg=onnx).
git grep -rn "onnx==1" . to find other locations and update this document if necessary.If there is any change to cmake/external/onnx/onnx/*.in.proto, you need to regenerate OnnxMl.cs.
Building onnxruntime with Nuget will do
this.
If you are updating ONNX from a released tag to a new commit, please ask Changming (@snnn) to deploy the new test data along with other test models to our CI build machines. This is to ensure that our tests cover every ONNX opset.
Send your PR, and manually queue a build for every packaging pipeline for your branch.
If there is a build failure in stage "Check out of dated documents" in WebAssembly CI pipeline, update ONNX Runtime Web WebGL operator support document:
docs/operators.md.Usually some newly introduced tests will fail. Then you may need to update