Skip to content

gguf-split: add --no-tensor-first-split option#7072

Merged
ngxson merged 1 commit into
ggml-org:masterfrom
ngxson:xsn/split_without_tensor
May 4, 2024
Merged

gguf-split: add --no-tensor-first-split option#7072
ngxson merged 1 commit into
ggml-org:masterfrom
ngxson:xsn/split_without_tensor

Conversation

@ngxson

@ngxson ngxson commented May 4, 2024

Copy link
Copy Markdown
Collaborator

Resolves #6463

  • Add --no-tensor-first-split that produces the first split *-00001-of-0000.. with only metadata (no tensors)
  • Add a small fix to ggml.c to resolve the WARNING: Behavior may be unexpected when allocating 0 bytes for ggml_calloc! when loading a gguf with 0 tensors ==> For extra safe, I'd like to ask @slaren if there is any side effect of this change? (ctx->infos will now be uninitialized)
  • Updated & run the tests.sh locally

@ngxson ngxson requested review from phymbert and slaren May 4, 2024 13:03

@phymbert phymbert left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool! Mind someone did an attempt on python side:
#6942

@github-actions

github-actions Bot commented May 4, 2024

Copy link
Copy Markdown
Contributor

📈 llama.cpp server for bench-server-baseline on Standard_NC4as_T4_v3 for phi-2-q4_0: 546 iterations 🚀

Expand details for performance related PR only
  • Concurrent users: 8, duration: 10m
  • HTTP request : avg=8546.11ms p(95)=22146.56ms fails=, finish reason: stop=479 truncated=67
  • Prompt processing (pp): avg=105.29tk/s p(95)=441.53tk/s
  • Token generation (tg): avg=32.18tk/s p(95)=47.27tk/s
  • ggml-org/models/phi-2/ggml-model-q4_0.gguf parallel=8 ctx-size=16384 ngl=33 batch-size=2048 ubatch-size=256 pp=1024 pp+tg=2048 branch=xsn/split_without_tensor commit=52d2cac4f87d54a006475e3bd4f94bd7f47a2adc

prompt_tokens_seconds

More
---
config:
    xyChart:
        titleFontSize: 12
        width: 900
        height: 600
    themeVariables:
        xyChart:
            titleColor: "#000000"
