[Windows] Linker error "undefined symbol: quantize_i2_s" when building with -q i2_s or -q tl2 on Windows 11

Aperta
#595 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
62/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Tranquilla
Stack tecnologico
cmake, cpp
Ambito
build-system

Direzione di ricerca

Inizia da 3rdparty/llama.cpp/ggml.c e dai target CMake che producono ggml-base.vcxproj, quindi riproduci il problema con setup_env.py usando -q tl2 o -q i2_s. Traccia dove sono definite quantize_i2_s e dequantize_row_i2_s e se i relativi file sorgente entrano nel target Windows. Il lavoro è completato quando entrambi i comandi completano la build CMake senza errori del linker dovuti a simboli non definiti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When attempting to build the project on Windows at 16da220ae2b510caff437d403288882687f44ae5 using python setup_env.py -md models/BitNet-b1.58-2B-4T -q tl2(or -q i2_s), the build fails during the CMake linking phase.

The linker (lld-link) reports undefined symbol errors for quantize_i2_s and dequantize_row_i2_s inside ggml-base.vcxproj.

It appears that recent updates in the 3rdparty/llama.cpp submodule (specifically ggml.c) reference the i2_s quantization symbols, but the source files implementing these i2_s functions are not included in the compilation target, causing a linker failure.

Terminal Output:
(.venv) PS D:\Projects\BitNet> python setup_env.py -md models/BitNet-b1.58-2B-4T -q tl2
INFO:root:Compiling the code using CMake.
ERROR:root:Error occurred while running command: Command '['cmake', '--build', 'build', '--config', 'Release']' returned non-zero exit status 1., check details in logs\compile.log
Relevant Section from logs/compile.log:
lld-link : error : undefined symbol: quantize_i2_s [D:\Projects\BitNet\build\3rdparty\llama.cpp\ggml\src\ggml-base.vcxproj]
  >>> referenced by ggml-base.dir\Release\ggml.c.obj:(ggml_quantize_chunk)
  
lld-link : error : undefined symbol: dequantize_row_i2_s [D:\Projects\BitNet\build\3rdparty\llama.cpp\ggml\src\ggml-base.vcxproj]
  >>> referenced by ggml-base.dir\Release\ggml.c.obj:(type_traits)
  Building Custom Rule D:/Projects/BitNet/3rdparty/llama.cpp/common/CMakeLists.txt
  llama-common-base.vcxproj -> D:\Projects\BitNet\build\3rdparty\llama.cpp\common\Release\llama-common-base.lib
  Building Custom Rule D:/Projects/BitNet/3rdparty/llama.cpp/tools/mtmd/CMakeLists.txt
  llama-gemma3-cli.vcxproj -> D:\Projects\BitNet\build\bin\Release\llama-gemma3-cli.exe
  Building Custom Rule D:/Projects/BitNet/3rdparty/llama.cpp/tools/mtmd/CMakeLists.txt
  llama-llava-cli.vcxproj -> D:\Projects\BitNet\build\bin\Release\llama-llava-cli.exe
  Building Custom Rule D:/Projects/BitNet/3rdparty/llama.cpp/tools/mtmd/CMakeLists.txt
  llama-minicpmv-cli.vcxproj -> D:\Projects\BitNet\build\bin\Release\llama-minicpmv-cli.exe
  Building Custom Rule D:/Projects/BitNet/3rdparty/llama.cpp/tools/mtmd/CMakeLists.txt
  llama-qwen2vl-cli.vcxproj -> D:\Projects\BitNet\build\bin\Release\llama-qwen2vl-cli.exe
  Building Custom Rule D:/Projects/BitNet/3rdparty/llama.cpp/tools/ui/CMakeLists.txt
  llama-ui.vcxproj -> D:\Projects\BitNet\build\3rdparty\llama.cpp\tools\ui\Release\llama-ui.lib
Environment:
  • OS: Windows 11 Home (Build 10.0.26200)
  • Compiler / Toolchain: Visual Studio 2026 + Clang 22.1.3 (x86_64-pc-windows-msvc)
  • CMake Version: 4.3.1-msvc1
  • Python Version: 3.10.11
Lingua principale
C++
Stelle
40.3k
Fork
3.7k
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/BitNet

Tutte le issue di microsoft/BitNet

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.