Skip to content

Commit

Permalink
ビルド済みエンジンに Rust 実装のコアを含めるようにする (#510)
Browse files Browse the repository at this point in the history
close #481
  • Loading branch information
PickledChair authored Dec 1, 2022
1 parent 1060356 commit ed3748c
Show file tree
Hide file tree
Showing 7 changed files with 571 additions and 382 deletions.
50 changes: 25 additions & 25 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/voicevox_engine
PYTHON_VERSION: "3.8.10"
VOICEVOX_RESOURCE_VERSION: "0.13.2"
VOICEVOX_CORE_VERSION: "0.13.2"
VOICEVOX_CORE_VERSION: "0.14.0-preview.2"
VOICEVOX_ENGINE_VERSION:
|- # releaseタグ名か、workflow_dispatchでのバージョン名か、latestが入る
${{ github.event.release.tag_name || github.event.inputs.version || 'latest' }}
Expand All @@ -38,42 +38,42 @@ jobs:
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-win-x64-1.10.0.zip
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-win-x64-1.11.1.zip
artifact_name: windows-cpu
# Windows DirectML
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-directml
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/Microsoft.ML.OnnxRuntime.DirectML.1.10.0.zip
directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.8.0
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/Microsoft.ML.OnnxRuntime.DirectML.1.11.1.zip
directml_url: https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.9.0
artifact_name: windows-directml
# Windows NVIDIA GPU
- os: windows-2019
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-windows-x64-cuda
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-win-x64-gpu-1.10.0.zip
cuda_version: "11.4.2"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.2.4/cudnn-11.4-windows-x64-v8.2.4.15.zip
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-win-x64-gpu-1.11.1.zip
cuda_version: "11.6.0"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-windows-x86_64-8.4.1.50_cuda11.6-archive.zip
artifact_name: windows-nvidia
# Mac CPU (x64 arch only)
- os: macos-11
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-osx-universal2-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-osx-universal2-1.10.0.tgz
voicevox_core_asset_prefix: voicevox_core-osx-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-osx-x86_64-1.11.1.tgz
artifact_name: macos-x64
# Linux CPU
- os: ubuntu-18.04
- os: ubuntu-20.04
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-linux-x64-cpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-1.10.0.tgz
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-linux-x64-1.11.1.tgz
artifact_name: linux-cpu
# Linux NVIDIA GPU
- os: ubuntu-18.04
- os: ubuntu-20.04
architecture: "x64"
voicevox_core_asset_prefix: voicevox_core-linux-x64-gpu
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.10.0/onnxruntime-linux-x64-gpu-1.10.0.tgz
cuda_version: "11.4.2"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.2.4/cudnn-11.4-linux-x64-v8.2.4.15.tgz
onnxruntime_url: https://github.com/microsoft/onnxruntime/releases/download/v1.11.1/onnxruntime-linux-x64-gpu-1.11.1.tgz
cuda_version: "11.6.0"
cudnn_url: https://developer.download.nvidia.com/compute/redist/cudnn/v8.4.1/local_installers/11.6/cudnn-linux-x86_64-8.4.1.50_cuda11.6-archive.tar.xz
artifact_name: linux-nvidia

runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -177,27 +177,27 @@ jobs:
if [[ ${{ matrix.os }} == windows-* ]]; then
curl -L "${{ matrix.cudnn_url }}" > download/cudnn.zip
unzip download/cudnn.zip cuda/bin/*.dll -d download/cudnn_tmp
unzip download/cudnn.zip cudnn-*/bin/*.dll -d download/cudnn_tmp

mkdir -p download/cudnn/bin
mv download/cudnn_tmp/cuda/bin/*.dll download/cudnn/bin/
mv download/cudnn_tmp/cudnn-*/bin/*.dll download/cudnn/bin/
rm -rf download/cudnn_tmp

rm download/cudnn.zip
else
curl -L "${{ matrix.cudnn_url }}" > download/cudnn.tgz
curl -L "${{ matrix.cudnn_url }}" > download/cudnn.tar.xz

tar -zxf download/cudnn.tgz -C download/
tar -Jxf download/cudnn.tar.xz -C download/

mkdir -p download/cudnn/bin
cp download/cuda/lib64/libcudnn.so.* download/cudnn/bin/
cp download/cuda/lib64/libcudnn_*_infer.so.* download/cudnn/bin/
cp download/cudnn-*/lib/libcudnn.so.* download/cudnn/bin/
cp download/cudnn-*/lib/libcudnn_*_infer.so.* download/cudnn/bin/

# remove unneed full version libraries
rm -f download/cudnn/bin/libcudnn.so.*.*
rm -f download/cudnn/bin/libcudnn_*_infer.so.*.*

rm download/cudnn.tgz
rm download/cudnn.tar.xz
fi

- name: Show disk space (debug info)
Expand Down Expand Up @@ -392,15 +392,15 @@ jobs:
# Replace version & specify dynamic libraries
if [[ ${{ matrix.os }} == macos-* ]]; then
gsed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION }}\"/" voicevox_engine/__init__.py
LIBCORE_PATH=download/core/libcore.dylib
LIBCORE_PATH=download/core/libvoicevox_core.dylib
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.dylib
else
sed -i "s/__version__ = \"latest\"/__version__ = \"${{ env.VOICEVOX_ENGINE_VERSION }}\"/" voicevox_engine/__init__.py
if [[ ${{ matrix.os }} == windows-* ]]; then
LIBCORE_PATH=download/core/core.dll
LIBCORE_PATH=download/core/voicevox_core.dll
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/onnxruntime.dll
else
LIBCORE_PATH=download/core/libcore.so
LIBCORE_PATH=download/core/libvoicevox_core.so
LIBONNXRUNTIME_PATH=download/onnxruntime/lib/libonnxruntime.so
fi
fi
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ jobs:
fail-fast: false
matrix:
include:
- os: ubuntu-18.04
- os: ubuntu-20.04
target: linux-cpu
- os: ubuntu-18.04
- os: ubuntu-20.04
target: linux-nvidia
- os: macos-10.15
- os: macos-11
target: macos-x64
- os: windows-2019
target: windows-cpu
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, windows-latest] # [ubuntu-latest, macos-latest, windows-latest]
os: [ubuntu-20.04, windows-latest] # [ubuntu-20.04, macos-latest, windows-latest]
python: ['3.8.10']
include:
- os: ubuntu-latest
- os: ubuntu-20.04
path: ~/.cache/pip
# - os: macos-latest
# path: ~/Library/Caches/pip
Expand All @@ -32,7 +32,7 @@ jobs:
cache: pip

- name: Install libraries for ubuntu
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-20.04'
run: sudo apt-get install libsndfile1

- name: Install dependencies
Expand All @@ -47,20 +47,20 @@ jobs:
coverage run --omit=test/* -m pytest
- name: Submit coverage to Coveralls
if: matrix.os == 'ubuntu-latest'
if: matrix.os == 'ubuntu-20.04'
run: coveralls --service=github
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Create coverage result
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04'
run: |
mkdir report
coverage report > report/report.txt
echo ${{ github.event.number }} > report/pr_num.txt
- name: Upload coverage result
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-latest'
if: github.event_name == 'pull_request' && matrix.os == 'ubuntu-20.04'
uses: actions/upload-artifact@v3
with:
name: report
Expand Down
Loading

0 comments on commit ed3748c

Please sign in to comment.