Skip to content

Commit d75561d

Browse files
authored
server : add --numa support (#2524)
1 parent 348acf1 commit d75561d

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

examples/server/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ Command line options:
1616
- `--memory-f32`: Use 32-bit floats instead of 16-bit floats for memory key+value. Not recommended.
1717
- `--mlock`: Lock the model in memory, preventing it from being swapped out when memory-mapped.
1818
- `--no-mmap`: Do not memory-map the model. By default, models are mapped into memory, which allows the system to load only the necessary parts of the model as needed.
19+
- `--numa`: Attempt optimizations that help on some NUMA systems.
1920
- `--lora FNAME`: Apply a LoRA (Low-Rank Adaptation) adapter to the model (implies --no-mmap). This allows you to adapt the pretrained model to specific tasks or domains.
2021
- `--lora-base FNAME`: Optional model to use as a base for the layers modified by the LoRA adapter. This flag is used in conjunction with the `--lora` flag, and specifies the base model for the adaptation.
2122
- `-to N`, `--timeout N`: Server read/write timeout in seconds. Default `600`.

examples/server/server.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -666,6 +666,7 @@ static void server_print_usage(const char *argv0, const gpt_params &params,
666666
{
667667
fprintf(stdout, " --no-mmap do not memory-map model (slower load but may reduce pageouts if not using mlock)\n");
668668
}
669+
fprintf(stdout, " --numa attempt optimizations that help on some NUMA systems\n");
669670
#ifdef LLAMA_SUPPORTS_GPU_OFFLOAD
670671
fprintf(stdout, " -ngl N, --n-gpu-layers N\n");
671672
fprintf(stdout, " number of layers to store in VRAM\n");
@@ -940,6 +941,10 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
940941
{
941942
params.use_mmap = false;
942943
}
944+
else if (arg == "--numa")
945+
{
946+
params.numa = true;
947+
}
943948
else if (arg == "--embedding")
944949
{
945950
params.embedding = true;

0 commit comments

Comments
 (0)