Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onnxruntime-rsからortに乗り換える #725

Merged
merged 42 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from 39 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
87ff8b6
onnxruntime-rsからortに乗り換える
qryxip Jan 10, 2024
6b04c1f
`--features onnxruntime/disable-sys-build-script`を消す
qryxip Jan 10, 2024
3215aa8
ortをアップデート
qryxip Jan 10, 2024
81aa2f8
ortをアップデート
qryxip Jan 11, 2024
0dec554
`onnxruntimeVersion`をアップデート
qryxip Jan 11, 2024
d68f236
libonnxruntimeのコピー処理を更新
qryxip Jan 11, 2024
e656723
ortをアップデート
qryxip Jan 13, 2024
95fdea0
libonnxruntimeのコピー処理を更新
qryxip Jan 13, 2024
f7708f0
ortをアップデート
qryxip Jan 15, 2024
d8b8ffc
ortをアップデート
qryxip Jan 18, 2024
6740a9d
`ort::ExecutionProvider::is_available`を使う
qryxip Jan 20, 2024
be70dba
`todo!`を消す
qryxip Jan 20, 2024
a4e7b2c
ortをアップデート
qryxip Jan 21, 2024
ae8dc0a
ortにあったAPIを使う
qryxip Jan 21, 2024
fbd26cb
ortをアップデート
qryxip Jan 21, 2024
f65f61a
`$ORT_OUT_DIR`を削除
qryxip Jan 21, 2024
aebe949
ortをアップデート
qryxip Jan 21, 2024
8e49fc3
ログのフィルタを更新
qryxip Jan 21, 2024
205274d
ortをアップデート
qryxip Jan 23, 2024
d3b971e
tracingのレベルでortのログを抑える
qryxip Jan 23, 2024
0ab68f2
Minor refactor
qryxip Jan 23, 2024
e9eae94
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Jan 28, 2024
b1e225a
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Feb 10, 2024
2108b90
ortをアップデート
qryxip Feb 11, 2024
46a93dd
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Feb 11, 2024
4779da5
Fix Cargo.lock
qryxip Feb 11, 2024
6b1af81
Gradleのlibonnxruntimeのバージョンを更新
qryxip Feb 11, 2024
f1503ac
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Mar 30, 2024
b147977
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Apr 19, 2024
fc968d1
ort v2.0.0-rc.1ベースに切り替える
qryxip Apr 28, 2024
dfe5009
Gradleのlibonnxruntimeのバージョンを更新
qryxip Apr 28, 2024
7e74743
`with_execution_provider` → `register`
qryxip Apr 28, 2024
b51033c
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Apr 30, 2024
0d77945
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip Apr 30, 2024
2f23dc8
ort v2.0.0-rc.2ベースに切り替える
qryxip May 1, 2024
2584395
Gradleのlibonnxruntimeのバージョンを更新
qryxip May 1, 2024
a684538
voicevox-ortを更新
qryxip May 2, 2024
ef9c216
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip May 3, 2024
3c7529d
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip May 6, 2024
7b1d234
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip May 11, 2024
93f7885
VOICEVOX/ort#2 に追従する
qryxip May 21, 2024
d6a7bb0
Merge branch 'main' into onnxruntime-rs-to-ort
qryxip May 21, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@ xtask = "run -p xtask --"
[env]
CARGO_WORKSPACE_DIR = { value = "", relative = true }

# Windows環境でテストエラーになるのを防ぐために設定するworkaround
# https://github.com/VOICEVOX/onnxruntime-rs/issues/3#issuecomment-1207381367
ORT_OUT_DIR = { value = "target/debug/deps", relative = true }

[target.aarch64-unknown-linux-gnu]
linker = "aarch64-linux-gnu-gcc"

