From 00383f08e9ee6f194aae97e4ee352fde9ddaf5c6 Mon Sep 17 00:00:00 2001 From: Michele Balistreri Date: Mon, 28 Sep 2026 21:17:18 +0200 Subject: [PATCH] add all family members to build --- build-scripts/build_portable.ps1 | 33 ++++++++++++++++++++++++++------ build-scripts/build_portable.sh | 29 ++++++++++++++++++++++++---- 2 files changed, 52 insertions(+), 10 deletions(-) diff --git a/build-scripts/build_portable.ps1 b/build-scripts/build_portable.ps1 index f38b7ff..8356d2f 100644 --- a/build-scripts/build_portable.ps1 +++ b/build-scripts/build_portable.ps1 @@ -23,6 +23,9 @@ # Linux build, _rocm_sdk_core\bin must NOT be removed. # # Usage: build_portable.ps1 +# is either an exact device (gfx1151) or a family name that +# expands to every device variant of that family (gfx103X, gfx110X, +# gfx120X) - see the device-extras mapping below. # # Environment overrides (all optional): # THENOISE_ROOT output bundle root (default: $env:RUNNER_TEMP\thenoise-build\thenoise) @@ -40,9 +43,6 @@ param( $ErrorActionPreference = "Stop" -# torch wheel device spec: gfx115X -> gfx1150 (mirror build_portable.sh). -$GfxArch = $GfxTarget -creplace 'X', '0' - $Root = $env:THENOISE_ROOT if (-not $Root) { $base = if ($env:RUNNER_TEMP) { $env:RUNNER_TEMP } else { $env:TEMP } @@ -64,6 +64,27 @@ $Py = Join-Path $Root "python.exe" function say { param([string]$m) Write-Host "[build] $m" -ForegroundColor Blue } function warn { param([string]$m) Write-Host "[build:warning] $m" -ForegroundColor Yellow } +# ------------------------------------------- gfx target -> wheel device extras -- +# The torch/torchvision wheels on the AMD index expose one extra PER DEVICE +# (device-gfx1030 ... device-gfx1036, device-gfx1100 ... device-gfx1103, +# device-gfx1200/1201/1250, ...); there is no device-gfx103X / gfx110X / +# gfx120X extra. So the "family" targets used by CI must expand to every +# variant in the family. +switch -CaseSensitive ($GfxTarget) { + "gfx103X" { $GfxDevices = "device-gfx1030,device-gfx1031,device-gfx1032,device-gfx1033,device-gfx1034,device-gfx1035,device-gfx1036"; break } + "gfx110X" { $GfxDevices = "device-gfx1100,device-gfx1101,device-gfx1102,device-gfx1103"; break } + "gfx120X" { $GfxDevices = "device-gfx1200,device-gfx1201,device-gfx1250"; break } + default { + if ($GfxTarget -clike "*X") { + $fallback = $GfxTarget -creplace 'X', '0' + warn "no device list for family target '$GfxTarget'; falling back to X->0 ($fallback). Add a case above if this family has more than one SKU." + $GfxDevices = "device-$fallback" + } else { + $GfxDevices = "device-$GfxTarget" + } + } +} + # pip helper with a raised recursion limit. Some large dependency graphs (e.g. # vLLM's) make pip's resolvelib RecursionError; thenoise's is simpler, but this # is cheap insurance and harmless. @@ -101,14 +122,14 @@ if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } # ---------------------------------------------------------- 2. torch + deps -- -say "Installing torch $TorchVer for $GfxTarget" +say "Installing torch $TorchVer for $GfxTarget ($GfxDevices)" $env:PATH = "$Root;${Root}\Scripts;$env:PATH" pip-deep install --index-url $TorchIndex ` --extra-index-url https://pypi.org/simple/ ` - "torch[device-${GfxArch}]==${TorchVer}" + "torch[${GfxDevices}]==${TorchVer}" pip-deep install --index-url $TorchIndex ` --extra-index-url https://pypi.org/simple/ ` - "torchvision[device-${GfxArch}]==${TorchVisionVer}" + "torchvision[${GfxDevices}]==${TorchVisionVer}" pip-deep install "triton-windows<3.9" say "Installing thenoise + dependencies (from $RepoRoot)" diff --git a/build-scripts/build_portable.sh b/build-scripts/build_portable.sh index 15e8dc1..3ecec54 100644 --- a/build-scripts/build_portable.sh +++ b/build-scripts/build_portable.sh @@ -13,6 +13,10 @@ # # Usage: build_portable.sh # +# is either an exact device (gfx1151) or a family name that +# expands to every device variant of that family (gfx103X, gfx110X, gfx120X) +# — see the device-extras mapping below. +# # Environment overrides (all optional): # THENOISE_ROOT output bundle root (default: $RUNNER_TEMP/thenoise-build/thenoise) # PBS_TAG python-build-standalone release tag @@ -24,7 +28,6 @@ set -euo pipefail GFX_TARGET="${1:?usage: build_portable.sh }" -GFX_ARCH="${GFX_TARGET//X/0}" ROOT="${THENOISE_ROOT:-${RUNNER_TEMP:-/tmp}/thenoise-build/thenoise}" REPO_ROOT="$(cd "$(dirname "$0")/.." && pwd)" @@ -42,6 +45,24 @@ PY="$ROOT/bin/python${PYVER}" say() { printf '\033[1;34m[build] %s\033[0m\n' "$*"; } warn() { printf '\033[1;33m[build:warning] %s\033[0m\n' "$*"; } +# ------------------------------------------- gfx target -> wheel device extras -- +# The torch/torchvision wheels on the AMD index expose one extra PER DEVICE +# (device-gfx1030 ... device-gfx1036, device-gfx1100 ... device-gfx1103, +# device-gfx1200/1201/1250, ...); there is no device-gfx103X / gfx110X / +# gfx120X extra. So the "family" targets used by CI must expand to every +# variant in the family. + +case "$GFX_TARGET" in + gfx103X) GFX_DEVICES="device-gfx1030,device-gfx1031,device-gfx1032,device-gfx1033,device-gfx1034,device-gfx1035,device-gfx1036" ;; + gfx110X) GFX_DEVICES="device-gfx1100,device-gfx1101,device-gfx1102,device-gfx1103" ;; + gfx120X) GFX_DEVICES="device-gfx1200,device-gfx1201,device-gfx1250" ;; + *X) + warn "no device list for family target '$GFX_TARGET'; falling back to X->0 (${GFX_TARGET//X/0}). Add a case above if this family has more than one SKU." + GFX_DEVICES="device-${GFX_TARGET//X/0}" ;; + *) + GFX_DEVICES="device-${GFX_TARGET}" ;; +esac + # pip helper with a raised recursion limit. Some large dependency graphs (e.g. # vLLM's) make pip's resolvelib RecursionError; thenoise's is simpler, but this # is cheap insurance and harmless. @@ -96,14 +117,14 @@ rm -rf "$PY_TMP" "$PY" -m pip install --upgrade pip setuptools wheel # ---------------------------------------------------------- 2. torch + deps -- -say "Installing torch ${TORCH_VER} for ${GFX_TARGET}" +say "Installing torch ${TORCH_VER} for ${GFX_TARGET} (${GFX_DEVICES})" export PATH="$ROOT/bin:$PATH" pip_deep install --index-url "$TORCH_INDEX" \ --extra-index-url https://pypi.org/simple/ \ - "torch[device-${GFX_ARCH}]==${TORCH_VER}" + "torch[${GFX_DEVICES}]==${TORCH_VER}" pip_deep install --index-url "$TORCH_INDEX" \ --extra-index-url https://pypi.org/simple/ \ - "torchvision[device-${GFX_ARCH}]==${TORCHVISION_VER}" + "torchvision[${GFX_DEVICES}]==${TORCHVISION_VER}" say "Installing thenoise + dependencies (from $REPO_ROOT)" # torch is intentionally absent from pyproject.toml. But a constraints file is cheap insurance