Skip to content

Commit

Permalink
Merge branch 'main' into kvaishnavi/logit-softcapping
Browse files Browse the repository at this point in the history
  • Loading branch information
kunal-vaishnavi committed Sep 5, 2024
2 parents b8889e7 + c7eba3c commit 48c0a07
Show file tree
Hide file tree
Showing 93 changed files with 95,950 additions and 680 deletions.
5 changes: 5 additions & 0 deletions .github/policies/issueLabeler.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
id:
name: Issue Triage
description: Assign label to issues
owner:
resource: repository
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
Expand Down Expand Up @@ -79,3 +82,5 @@ configuration:
then:
- addLabel:
label: model:transformer
onFailure:
onSuccess:
24 changes: 24 additions & 0 deletions .github/policies/test_issueLabeler.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
id:
name: Issue Triage
description: Assign label to issues
owner:
resource: repository
where:
configuration:
resourceManagementConfiguration:
eventResponderTasks:
- if:
- payloadType: Issues
- isOpen
then:
- if:
- or:
- titleContains:
pattern: shark
- bodyContains:
pattern: strawberry
then:
- addLabel:
label: wontfix
onFailure:
onSuccess:
16 changes: 7 additions & 9 deletions .github/workflows/linux-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,17 @@ jobs:
with:
submodules: 'true'

- name: Install jq
run: |
sudo apt-get install jq
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Get the Latest OnnxRuntime Nightly Version
shell: pwsh
run: |
ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion')
echo "$ORT_NIGHTLY_VERSION"
echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV
$resp = Invoke-RestMethod "${{ env.ORT_NIGHTLY_REST_API }}"
$ORT_NIGHTLY_VERSION = $resp.value[0].versions[0].normalizedVersion
Write-Host "$ORT_NIGHTLY_VERSION"
"ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Download OnnxRuntime Nightly
run: |
Expand Down Expand Up @@ -72,7 +70,7 @@ jobs:
--container-registry onnxruntimebuildcache \
--repository ort_genai_linux_arm64_gha
- name: Doker -- Configure with CMake and GCC
- name: Docker -- Configure with CMake and GCC
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
Expand All @@ -84,7 +82,7 @@ jobs:
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
-w /onnxruntime_src ort_genai_linux_arm64_gha bash -c "/usr/bin/cmake --build --preset linux_gcc_cpu_release"
- name: Dokcer -- check test directory
- name: Docker -- Check test directory
run: |
docker run --rm \
--volume $GITHUB_WORKSPACE:/onnxruntime_src \
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/linux-cpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,17 @@ jobs:
with:
submodules: true

- name: Install jq
run: |
sudo apt-get install jq
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Get the Latest OnnxRuntime Nightly Version
shell: pwsh
run: |
ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion')
echo "$ORT_NIGHTLY_VERSION"
echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV
$resp = Invoke-RestMethod "${{ env.ORT_NIGHTLY_REST_API }}"
$ORT_NIGHTLY_VERSION = $resp.value[0].versions[0].normalizedVersion
Write-Host "$ORT_NIGHTLY_VERSION"
"ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Download OnnxRuntime Nightly
run: |
Expand Down Expand Up @@ -71,7 +69,7 @@ jobs:
run: |
python3 -m pip install -r test/python/requirements.txt --user
python3 -m pip install -r test/python/requirements-cpu.txt --user
python3 -m pip install build/cpu/wheel/onnxruntime_genai*.whl --user
python3 -m pip install build/cpu/wheel/onnxruntime_genai*.whl --user --no-deps
- name: Get HuggingFace Token
run: |
Expand All @@ -90,6 +88,11 @@ jobs:
run: |
python3 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:Configuration=Release /p:NativeBuildOutputDir="../../build/cpu/"
- name: Verify Build Artifacts
if: always()
continue-on-error: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/linux-cpu-x64-nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
run: |
python3 -m pip install -r test/python/requirements.txt --user
python3 -m pip install -r test/python/requirements-cpu.txt --user
python3 -m pip install build/cpu/wheel/onnxruntime_genai*.whl
python3 -m pip install build/cpu/wheel/onnxruntime_genai*.whl --no-deps
- name: Get HuggingFace Token
run: |
Expand Down
32 changes: 21 additions & 11 deletions .github/workflows/linux-gpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,19 +37,17 @@ jobs:
path: manylinux
submodules: true

- name: Install jq
run: |
sudo apt-get install jq
- uses: actions/setup-dotnet@v4
with:
dotnet-version: '8.0.x'

- name: Download OnnxRuntime
- name: Get the Latest OnnxRuntime Nightly Version
shell: pwsh
run: |
ORT_NIGHTLY_VERSION=$(curl -s "${{ env.ORT_NIGHTLY_REST_API }}" | jq -r '.value[0].versions[0].normalizedVersion')
echo "$ORT_NIGHTLY_VERSION"
echo "ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" >> $GITHUB_ENV
$resp = Invoke-RestMethod "${{ env.ORT_NIGHTLY_REST_API }}"
$ORT_NIGHTLY_VERSION = $resp.value[0].versions[0].normalizedVersion
Write-Host "$ORT_NIGHTLY_VERSION"
"ORT_NIGHTLY_VERSION=$ORT_NIGHTLY_VERSION" | Out-File -FilePath $env:GITHUB_ENV -Append
- name: Download OnnxRuntime Nightly
run: |
Expand All @@ -65,7 +63,6 @@ jobs:
ls -R ${{ env.ORT_PACKAGE_NAME }}
continue-on-error: true

