mirror of
https://github.com/kvcache-ai/ktransformers.git
synced 2025-09-09 13:55:27 +00:00
Initial commit
This commit is contained in:
commit
18c42e67df
247 changed files with 53775 additions and 0 deletions
24
third_party/llamafile/tinyblas_cpu_mixmul_arm80.cpp
vendored
Normal file
24
third_party/llamafile/tinyblas_cpu_mixmul_arm80.cpp
vendored
Normal file
|
@ -0,0 +1,24 @@
|
|||
// Adapted from
|
||||
// https://github.com/Mozilla-Ocho/llamafile/blob/0.8.8/llamafile/tinyblas_cpu_mixmul_arm80.cpp
|
||||
// Copyrigth 2024 Mozilla Foundation.
|
||||
// Copyright(c) 2024 by KVCache.AI, All Rights Reserved.
|
||||
|
||||
#ifdef __aarch64__
|
||||
#define llamafile_mixmul llamafile_mixmul_arm80
|
||||
#include "tinyblas_cpu_mixmul.inc"
|
||||
|
||||
/**
|
||||
* Returns number of shared memory bytes llamafile_mixmul() needs.
|
||||
*/
|
||||
size_t llamafile_mixmul_needs(const ggml_tensor* weights, const ggml_tensor* thought, const ggml_tensor* plan) {
|
||||
ggml_compute_params params{};
|
||||
params.wsize = 0x7ffff000;
|
||||
params.wdata = (void*)0x1000;
|
||||
MixMul mm{¶ms, weights, thought, plan, 0};
|
||||
if (mm.allocate_shared_memory())
|
||||
return mm.get_allocated_bytes();
|
||||
else
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif // __aarch64__
|
Loading…
Add table
Add a link
Reference in a new issue