Repository navigation
Commit 67c38a7
committed
feat: update llama.cpp submodule and bindings for Qwen 3.5 support
Updates the llama.cpp submodule to da348c9df which includes support for
the Qwen 3.5 model architecture (hybrid SSM + attention).
Changes to Python bindings:
1. llama_cpp.py: Sync llama_context_params struct with upstream C API
- flash_attn (bool) → flash_attn_type (enum llama_flash_attn_type)
- Add samplers (void*) and n_samplers (size_t) fields
- Add LLAMA_FLASH_ATTN_TYPE_* enum constants
2. llama.py: Update flash_attn parameter handling
- Map flash_attn=True/False to flash_attn_type=1/0
3. _ctypes_extensions.py: Graceful handling of deprecated symbols
- ctypes_function decorator returns stub instead of crashing
when a symbol is not found in the shared library
Tested with Qwen3.5-0.8B-Q4_K_M.gguf on Apple Silicon (M1 Pro):
- Cold start: ~4s (vs ~40s with mlx-vlm)
- Inference: ~0.6s per chat completion
- Model loads and runs correctly on Metal GPU1 parent c37132b commit 67c38a7
4 files changed
Lines changed: 27 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
110 | 110 | | |
111 | 111 | | |
112 | 112 | | |
113 | | - | |
114 | | - | |
115 | | - | |
116 | | - | |
117 | | - | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
118 | 122 | | |
119 | 123 | | |
120 | 124 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
341 | 341 | | |
342 | 342 | | |
343 | 343 | | |
344 | | - | |
| 344 | + | |
345 | 345 | | |
346 | 346 | | |
347 | 347 | | |
| |||
2096 | 2096 | | |
2097 | 2097 | | |
2098 | 2098 | | |
2099 | | - | |
| 2099 | + | |
2100 | 2100 | | |
2101 | 2101 | | |
2102 | 2102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
463 | 463 | | |
464 | 464 | | |
465 | 465 | | |
| 466 | + | |
| 467 | + | |
| 468 | + | |
| 469 | + | |
| 470 | + | |
| 471 | + | |
| 472 | + | |
| 473 | + | |
| 474 | + | |
| 475 | + | |
466 | 476 | | |
467 | 477 | | |
468 | 478 | | |
| |||
859 | 869 | | |
860 | 870 | | |
861 | 871 | | |
862 | | - | |
863 | 872 | | |
864 | 873 | | |
865 | 874 | | |
866 | 875 | | |
| 876 | + | |
| 877 | + | |
867 | 878 | | |
868 | 879 | | |
869 | 880 | | |
| |||
875 | 886 | | |
876 | 887 | | |
877 | 888 | | |
| 889 | + | |
878 | 890 | | |
879 | 891 | | |
880 | 892 | | |
| |||
891 | 903 | | |
892 | 904 | | |
893 | 905 | | |
894 | | - | |
895 | 906 | | |
896 | 907 | | |
897 | 908 | | |
898 | 909 | | |
| 910 | + | |
| 911 | + | |
899 | 912 | | |
900 | 913 | | |
901 | 914 | | |
| |||
Submodule llama.cpp updated from 4227c9b to da348c9
0 commit comments