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

gguf : fix mismatch between alloc and free functions #6929

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

slaren
Copy link
Collaborator

@slaren slaren commented Apr 26, 2024

The gguf contexts are no longer allocated with GGML_ALIGNED_MALLOC, so the free function must also be updated to match.

@ggerganov This should fix the tokenizer tests under windows.

Copy link
Owner

@ggerganov ggerganov left a comment

Choose a reason for hiding this comment

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

Waiting for green CI and will merge

@ggerganov ggerganov merged commit e2764cd into master Apr 26, 2024
58 of 61 checks passed
@ggerganov ggerganov deleted the sl/fix-gguf-free branch April 26, 2024 15:07
Copy link
Contributor

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

Expand details for performance related PR only
  • Concurrent users: 8, duration: 10m
  • HTTP request : avg=10360.52ms p(95)=28127.91ms fails=, finish reason: stop=406 truncated=48
  • Prompt processing (pp): avg=109.48tk/s p(95)=491.65tk/s
  • Token generation (tg): avg=24.32tk/s p(95)=37.5tk/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=sl/fix-gguf-free commit=828661cfe6362e9e801d01ebffa342f1fc907fc8

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 454 iterations"
    y-axis "llamacpp:prompt_tokens_seconds"
    x-axis "llamacpp:prompt_tokens_seconds" 1714145556 --> 1714146178
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 499.67, 499.67, 499.67, 499.67, 499.67, 394.4, 394.4, 394.4, 394.4, 394.4, 402.88, 402.88, 402.88, 402.88, 402.88, 427.93, 427.93, 427.93, 427.93, 427.93, 459.43, 459.43, 459.43, 459.43, 459.43, 456.56, 456.56, 456.56, 456.56, 456.56, 464.25, 464.25, 464.25, 464.25, 464.25, 484.12, 484.12, 484.12, 484.12, 484.12, 501.7, 501.7, 501.7, 501.7, 501.7, 501.96, 501.96, 501.96, 501.96, 501.96, 515.81, 515.81, 515.81, 515.81, 515.81, 519.84, 519.84, 519.84, 519.84, 519.84, 541.7, 541.7, 541.7, 541.7, 541.7, 543.84, 543.84, 543.84, 543.84, 543.84, 575.07, 575.07, 575.07, 575.07, 575.07, 575.53, 575.53, 575.53, 575.53, 575.53, 599.61, 599.61, 599.61, 599.61, 599.61, 589.27, 589.27, 589.27, 589.27, 589.27, 587.57, 587.57, 587.57, 587.57, 587.57, 592.32, 592.32, 592.32, 592.32, 592.32, 591.42, 591.42, 591.42, 591.42, 591.42, 609.42, 609.42, 609.42, 609.42, 609.42, 608.58, 608.58, 608.58, 608.58, 608.58, 609.81, 609.81, 609.81, 609.81, 609.81, 609.2, 609.2, 609.2, 609.2, 609.2, 615.85, 615.85, 615.85, 615.85, 615.85, 619.02, 619.02, 619.02, 619.02, 619.02, 628.94, 628.94, 628.94, 628.94, 628.94, 617.58, 617.58, 617.58, 617.58, 617.58, 619.45, 619.45, 619.45, 619.45, 619.45, 622.61, 622.61, 622.61, 622.61, 622.61, 627.54, 627.54, 627.54, 627.54, 627.54, 627.15, 627.15, 627.15, 627.15, 627.15, 629.1, 629.1, 629.1, 629.1, 629.1, 630.8, 630.8, 630.8, 630.8, 630.8, 633.34, 633.34, 633.34, 633.34, 633.34, 637.58, 637.58, 637.58, 637.58, 637.58, 636.51, 636.51, 636.51, 636.51, 636.51, 640.2, 640.2, 640.2, 640.2, 640.2, 641.24, 641.24, 641.24, 641.24, 641.24, 641.7, 641.7, 641.7, 641.7, 641.7, 628.41, 628.41, 628.41, 628.41, 628.41, 633.77, 633.77, 633.77, 633.77, 633.77, 635.55, 635.55, 635.55, 635.55, 635.55, 635.39, 635.39, 635.39, 635.39, 635.39, 636.68, 636.68, 636.68, 636.68, 636.68, 642.46, 642.46, 642.46, 642.46, 642.46, 643.72, 643.72, 643.72, 643.72, 643.72, 652.09, 652.09, 652.09, 652.09, 652.09, 649.6, 649.6, 649.6, 649.6, 649.6, 637.23, 637.23, 637.23, 637.23, 637.23, 636.77, 636.77, 636.77, 636.77, 636.77, 635.04, 635.04, 635.04, 635.04, 635.04, 633.5, 633.5, 633.5, 633.5, 633.5, 633.0, 633.0, 633.0, 633.0, 633.0, 632.36, 632.36, 632.36, 632.36, 632.36, 635.27, 635.27, 635.27, 635.27, 635.27, 637.84, 637.84, 637.84, 637.84, 637.84, 640.84, 640.84, 640.84, 640.84, 640.84, 643.08, 643.08, 643.08, 643.08, 643.08, 643.62, 643.62]
                    
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 454 iterations"
    y-axis "llamacpp:predicted_tokens_seconds"
    x-axis "llamacpp:predicted_tokens_seconds" 1714145556 --> 1714146178
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 33.24, 33.24, 33.24, 33.24, 33.24, 30.0, 30.0, 30.0, 30.0, 30.0, 24.89, 24.89, 24.89, 24.89, 24.89, 24.8, 24.8, 24.8, 24.8, 24.8, 25.31, 25.31, 25.31, 25.31, 25.31, 25.79, 25.79, 25.79, 25.79, 25.79, 27.06, 27.06, 27.06, 27.06, 27.06, 27.67, 27.67, 27.67, 27.67, 27.67, 27.79, 27.79, 27.79, 27.79, 27.79, 27.71, 27.71, 27.71, 27.71, 27.71, 27.28, 27.28, 27.28, 27.28, 27.28, 25.83, 25.83, 25.83, 25.83, 25.83, 25.71, 25.71, 25.71, 25.71, 25.71, 25.37, 25.37, 25.37, 25.37, 25.37, 25.25, 25.25, 25.25, 25.25, 25.25, 24.68, 24.68, 24.68, 24.68, 24.68, 24.41, 24.41, 24.41, 24.41, 24.41, 23.92, 23.92, 23.92, 23.92, 23.92, 23.39, 23.39, 23.39, 23.39, 23.39, 22.87, 22.87, 22.87, 22.87, 22.87, 23.07, 23.07, 23.07, 23.07, 23.07, 23.1, 23.1, 23.1, 23.1, 23.1, 22.85, 22.85, 22.85, 22.85, 22.85, 22.46, 22.46, 22.46, 22.46, 22.46, 22.25, 22.25, 22.25, 22.25, 22.25, 22.22, 22.22, 22.22, 22.22, 22.22, 22.25, 22.25, 22.25, 22.25, 22.25, 22.32, 22.32, 22.32, 22.32, 22.32, 22.32, 22.32, 22.32, 22.32, 22.32, 22.27, 22.27, 22.27, 22.27, 22.27, 22.3, 22.3, 22.3, 22.3, 22.3, 22.43, 22.43, 22.43, 22.43, 22.43, 22.29, 22.29, 22.29, 22.29, 22.29, 22.21, 22.21, 22.21, 22.21, 22.21, 22.33, 22.33, 22.33, 22.33, 22.33, 22.62, 22.62, 22.62, 22.62, 22.62, 22.68, 22.68, 22.68, 22.68, 22.68, 22.82, 22.82, 22.82, 22.82, 22.82, 22.89, 22.89, 22.89, 22.89, 22.89, 22.98, 22.98, 22.98, 22.98, 22.98, 23.0, 23.0, 23.0, 23.0, 23.0, 22.84, 22.84, 22.84, 22.84, 22.84, 22.84, 22.84, 22.84, 22.84, 22.84, 22.63, 22.63, 22.63, 22.63, 22.63, 22.69, 22.69, 22.69, 22.69, 22.69, 22.85, 22.85, 22.85, 22.85, 22.85, 22.99, 22.99, 22.99, 22.99, 22.99, 23.09, 23.09, 23.09, 23.09, 23.09, 23.15, 23.15, 23.15, 23.15, 23.15, 23.04, 23.04, 23.04, 23.04, 23.04, 22.85, 22.85, 22.85, 22.85, 22.85, 22.74, 22.74, 22.74, 22.74, 22.74, 22.25, 22.25, 22.25, 22.25, 22.25, 22.2, 22.2, 22.2, 22.2, 22.2, 21.91, 21.91, 21.91, 21.91, 21.91, 20.96, 20.96, 20.96, 20.96, 20.96, 20.96, 20.96, 20.96, 20.96, 20.96, 21.0, 21.0, 21.0, 21.0, 21.0, 21.13, 21.13, 21.13, 21.13, 21.13, 21.14, 21.14, 21.14, 21.14, 21.14, 21.25, 21.25]
                    
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 454 iterations"
    y-axis "llamacpp:kv_cache_usage_ratio"
    x-axis "llamacpp:kv_cache_usage_ratio" 1714145556 --> 1714146178
    line [0.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.29, 0.29, 0.29, 0.29, 0.29, 0.11, 0.11, 0.11, 0.11, 0.11, 0.09, 0.09, 0.09, 0.09, 0.09, 0.18, 0.18, 0.18, 0.18, 0.18, 0.11, 0.11, 0.11, 0.11, 0.11, 0.1, 0.1, 0.1, 0.1, 0.1, 0.13, 0.13, 0.13, 0.13, 0.13, 0.15, 0.15, 0.15, 0.15, 0.15, 0.21, 0.21, 0.21, 0.21, 0.21, 0.2, 0.2, 0.2, 0.2, 0.2, 0.18, 0.18, 0.18, 0.18, 0.18, 0.23, 0.23, 0.23, 0.23, 0.23, 0.15, 0.15, 0.15, 0.15, 0.15, 0.29, 0.29, 0.29, 0.29, 0.29, 0.18, 0.18, 0.18, 0.18, 0.18, 0.34, 0.34, 0.34, 0.34, 0.34, 0.32, 0.32, 0.32, 0.32, 0.32, 0.16, 0.16, 0.16, 0.16, 0.16, 0.17, 0.17, 0.17, 0.17, 0.17, 0.14, 0.14, 0.14, 0.14, 0.14, 0.23, 0.23, 0.23, 0.23, 0.23, 0.27, 0.27, 0.27, 0.27, 0.27, 0.27, 0.27, 0.27, 0.27, 0.27, 0.12, 0.12, 0.12, 0.12, 0.12, 0.14, 0.14, 0.14, 0.14, 0.14, 0.18, 0.18, 0.18, 0.18, 0.18, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.24, 0.11, 0.11, 0.11, 0.11, 0.11, 0.13, 0.13, 0.13, 0.13, 0.13, 0.27, 0.27, 0.27, 0.27, 0.27, 0.21, 0.21, 0.21, 0.21, 0.21, 0.1, 0.1, 0.1, 0.1, 0.1, 0.12, 0.12, 0.12, 0.12, 0.12, 0.13, 0.13, 0.13, 0.13, 0.13, 0.16, 0.16, 0.16, 0.16, 0.16, 0.13, 0.13, 0.13, 0.13, 0.13, 0.16, 0.16, 0.16, 0.16, 0.16, 0.15, 0.15, 0.15, 0.15, 0.15, 0.29, 0.29, 0.29, 0.29, 0.29, 0.15, 0.15, 0.15, 0.15, 0.15, 0.28, 0.28, 0.28, 0.28, 0.28, 0.13, 0.13, 0.13, 0.13, 0.13, 0.14, 0.14, 0.14, 0.14, 0.14, 0.07, 0.07, 0.07, 0.07, 0.07, 0.08, 0.08, 0.08, 0.08, 0.08, 0.1, 0.1, 0.1, 0.1, 0.1, 0.31, 0.31, 0.31, 0.31, 0.31, 0.47, 0.47, 0.47, 0.47, 0.47, 0.62, 0.62, 0.62, 0.62, 0.62, 0.56, 0.56, 0.56, 0.56, 0.56, 0.58, 0.58, 0.58, 0.58, 0.58, 0.53, 0.53, 0.53, 0.53, 0.53, 0.47, 0.47, 0.47, 0.47, 0.47, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.12, 0.15, 0.15, 0.15, 0.15, 0.15, 0.09, 0.09, 0.09, 0.09, 0.09, 0.15, 0.15]
                    
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 454 iterations"
    y-axis "llamacpp:requests_processing"
    x-axis "llamacpp:requests_processing" 1714145556 --> 1714146178
    line [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.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, 7.0, 7.0, 7.0, 7.0, 7.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, 4.0, 4.0, 4.0, 4.0, 4.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, 4.0, 4.0, 4.0, 4.0, 4.0, 7.0, 7.0, 7.0, 7.0, 7.0, 5.0, 5.0, 5.0, 5.0, 5.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, 8.0, 8.0, 8.0, 8.0, 8.0, 4.0, 4.0, 4.0, 4.0, 4.0, 5.0, 5.0, 5.0, 5.0, 5.0, 8.0, 8.0, 8.0, 8.0, 8.0, 7.0, 7.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 6.0, 4.0, 4.0, 4.0, 4.0, 4.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, 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, 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, 3.0, 3.0, 3.0, 3.0, 3.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, 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, 8.0, 8.0, 8.0, 8.0, 8.0, 6.0, 6.0, 6.0, 6.0, 6.0, 8.0, 8.0, 8.0, 8.0, 8.0, 4.0, 4.0, 4.0, 4.0, 4.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, 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, 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, 7.0, 7.0, 7.0, 7.0, 7.0, 6.0, 6.0, 6.0, 6.0, 6.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, 2.0, 2.0]
                    
Loading

nopperl pushed a commit to nopperl/llama.cpp that referenced this pull request May 5, 2024
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.

main: crashing upon loading model since commit 83b72cb0 - Windows MSVC + CUDA
2 participants