Skip to content

[GGML][RPC] Support for models with non-512-aligned tensors over RPC. - #11047

Merged
slaren merged 7 commits into
ggml-org:masterfrom
matt23654:rpc-experimental
Jan 4, 2025
Merged

slaren merged 7 commits into
ggml-org:masterfrom
matt23654:rpc-experimental

Conversation

@matt23654

Copy link
Copy Markdown
Contributor

This PR adds support for quantized tensors with sizes not divisible by 512, such as those found in quantized versions of the Qwen2.5 72B model. Please also see discussion in #10943.

Changes

  • Implemented forwarding to CUDA backend on server for init_tensor and get_alloc_size calls
  • Forwarding all calls would result in unacceptable latency (tested and tok/s drops to 0.02). At the moment only calls for misaligned tensors are forwarded. There may be a better way of handling this in the future.

Performance Impact

  • Qwen2.5 72B Q4_K_M: Coherent at ~4 tokens/s over GbE with mix of GPU/RPC/CPU. (previously outputted garbage)
  • Existing models (e.g. LLaMA 3.3 70B Q4_K_M): Unaffected (~7 tokens/s over GbE with GPU/RPC)

Testing

  • Perplexity validation with Tulu-3 8B:
    • Without RPC: 6.9362 ± 0.04526
    • With RPC: 6.9362 ± 0.04526 (identical results)
  • test-backend-ops: Passed for supported backends
  • Note: Unable to run full CI due to bandwidth limitations with model downloads

@github-actions github-actions Bot added the ggml changes relating to the ggml tensor library for machine learning label Jan 2, 2025

@rgerganov rgerganov left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

looks fine to me, some minor comments inline

Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
Comment thread ggml/src/ggml-rpc/ggml-rpc.cpp Resolved
@slaren
slaren merged commit f922a9c into ggml-org:master Jan 4, 2025
arthw pushed a commit to arthw/llama.cpp that referenced this pull request Feb 26, 2025
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
Seunghhon pushed a commit to Seunghhon/llama.cpp that referenced this pull request Apr 26, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
ljubomirj pushed a commit to ljubomirj/llama.cpp that referenced this pull request May 6, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
my-other-github-account pushed a commit to my-other-github-account/llama.cpp that referenced this pull request May 15, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
AlexiAlp pushed a commit to minghaop/llama.cpp that referenced this pull request Jun 2, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
fukuro-kun pushed a commit to fukuro-kun/fukuro-llama-cpp-turboquant that referenced this pull request Jul 5, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
zommiommy pushed a commit to zommiommy/llama.cpp that referenced this pull request Aug 18, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
frostyautumnleaf pushed a commit to frostyautumnleaf/llama.cpp that referenced this pull request Oct 5, 2026
…ggml-org#11047)

* Added init tensor calling code

* Added get_alloc_size forwarding

* Cleaned up and improved type/error handling.

* fix: remove trailing whitespaces.

* Cleanup and use GGML error logging functions.

* Handle potentially dangerous edge cases.

* Apply suggestions from code review

Co-authored-by: Diego Devesa <[email protected]>

---------

Co-authored-by: Diego Devesa <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ggml changes relating to the ggml tensor library for machine learning

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants