Commit 92900a3
committed
add --split-output-tensor / -sot CLI parameter (port from custom_neo)
Adds a CLI flag to force-split the output tensor (output.weight,
output_extra.weight) across GPUs when using split mode graph. When
enabled, the output tensor is allocated on buft_matrix (split-capable
buffer type) instead of buft_output, allowing it to participate in
tensor parallelism. The output norm tensors remain on buft_output
(except gemma4/gemma4_mtp, which also split output_norm).
- common/common.h: split_output_tensor field in gpt_params
- common/common.cpp: -sot / --split-output-tensor CLI arg, help, yaml
- include/llama.h: split_output_tensor field in llama_model_params
- src/llama-model.h: split_output_tensor flag in llama_model
- src/llama.cpp: pass split_output_tensor to llm_load_tensors
- src/llama-load-tensors.cpp:
* LOADING_PRELUDE sets ctx_output_split conditionally
* get_context_for_tensor skips -ot overrides for output tensor names
* create_embd_output / create_default_embd_output use ctx_output_split
* All architecture tensor functions use ctx_output_split for output
* Single centralized log when split_output_tensor = ON1 parent f74a6fb commit 92900a3
6 files changed
Lines changed: 112 additions & 85 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2177 | 2177 | | |
2178 | 2178 | | |
2179 | 2179 | | |
| 2180 | + | |
| 2181 | + | |
| 2182 | + | |
| 2183 | + | |
2180 | 2184 | | |
2181 | 2185 | | |
2182 | 2186 | | |
| |||
3029 | 3033 | | |
3030 | 3034 | | |
3031 | 3035 | | |
| 3036 | + | |
3032 | 3037 | | |
3033 | 3038 | | |
3034 | 3039 | | |
| |||
4171 | 4176 | | |
4172 | 4177 | | |
4173 | 4178 | | |
| 4179 | + | |
4174 | 4180 | | |
4175 | 4181 | | |
4176 | 4182 | | |
| |||
5301 | 5307 | | |
5302 | 5308 | | |
5303 | 5309 | | |
| 5310 | + | |
5304 | 5311 | | |
5305 | 5312 | | |
5306 | 5313 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
444 | 444 | | |
445 | 445 | | |
446 | 446 | | |
| 447 | + | |
447 | 448 | | |
448 | 449 | | |
449 | 450 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
429 | 429 | | |
430 | 430 | | |
431 | 431 | | |
| 432 | + | |
432 | 433 | | |
433 | 434 | | |
434 | 435 | | |
| |||
0 commit comments