Expand Down
23 changes: 3 additions & 20 deletions .github/workflows/build_and_deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ jobs:
"target": "x86_64-pc-windows-msvc",
"artifact_name": "windows-x64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
Expand All @@ -67,16 +66,14 @@ jobs:
"target": "x86_64-pc-windows-msvc",
"artifact_name": "windows-x64-directml",
"whl_local_version": "directml",
"use_cuda": false,
"can_skip_in_simple_test": false
},
{
"os": "windows-2019",
"features": "",
"features": "cuda",
"target": "x86_64-pc-windows-msvc",
"artifact_name": "windows-x64-cuda",
"whl_local_version": "cuda",
"use_cuda": true,
"can_skip_in_simple_test": true
},
{
Expand All @@ -85,7 +82,6 @@ jobs:
"target": "i686-pc-windows-msvc",
"artifact_name": "windows-x86-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
Expand All @@ -94,16 +90,14 @@ jobs:
"target": "x86_64-unknown-linux-gnu",
"artifact_name": "linux-x64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "ubuntu-20.04",
"features": "",
"features": "cuda",
"target": "x86_64-unknown-linux-gnu",
"artifact_name": "linux-x64-gpu",
"whl_local_version": "cuda",
"use_cuda": true,
"can_skip_in_simple_test": false
},
{
Expand All @@ -112,23 +106,20 @@ jobs:
"target": "aarch64-unknown-linux-gnu",
"artifact_name": "linux-arm64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "ubuntu-20.04",
"features": "",
"target": "aarch64-linux-android",
"artifact_name": "android-arm64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "ubuntu-20.04",
"features": "",
"target": "x86_64-linux-android",
"artifact_name": "android-x86_64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
Expand All @@ -137,7 +128,6 @@ jobs:
"target": "aarch64-apple-darwin",
"artifact_name": "osx-arm64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": false
},
{
Expand All @@ -146,31 +136,27 @@ jobs:
"target": "x86_64-apple-darwin",
"artifact_name": "osx-x64-cpu",
"whl_local_version": "cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "macos-12",
"features": "",
"target": "aarch64-apple-ios",
"artifact_name": "ios-arm64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "macos-12",
"features": "",
"target": "aarch64-apple-ios-sim",
"artifact_name": "ios-arm64-cpu-sim",
"use_cuda": false,
"can_skip_in_simple_test": true
},
{
"os": "macos-12",
"features": "",
"target": "x86_64-apple-ios",
"artifact_name": "ios-x64-cpu",
"use_cuda": false,
"can_skip_in_simple_test": true
}
]'
Expand Down Expand Up @@ -268,7 +254,6 @@ jobs:
fi
env:
RUSTFLAGS: -C panic=abort
ORT_USE_CUDA: ${{ matrix.use_cuda }}
- name: build voicevox_core_python_api
if: matrix.whl_local_version
id: build-voicevox-core-python-api
Expand All @@ -286,8 +271,6 @@ jobs:
build > /dev/null 2>&1
fi
echo "whl=$(find ./target/wheels -type f)" >> "$GITHUB_OUTPUT"
env:
ORT_USE_CUDA: ${{ matrix.use_cuda }}
- name: build voicevox_core_java_api
if: contains(matrix.target, 'android')
run: |
Expand All @@ -305,7 +288,7 @@ jobs:
cp -v crates/voicevox_core_c_api/include/voicevox_core.h "artifact/${{ env.ASSET_NAME }}"
cp -v target/${{ matrix.target }}/release/*voicevox_core.{dll,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true
cp -v target/${{ matrix.target }}/release/voicevox_core.dll.lib "artifact/${{ env.ASSET_NAME }}/voicevox_core.lib" || true
cp -v -n target/${{ matrix.target }}/release/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/*.{dll,so.*,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true
cp -v -n target/${{ matrix.target }}/release/{,lib}onnxruntime*.{dll,so.*,so,dylib} "artifact/${{ env.ASSET_NAME }}" || true
# libonnxruntimeについてはバージョン付のshared libraryを使用するためバージョンがついてないものを削除する
rm -f artifact/${{ env.ASSET_NAME }}/libonnxruntime.{so,dylib}
cp -v README.md "artifact/${{ env.ASSET_NAME }}/README.txt"
Expand Down
14 changes: 7 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ jobs:
with:
python-version: "3.8"
- uses: Swatinem/rust-cache@v2
- run: cargo clippy -vv --all-features --features onnxruntime/disable-sys-build-script --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -vv --all-features --features onnxruntime/disable-sys-build-script -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -vv --all-features --tests -- -D clippy::all -D warnings --no-deps
- run: cargo clippy -vv --all-features -- -D clippy::all -D warnings --no-deps
- run: cargo fmt -- --check

rust-unit-test:
Expand Down Expand Up @@ -199,8 +199,8 @@ jobs:
mkdir -p example/cpp/unix/voicevox_core/
cp -v crates/voicevox_core_c_api/include/voicevox_core.h example/cpp/unix/voicevox_core/
cp -v target/debug/libvoicevox_core.{so,dylib} example/cpp/unix/voicevox_core/ || true
cp -v target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.so.* example/cpp/unix/voicevox_core/ || true
cp -v target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.*.dylib example/cpp/unix/voicevox_core/ || true
cp -v target/debug/libonnxruntime.so.* example/cpp/unix/voicevox_core/ || true
cp -v target/debug/libonnxruntime.*.dylib example/cpp/unix/voicevox_core/ || true

- if: startsWith(matrix.os, 'mac')
uses: jwlawson/[email protected]
Expand Down Expand Up @@ -281,9 +281,9 @@ jobs:
- run: poetry run maturin develop --locked
- name: 必要なDLLをコピーしてpytestを実行
run: |
cp -v ../../target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/onnxruntime.dll . || true
cp -v ../../target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.so.* . || true
cp -v ../../target/debug/build/onnxruntime-sys-*/out/onnxruntime_*/onnxruntime-*/lib/libonnxruntime.*.dylib . || true
cp -v ../../target/debug/onnxruntime.dll . || true
cp -v ../../target/debug/libonnxruntime.so.* . || true
cp -v ../../target/debug/libonnxruntime.*.dylib . || true

poetry run pytest
- name: Exampleを実行
Expand Down
Loading
Loading