Skip to content

[WebGPU plugin EP] Add Win ARM64 Python package#28526

Open
edgchen1 wants to merge 8 commits into
mainfrom
edgchen1/webgpu_plugin_ep_win_arm64_python
Open

[WebGPU plugin EP] Add Win ARM64 Python package#28526
edgchen1 wants to merge 8 commits into
mainfrom
edgchen1/webgpu_plugin_ep_win_arm64_python

Conversation

@edgchen1
Copy link
Copy Markdown
Contributor

Description

  • Add WebGPU plugin EP Windows ARM64 Python package build and test
  • Disable unit test building in packaging pipeline to reduce build time

Motivation and Context

Add Windows ARM64 Python package.

edgchen1 added 7 commits May 13, 2026 15:06
Move the Win ARM64 plugin EP build off the x64 cross-compile path and onto the onnxruntime-qnn-windows-vs-2022-arm64 pool, where it builds natively. The build job's pool is now arch-conditional, host_cpu_arch follows parameters.arch, and the build runs without --arm64 or LLVM_TABLEGEN/CLANG_TABLEGEN overrides.

This removes the inter-stage dependency on the Windows x64 build: the WebGPU_BuildTools_x64 artifact, the Copy WebGPU build tools step, the tblgen.exe SDL exclusion, and the ArchFlag/CrossCompileDefines variables are all gone. The invalidARM64Config validator in plugin-webgpu-pipeline.yml is removed as well, so build_windows_arm64=true can be queued without also enabling build_windows_x64.

Python wheel build/test for ARM64 is not enabled in this commit; that stays gated to x64 for now and will follow in a subsequent change.
This reverts commit dbf99b3.

Native ARM64 build fails because the onnxruntime-qnn-windows-vs-2022-arm64 pool image lacks the C++ ATL ARM64/ARM64EC build tools component, which DXC's LLVMMSSupport requires (atlbase.h not found). Until that component is available on the pool, fall back to cross-compiling the ARM64 plugin DLL on the x64 agent and consuming the x64-built tblgen binaries, which is the previous flow.
Run the WebGPU plugin EP Python wheel build job and the corresponding wheel test stage on the onnxruntime-qnn-windows-vs-2022-arm64 pool when arch is arm64. Both jobs now select their pool conditionally on parameters.arch (with hostArchitecture and an Agent.Version demand on ARM64) and pass parameters.arch through to setup-build-tools.yml so the matching Python is provisioned.

The native plugin DLL is still cross-compiled on the x64 agent and consumed via the existing webgpu_plugin_win_arm64 artifact dependency. Building the wheel on an ARM64 host means PlatformBdistWheel.get_tag() naturally produces a py3-none-win_arm64 wheel with no setup.py changes.

The packaging pipeline already exposes build_windows_arm64; the test pipeline gains a matching test_windows_arm64 parameter (default true) and a conditional include of plugin-win-webgpu-test-stage.yml with arch: arm64. The NuGet smoke test stays gated to arch x64.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds Windows ARM64 support to the WebGPU plugin EP Python wheel build/test in CI, and reduces packaging build time by disabling ORT unit test builds for plugin packaging jobs.

Changes:

  • Build and test the WebGPU plugin EP Python wheel on Windows ARM64 agents, producing correctly tagged win_arm64 wheels.
  • Update Windows WebGPU test stage to select an ARM64 agent pool when testing ARM64 artifacts.
  • Disable onnxruntime_BUILD_UNIT_TESTS in WebGPU plugin packaging builds (Linux/macOS/Windows) to reduce CI build time.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tools/ci_build/github/linux/build_webgpu_plugin_package.sh Disables unit test builds when building the WebGPU plugin inside Docker.
tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-test-stage.yml Adds ARM64 pool selection and runs Python wheel tests on ARM64 hosts; switches script steps to powershell:.
tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-stage.yml Builds Python wheels on a host matching the target arch (x64/arm64) and disables unit test builds.
tools/ci_build/github/azure-pipelines/stages/plugin-mac-webgpu-stage.yml Disables unit test builds for the macOS ARM64 WebGPU plugin build.
tools/ci_build/github/azure-pipelines/plugin-webgpu-test-pipeline.yml Adds a toggle to run Windows ARM64 tests and enables them by default.
Comments suppressed due to low confidence (4)

tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-test-stage.yml:47

  • The PowerShell scripts no longer set $ErrorActionPreference = 'Stop'. Without this, non-terminating cmdlet errors (e.g., from Get-ChildItem/Copy-Item) can be swallowed and the job may continue in a partially-failed state. Add $ErrorActionPreference = 'Stop' at the top of this script block (and the other PowerShell blocks in this file) to keep failure behavior consistent with other pipeline stages.

This issue also appears in the following locations of the same file:

  • line 92
  • line 134
  • line 142
    - powershell: |
        echo "creating test_venv"
        python -m venv "$(Build.BinariesDirectory)\test_venv"

        echo "activating test_venv"
        & "$(Build.BinariesDirectory)\test_venv\Scripts\Activate.ps1"

tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-test-stage.yml:100

  • This PowerShell block should set $ErrorActionPreference = 'Stop' to ensure cmdlet failures (e.g., missing artifacts, Copy-Item issues) fail the job immediately. Other plugin test stages in this repo consistently set this to avoid non-terminating errors being ignored.
      - powershell: |
          $localFeedDir = "$(Build.BinariesDirectory)\local_feed"
          New-Item -ItemType Directory -Path $localFeedDir -Force | Out-Null

          # Locate the .nupkg.
          $nupkg = Get-ChildItem "$(Pipeline.Workspace)\build\webgpu_plugin_nuget\Microsoft.ML.OnnxRuntime.EP.WebGpu.*.nupkg" |
                   Select-Object -First 1
          if (-not $nupkg) {
              throw "No matching .nupkg found under $(Pipeline.Workspace)\build\webgpu_plugin_nuget"

tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-test-stage.yml:139

  • Consider adding $ErrorActionPreference = 'Stop' at the start of this PowerShell script block. With the move from pwsh to powershell, cmdlet errors can become non-terminating by default, which can lead to hard-to-diagnose pipeline flakiness.
      - powershell: |
          dotnet build `
            "$(WebGpuTestProject)" `
            --configuration Release `
            -p:OrtWebGpuPackageVersion=$(OrtWebGpuPackageVersion) `
            -p:OrtCoreTestVersion=$(OrtCoreTestVersion)

tools/ci_build/github/azure-pipelines/stages/plugin-win-webgpu-test-stage.yml:147

  • This PowerShell block should set $ErrorActionPreference = 'Stop' to ensure dotnet run/cmdlet failures stop the job reliably (especially after switching away from pwsh blocks that explicitly set it).
      - powershell: |
          dotnet run `
            --project "$(WebGpuTestProject)" `
            --configuration Release `
            --no-build
        displayName: 'Run NuGet package test'

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

guschmue
guschmue previously approved these changes May 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants