mirror of https://github.com/ollama/ollama.git
Merge 33e253a1bd
into bc71278670
This commit is contained in:
commit
d5f1a09e16
|
@ -398,6 +398,7 @@ type Runner struct {
|
||||||
MainGPU int `json:"main_gpu,omitempty"`
|
MainGPU int `json:"main_gpu,omitempty"`
|
||||||
UseMMap *bool `json:"use_mmap,omitempty"`
|
UseMMap *bool `json:"use_mmap,omitempty"`
|
||||||
NumThread int `json:"num_thread,omitempty"`
|
NumThread int `json:"num_thread,omitempty"`
|
||||||
|
NumParallel int `json:"num_parallel,omitempty"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// EmbedRequest is the request passed to [Client.Embed].
|
// EmbedRequest is the request passed to [Client.Embed].
|
||||||
|
@ -836,6 +837,7 @@ func DefaultOptions() Options {
|
||||||
NumGPU: -1, // -1 here indicates that NumGPU should be set dynamically
|
NumGPU: -1, // -1 here indicates that NumGPU should be set dynamically
|
||||||
NumThread: 0, // let the runtime decide
|
NumThread: 0, // let the runtime decide
|
||||||
UseMMap: nil,
|
UseMMap: nil,
|
||||||
|
NumParallel: int(envconfig.NumParallel()),
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -392,7 +392,7 @@ func (pending *LlmRequest) useLoadedRunner(runner *runnerRef, finished chan *Llm
|
||||||
// load creates a new model based on req and loads it. If requireFull is true then the model must be loaded fully onto GPUs
|
// load creates a new model based on req and loads it. If requireFull is true then the model must be loaded fully onto GPUs
|
||||||
// (if any). Returns whether the scheduler needs to evict a model to make this one fit.
|
// (if any). Returns whether the scheduler needs to evict a model to make this one fit.
|
||||||
func (s *Scheduler) load(req *LlmRequest, f *ggml.GGML, gpus discover.GpuInfoList, requireFull bool) bool {
|
func (s *Scheduler) load(req *LlmRequest, f *ggml.GGML, gpus discover.GpuInfoList, requireFull bool) bool {
|
||||||
numParallel := max(int(envconfig.NumParallel()), 1)
|
numParallel := max(req.opts.NumParallel, 1)
|
||||||
|
|
||||||
// Embedding models should always be loaded with parallel=1
|
// Embedding models should always be loaded with parallel=1
|
||||||
if req.model.CheckCapabilities(model.CapabilityCompletion) != nil {
|
if req.model.CheckCapabilities(model.CapabilityCompletion) != nil {
|
||||||
|
|
Loading…
Reference in New Issue