You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
LLVM backend code generation error on ARM64 #10388
Using the latest 0.63.1 build, running the following code:
from numba import guvectorize, int64
import numpy as np
@guvectorize([(int64[:], int64, int64[:])], '(n),()->(n)')
def g(x, y, res):
for i in range(x.shape[0]):
res[i] = x[i] + y
a = np.arange(5)
result = g(a, 2) #type: ignore
print(result)
Results in the following error:
DefIdx 1 exceeds machine model writes for renamable $x11, renamable $x10 = LDPXi $sp, 0 :: (load (s64) from %fixed-stack.7), (load (s64) from %fixed-stack.8, align 16)
(Try with MCSchedModel.CompleteModel set to false)incomplete machine model
UNREACHABLE executed at /root/miniconda3/envs/buildenv/conda-bld/llvmdev_1755759150100/work/llvm/lib/CodeGen/TargetSchedule.cpp:229!
Aborted (core dumped)
I can get Numba to work by including this code snippet above the import statements:
import os
# ARM64 LLVM optimization workaround
# Use generic ARM64 target to avoid CPU-specific scheduling model bugs
os.environ['NUMBA_CPU_NAME'] = 'generic'
from numba import guvectorize, int64
import numpy as np
Since this issue seems to be specific to my CPU model, I've included the details from cat /proc/cpuinfo | grep "CPU":
processor : 0
BogoMIPS : 38.40
Features : fp asimd evtstrm aes pmull sha1 sha2 crc32 atomics fphp asimdhp cpuid asimdrdm jscvt fcma lrcpc dcpop sha3 sm3 sm4 asimddp sha512 asimdfhm uscat ilrcpc flagm ssbs sb paca pacg dcpodp flagm2 frint i8mm bf16 rng afp rpres
CPU implementer : 0x51
CPU architecture: 8
CPU variant : 0x2
CPU part : 0x001
CPU revision : 1
I have a 12 core CPU, I've included the details for the first core for brevity.
I'm willing to provide additional details if necessary.
@esc Yes, this is on Linux. Here is my numba -s output.
System info:
--------------------------------------------------------------------------------
__Time Stamp__
Report started (local time) : 2025-12-20 10:12:25.333612
UTC start time : 2025-12-20 15:12:25.333676
Running time (s) : 0.789041
__Hardware Information__
Machine : aarch64
CPU Name : oryon-1
CPU Count : 12
Number of accessible CPUs : 12
List of accessible CPUs cores : 0 1 2 3 4 5 6 7 8 9 10 11
CFS Restrictions (CPUs worth of runtime) : None
CPU Features : aes crc fp-armv8 lse neon sha2
Memory Total (MB) : 15744
Memory Available (MB) : 12676
__OS Information__
Platform Name : Linux-6.6.87.2-microsoft-standard-WSL2-aarch64-with-glibc2.39
Platform Release : 6.6.87.2-microsoft-standard-WSL2
OS Name : Linux
OS Version : #1 SMP PREEMPT_DYNAMIC Thu Jun 5 18:31:42 UTC 2025
OS Specific Version : ?
Libc Version : glibc 2.39
__Python Information__
Python Compiler : GCC 13.3.0
Python Implementation : CPython
Python Version : 3.12.3
Python Locale : C.UTF-8
__Numba Toolchain Versions__
Numba Version : 0.63.1
llvmlite Version : 0.46.0
__LLVM Information__
LLVM Version : 20.1.8
__CUDA Information__
CUDA Target Implementation : Built-in
CUDA Device Initialized : False
CUDA Driver Version : ?
CUDA Runtime Version : ?
CUDA NVIDIA Bindings Available : ?
CUDA NVIDIA Bindings In Use : ?
CUDA Minor Version Compatibility Available : ?
CUDA Minor Version Compatibility Needed : ?
CUDA Minor Version Compatibility In Use : ?
CUDA Detect Output:
None
CUDA Libraries Test Output:
None
__NumPy Information__
NumPy Version : 2.3.4
NumPy Supported SIMD features : ('NEON', 'NEON_FP16', 'NEON_VFPV4', 'ASIMD', 'FPHP', 'ASIMDHP', 'ASIMDDP', 'ASIMDFHM')
NumPy Supported SIMD dispatch : ('ASIMDHP', 'ASIMDFHM', 'SVE')
NumPy Supported SIMD baseline : ('NEON', 'NEON_FP16', 'NEON_VFPV4', 'ASIMD')
NumPy AVX512_SKX support detected : False
__SVML Information__
SVML State, config.USING_SVML : False
SVML Library Loaded : False
llvmlite Using SVML Patched LLVM : False
SVML Operational : False
__Threading Layer Information__
TBB Threading Layer Available : False
+--> Disabled due to Unknown import problem.
OpenMP Threading Layer Available : False
+--> Disabled due to Unknown import problem.
Workqueue Threading Layer Available : True
+-->Workqueue imported successfully.
__Numba Environment Variable Information__
None found.
__Conda Information__
Conda not available.
__Installed Packages__
Package Version
-------- -------
llvmlite 0.46.0
numba 0.63.1
numpy 2.3.4
pip 24.0
psutil 7.1.3
No errors reported.
__Warning log__
Warning (cuda): CUDA driver library cannot be found or no CUDA enabled devices are present.
Exception class: <class 'numba.cuda.cudadrv.error.CudaSupportError'>
Warning: Conda not available.
Error was [Errno 2] No such file or directory: 'conda'
Warning (no file): /sys/fs/cgroup/cpuacct/cpu.cfs_quota_us
Warning (no file): /sys/fs/cgroup/cpuacct/cpu.cfs_period_us
--------------------------------------------------------------------------------
If requested, please copy and paste the information between
the dashed (----) lines, or from a given specific section as
appropriate.
=============================================================
IMPORTANT: Please ensure that you are happy with sharing the
contents of the information present, any information that you
wish to keep private you should remove before sharing.
=============================================================
@Detrilemma OK, thank you. Nothing obvious stands out. The project is currently on winter break so you are likely to experience some delay with the triage. I expect that this will not be triaged until mid-january 2026 at the earliest. Thank you in advance for your patience.
@Detrilemma took another look today. This is not "just" linux, this is WSL, i.e. Windows Subsytem on Linux? Also, it looks like you compiled the stack yourself, given the llvm is in the conda-bld directory? Did you compile LLVM yourself too?
Yes, I'm running Linux using WSL. I didn't compile anything myself in this environment. I created a separate venv, pip installed numba, and the copied some code from the docs to try and isolate this issue. If you think it would be helpful, I could try and re-create this issue in a pure Windows environment to see if the issue is specific to my particular CPU model.
I started setting up a Windows environment to test this only to find that Numba doesn't support Windows ARM64. This makes sense given that LLVMlite also does not support Windows ARM64.
As a sanity check, I went ahead and installed Numba to an environment running the amd64 Python interpreter. This worked, however this come to no surprise and only confirms that the x86 to ARM64 emulator is functioning correctly.
I started setting up a Windows environment to test this only to find that Numba doesn't support Windows ARM64. This makes sense given that LLVMlite also does not support Windows ARM64.
As a sanity check, I went ahead and installed Numba to an environment running the amd64 Python interpreter. This worked, however this come to no surprise and only confirms that the x86 to ARM64 emulator is functioning correctly.
Yes, Windows-on-arm is currently WIP. You can track the issue here: #10066 -- hopefully support will become available sometime in 2026.
I can reproduce this on a Jetson AGX Orin (a 12-core NVIDIA ARM CPU) by setting the CPU name to match that given in the report:
NUMBA_CPU_NAME="oryon-1" python repro.py
DefIdx 1 exceeds machine model writes for renamable $x11, renamable $x10 = LDPXi $sp, 0 :: (load (s64) from %fixed-stack.7), (load (s64) from %fixed-stack.8, align 16)
(Try with MCSchedModel.CompleteModel set to false)incomplete machine model
UNREACHABLE executed at /root/miniconda3/envs/buildenv/conda-bld/llvmdev_1755759150100/work/llvm/lib/CodeGen/TargetSchedule.cpp:229!
This may be because we build with assertions enabled. It appears that without assertions, the function reporting this error will return a default latency if one does does not exist in the model.
The following crude change works around the issue:
diff --git a/llvm/lib/Target/AArch64/AArch64SchedOryon.td b/llvm/lib/Target/AArch64/AArch64SchedOryon.td
index 435eaf99c617..9fb685283829 100644
--- a/llvm/lib/Target/AArch64/AArch64SchedOryon.td+++ b/llvm/lib/Target/AArch64/AArch64SchedOryon.td@@ -21,7 +21,7 @@ def OryonModel : SchedMachineModel {
let MispredictPenalty = 13; // 13 cycles for mispredicted branch.
let LoopMicroOpBufferSize = 16; // Oryon-1 does not have loop micro op buffer, we enable this pseudo value to allow for aggressive unrolling based on runtime TC.
let PostRAScheduler = 1; // Using PostRA sched.
- let CompleteModel = 1;+ let CompleteModel = 0;
list<Predicate> UnsupportedFeatures = !listconcat(SVEUnsupported.F,
SMEUnsupported.F,
It turns out that reducing the latencies to 1 causes the issue to reproduce again. So maybe they shouldn't be 1 just to match the 1Cyc description in their name. (Perhaps the default latency is 1 anyway?)
@gmarkall that's good to hear. Are there any plans to change the llvmdev build so that it's configured for this particular case upon installation? I don't expect your team to prioritize my odd case; I’m just curious if there is a long-term plan.
We intend to change the llvmdev build, but it can't be done at installation time - we need to do a new build of the llvmdev package with the patch applied. For that, we need to do a PR that modifies the llvmdev recipe to apply the patch, and then to do a new build of it.
patch to flip CompleteModel field to resolve this issue has been merged to llvmdev recipe - numba/llvmlite#1472. I'm working to rebuild llvmdev and upload to numba channel now. This should resolve the issue on oryon-1 with next llvmlite and Numba release.
Activity
esc commentedon Dec 20, 2025
Thank you for submitting this error report. Can you run
numba -sand post the output. Also, what OS/Platform is this? Linux?Detrilemma commentedon Dec 20, 2025
@esc Yes, this is on Linux. Here is my numba -s output.
esc commentedon Dec 20, 2025
@Detrilemma OK, thank you. Nothing obvious stands out. The project is currently on winter break so you are likely to experience some delay with the triage. I expect that this will not be triaged until mid-january 2026 at the earliest. Thank you in advance for your patience.
esc commentedon Dec 21, 2025
@Detrilemma took another look today. This is not "just" linux, this is WSL, i.e. Windows Subsytem on Linux? Also, it looks like you compiled the stack yourself, given the
llvmis in theconda-blddirectory? Did you compile LLVM yourself too?Looks like you hit the following snippet:
Detrilemma commentedon Dec 21, 2025
Yes, I'm running Linux using WSL. I didn't compile anything myself in this environment. I created a separate venv, pip installed numba, and the copied some code from the docs to try and isolate this issue. If you think it would be helpful, I could try and re-create this issue in a pure Windows environment to see if the issue is specific to my particular CPU model.
esc commentedon Dec 21, 2025
I am not sure why the following path shows up in the error message. I think this might be artifact of compiling
llvmlite, not sure:We recently saw some micro-architecture related issues.
#10325
So, yes, if you can try on plain windows that would help and add additional data to this.
Detrilemma commentedon Dec 24, 2025
I started setting up a Windows environment to test this only to find that Numba doesn't support Windows ARM64. This makes sense given that LLVMlite also does not support Windows ARM64.
As a sanity check, I went ahead and installed Numba to an environment running the amd64 Python interpreter. This worked, however this come to no surprise and only confirms that the x86 to ARM64 emulator is functioning correctly.
esc commentedon Dec 30, 2025
Yes, Windows-on-arm is currently WIP. You can track the issue here: #10066 -- hopefully support will become available sometime in 2026.
gmarkall commentedon Jan 5, 2026
I can reproduce this on a Jetson AGX Orin (a 12-core NVIDIA ARM CPU) by setting the CPU name to match that given in the report:
gmarkall commentedon Jan 5, 2026
This may be because we build with assertions enabled. It appears that without assertions, the function reporting this error will return a default latency if one does does not exist in the model.
gmarkall commentedon Jan 5, 2026
With an LLVM build with assertions enabled I can reproduce the issue with
llc(using the IR dumped withNUMBA_DUMP_LLVM=1:gmarkall commentedon Jan 5, 2026
A similar issue occurs on LLVM
main.gmarkall commentedon Jan 5, 2026
The following crude change works around the issue:
gmarkall commentedon Jan 5, 2026
Perhaps a slightly better patch, though I am wading out of my depth here:
gmarkall commentedon Jan 5, 2026
... those latencies should all be 1, not 5 🤕
gmarkall commentedon Jan 5, 2026
It turns out that reducing the latencies to 1 causes the issue to reproduce again. So maybe they shouldn't be 1 just to match the
1Cycdescription in their name. (Perhaps the default latency is 1 anyway?)gmarkall commentedon Jan 20, 2026
From triage meeting: Only we build LLVM with assertions enabled, so applying #10388 (comment) to our llvmdev build is likely an acceptable workaround.
Detrilemma commentedon Jan 21, 2026
@gmarkall that's good to hear. Are there any plans to change the llvmdev build so that it's configured for this particular case upon installation? I don't expect your team to prioritize my odd case; I’m just curious if there is a long-term plan.
gmarkall commentedon Jan 21, 2026
We intend to change the llvmdev build, but it can't be done at installation time - we need to do a new build of the llvmdev package with the patch applied. For that, we need to do a PR that modifies the llvmdev recipe to apply the patch, and then to do a new build of it.
swap357 commentedon Aug 26, 2026
patch to flip
CompleteModelfield to resolve this issue has been merged to llvmdev recipe - numba/llvmlite#1472. I'm working to rebuild llvmdev and upload to numba channel now. This should resolve the issue onoryon-1with next llvmlite and Numba release.