Merge upstream main (v1.17.0 -> v2.1.0) into the SYCL port

102 upstream commits. Nine conflicts resolved. Fork side of the merge:
- libxe2: declare the givens_dense_quant schema (upstream 2.0 dropped it
  from libavx and libref; the device libraries now each carry it).
- plain_norm becomes an ABI 42 append to RadBuildCtx; abi layout table
  regenerated, kTableAbi = 42.

Known before the PR: arch_test (MTP lint and pinned graph hashes for
qwen35_fp8, qwen35moe_fp8, qwen4exp with MTP).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
aneinanderandClaude Opus 5.5 committed 2026-11-18 15:06:17 +01:00
commit 4b70a96378
850 files changed
+157819 -58519

No files matched your search

+64 -11
View File
@@ -1,5 +1,6 @@
#!/bin/sh
# oot_plugins.sh BUILD SOURCE WORK [HIP_COMPILER HIP_TARGETS [VOPD_REPEATABLE [CXX_COMPILER]]]
# oot_plugins.sh BUILD SOURCE WORK [HIP_COMPILER HIP_TARGETS [VOPD_REPEATABLE [CXX_COMPILER
# [BUILD_TYPE]]]]
#
# THE PLUGINS RADIANCE SHIPS, BUILT THE WAY A THIRD PARTY BUILDS THEIRS. The tree's build is
# installed into a prefix; then every plugin directory -- the kernel libraries, the quantisers,
@@ -31,11 +32,15 @@
# it needs an Intel card, which this test must not touch.
set -eu
B=$1; S=$2; W=$3
HIPC=${4:-}; HIPT=${5:-}; VOPD=${6:-OFF}; CXXC=${7:-}
HIPC=${4:-}; HIPT=${5:-}; VOPD=${6:-OFF}; CXXC=${7:-}; BT=${8:-}
# The tree's own C++ compiler, so the out-of-tree build does not depend on the host's default
# (`c++` may be a different GCC than the one the installed ABI headers require).
CCXX=""
[ -n "$CXXC" ] && CCXX="-DCMAKE_CXX_COMPILER=$CXXC"
# The tree's build type too: a plugin configured without one takes RelWithDebInfo
# (rad_plugin_defaults), and a tree configured as anything else would then be compared with device
# code compiled at other flags.
[ -n "$BT" ] && CCXX="$CCXX -DCMAKE_BUILD_TYPE=$BT"
GEN=${CMAKE_GENERATOR:-Ninja}
J=${CMAKE_BUILD_PARALLEL_LEVEL:-$(nproc 2>/dev/null || echo 4)}
@@ -54,10 +59,14 @@ run() { # run LOG CMD... -- quiet unless it fails
say "installing $B into $P"
run "$W/logs/install.log" cmake --install "$B" --prefix "$P"
# The libraries have many sources and build one at a time at the build's full width. An
# architecture or a bundled plugin is one or two large translation units, which no -j speeds up, and
# there are dozens of them: those are built several at a time (`small`, below).
dirs="libref libquant"
[ -d "$S/libavx" ] && [ -f "$B/radiance_home/kernels/libavx.so" ] && dirs="$dirs libavx"
small=""
for d in "$S"/arch/*/ "$S"/plugin/*/; do
[ -f "$d/CMakeLists.txt" ] && dirs="$dirs $(basename "$(dirname "$d")")/$(basename "$d")"
[ -f "$d/CMakeLists.txt" ] && small="$small $(basename "$(dirname "$d")")/$(basename "$d")"
done
# The device libraries: built out of tree only with the tree's HIP compiler, and left out of every
# comparison below without it. Each declares the family it serves, so a tree built for one family
@@ -67,21 +76,28 @@ devlibs=""
for d in libr4d libr3d; do
[ -f "$S/$d/CMakeLists.txt" ] && [ -f "$B/radiance_home/kernels/$d.so" ] && devlibs="$devlibs $d"
done
[ -n "$HIPC" ] && dirs="$dirs $devlibs"
devdirs=""
[ -n "$HIPC" ] && devdirs="$devlibs"
ICPX=${RAD_OOT_ICPX:-}
sycllibs=""
for d in libxe2; do
[ -f "$S/$d/CMakeLists.txt" ] && [ -f "$B/radiance_home/kernels/$d.so" ] && sycllibs="$sycllibs $d"
done
[ -n "$ICPX" ] && dirs="$dirs $sycllibs"
[ -n "$ICPX" ] && devdirs="$devdirs $sycllibs"
is_dev() { case " $devlibs $sycllibs " in *" $1 "*) return 0 ;; esac; return 1; }
is_sycl() { case " $sycllibs " in *" $1 "*) return 0 ;; esac; return 1; }
# Each plugin installs its plugin file under $H and anything else it ships (libr4d's r4d_selftest)
# under the package's prefix, as a third party installing into that radiance would.
for d in $dirs; do
n=$(basename "$d")
say "building $d against the installed package"
#
# The ROCm the environment names (the test sets ROCM_PATH to the one the tree links) goes on the
# prefix path beside the package: CMake otherwise takes the HIP runtime from wherever the HIP
# compiler sits, and a tree whose compiler comes from another ROCm build than its runtime would
# get a libr4d linked against that build's runtime, which then fails to load.
PP="$P"
[ -n "${ROCM_PATH:-}" ] && PP="$P;$ROCM_PATH"
build_one() { # build_one DIR JOBS -- configure and build one plugin directory
d=$1; n=$(basename "$d")
extra="$CCXX"
if is_sycl "$n"; then
extra="-DCMAKE_CXX_COMPILER=$ICPX"
@@ -91,17 +107,54 @@ for d in $dirs; do
fi
# A bundled plugin under plugin/ may carry device rows beside its host ones; it gets the tree's
# HIP compiler as a third party would pass theirs.
case "$d" in plugin/*) [ -n "$HIPC" ] && extra="-DCMAKE_HIP_COMPILER=$HIPC" ;; esac
case "$d" in plugin/*) [ -n "$HIPC" ] && extra="$extra -DCMAKE_HIP_COMPILER=$HIPC" ;; esac
# shellcheck disable=SC2086
run "$W/logs/$n.configure.log" cmake -S "$S/$d" -B "$W/b/$n" -G "$GEN" \
-DCMAKE_PREFIX_PATH="$P" -DCMAKE_INSTALL_PREFIX="$P" -DRAD_PLUGIN_INSTALL_HOME="$H" $extra
run "$W/logs/$n.build.log" cmake --build "$W/b/$n" -j "$J"
-DCMAKE_PREFIX_PATH="$PP" -DCMAKE_INSTALL_PREFIX="$P" -DRAD_PLUGIN_INSTALL_HOME="$H" $extra
run "$W/logs/$n.build.log" cmake --build "$W/b/$n" -j "$2"
}
install_one() { # install_one DIR
n=$(basename "$1")
# --prefix for the same reason as the tree install above: a plugin's own CMakeLists may install
# companions (libr4d ships r4d_selftest) to relative destinations under CMAKE_INSTALL_PREFIX, and
# the test must not need root. The plugins themselves ignore the prefix -- rad_add_plugin installs
# them under the absolute RAD_PLUGIN_INSTALL_HOME given at configure time -- so the checks below,
# which look in $H, are unaffected.
run "$W/logs/$n.install.log" cmake --install "$W/b/$n" --prefix "$W/i"
}
for d in $dirs; do
say "building $d against the installed package"
build_one "$d" "$J"
install_one "$d"
done
# OOT_JOBS of the small ones at a time (default half the build's width, at most 16: a plugin's
# compile holds about half a GiB), two compile jobs each; installed one after another, in order.
PJ=${OOT_JOBS:-$((J / 2))}
[ "$PJ" -gt 16 ] && PJ=16
[ "$PJ" -lt 1 ] && PJ=1
# shellcheck disable=SC2086
set -- $small
say "building $# architectures and bundled plugins against the installed package, $PJ at a time"
while [ $# -gt 0 ]; do
batch=""; nb=0
while [ $# -gt 0 ] && [ "$nb" -lt "$PJ" ]; do
batch="$batch $1"; nb=$((nb + 1))
( build_one "$1" 2 && : > "$W/logs/$(basename "$1").built" ) &
shift
done
wait
for d in $batch; do
[ -f "$W/logs/$(basename "$d").built" ] ||
fail "$d did not build out of tree (logs: $W/logs/$(basename "$d").*.log)"
install_one "$d"
done
done
for d in $devdirs; do
say "building $d against the installed package"
build_one "$d" "$J"
install_one "$d"
done
# 1. The same plugins, file for file.