Investigate different approaches to binding to ggml
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 30/100
- Tipo de issue
- Refactorización
- Claridad
- Bien especificado
- Estado de actividad
- Estancado
- Área
- backend, build-system, devtools
Línea de trabajo
Revisa el binding existente de ctypes en ggml/ggml.py y la configuración de compilación de CMakeLists.txt. Examina las ramas de prueba para nanobind y SWIG para comprender los intentos de integración. El objetivo es evaluar los sistemas de binding según los requisitos indicados: rendimiento, mantenibilidad, extensibilidad y compatibilidad con el sistema de compilación de ggml. Determina las ventajas y desventajas de cada enfoque sin implementar una solución completa.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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
- Cython
- Pybind11
- Nanobind (WIP)
- SWIG (WIP)
- CFFI(?)
- Stick with ctypes
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
- Lenguaje dominante
- Python
- Estrellas
- 152
- Forks
- 16
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de abetlen/ggml-python
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
abetlen/ggml-python#91 ·
-
Import errorAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
abetlen/ggml-python#90 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
abetlen/ggml-python#93 · 1 comentario ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
abetlen/ggml-python#92 ·
-
Dificultad 3/5 1-2 días Aptitud para principiantes 30/100
abetlen/ggml-python#21 ·
Todos los issues de abetlen/ggml-python
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
aws-samples/sample-per-model-bedrock#243 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
FuRongJun-1999/dsh-memory#404 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
Los mantenedores suelen responder en 1 día
-
bug frontend
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
PennyLaneAI/catalyst#3337 ·
Los mantenedores suelen responder en 1 día
-
Workflow.schedule stops when a cron deadline passes before sleepPosiblemente ocupada @HuaTNA la tomó hoy. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 82/100
Los mantenedores suelen responder en 1 día