mirror of
https://github.com/mudler/LocalAI.git
synced 2025-05-02 08:43:10 +00:00
feat(llama.cpp): add flash_attention
and no_kv_offloading
(#2310)
feat(llama.cpp): add flash_attn and no_kv_offload Signed-off-by: Ettore Di Giacinto <mudler@localai.io>
This commit is contained in:
parent
7123d07456
commit
e49ea0123b
@ -212,6 +212,9 @@ message ModelOptions {
|
|||||||
float YarnBetaSlow = 47;
|
float YarnBetaSlow = 47;
|
||||||
|
|
||||||
string Type = 49;
|
string Type = 49;
|
||||||
|
|
||||||
|
bool FlashAttention = 56;
|
||||||
|
bool NoKVOffload = 57;
|
||||||
}
|
}
|
||||||
|
|
||||||
message Result {
|
message Result {
|
||||||
|
@ -2254,6 +2254,9 @@ static void params_parse(const backend::ModelOptions* request,
|
|||||||
}
|
}
|
||||||
params.use_mlock = request->mlock();
|
params.use_mlock = request->mlock();
|
||||||
params.use_mmap = request->mmap();
|
params.use_mmap = request->mmap();
|
||||||
|
params.flash_attn = request->flashattention();
|
||||||
|
params.no_kv_offload = request->nokvoffload();
|
||||||
|
|
||||||
params.embedding = request->embeddings();
|
params.embedding = request->embeddings();
|
||||||
|
|
||||||
if (request->ropescaling() == "none") { params.rope_scaling_type = LLAMA_ROPE_SCALING_TYPE_NONE; }
|
if (request->ropescaling() == "none") { params.rope_scaling_type = LLAMA_ROPE_SCALING_TYPE_NONE; }
|
||||||
|
@ -77,6 +77,8 @@ func gRPCModelOpts(c config.BackendConfig) *pb.ModelOptions {
|
|||||||
MaxModelLen: int32(c.MaxModelLen),
|
MaxModelLen: int32(c.MaxModelLen),
|
||||||
TensorParallelSize: int32(c.TensorParallelSize),
|
TensorParallelSize: int32(c.TensorParallelSize),
|
||||||
MMProj: c.MMProj,
|
MMProj: c.MMProj,
|
||||||
|
FlashAttention: c.FlashAttention,
|
||||||
|
NoKVOffload: c.NoKVOffloading,
|
||||||
YarnExtFactor: c.YarnExtFactor,
|
YarnExtFactor: c.YarnExtFactor,
|
||||||
YarnAttnFactor: c.YarnAttnFactor,
|
YarnAttnFactor: c.YarnAttnFactor,
|
||||||
YarnBetaFast: c.YarnBetaFast,
|
YarnBetaFast: c.YarnBetaFast,
|
||||||
|
@ -132,6 +132,9 @@ type LLMConfig struct {
|
|||||||
TensorParallelSize int `yaml:"tensor_parallel_size"` // vLLM
|
TensorParallelSize int `yaml:"tensor_parallel_size"` // vLLM
|
||||||
MMProj string `yaml:"mmproj"`
|
MMProj string `yaml:"mmproj"`
|
||||||
|
|
||||||
|
FlashAttention bool `yaml:"flash_attention"`
|
||||||
|
NoKVOffloading bool `yaml:"no_kv_offloading"`
|
||||||
|
|
||||||
RopeScaling string `yaml:"rope_scaling"`
|
RopeScaling string `yaml:"rope_scaling"`
|
||||||
ModelType string `yaml:"type"`
|
ModelType string `yaml:"type"`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user