Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ggml : fa without mask + add asserts #7278

Merged
merged 2 commits into from
May 14, 2024
Merged

ggml : fa without mask + add asserts #7278

merged 2 commits into from
May 14, 2024

Conversation

ggerganov
Copy link
Member

Need FA without mask for Whisper encoder

Copy link
Contributor

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

Expand details for performance related PR only
  • Concurrent users: 8, duration: 10m
  • HTTP request : avg=8878.9ms p(95)=21317.14ms fails=, finish reason: stop=475 truncated=53
  • Prompt processing (pp): avg=103.31tk/s p(95)=492.56tk/s
  • Token generation (tg): avg=58.74tk/s p(95)=47.61tk/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=gg/fa-no-mask commit=f8c96dfd97fde403a10561f6246e22b111078132

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 528 iterations"
    y-axis "llamacpp:prompt_tokens_seconds"
    x-axis "llamacpp:prompt_tokens_seconds" 1715686232 --> 1715686862
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 308.52, 308.52, 308.52, 308.52, 308.52, 789.82, 789.82, 789.82, 789.82, 789.82, 895.87, 895.87, 895.87, 895.87, 895.87, 874.7, 874.7, 874.7, 874.7, 874.7, 886.26, 886.26, 886.26, 886.26, 886.26, 916.16, 916.16, 916.16, 916.16, 916.16, 905.04, 905.04, 905.04, 905.04, 905.04, 901.32, 901.32, 901.32, 901.32, 901.32, 919.83, 919.83, 919.83, 919.83, 919.83, 911.32, 911.32, 911.32, 911.32, 911.32, 924.77, 924.77, 924.77, 924.77, 924.77, 940.68, 940.68, 940.68, 940.68, 940.68, 952.82, 952.82, 952.82, 952.82, 952.82, 952.51, 952.51, 952.51, 952.51, 952.51, 928.95, 928.95, 928.95, 928.95, 928.95, 938.91, 938.91, 938.91, 938.91, 938.91, 939.12, 939.12, 939.12, 939.12, 939.12, 927.62, 927.62, 927.62, 927.62, 927.62, 925.13, 925.13, 925.13, 925.13, 925.13, 939.56, 939.56, 939.56, 939.56, 939.56, 941.66, 941.66, 941.66, 941.66, 941.66, 939.26, 939.26, 939.26, 939.26, 939.26, 936.4, 936.4, 936.4, 936.4, 936.4, 938.66, 938.66, 938.66, 938.66, 938.66, 896.78, 896.78, 896.78, 896.78, 896.78, 894.6, 894.6, 894.6, 894.6, 894.6, 890.84, 890.84, 890.84, 890.84, 890.84, 879.87, 879.87, 879.87, 879.87, 879.87, 878.0, 878.0, 878.0, 878.0, 878.0, 876.07, 876.07, 876.07, 876.07, 876.07, 877.69, 877.69, 877.69, 877.69, 877.69, 880.65, 880.65, 880.65, 880.65, 880.65, 879.3, 879.3, 879.3, 879.3, 879.3, 877.96, 877.96, 877.96, 877.96, 877.96, 880.04, 880.04, 880.04, 880.04, 880.04, 887.87, 887.87, 887.87, 887.87, 887.87, 888.78, 888.78, 888.78, 888.78, 888.78, 887.9, 887.9, 887.9, 887.9, 887.9, 889.42, 889.42, 889.42, 889.42, 889.42, 885.27, 885.27, 885.27, 885.27, 885.27, 884.2, 884.2, 884.2, 884.2, 884.2, 888.33, 888.33, 888.33, 888.33, 888.33, 889.1, 889.1, 889.1, 889.1, 889.1, 899.65, 899.65, 899.65, 899.65, 899.65, 902.81, 902.81, 902.81, 902.81, 902.81, 903.2, 903.2, 903.2, 903.2, 903.2, 902.33, 902.33, 902.33, 902.33, 902.33, 900.41, 900.41, 900.41, 900.41, 900.41, 901.37, 901.37, 901.37, 901.37, 901.37, 903.14, 903.14, 903.14, 903.14, 903.14, 902.13, 902.13, 902.13, 902.13, 902.13, 902.63, 902.63, 902.63, 902.63, 902.63, 903.09, 903.09, 903.09, 903.09, 903.09, 904.69, 904.69, 904.69, 904.69, 904.69, 907.88, 907.88, 907.88, 907.88, 907.88, 905.94, 905.94, 905.94, 905.94, 905.94, 911.77, 911.77, 911.77, 911.77, 911.77, 910.35, 910.35, 910.35, 910.35, 910.35, 910.78, 910.78, 910.78, 910.78, 910.78, 912.27, 912.27, 912.27, 912.27, 912.27, 911.18, 911.18, 911.18, 911.18, 911.18, 911.18]
                    
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 528 iterations"
    y-axis "llamacpp:predicted_tokens_seconds"
    x-axis "llamacpp:predicted_tokens_seconds" 1715686232 --> 1715686862
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 43.06, 43.06, 43.06, 43.06, 43.06, 28.75, 28.75, 28.75, 28.75, 28.75, 27.74, 27.74, 27.74, 27.74, 27.74, 29.78, 29.78, 29.78, 29.78, 29.78, 30.85, 30.85, 30.85, 30.85, 30.85, 31.43, 31.43, 31.43, 31.43, 31.43, 32.66, 32.66, 32.66, 32.66, 32.66, 33.2, 33.2, 33.2, 33.2, 33.2, 33.66, 33.66, 33.66, 33.66, 33.66, 33.73, 33.73, 33.73, 33.73, 33.73, 33.97, 33.97, 33.97, 33.97, 33.97, 33.77, 33.77, 33.77, 33.77, 33.77, 32.51, 32.51, 32.51, 32.51, 32.51, 32.04, 32.04, 32.04, 32.04, 32.04, 30.82, 30.82, 30.82, 30.82, 30.82, 30.04, 30.04, 30.04, 30.04, 30.04, 29.47, 29.47, 29.47, 29.47, 29.47, 29.5, 29.5, 29.5, 29.5, 29.5, 29.72, 29.72, 29.72, 29.72, 29.72, 29.29, 29.29, 29.29, 29.29, 29.29, 29.49, 29.49, 29.49, 29.49, 29.49, 29.69, 29.69, 29.69, 29.69, 29.69, 29.88, 29.88, 29.88, 29.88, 29.88, 30.13, 30.13, 30.13, 30.13, 30.13, 30.1, 30.1, 30.1, 30.1, 30.1, 30.31, 30.31, 30.31, 30.31, 30.31, 30.42, 30.42, 30.42, 30.42, 30.42, 30.35, 30.35, 30.35, 30.35, 30.35, 30.35, 30.35, 30.35, 30.35, 30.35, 30.66, 30.66, 30.66, 30.66, 30.66, 30.73, 30.73, 30.73, 30.73, 30.73, 30.72, 30.72, 30.72, 30.72, 30.72, 30.85, 30.85, 30.85, 30.85, 30.85, 30.92, 30.92, 30.92, 30.92, 30.92, 30.75, 30.75, 30.75, 30.75, 30.75, 30.69, 30.69, 30.69, 30.69, 30.69, 30.34, 30.34, 30.34, 30.34, 30.34, 30.04, 30.04, 30.04, 30.04, 30.04, 29.91, 29.91, 29.91, 29.91, 29.91, 30.02, 30.02, 30.02, 30.02, 30.02, 30.07, 30.07, 30.07, 30.07, 30.07, 30.21, 30.21, 30.21, 30.21, 30.21, 30.36, 30.36, 30.36, 30.36, 30.36, 30.28, 30.28, 30.28, 30.28, 30.28, 29.65, 29.65, 29.65, 29.65, 29.65, 29.43, 29.43, 29.43, 29.43, 29.43, 28.89, 28.89, 28.89, 28.89, 28.89, 28.74, 28.74, 28.74, 28.74, 28.74, 28.7, 28.7, 28.7, 28.7, 28.7, 28.7, 28.7, 28.7, 28.7, 28.7, 28.74, 28.74, 28.74, 28.74, 28.74, 28.79, 28.79, 28.79, 28.79, 28.79, 28.85, 28.85, 28.85, 28.85, 28.85, 28.82, 28.82, 28.82, 28.82, 28.82, 28.71, 28.71, 28.71, 28.71, 28.71, 28.71, 28.71, 28.71, 28.71, 28.71, 28.7, 28.7, 28.7, 28.7, 28.7, 28.8, 28.8, 28.8, 28.8, 28.8, 28.95, 28.95, 28.95, 28.95, 28.95, 28.98, 28.98, 28.98, 28.98, 28.98, 29.17]
                    
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 528 iterations"
    y-axis "llamacpp:kv_cache_usage_ratio"
    x-axis "llamacpp:kv_cache_usage_ratio" 1715686232 --> 1715686862
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.07, 0.07, 0.07, 0.07, 0.07, 0.33, 0.33, 0.33, 0.33, 0.33, 0.32, 0.32, 0.32, 0.32, 0.32, 0.22, 0.22, 0.22, 0.22, 0.22, 0.15, 0.15, 0.15, 0.15, 0.15, 0.19, 0.19, 0.19, 0.19, 0.19, 0.15, 0.15, 0.15, 0.15, 0.15, 0.17, 0.17, 0.17, 0.17, 0.17, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.13, 0.18, 0.18, 0.18, 0.18, 0.18, 0.19, 0.19, 0.19, 0.19, 0.19, 0.31, 0.31, 0.31, 0.31, 0.31, 0.33, 0.33, 0.33, 0.33, 0.33, 0.32, 0.32, 0.32, 0.32, 0.32, 0.4, 0.4, 0.4, 0.4, 0.4, 0.27, 0.27, 0.27, 0.27, 0.27, 0.18, 0.18, 0.18, 0.18, 0.18, 0.17, 0.17, 0.17, 0.17, 0.17, 0.32, 0.32, 0.32, 0.32, 0.32, 0.11, 0.11, 0.11, 0.11, 0.11, 0.19, 0.19, 0.19, 0.19, 0.19, 0.12, 0.12, 0.12, 0.12, 0.12, 0.14, 0.14, 0.14, 0.14, 0.14, 0.27, 0.27, 0.27, 0.27, 0.27, 0.14, 0.14, 0.14, 0.14, 0.14, 0.15, 0.15, 0.15, 0.15, 0.15, 0.28, 0.28, 0.28, 0.28, 0.28, 0.17, 0.17, 0.17, 0.17, 0.17, 0.14, 0.14, 0.14, 0.14, 0.14, 0.15, 0.15, 0.15, 0.15, 0.15, 0.2, 0.2, 0.2, 0.2, 0.2, 0.18, 0.18, 0.18, 0.18, 0.18, 0.14, 0.14, 0.14, 0.14, 0.14, 0.17, 0.17, 0.17, 0.17, 0.17, 0.34, 0.34, 0.34, 0.34, 0.34, 0.32, 0.32, 0.32, 0.32, 0.32, 0.37, 0.37, 0.37, 0.37, 0.37, 0.35, 0.35, 0.35, 0.35, 0.35, 0.18, 0.18, 0.18, 0.18, 0.18, 0.12, 0.12, 0.12, 0.12, 0.12, 0.14, 0.14, 0.14, 0.14, 0.14, 0.11, 0.11, 0.11, 0.11, 0.11, 0.3, 0.3, 0.3, 0.3, 0.3, 0.44, 0.44, 0.44, 0.44, 0.44, 0.48, 0.48, 0.48, 0.48, 0.48, 0.46, 0.46, 0.46, 0.46, 0.46, 0.23, 0.23, 0.23, 0.23, 0.23, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.22, 0.25, 0.25, 0.25, 0.25, 0.25, 0.15, 0.15, 0.15, 0.15, 0.15, 0.17, 0.17, 0.17, 0.17, 0.17, 0.29, 0.29, 0.29, 0.29, 0.29, 0.31, 0.31, 0.31, 0.31, 0.31, 0.12, 0.12, 0.12, 0.12, 0.12, 0.27, 0.27, 0.27, 0.27, 0.27, 0.12, 0.12, 0.12, 0.12, 0.12, 0.11, 0.11, 0.11, 0.11, 0.11, 0.09, 0.09, 0.09, 0.09, 0.09, 0.14, 0.14, 0.14, 0.14, 0.14, 0.22]
                    
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 528 iterations"
    y-axis "llamacpp:requests_processing"
    x-axis "llamacpp:requests_processing" 1715686232 --> 1715686862
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 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 0.0, 0.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, 8.0, 8.0, 8.0, 8.0, 8.0, 7.0, 7.0, 7.0, 7.0, 7.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 8.0, 6.0, 6.0, 6.0, 6.0, 6.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, 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, 4.0, 4.0, 4.0, 4.0, 4.0, 8.0, 8.0, 8.0, 8.0, 8.0, 1.0, 1.0, 1.0, 1.0, 1.0, 3.0, 3.0, 3.0, 3.0, 3.0, 4.0, 4.0, 4.0, 4.0, 4.0, 7.0, 7.0, 7.0, 7.0, 7.0, 0.0]
                    
Loading

@mofosyne mofosyne added refactoring Refactoring Review Complexity : High Generally require indepth knowledge of LLMs or GPUs labels May 14, 2024
@ggerganov ggerganov marked this pull request as ready for review May 14, 2024 16:09
@ggerganov ggerganov merged commit e8a7fd4 into master May 14, 2024
61 of 62 checks passed
@ggerganov ggerganov deleted the gg/fa-no-mask branch May 14, 2024 16:09
teleprint-me pushed a commit to teleprint-me/llama.cpp that referenced this pull request May 17, 2024
* ggml : fa without mask + add asserts

ggml-ci

* metal : support non-contiguous KV

ggml-ci
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
refactoring Refactoring Review Complexity : High Generally require indepth knowledge of LLMs or GPUs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants