Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

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

Đang mở
#595 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
62/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
cmake, cpp
Lĩnh vực
build-system

Hướng nghiên cứu

Bắt đầu với 3rdparty/llama.cpp/ggml.c và các target CMake tạo ra ggml-base.vcxproj, sau đó tái hiện lỗi bằng setup_env.py với -q tl2 hoặc -q i2_s. Truy vết nơi quantize_i2_s và dequantize_row_i2_s được định nghĩa, cũng như liệu các tệp nguồn của chúng có được đưa vào target Windows hay không. Hoàn tất khi cả hai lệnh đều hoàn thành bản build CMake mà không có lỗi linker do các symbol chưa được định nghĩa.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
C++
Star
40.3k
Fork
3.7k
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của microsoft/BitNet

Tất cả issue của microsoft/BitNet

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.