Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Investigate different approaches to binding to ggml

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
30/100
Tipo di issue
Refactoring
Chiarezza
Specificata chiaramente
Stato di attività
Ferma
Stack tecnologico
c, cmake, python

Direzione di ricerca

Esamina il binding ctypes esistente in ggml/ggml.py e la configurazione di build di CMakeLists.txt. Esamina i branch di test per nanobind e SWIG per comprendere i tentativi di integrazione. L’obiettivo è valutare i sistemi di binding in base ai requisiti elencati: prestazioni, manutenibilità, estensibilità e compatibilità con il sistema di build di ggml. Determina i compromessi di ciascun approccio senza implementare una soluzione completa.

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

Descrizione

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
Lingua principale
Python
Stelle
152
Fork
16
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

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

Tutte le issue di abetlen/ggml-python

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.