# TODO: Find out why do we need to to have libonnxruntime.so.$ort_version
- name: Extract OnnxRuntime library and header files
run: |
set -e -x
Expand Down Expand Up @@ -129,19 +126,32 @@ jobs:
docker run \
--gpus all \
--rm \
--volume /data/ortgenai_pytorch_models:/data/ortgenai_pytorch_models \
--volume $GITHUB_WORKSPACE:/ort_genai_src \
-e HF_TOKEN=$HF_TOKEN \
-w /ort_genai_src onnxruntimecudabuildx64 bash -c " \
${{ env.PYTHON_EXECUTABLE }} -m pip install -r test/python/requirements.txt --user && \
${{ env.PYTHON_EXECUTABLE }} -m pip install -r test/python/requirements-cuda.txt --user && \
${{ env.PYTHON_EXECUTABLE }} -m pip install /ort_genai_src/build/cuda/wheel/onnxruntime_genai*manylinux*.whl --user && \
${{ env.PYTHON_EXECUTABLE }} test/python/test_onnxruntime_genai.py --cwd test/python --test_models test/test_models"
${{ env.PYTHON_EXECUTABLE }} -m pip install /ort_genai_src/build/cuda/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
# - name: Build the C# API and Run the C# Tests
# run: |
# echo "Building the C# API and running the C# tests"
# docker run \
# --gpus all \
# --rm \
# --volume $GITHUB_WORKSPACE:/ort_genai_src \
# -w /ort_genai_src/test/csharp onnxruntimecudabuildx64 bash -c " \
# dotnet test /p:NativeBuildOutputDir='/ort_genai_src/build/cuda/'"

- name: Docker -- Run unit tests
run: |
echo "Running docker image onnxruntimecudabuildx64"
docker run \
--gpus all \
--rm \
--volume /data/ortgenai_pytorch_models:/data/ortgenai_pytorch_models \
--volume $GITHUB_WORKSPACE:/ort_genai_src \
-w /ort_genai_src onnxruntimecudabuildx64 bash -c "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/ort_genai_src/build/cuda/ /ort_genai_src/build/cuda/test/unit_tests"
4 changes: 1 addition & 3 deletions .github/workflows/win-cpu-arm64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,9 @@ jobs:
- name: Install the Python Wheel and Test Dependencies
run: |
python -c "import platform; print(platform.machine()); print(platform.version()); print(platform.platform()); print(platform.system()); print(platform.processor()); print(platform.architecture())"
python -c "import sys; print(sys.version)"
python -m pip install "numpy<2" coloredlogs flatbuffers packaging protobuf sympy pytest
python -m pip install -i https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/pypi/simple/ ort-nightly-qnn
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl"))
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps
- name: Run the Python Tests
run: |
Expand Down
12 changes: 5 additions & 7 deletions .github/workflows/win-cpu-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,16 +72,11 @@ jobs:
run: |
cmake --build --preset windows_x64_cpu_release --parallel
- name: Build the C# API and Run the C# Tests
run: |
cd test\csharp
dotnet test /p:NativeBuildOutputDir="$env:GITHUB_WORKSPACE\$env:binaryDir\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\requirements-cpu.txt --user
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl"))
python3 -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps
- name: Get HuggingFace Token
run: |
Expand All @@ -94,7 +89,10 @@ 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"
- name: Verify Build Artifacts
if: always()
Expand Down
5 changes: 2 additions & 3 deletions .github/workflows/win-cuda-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ jobs:
run: |
python -m pip install -r test\python\requirements.txt
python -m pip install -r test\python\requirements-cuda.txt
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl"))
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps
- name: Get HuggingFace Token
run: |
Expand All @@ -93,8 +93,7 @@ jobs:
- name: Run the Python Tests
run: |
python test/python/test_onnxruntime_genai.py --cwd "test\python" --test_models "test\test_models"
python test/python/test_onnxruntime_genai.py --cwd "test\python" --test_models "test\test_models" --e2e
- name: Verify Build Artifacts
if: always()
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/win-directml-x64-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ env:
ort_zip: "Microsoft.ML.OnnxRuntime.DirectML.1.17.3.zip"
# TODO: Update with nightly ORT-DML build
ort_url: "https://github.com/microsoft/onnxruntime/releases/download/v1.17.3/Microsoft.ML.OnnxRuntime.DirectML.1.17.3.zip"
dml_dir: "Microsoft.AI.DirectML.1.15.0"
dml_zip: "Microsoft.AI.DirectML.1.15.0.zip"
dml_url: "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.0"
dml_dir: "Microsoft.AI.DirectML.1.15.1"
dml_zip: "Microsoft.AI.DirectML.1.15.1.zip"
dml_url: "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.1"
d3d12_dir: "Microsoft.Direct3D.D3D12.1.614.0"
d3d12_zip: "Microsoft.Direct3D.D3D12.1.614.0.zip"
d3d12_url: "https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.614.0"
Expand Down Expand Up @@ -92,7 +92,7 @@ jobs:
run: |
python -m pip install -r test\python\requirements.txt
python -m pip install -r test\python\requirements-directml.txt
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl"))
python -m pip install (Get-ChildItem ("$env:binaryDir\wheel\*.whl")) --no-deps
- name: Verify Build Artifacts
if: always()
Expand Down
6 changes: 3 additions & 3 deletions .pipelines/stages/jobs/capi-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,11 +74,11 @@ jobs:
- name: ortHome
value: 'ort'
- name: dml_dir
value: 'Microsoft.AI.DirectML.1.15.0'
value: 'Microsoft.AI.DirectML.1.15.1'
- name: dml_zip
value: 'Microsoft.AI.DirectML.1.15.0.zip'
value: 'Microsoft.AI.DirectML.1.15.1.zip'
- name: dml_url
value: "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.0"
value: "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.1"

