-
Notifications
You must be signed in to change notification settings - Fork 130
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Phi-3.5-vision model validation in pipeline (#1066)
* Restructure Phi-3.5-vision C# and Python examples to make them more CI-friendly. * Added Phi-3.5-vision validation steps to the existing validation pipeline. Python run: * https://aiinfra.visualstudio.com/ONNX%20Runtime/_build/results?buildId=609855&view=results NuGet run: * https://aiinfra.visualstudio.com/ONNX%20Runtime/_build/results?buildId=609849&view=results --- Internal work item: https://task.ms/aii/34279 --------- Co-authored-by: kunal-vaishnavi <[email protected]>
- Loading branch information
1 parent
ec89e49
commit d4d3a88
Showing
13 changed files
with
538 additions
and
282 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
parameters: | ||
- name: CsprojFolder | ||
type: string | ||
- name: CsprojName | ||
type: string | ||
- name: CsprojConfiguration | ||
type: string | ||
- name: LocalFolder | ||
type: string | ||
- name: ModelFolder | ||
type: string | ||
|
||
steps: | ||
- task: Docker@2 | ||
inputs: | ||
containerRegistry: onnxruntimebuildcache | ||
command: "login" | ||
addPipelineData: false | ||
displayName: "Log in to container registry" | ||
|
||
- powershell: | | ||
$env:AZCOPY_MSI_CLIENT_ID = "63b63039-6328-442f-954b-5a64d124e5b4"; | ||
azcopy.exe cp --recursive "https://lotusscus.blob.core.windows.net/models/cuda_sdk/v$(cuda_version)" 'cuda_sdk' | ||
displayName: 'Download CUDA $(cuda_version)' | ||
workingDirectory: '$(Build.Repository.LocalPath)' | ||
condition: and(eq(variables['os'], 'win'), eq(variables['ep'], 'cuda')) | ||
- powershell: | | ||
if ("$(ep)" -eq "cuda") { | ||
$env:CUDA_PATH = '$(Build.Repository.LocalPath)\cuda_sdk\v$(cuda_version)' | ||
$env:PATH = "$env:CUDA_PATH\bin;$env:CUDA_PATH\extras\CUPTI\lib64;$env:PATH" | ||
Write-Host $env:PATH | ||
} | ||
dotnet --info | ||
Copy-Item -Force -Recurse -Verbose $(Build.BinariesDirectory)/nuget/* -Destination ${{ parameters.CsprojFolder }} | ||
cd ${{ parameters.CsprojFolder }} | ||
dotnet restore -r $(os)-$(arch) /property:Configuration=${{ parameters.CsprojConfiguration }} --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 run -r $(os)-$(arch) --configuration ${{ parameters.CsprojConfiguration }} --no-restore --verbosity normal -- -m ./${{ parameters.LocalFolder }}/${{ parameters.ModelFolder }} --non-interactive | ||
displayName: 'Run ${{ parameters.CsprojName }} With Artifact on Windows' | ||
workingDirectory: '$(Build.Repository.LocalPath)' | ||
condition: eq(variables['os'], 'win') | ||
env: | ||
NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 180 | ||
NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 180 | ||
- bash: | | ||
set -e -x | ||
dotnet --info | ||
cp $(Build.BinariesDirectory)/nuget/* ${{ parameters.CsprojFolder }} | ||
cd ${{ parameters.CsprojFolder }} | ||
dotnet restore -r $(os)-$(arch) /property:Configuration=${{ parameters.CsprojConfiguration }} --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 ./${{ parameters.CsprojName }}.csproj -r $(os)-$(arch) /property:Configuration=${{ parameters.CsprojConfiguration }} --no-restore --self-contained --verbosity normal | ||
ls -l ./bin/${{ parameters.CsprojConfiguration }}/net6.0/$(os)-$(arch)/ | ||
displayName: 'Perform dotnet restore & build' | ||
workingDirectory: '$(Build.Repository.LocalPath)' | ||
condition: or(eq(variables['os'], 'linux'), eq(variables['os'], 'osx')) | ||
env: | ||
NUGET_PLUGIN_HANDSHAKE_TIMEOUT_IN_SECONDS: 180 | ||
NUGET_PLUGIN_REQUEST_TIMEOUT_IN_SECONDS: 180 | ||
- bash: | | ||
set -e -x | ||
az login --identity --username 63b63039-6328-442f-954b-5a64d124e5b4 | ||
az acr login --name onnxruntimebuildcache --subscription 00c06639-6ee4-454e-8058-8d8b1703bd87 | ||
docker pull $(cuda_docker_image) | ||
docker run \ | ||
--gpus all \ | ||
--rm \ | ||
--volume $(Build.Repository.LocalPath):/ort_genai_src \ | ||
--volume $(Build.BinariesDirectory):/ort_genai_binary \ | ||
-e HF_TOKEN=$HF_TOKEN \ | ||
-w /ort_genai_src/ $(cuda_docker_image) \ | ||
bash -c " \ | ||
export ORTGENAI_LOG_ORT_LIB=1 && \ | ||
cd /ort_genai_src/${{ parameters.CsprojFolder }} && \ | ||
chmod +x ./bin/Release_Cuda/net6.0/linux-x64/${{ parameters.CsprojName }} && \ | ||
./bin/Release_Cuda/net6.0/linux-x64/${{ parameters.CsprojName }} -m ./${{ parameters.LocalFolder }}/${{ parameters.ModelFolder }} --non-interactive" | ||
displayName: 'Run ${{ parameters.CsprojName }} With Artifact on Linux CUDA' | ||
workingDirectory: '$(Build.Repository.LocalPath)' | ||
condition: and(eq(variables['os'], 'linux'), eq(variables['ep'], 'cuda')) | ||
- bash: | | ||
export ORTGENAI_LOG_ORT_LIB=1 | ||
cd ${{ parameters.CsprojFolder }} | ||
dotnet run -r $(os)-$(arch) --configuration ${{ parameters.CsprojConfiguration }} --no-build --verbosity normal -- -m ./${{ parameters.LocalFolder }}/${{ parameters.ModelFolder }} --non-interactive | ||
displayName: 'Run ${{ parameters.CsprojName }} With Artifact on Linux/macOS CPU' | ||
workingDirectory: '$(Build.Repository.LocalPath)' | ||
condition: and(or(eq(variables['os'], 'linux'), eq(variables['os'], 'osx')), eq(variables['ep'], 'cpu')) |
Oops, something went wrong.