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

Investigate different approaches to binding to ggml

Đang mở
#3 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ó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
30/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
c, cmake, python
Lĩnh vực
backend, build-system, devtools

Hướng nghiên cứu

Xem xét binding ctypes hiện có trong ggml/ggml.py và cấu hình build trong CMakeLists.txt. Kiểm tra các nhánh kiểm thử cho nanobind và SWIG để hiểu các nỗ lực tích hợp. Mục tiêu là đánh giá các hệ thống binding theo các yêu cầu được liệt kê: hiệu năng, khả năng bảo trì, khả năng mở rộng và khả năng tương thích với hệ thống build của ggml. Xác định các trade-off của từng cách tiếp cận mà không triển khai một giải pháp hoàn chỉnh.

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

Mô tả

Current Approach
Use scikit-build-core and a CMakeLists file in the root directory to compile ggml as a shared library and install it relative to the ggml/ggml.py file so that it can be loaded by ctypes.CDLL.

Issues with Current Approach

  • #define's are not accessible from the shared library, this is an issue for values that are computed on the host system at compile time.
  • Platform specific functions such as those for CUDA, OpenCL, and Metal are also awkward to conditionally support with the ctypes approach
  • Assuming the relative location of files in an installed package causes issues, especially when installing in ie. editable mode for local development.
  • Some arguments such as ctypes Array's require awkward typing workarounds.

Alternative Binding Systems

Requirements

  • Should be at least as fast as ctypes approach (large overhead is not acceptable for this application)
  • Should be simple to maintain (ggml changes often, should be at least as simple as ctypes to add new function definitions / types / etc)
  • Should be easy for others to extend or modify ggml
  • Should use ggml's existing build system and flags when compiling, should not limit which platforms / optimizations can be used
Ngôn ngữ chính
Python
Star
152
Fork
16
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

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 abetlen/ggml-python

Tất cả issue của abetlen/ggml-python

Issue tương tự

Thêm issue về Python

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.