---
xychart-beta
    title "llama.cpp bench-server-baseline on Standard_NC4as_T4_v3
 duration=10m 546 iterations"
    y-axis "llamacpp:prompt_tokens_seconds"
    x-axis "llamacpp:prompt_tokens_seconds" 1714828907 --> 1714829535
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 415.9, 415.9, 415.9, 415.9, 415.9, 720.72, 720.72, 720.72, 720.72, 720.72, 716.36, 716.36, 716.36, 716.36, 716.36, 734.01, 734.01, 734.01, 734.01, 734.01, 764.51, 764.51, 764.51, 764.51, 764.51, 767.86, 767.86, 767.86, 767.86, 767.86, 769.35, 769.35, 769.35, 769.35, 769.35, 785.3, 785.3, 785.3, 785.3, 785.3, 800.37, 800.37, 800.37, 800.37, 800.37, 815.67, 815.67, 815.67, 815.67, 815.67, 818.65, 818.65, 818.65, 818.65, 818.65, 840.23, 840.23, 840.23, 840.23, 840.23, 877.52, 877.52, 877.52, 877.52, 877.52, 925.15, 925.15, 925.15, 925.15, 925.15, 930.56, 930.56, 930.56, 930.56, 930.56, 936.53, 936.53, 936.53, 936.53, 936.53, 931.97, 931.97, 931.97, 931.97, 931.97, 889.15, 889.15, 889.15, 889.15, 889.15, 887.42, 887.42, 887.42, 887.42, 887.42, 885.11, 885.11, 885.11, 885.11, 885.11, 888.89, 888.89, 888.89, 888.89, 888.89, 889.19, 889.19, 889.19, 889.19, 889.19, 901.37, 901.37, 901.37, 901.37, 901.37, 859.9, 859.9, 859.9, 859.9, 859.9, 861.63, 861.63, 861.63, 861.63, 861.63, 861.83, 861.83, 861.83, 861.83, 861.83, 876.34, 876.34, 876.34, 876.34, 876.34, 870.55, 870.55, 870.55, 870.55, 870.55, 870.25, 870.25, 870.25, 870.25, 870.25, 869.82, 869.82, 869.82, 869.82, 869.82, 868.72, 868.72, 868.72, 868.72, 868.72, 869.46, 869.46, 869.46, 869.46, 869.46, 867.16, 867.16, 867.16, 867.16, 867.16, 870.12, 870.12, 870.12, 870.12, 870.12, 882.6, 882.6, 882.6, 882.6, 882.6, 887.32, 887.32, 887.32, 887.32, 887.32, 893.38, 893.38, 893.38, 893.38, 893.38, 881.95, 881.95, 881.95, 881.95, 881.95, 881.14, 881.14, 881.14, 881.14, 881.14, 877.21, 877.21, 877.21, 877.21, 877.21, 876.6, 876.6, 876.6, 876.6, 876.6, 876.17, 876.17, 876.17, 876.17, 876.17, 870.93, 870.93, 870.93, 870.93, 870.93, 853.84, 853.84, 853.84, 853.84, 853.84, 832.76, 832.76, 832.76, 832.76, 832.76, 831.06, 831.06, 831.06, 831.06, 831.06, 832.56, 832.56, 832.56, 832.56, 832.56, 829.74, 829.74, 829.74, 829.74, 829.74, 830.06, 830.06, 830.06, 830.06, 830.06, 835.17, 835.17, 835.17, 835.17, 835.17, 836.12, 836.12, 836.12, 836.12, 836.12, 844.11, 844.11, 844.11, 844.11, 844.11, 843.25, 843.25, 843.25, 843.25, 843.25, 846.43, 846.43, 846.43, 846.43, 846.43, 848.74, 848.74, 848.74, 848.74, 848.74, 850.13, 850.13, 850.13, 850.13, 850.13, 850.09, 850.09, 850.09, 850.09, 850.09, 851.02, 851.02, 851.02, 851.02, 851.02, 848.93, 848.93, 848.93, 848.93, 848.93, 849.74, 849.74, 849.74, 849.74, 849.74, 852.07, 852.07, 852.07, 852.07, 852.07]
                    
Loading
predicted_tokens_seconds
More
---
config:
    xyChart:
        titleFontSize: 12
        width: 900
        height: 600
    themeVariables:
        xyChart:
            titleColor: "#000000"
---
xychart-beta
    title "llama.cpp bench-server-baseline on Standard_NC4as_T4_v3
 duration=10m 546 iterations"
    y-axis "llamacpp:predicted_tokens_seconds"
    x-axis "llamacpp:predicted_tokens_seconds" 1714828907 --> 1714829535
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 44.76, 44.76, 44.76, 44.76, 44.76, 29.65, 29.65, 29.65, 29.65, 29.65, 28.59, 28.59, 28.59, 28.59, 28.59, 26.42, 26.42, 26.42, 26.42, 26.42, 27.66, 27.66, 27.66, 27.66, 27.66, 29.11, 29.11, 29.11, 29.11, 29.11, 31.2, 31.2, 31.2, 31.2, 31.2, 32.06, 32.06, 32.06, 32.06, 32.06, 32.52, 32.52, 32.52, 32.52, 32.52, 32.74, 32.74, 32.74, 32.74, 32.74, 32.88, 32.88, 32.88, 32.88, 32.88, 32.95, 32.95, 32.95, 32.95, 32.95, 32.09, 32.09, 32.09, 32.09, 32.09, 31.51, 31.51, 31.51, 31.51, 31.51, 31.06, 31.06, 31.06, 31.06, 31.06, 30.8, 30.8, 30.8, 30.8, 30.8, 31.21, 31.21, 31.21, 31.21, 31.21, 31.45, 31.45, 31.45, 31.45, 31.45, 30.95, 30.95, 30.95, 30.95, 30.95, 30.75, 30.75, 30.75, 30.75, 30.75, 30.48, 30.48, 30.48, 30.48, 30.48, 30.43, 30.43, 30.43, 30.43, 30.43, 30.69, 30.69, 30.69, 30.69, 30.69, 30.5, 30.5, 30.5, 30.5, 30.5, 30.68, 30.68, 30.68, 30.68, 30.68, 30.9, 30.9, 30.9, 30.9, 30.9, 30.95, 30.95, 30.95, 30.95, 30.95, 30.67, 30.67, 30.67, 30.67, 30.67, 30.3, 30.3, 30.3, 30.3, 30.3, 30.33, 30.33, 30.33, 30.33, 30.33, 30.53, 30.53, 30.53, 30.53, 30.53, 30.69, 30.69, 30.69, 30.69, 30.69, 30.8, 30.8, 30.8, 30.8, 30.8, 31.0, 31.0, 31.0, 31.0, 31.0, 30.97, 30.97, 30.97, 30.97, 30.97, 30.87, 30.87, 30.87, 30.87, 30.87, 30.82, 30.82, 30.82, 30.82, 30.82, 30.57, 30.57, 30.57, 30.57, 30.57, 30.59, 30.59, 30.59, 30.59, 30.59, 30.75, 30.75, 30.75, 30.75, 30.75, 30.95, 30.95, 30.95, 30.95, 30.95, 30.97, 30.97, 30.97, 30.97, 30.97, 30.85, 30.85, 30.85, 30.85, 30.85, 30.76, 30.76, 30.76, 30.76, 30.76, 30.32, 30.32, 30.32, 30.32, 30.32, 29.99, 29.99, 29.99, 29.99, 29.99, 29.51, 29.51, 29.51, 29.51, 29.51, 29.49, 29.49, 29.49, 29.49, 29.49, 29.57, 29.57, 29.57, 29.57, 29.57, 29.73, 29.73, 29.73, 29.73, 29.73, 29.83, 29.83, 29.83, 29.83, 29.83, 29.92, 29.92, 29.92, 29.92, 29.92, 29.91, 29.91, 29.91, 29.91, 29.91, 29.73, 29.73, 29.73, 29.73, 29.73, 29.63, 29.63, 29.63, 29.63, 29.63, 29.72, 29.72, 29.72, 29.72, 29.72, 29.87, 29.87, 29.87, 29.87, 29.87, 29.95, 29.95, 29.95, 29.95, 29.95, 30.07, 30.07, 30.07, 30.07, 30.07, 30.08, 30.08, 30.08, 30.08, 30.08, 30.12, 30.12, 30.12, 30.12, 30.12]
                    
Loading

Details

kv_cache_usage_ratio

More
---
config:
    xyChart:
        titleFontSize: 12
        width: 900
        height: 600
    themeVariables:
        xyChart:
            titleColor: "#000000"
---
xychart-beta
    title "llama.cpp bench-server-baseline on Standard_NC4as_T4_v3
 duration=10m 546 iterations"
    y-axis "llamacpp:kv_cache_usage_ratio"
    x-axis "llamacpp:kv_cache_usage_ratio" 1714828907 --> 1714829535
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.11, 0.11, 0.11, 0.11, 0.11, 0.48, 0.48, 0.48, 0.48, 0.48, 0.26, 0.26, 0.26, 0.26, 0.26, 0.13, 0.13, 0.13, 0.13, 0.13, 0.18, 0.18, 0.18, 0.18, 0.18, 0.1, 0.1, 0.1, 0.1, 0.1, 0.09, 0.09, 0.09, 0.09, 0.09, 0.11, 0.11, 0.11, 0.11, 0.11, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.2, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14, 0.14, 0.14, 0.14, 0.14, 0.2, 0.2, 0.2, 0.2, 0.2, 0.32, 0.32, 0.32, 0.32, 0.32, 0.18, 0.18, 0.18, 0.18, 0.18, 0.13, 0.13, 0.13, 0.13, 0.13, 0.17, 0.17, 0.17, 0.17, 0.17, 0.31, 0.31, 0.31, 0.31, 0.31, 0.3, 0.3, 0.3, 0.3, 0.3, 0.33, 0.33, 0.33, 0.33, 0.33, 0.21, 0.21, 0.21, 0.21, 0.21, 0.14, 0.14, 0.14, 0.14, 0.14, 0.23, 0.23, 0.23, 0.23, 0.23, 0.21, 0.21, 0.21, 0.21, 0.21, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.15, 0.33, 0.33, 0.33, 0.33, 0.33, 0.28, 0.28, 0.28, 0.28, 0.28, 0.24, 0.24, 0.24, 0.24, 0.24, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14, 0.14, 0.14, 0.14, 0.14, 0.17, 0.17, 0.17, 0.17, 0.17, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14, 0.14, 0.14, 0.14, 0.14, 0.26, 0.26, 0.26, 0.26, 0.26, 0.21, 0.21, 0.21, 0.21, 0.21, 0.32, 0.32, 0.32, 0.32, 0.32, 0.13, 0.13, 0.13, 0.13, 0.13, 0.15, 0.15, 0.15, 0.15, 0.15, 0.09, 0.09, 0.09, 0.09, 0.09, 0.13, 0.13, 0.13, 0.13, 0.13, 0.12, 0.12, 0.12, 0.12, 0.12, 0.38, 0.38, 0.38, 0.38, 0.38, 0.48, 0.48, 0.48, 0.48, 0.48, 0.47, 0.47, 0.47, 0.47, 0.47, 0.44, 0.44, 0.44, 0.44, 0.44, 0.17, 0.17, 0.17, 0.17, 0.17, 0.13, 0.13, 0.13, 0.13, 0.13, 0.11, 0.11, 0.11, 0.11, 0.11, 0.14, 0.14, 0.14, 0.14, 0.14, 0.12, 0.12, 0.12, 0.12, 0.12, 0.27, 0.27, 0.27, 0.27, 0.27, 0.28, 0.28, 0.28, 0.28, 0.28, 0.2, 0.2, 0.2, 0.2, 0.2, 0.15, 0.15, 0.15, 0.15, 0.15, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.12, 0.12, 0.12, 0.12, 0.12, 0.15, 0.15, 0.15, 0.15, 0.15, 0.1, 0.1, 0.1, 0.1, 0.1, 0.2, 0.2, 0.2, 0.2, 0.2]
                    
Loading
requests_processing
More
---
config:
    xyChart:
        titleFontSize: 12
        width: 900
        height: 600
    themeVariables:
        xyChart:
            titleColor: "#000000"
---
xychart-beta
    title "llama.cpp bench-server-baseline on Standard_NC4as_T4_v3
 duration=10m 546 iterations"
    y-axis "llamacpp:requests_processing"
    x-axis "llamacpp:requests_processing" 1714828907 --> 1714829535
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 1.0, 1.0, 1.0, 1.0, 1.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 7.0, 7.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 6.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 8.0, 8.0, 8.0, 8.0, 8.0, 4.0, 4.0, 4.0, 4.0, 4.0, 3.0, 3.0, 3.0, 3.0, 3.0, 1.0, 1.0, 1.0, 1.0, 1.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 6.0, 6.0, 6.0, 6.0, 6.0, 7.0, 7.0, 7.0, 7.0, 7.0, 8.0, 8.0, 8.0, 8.0, 8.0, 5.0, 5.0, 5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 7.0, 7.0, 7.0, 7.0, 7.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 8.0, 8.0, 8.0, 8.0, 8.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 5.0, 5.0, 6.0, 6.0, 6.0, 6.0, 6.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 5.0, 7.0, 7.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 6.0, 5.0, 5.0, 5.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 5.0, 5.0, 4.0, 4.0, 4.0, 4.0, 4.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 6.0, 8.0, 8.0, 8.0, 8.0, 8.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 4.0, 2.0, 2.0, 2.0, 2.0, 2.0, 6.0, 6.0, 6.0, 6.0, 6.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 7.0, 4.0, 4.0, 4.0, 4.0, 4.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 3.0, 6.0, 6.0, 6.0, 6.0, 6.0, 3.0, 3.0, 3.0, 3.0, 3.0, 7.0, 7.0, 7.0, 7.0, 7.0, 4.0, 4.0, 4.0, 4.0, 4.0]
                    
Loading

@ngxson ngxson merged commit 8425001 into ggml-org:master May 4, 2024
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
phuongncn pushed a commit to phuongncn/llama.cpp-gx10-dgx-sparks-deepseekv4 that referenced this pull request Apr 28, 2026
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

gguf-split add a default option to not include tensors data in first shard

3 participants