forked from rustformers/llm
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added untested support for Metal. The Metal bindings might need to be
reworked. Use metal in features list to activate it.
- Loading branch information
Showing
12 changed files
with
165 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ cc = "^1.0" | |
[features] | ||
cublas = [] | ||
clblast = [] | ||
metal = [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule llama-cpp
updated
4 files
+4 −0 | Makefile | |
+9 −0 | ggml-opencl.cpp | |
+2 −0 | ggml-opencl.h | |
+5 −1 | llama.cpp |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
/* automatically generated by rust-bindgen 0.65.1 */ | ||
|
||
pub const GGML_METAL_MAX_BUFFERS: u32 = 16; | ||
#[repr(C)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub struct ggml_tensor { | ||
_unused: [u8; 0], | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub struct ggml_cgraph { | ||
_unused: [u8; 0], | ||
} | ||
#[repr(C)] | ||
#[derive(Debug, Copy, Clone)] | ||
pub struct ggml_metal_context { | ||
_unused: [u8; 0], | ||
} | ||
extern "C" { | ||
pub fn ggml_metal_init() -> *mut ggml_metal_context; | ||
} | ||
extern "C" { | ||
pub fn ggml_metal_free(ctx: *mut ggml_metal_context); | ||
} | ||
extern "C" { | ||
pub fn ggml_metal_add_buffer( | ||
ctx: *mut ggml_metal_context, | ||
name: *const ::std::os::raw::c_char, | ||
data: *mut ::std::os::raw::c_void, | ||
size: usize, | ||
) -> bool; | ||
} | ||
extern "C" { | ||
pub fn ggml_metal_set_tensor(ctx: *mut ggml_metal_context, t: *mut ggml_tensor); | ||
} | ||
extern "C" { | ||
pub fn ggml_metal_get_tensor(ctx: *mut ggml_metal_context, t: *mut ggml_tensor); | ||
} | ||
extern "C" { | ||
pub fn ggml_metal_graph_compute(ctx: *mut ggml_metal_context, gf: *mut ggml_cgraph); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters