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
Same failure here, with the root cause and a workaround.
Environment: MacBook Pro M2 Pro, macOS 26.5.2, Apple clang 21.0.0 (clang-2100.1.1.101), CMake 4.4.3, main @ 0b341e5, submodule 3rdparty/llama.cpp @ 390c3077. Reproduced with the README command python setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_s on a clean build/; logs/compile.log is identical to yours.
Root cause:ggml/src/ggml.c references quantize_i2_s (in ggml_quantize_chunk) and dequantize_row_i2_s (in type_traits[GGML_TYPE_I2_S]). Both are declared in ggml/src/ggml-quants.h but defined in ggml/src/ggml-cpu/quants.c, i.e. in the ggml-cpu backend library, so libggml-base depends on symbols that live in a library loaded after it. Linux/ELF tolerates undefined symbols in shared objects and resolves them at load time; macOS ld (two-level namespace) and MSVC/lld-link refuse. It is the same defect as the Windows report #595 (PR #606 only addresses the Windows side).
Suggested fix: implement the I2_S quantize/dequantize routines inside ggml-base (next to the other quantize_*/dequantize_row_* in ggml-quants.c), or stop referencing CPU-backend symbols from ggml.c.
(setup_env.py re-uses the cached CMake configuration, so you can run it afterwards.) Building static libraries (-DBUILD_SHARED_LIBS=OFF) should also work.
Heads-up: on M2 and later (any ARM CPU with i8mm) the build then fails at a second, unrelated spot, ggml-cpu.c:1495: use of undeclared identifier 'src1_cont'. I opened #618 for that one. And once both are fixed, I2_S inference on the arm64 binary still produces garbage with the official GGUF, which is #585 / #600 (fix in PR #586). Until those land, a usable path on Apple Silicon is an x86_64 build run under Rosetta 2 (details in #600).
Activity
claudioaldrighettiatroos commentedon Sep 5, 2026
Same failure here, with the root cause and a workaround.
Environment: MacBook Pro M2 Pro, macOS 26.5.2, Apple clang 21.0.0 (clang-2100.1.1.101), CMake 4.4.3,
main@0b341e5, submodule3rdparty/llama.cpp@390c3077. Reproduced with the README commandpython setup_env.py -md models/BitNet-b1.58-2B-4T -q i2_son a cleanbuild/;logs/compile.logis identical to yours.Root cause:
ggml/src/ggml.creferencesquantize_i2_s(inggml_quantize_chunk) anddequantize_row_i2_s(intype_traits[GGML_TYPE_I2_S]). Both are declared inggml/src/ggml-quants.hbut defined inggml/src/ggml-cpu/quants.c, i.e. in theggml-cpubackend library, solibggml-basedepends on symbols that live in a library loaded after it. Linux/ELF tolerates undefined symbols in shared objects and resolves them at load time; macOSld(two-level namespace) and MSVC/lld-link refuse. It is the same defect as the Windows report #595 (PR #606 only addresses the Windows side).Suggested fix: implement the I2_S quantize/dequantize routines inside
ggml-base(next to the otherquantize_*/dequantize_row_*inggml-quants.c), or stop referencing CPU-backend symbols fromggml.c.Workaround (no source change):
(
setup_env.pyre-uses the cached CMake configuration, so you can run it afterwards.) Building static libraries (-DBUILD_SHARED_LIBS=OFF) should also work.Heads-up: on M2 and later (any ARM CPU with i8mm) the build then fails at a second, unrelated spot,
ggml-cpu.c:1495: use of undeclared identifier 'src1_cont'. I opened #618 for that one. And once both are fixed, I2_S inference on the arm64 binary still produces garbage with the official GGUF, which is #585 / #600 (fix in PR #586). Until those land, a usable path on Apple Silicon is an x86_64 build run under Rosetta 2 (details in #600).