Skip to content

Conversation

@Ayush10
Copy link

@Ayush10 Ayush10 commented Feb 1, 2026

Summary

  • Added -mllvm -disable-interleaved-load-combine compiler flags to setup_env.py for macOS ARM64 builds
  • LLVM's InterleavedLoadCombine optimization pass triggers infinite recursion on Apple Silicon when compiling BitNet's vector shuffle patterns, causing the build to hang indefinitely
  • This has been reported across multiple LLVM versions (Apple Clang 17.0.0, Homebrew Clang 20.1.6) and affects M1/M2/M4 chips
  • The fix is scoped to Darwin + arm64 only, so it does not affect x86, Linux, or Windows builds

Related issues

Test plan

  • Run python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s on Apple Silicon Mac — verify build completes in minutes, not hours
  • Verify build still works on x86_64 Linux/Windows (no flags added on those platforms)
  • Run inference after build to verify model correctness is unaffected

Fixes #294

LLVM's InterleavedLoadCombine pass triggers infinite recursion when
compiling BitNet's vector shuffle patterns on Apple Silicon, causing
builds to hang indefinitely. This affects both Apple Clang and
Homebrew Clang (reported with versions 17.0.0 through 20.1.6).

Added -mllvm -disable-interleaved-load-combine to CMAKE_C_FLAGS and
CMAKE_CXX_FLAGS, scoped to Darwin + arm64 only.

Fixes microsoft#294
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

LLVM bug triggered by BitNet's code patterns

1 participant