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

Add Debug Pipelines #1116

Open
wants to merge 17 commits into
base: main
Choose a base branch
from
24 changes: 12 additions & 12 deletions .github/workflows/linux-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,26 +70,26 @@ jobs:
--container-registry onnxruntimebuildcache \
--repository ort_genai_linux_arm64_gha

- name: Docker -- Configure with CMake and GCC
- name: Build with Python
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "/usr/bin/cmake --preset linux_gcc_cpu_release"

- name: Docker -- Build with CMake and GCC
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "/usr/bin/cmake --build --preset linux_gcc_cpu_release"
set -e -x
docker run \
--rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src ort_genai_linux_arm64_gha \
bash -c " \
python3 -m pip install wheel && \
python3 -m pip install requests && \
python3 build.py --parallel --config=Debug"

- name: Docker -- Check test directory
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "ls -l /onnxruntime_src/build/cpu/test/"
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "ls -l /onnxruntime_src/build/Linux/Debug/test/"

- name: Docker -- Run tests
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/onnxruntime_src/ort/lib/ /onnxruntime_src/build/cpu/unit_tests"
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/onnxruntime_src/ort/lib/ /onnxruntime_src/build/Linux/Debug/unit_tests"
20 changes: 9 additions & 11 deletions .github/workflows/linux-cpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,17 @@ jobs:
mv microsoft.ml.onnxruntime/${{ env.ORT_NIGHTLY_VERSION }}/runtimes/linux-x64/native/* ort/lib/
cp ort/lib/libonnxruntime.so ort/lib/libonnxruntime.so.1

- name: Build with CMake and GCC
- name: Build with Python
run: |
set -e -x
rm -rf build
cmake --preset linux_gcc_cpu_release
cmake --build --preset linux_gcc_cpu_release
python -m pip install requests
python3 build.py --parallel --config=Debug

- name: Install the python wheel and test dependencies
run: |
python3 -m pip install -r test/python/requirements.txt --user
python3 -m pip install -r test/python/cpu/torch/requirements.txt --user
python3 -m pip install -r test/python/cpu/ort/requirements.txt --user
python3 -m pip install --user --no-index --no-deps --find-links build/cpu/wheel onnxruntime_genai
python3 -m pip install --user --no-index --no-deps --find-links build/Linux/Debug/wheel onnxruntime_genai

- name: Use Dummy HuggingFace Token
run: |
Expand All @@ -92,8 +90,8 @@ jobs:
if: always()
continue-on-error: true
run: |
ls -l ${{ github.workspace }}/build/cpu
ls -l ${{ github.workspace }}/build/cpu/wheel
ls -l ${{ github.workspace }}/build/Linux/Debug
ls -l ${{ github.workspace }}/build/Linux/Debug/wheel

# This will also download all the test models to the test/test_models directory
# These models are used by the python tests as well as C#, C++ and others.
Expand All @@ -106,16 +104,16 @@ jobs:
run: |
export ORTGENAI_LOG_ORT_LIB=1
cd test/csharp
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/" /p:OrtLibDir="../../ort/lib/" --verbosity normal
dotnet test /p:Configuration=Debug /p:NativeBuildOutputDir="../../build/Linux/Debug/" /p:OrtLibDir="../../ort/lib/" --verbosity normal

- name: Build the Java API and Run the Java Tests
run: |
set -e -x
python3 build.py --config=Release --build_dir build/cpu --build_java --parallel --cmake_generator "Ninja"
python3 build.py --config=Debug --build_dir build/Linux/Debug --build_java --parallel

- name: Run tests
run: |
set -e -x
export ORTGENAI_LOG_ORT_LIB=1
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$GITHUB_WORKSPACE/ort/lib
./build/cpu/unit_tests
./build/Linux/Debug/unit_tests
12 changes: 4 additions & 8 deletions .github/workflows/linux-cpu-x64-nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ jobs:
- name: Checkout OnnxRuntime GenAI repo
uses: actions/checkout@v2



- name: Download OnnxRuntime
run: |
curl -L -o ${{ env.ort_zip }} ${{ env.ort_url }}
Expand All @@ -41,19 +39,17 @@ jobs:
run: |
git submodule update --init --recursive

- name: Build with CMake and clang
- name: Build with Python
run: |
set -e -x
rm -rf build
cmake --preset linux_gcc_cpu_release
cmake --build --preset linux_gcc_cpu_release
python3 -m pip install requests
python3 build.py --parallel --config=Release

- name: Install the python wheel and test dependencies
run: |
python3 -m pip install -r test/python/requirements.txt --user
python3 -m pip install -r test/python/cpu/torch/requirements.txt --user
python3 -m pip install -r test/python/cpu/ort/requirements.txt --user
python3 -m pip install build/cpu/wheel/onnxruntime_genai*.whl --no-deps
python3 -m pip install build/Linux/Release/wheel/onnxruntime_genai*.whl --no-deps

- name: Use Dummy HuggingFace Token
run: |
Expand Down
23 changes: 6 additions & 17 deletions .github/workflows/linux-gpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ jobs:
--multiple_repos \
--repository onnxruntimecudabuildx64

- name: Config with Cmake in Docker
- name: Build with Python in Docker
run: |
set -e -x
docker run \
Expand All @@ -94,20 +94,9 @@ jobs:
--volume $GITHUB_WORKSPACE:/ort_genai_src \
-w /ort_genai_src onnxruntimecudabuildx64 \
bash -c " \
/usr/bin/cmake --preset linux_gcc_cuda_release \
-DMANYLINUX=ON \
-DPYTHON_EXECUTABLE=${{ env.PYTHON_EXECUTABLE }} "

- name: Build with Cmake in Docker
run: |
set -e -x
docker run \
--gpus all \
--rm \
--volume $GITHUB_WORKSPACE:/ort_genai_src \
-w /ort_genai_src onnxruntimecudabuildx64 \
bash -c " \
/usr/bin/cmake --build --preset linux_gcc_cuda_release"
${{ env.PYTHON_EXECUTABLE }} -m pip install requests && \
${{ env.PYTHON_EXECUTABLE }} -m pip install wheel && \
${{ env.PYTHON_EXECUTABLE }} build.py --use_cuda --cuda_home=/usr/local/cuda-12.2 --parallel --config=Debug"

- name: Use Dummy HuggingFace Token
run: |
Expand All @@ -126,7 +115,7 @@ jobs:
${{ env.PYTHON_EXECUTABLE }} -m pip install -r test/python/requirements.txt --user && \
${{ env.PYTHON_EXECUTABLE }} -m pip install -r test/python/cuda/torch/requirements.txt --user && \
${{ env.PYTHON_EXECUTABLE }} -m pip install -r test/python/cuda/ort/requirements.txt --user && \
${{ env.PYTHON_EXECUTABLE }} -m pip install /ort_genai_src/build/cuda/wheel/onnxruntime_genai*manylinux*.whl --no-deps --user && \
${{ env.PYTHON_EXECUTABLE }} -m pip install /ort_genai_src/build/Linux/Debug/wheel/onnxruntime_genai*manylinux*.whl --no-deps --user && \
${{ env.PYTHON_EXECUTABLE }} test/python/test_onnxruntime_genai.py --cwd test/python --test_models test/test_models --e2e"

# TODO: Enable this by adding dotnet to the docker image
Expand All @@ -148,4 +137,4 @@ jobs:
--rm \
--volume /data/ortgenai_pytorch_models:/data/ortgenai_pytorch_models \
--volume $GITHUB_WORKSPACE:/ort_genai_src \
-w /ort_genai_src onnxruntimecudabuildx64 bash -c "ORTGENAI_LOG_ORT_LIB=1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ort_genai_src/build/cuda/ /ort_genai_src/build/cuda/unit_tests"
-w /ort_genai_src onnxruntimecudabuildx64 bash -c "ORTGENAI_LOG_ORT_LIB=1 LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ort_genai_src/build/Linux/Debug/ /ort_genai_src/build/Linux/Debug/unit_tests"
26 changes: 12 additions & 14 deletions .github/workflows/mac-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,14 +52,11 @@ jobs:
mv ${{ env.ORT_PACKAGE_NAME }}/build/native/include ort/
mv ${{ env.ORT_PACKAGE_NAME }}/runtimes/osx-arm64/native/* ort/lib/

- name: Configure CMake
- name: Build with Python
run: |
cmake --preset macos_arm64_cpu_release

- name: Build with CMake
run: |
cmake --build --preset macos_arm64_cpu_release --parallel
continue-on-error: false
python3 -m pip install requests
python3 -m pip install wheel
python3 build.py --parallel --config=Release --cmake_generator "Unix Makefiles"

- name: Install the python wheel and test dependencies
run: |
Expand All @@ -68,7 +65,7 @@ jobs:
python3 -m pip install -r test/python/requirements.txt
python3 -m pip install -r test/python/macos/torch/requirements.txt
python3 -m pip install -r test/python/macos/ort/requirements.txt
python3 -m pip install build/cpu/osx-arm64/wheel/onnxruntime_genai*.whl --no-deps
python3 -m pip install build/MacOS/Release/wheel/onnxruntime_genai*.whl --no-deps

- name: Remove the ort lib and header files
run: |
Expand All @@ -78,8 +75,8 @@ jobs:
if: always()
continue-on-error: true
run: |
ls -l ${{ github.workspace }}/build/cpu/osx-arm64
ls -l ${{ github.workspace }}/build/cpu/osx-arm64/wheel
ls -l ${{ github.workspace }}/build/MacOS/Release
ls -l ${{ github.workspace }}/build/MacOS/Release/wheel

# This will also download all the test models to the test/test_models directory
# These models are used by the python tests as well as C#, C++ and others.
Expand All @@ -95,17 +92,18 @@ jobs:
run: |
export ORTGENAI_LOG_ORT_LIB=1
cd test/csharp
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/osx-arm64" --verbosity normal
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/MacOS/Release/Release" --verbosity normal

- name: Build the Java API and Run the Java Tests
run: |
set -e -x
source genai-macos-venv/bin/activate
python3 build.py --config=Release --build_dir build/cpu/osx-arm64 --build_java --parallel --cmake_generator "Unix Makefiles"
python3 build.py --config=Release --build_java --parallel --cmake_generator "Unix Makefiles"
dotnet test /p:Configuration=Release /p:NativeBuildOutputDir="../../build/MacOS/Release/Release" --verbosity normal

- name: Run tests
run: |
set -e -x
export ORTGENAI_LOG_ORT_LIB=1
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/build/cpu/osx-arm64
./build/cpu/osx-arm64/unit_tests
export DYLD_LIBRARY_PATH=$DYLD_LIBRARY_PATH:$GITHUB_WORKSPACE/build/MacOS/Release/Release
./build/MacOS/Release/Release/unit_tests
36 changes: 8 additions & 28 deletions .github/workflows/win-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
binaryDir: 'build/cpu/win-arm64'
binaryDir: 'build/Windows/Release'
ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1"
ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime"

Expand All @@ -34,18 +34,6 @@ jobs:
with:
nuget-version: '5.x'

- name: Setup Java 21
uses: actions/setup-java@v4
with:
java-version: '21'
distribution: 'temurin'
cache: 'gradle'

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v3
with:
gradle-version: '8.6'

- name: Download OnnxRuntime Nightly
shell: powershell
run: |
Expand All @@ -64,15 +52,16 @@ jobs:
move ${{ env.ORT_PACKAGE_NAME }}/build/native/include ort/
move ${{ env.ORT_PACKAGE_NAME }}/runtimes/win-arm64/native/* ort/lib/

- name: Configure CMake
- name: Build with Python
run: |
python -m pip install wheel requests
python -m pip install requests
python -m pip install wheel
python build.py --parallel --config=Release

cmake --preset windows_arm64_cpu_release

- name: Build with CMake
- name: Build the C# API and Run the C# Tests
run: |
cmake --build --preset windows_arm64_cpu_release --parallel
cd test\csharp
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib"

- name: Install the Python Wheel and Test Dependencies
run: |
Expand All @@ -84,15 +73,6 @@ jobs:
run: |
python test/python/test_onnxruntime_genai.py --cwd "test\python" --test_models "test\test_models"

- name: Build the C# API and Run the C# Tests
run: |
cd test\csharp
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib"

- name: Build the Java API and Run the Java Tests
run: |
python build.py --config=Release --build_dir $env:binaryDir --build_java --parallel

- name: Verify Build Artifacts
if: always()
continue-on-error: true
Expand Down
24 changes: 9 additions & 15 deletions .github/workflows/win-cpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
binaryDir: 'build/cpu/win-x64'
binaryDir: 'build/Windows/Debug'
ORT_NIGHTLY_REST_API: "https://feeds.dev.azure.com/aiinfra/PublicPackages/_apis/packaging/Feeds/ORT-Nightly/packages?packageNameQuery=Microsoft.ML.OnnxRuntime&api-version=6.0-preview.1"
ORT_PACKAGE_NAME: "Microsoft.ML.OnnxRuntime"

Expand Down Expand Up @@ -76,13 +76,11 @@ jobs:
with:
languages: 'cpp'

- name: Configure CMake
- name: Build with Python
run: |
cmake --preset windows_x64_cpu_release

- name: Build with CMake
run: |
cmake --build --preset windows_x64_cpu_release --parallel
python3 -m pip install requests
python3 -m pip install wheel
python3 build.py --parallel --config=Debug --build_java

- name: Install the python wheel and test dependencies
run: |
Expand All @@ -102,23 +100,19 @@ jobs:
- name: Build the C# API and Run the C# Tests
run: |
cd test\csharp
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Release" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib" --verbosity normal

- name: Build the Java API and Run the Java Tests
run: |
python3 build.py --config=Release --build_dir $env:binaryDir --build_java --parallel
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\Debug" /p:OrtLibDir="$env:GITHUB_WORKSPACE\ort\lib" --verbosity normal

- name: Verify Build Artifacts
if: always()
continue-on-error: true
run: |
Get-ChildItem -Path $env:GITHUB_WORKSPACE\$env:binaryDir -Recurse
Get-ChildItem -Path $env:GITHUB_WORKSPACE\$env:binaryDir\Debug -Recurse
Get-ChildItem -Path $env:GITHUB_WORKSPACE\$env:binaryDir\test -Recurse

- name: Run tests
run: |
copy $env:GITHUB_WORKSPACE\ort\lib\* .\$env:binaryDir\Release
& .\$env:binaryDir\Release\unit_tests.exe
copy $env:GITHUB_WORKSPACE\ort\lib\* .\$env:binaryDir\Debug
& .\$env:binaryDir\Debug\unit_tests.exe

- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
Expand Down
Loading
Loading