mirror of
https://github.com/shinyobjectz/raea.git
synced 2026-12-01 12:44:11 -10:00
On an Intel Core i5-3550 (Ivy Bridge, 2012) raea.exe stopped at once with 0xC000001D, an illegal instruction, whatever it was asked. Intel's Software Development Emulator, running rc8's raea.exe --version as an Ivy Bridge, named the instruction: a shlx (BMI2) in the C++ library's unordered_map rehash, called from a static initializer that fills ONNX's set of experimental operators (ATen, Affine, ConstantFill, Crop). It was the static ONNX Runtime that ort downloads and links, built with AVX2. Its initializers run before main, so no path of raea's could avoid them: every CPU without AVX2 and BMI2 (an Intel Core before 2013, many Celerons and Pentiums) stopped there. With the emulator told to report and carry on, all 8 such instructions in raea --version lay in that library's code.
On Windows x64, ort now loads ONNX Runtime when a model first runs (load-dynamic), from onnxruntime.dll beside the executable, and links none of it. raea.exe and raea-perceive.exe are the two that used it; the hosts never did.
- systems/{ml,song,columns,speech,index}: ort's load-dynamic on Windows x64, in each crate that uses ort, since raea, raea-perceive and the hosts build in separate cargo runs (checked with cargo tree: disable-linking in both). The crates compile with it (checked on the Mac target; ring's C can't build for Windows here).
- tools/release/onnxruntime.sh: Microsoft's own build, Microsoft.ML.OnnxRuntime 1.28.0 from NuGet (the version the static build was; MIT), checked against its pinned sha256 (its sha512 matches NuGet's record), with its LICENSE and ThirdPartyNotices.txt. Under the emulator as an Ivy Bridge and a Sandy Bridge it loads, makes an environment and opens raea's beat model.
- release.yml runs it in the Windows job on both the built and the promoted paths, and lists the DLL's imports; release.sh packs the three files and refuses a build without them.
- release-check.sh allows that one DLL of Microsoft's, by name, and requires it and its licence in a Windows zip. Its song check (raea song) runs ONNX Runtime from the unpacked zip on every release.
- What's new for 0.1.8 says so.
29 lines
2.0 KiB
Bash
Executable File
29 lines
2.0 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
# Windows x64's ONNX Runtime as Microsoft builds it (the Microsoft.ML.OnnxRuntime package on NuGet, MIT): onnxruntime.dll,
|
|
# its LICENSE and its ThirdPartyNotices.txt, put in DEST beside raea.exe for tools/release.sh to pack.
|
|
#
|
|
# raea.exe loads it when a model first runs (ort's load-dynamic on Windows x64, #110). It used to link the static runtime
|
|
# ort downloads, which is built for AVX2: its static initializers ran before main, so raea.exe stopped at start on every
|
|
# CPU without AVX2 and BMI2 (an Ivy Bridge, a Celeron), whatever was asked of it. Microsoft's runtime picks its kernels
|
|
# by the CPU it finds; it loads and opens raea's models under Intel's emulator as an Ivy Bridge and a Sandy Bridge.
|
|
# 1.28.0 is the runtime the static build was (ort-sys 2.0.0-rc.13's [email protected]); ort asks for API 17 or newer.
|
|
# tools/release/onnxruntime.sh DEST
|
|
set -euo pipefail
|
|
die() { echo "onnxruntime: $*" >&2; exit 1; }
|
|
dest=${1:?DEST}
|
|
v=1.28.0
|
|
# the package's sha256; its sha512 is the one NuGet records for it (packageHash)
|
|
sum=769d1d3ea8ab6cd69f737c9dd4d4462aa4ad0ccfa106eaf506efc40d7bead5db
|
|
url=https://api.nuget.org/v3-flatcontainer/microsoft.ml.onnxruntime/$v/microsoft.ml.onnxruntime.$v.nupkg
|
|
tmp=$(mktemp -d)
|
|
trap 'rm -rf "$tmp"' EXIT
|
|
curl -fsSL --retry 5 --retry-all-errors --connect-timeout 30 -o "$tmp/ort.nupkg" "$url" || die "couldn't download $url"
|
|
got=$( (sha256sum "$tmp/ort.nupkg" 2>/dev/null || shasum -a 256 "$tmp/ort.nupkg") | cut -d' ' -f1)
|
|
[ "$got" = "$sum" ] || die "Microsoft.ML.OnnxRuntime $v is $got, not the $sum pinned here"
|
|
unzip -q -o "$tmp/ort.nupkg" runtimes/win-x64/native/onnxruntime.dll LICENSE ThirdPartyNotices.txt -d "$tmp/x"
|
|
mkdir -p "$dest"
|
|
cp "$tmp/x/runtimes/win-x64/native/onnxruntime.dll" "$dest/onnxruntime.dll"
|
|
cp "$tmp/x/LICENSE" "$dest/onnxruntime-LICENSE.txt"
|
|
cp "$tmp/x/ThirdPartyNotices.txt" "$dest/onnxruntime-ThirdPartyNotices.txt"
|
|
echo "onnxruntime: Microsoft.ML.OnnxRuntime $v's onnxruntime.dll ($(wc -c < "$dest/onnxruntime.dll" | tr -d ' ') bytes) and its notices in $dest"
|