Repository navigation
Windows: raea starts on a processor without AVX2 (#110) - #197
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #110.
On an Intel Core i5-3550 (Ivy Bridge, 2012),
raea.exestopped at once with0xC000001D, an illegal instruction, whatever it was asked to do.Cause. Intel's Software Development Emulator ran rc8's
raea.exe --versionas an Ivy Bridge and named the instruction. It was ashlx(BMI2) in the C++ library'sunordered_maprehash, called from a static initializer that fills ONNX's set of experimental operators (ATen, Affine, ConstantFill, Crop). That code is the static ONNX Runtimeortdownloads and links, and it's built with AVX2. Its initializers run beforemain, so no path of raea's could avoid them. Every CPU without AVX2 and BMI2 stopped there: an Intel Core from before 2013, and many Celerons and Pentiums. With the emulator set to report and carry on, all 8 such instructions inraea --versionwere in that library's code.Fix. On Windows x64,
ortnow loads ONNX Runtime when a model first runs (load-dynamic), fromonnxruntime.dllbeside the executable, and links none of it.raea.exeandraea-perceive.exeare the two executables that used it; the hosts never did.systems/{ml,song,columns,speech,index}:ort'sload-dynamicon Windows x64, in each crate that usesort. They need it separately because raea, raea-perceive and the hosts build in separate cargo runs.cargo treeshowsdisable-linkingin both builds that use it.tools/release/onnxruntime.sh: fetches Microsoft's own build, Microsoft.ML.OnnxRuntime 1.28.0 from NuGet (MIT). That's the version the static build was. It's checked against a pinned sha256; its sha512 also matches NuGet's record. Its LICENSE and ThirdPartyNotices.txt ship beside it. On the emulator, as an Ivy Bridge and as a Sandy Bridge, the DLL loads, makes an environment and opens raea's beat model.release.yml: runs that script 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 Microsoft DLL, by name, and requires it and its licence in a Windows zip. Itsraea songcheck runs ONNX Runtime from the unpacked zip on every release.Checked so far:
load-dynamic, checked on the Mac target;ring's C can't build for Windows there.cargo shearfinds nothing.Still to check on rc9:
raea --versionandraea songon an emulated Ivy Bridge, and the full Windows set natively on the box.🤖 Generated with Claude Code