- name: d3d12_dir
value: 'Microsoft.Direct3D.D3D12.1.614.0'
Expand Down
6 changes: 3 additions & 3 deletions .pipelines/stages/jobs/nuget-validation-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ jobs:
cd examples/csharp/HelloPhi
mv models/$(prebuild_phi3_mini_model_folder) models/phi-3
dotnet restore -r $(os)-$(arch) /property:Configuration=$(csproj_configuration) --source https://api.nuget.org/v3/index.json --source https://aiinfra.pkgs.visualstudio.com/PublicPackages/_packaging/ORT-Nightly/nuget/v3/index.json --source $PWD --disable-parallel --verbosity detailed
dotnet build ./HelloPhi.csproj -r $(os)-$(arch) /property:Configuration=$(csproj_configuration)
dotnet build ./HelloPhi.csproj -r $(os)-$(arch) /property:Configuration=$(csproj_configuration) --no-restore --self-contained
displayName: 'Perform dotnet restore & build'
workingDirectory: '$(Build.Repository.LocalPath)'
env:
Expand All @@ -188,9 +188,9 @@ jobs:
-w /ort_genai_src/ $(cuda_docker_image) \
bash -c " \
export ORTGENAI_LOG_ORT_LIB=1 && \
dotnet --info && \
cd /ort_genai_src/examples/csharp/HelloPhi && \
dotnet run -r $(os)-$(arch) --configuration $(csproj_configuration) --no-build --verbosity normal -- -m ./models/phi-3"
chmod +x ./bin/Release_Cuda/net6.0/linux-x64/HelloPhi && \
./bin/Release_Cuda/net6.0/linux-x64/HelloPhi -m ./models/phi-3"
displayName: 'Run Example With Artifact'
workingDirectory: '$(Build.Repository.LocalPath)'
Expand Down
6 changes: 3 additions & 3 deletions .pipelines/stages/jobs/py-packaging-job.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,11 @@ jobs:
value: 'Microsoft.ML.OnnxRuntime'

- name: dml_dir
value: 'Microsoft.AI.DirectML.1.15.0'
value: 'Microsoft.AI.DirectML.1.15.1'
- name: dml_zip
value: 'Microsoft.AI.DirectML.1.15.0.zip'
value: 'Microsoft.AI.DirectML.1.15.1.zip'
- name: dml_url
value: "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.0"
value: "https://www.nuget.org/api/v2/package/Microsoft.AI.DirectML/1.15.1"

- name: d3d12_dir
value: 'Microsoft.Direct3D.D3D12.1.614.0'
Expand Down
6 changes: 4 additions & 2 deletions .pipelines/stages/jobs/steps/capi-linux-step.yml
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,9 @@ steps:
docker run \
--rm \
--volume $(Build.Repository.LocalPath):/ort_genai_src \
-w /ort_genai_src/ ortgenai$(ep)build$(arch) \
-w /ort_genai_src/ \
-e ONNXRUNTIME_VERSION=$(ONNXRUNTIME_VERSION) \
ortgenai$(ep)build$(arch) \
bash -c " \
/usr/bin/cmake --preset linux_gcc_$(ep)_$(build_config) \
-DENABLE_TESTS=OFF \
Expand All @@ -145,8 +146,9 @@ steps:
docker run \
--rm \
--volume $(Build.Repository.LocalPath):/ort_genai_src \
-w /ort_genai_src/ ortgenai$(ep)build$(arch) \
-w /ort_genai_src/ \
-e ONNXRUNTIME_VERSION=$(ONNXRUNTIME_VERSION) \
ortgenai$(ep)build$(arch) \
bash -c " \
/usr/bin/cmake --build --preset linux_gcc_$(ep)_$(build_config) \
-DENABLE_TESTS=OFF \
Expand Down
Loading

0 comments on commit 48c0a07

Please sign in to comment.