From b8dae685e4fb7b6fd439cb543b6c4fa73e72a9ab Mon Sep 17 00:00:00 2001 From: Adrian Lizarraga Date: Tue, 17 Sep 2024 21:16:31 -0700 Subject: [PATCH] [QNN EP] Build Python 3.12 wheel for Windows ARM64 (#22118) ### Description Builds arm64 python 3.12 wheel for QNN EP. ### Motivation and Context --- .../templates/py-packaging-stage.yml | 1 - .../templates/py-win-arm64-qnn.yml | 28 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml index 451e5ad2d4..504aed9ff3 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-packaging-stage.yml @@ -512,7 +512,6 @@ stages: parameters: MACHINE_POOL: 'onnxruntime-qnn-windows-vs-2022-arm64' QNN_SDK: ${{ parameters.qnn_sdk_version }} - PYTHON_VERSION: '3.11' BUILD_PY_PARAMETERS: ${{ parameters.build_py_parameters }} - ${{ if eq(parameters.enable_windows_arm64ec_qnn, true) }}: diff --git a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml index 837aa2760b..6e573d79e4 100644 --- a/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml +++ b/tools/ci_build/github/azure-pipelines/templates/py-win-arm64-qnn.yml @@ -9,10 +9,6 @@ parameters: type: string default: 2.26.0.240828 -- name: PYTHON_VERSION - type: string - default: '3.11' - - name: ENV_SETUP_SCRIPT type: string default: '' @@ -24,12 +20,20 @@ parameters: default: '' jobs: -- job: Win_py_arm64_qnn_Wheels_${{ replace(parameters.PYTHON_VERSION,'.','_') }} +- job: Win_py_arm64_qnn_Wheels timeoutInMinutes: 210 workspace: clean: all pool: name: ${{ parameters.MACHINE_POOL }} + strategy: + matrix: + Python311_arm64: + PythonVersion: '3.11.0' + LocalPythonDir: 'C:\Python\Python311' + Python312_arm64: + PythonVersion: '3.12.6' + LocalPythonDir: 'C:\Python\Python312' variables: GRADLE_OPTS: '-Dorg.gradle.daemon=false' VSGenerator: 'Visual Studio 17 2022' @@ -41,17 +45,17 @@ jobs: - template: telemetry-steps.yml - script: | - MKDIR $(Agent.ToolsDirectory)\Python\3.11.0\arm64 - XCOPY /s /y /h /e /c /q "C:\Python\Python311\*.*" $(Agent.ToolsDirectory)\Python\3.11.0\arm64\ - COPY NUL $(Agent.ToolsDirectory)\Python\3.11.0\arm64.complete + MKDIR $(Agent.ToolsDirectory)\Python\$(PythonVersion)\arm64 + XCOPY /s /y /h /e /c /q "$(LocalPythonDir)\*.*" $(Agent.ToolsDirectory)\Python\$(PythonVersion)\arm64\ + COPY NUL $(Agent.ToolsDirectory)\Python\$(PythonVersion)\arm64.complete DIR $(Agent.ToolsDirectory)\Python - DIR $(Agent.ToolsDirectory)\Python\3.11.0 - DIR $(Agent.ToolsDirectory)\Python\3.11.0\arm64 - displayName: Copy python 3.11.0 version to agent tools directory + DIR $(Agent.ToolsDirectory)\Python\$(PythonVersion) + DIR $(Agent.ToolsDirectory)\Python\$(PythonVersion)\arm64 + displayName: Copy python $(PythonVersion) version to agent tools directory - task: UsePythonVersion@0 inputs: - versionSpec: ${{ parameters.PYTHON_VERSION }} + versionSpec: $(PythonVersion) addToPath: true architecture: 'arm64'