Repository navigation
rpc: include nb in the get_alloc_size cache key and floor the result at ggml_nbytes - #29283
Conversation
|
Hi @Jesssullivan, thanks for your contribution! Per our contribution guidelines, the automated PR checker found the following issue(s) that need your attention:
Please note that maintainers reserve the right to make final decisions on PRs. If you believe there is a mistake, please comment below. |
err, the description, body, PR title, etc etc was indeed written by me 👀 Cheers, |
6c981c4 to
4843ea8
Compare
rgerganov
left a comment
There was a problem hiding this comment.
this looks fine but now I wonder if we should change rpc_tensor.nb to uint64_t to prevent other issues with strides bigger than 4G
Merge upstream commits: - llama: add llama_prec_policy + model-driven W4A4 path (ggml-org#24364) - llama: fix tensor split for fused qkv with uneven K/V head sizes (ggml-org#29294) - metal: split fa kernels into per-dtype libraries (ggml-org#29329) - metal: FWHT kernels for block widths above 512 (ggml-org#29095) - CUDA: fuse RMS_NORM + SCALE into one kernel (ggml-org#29393) - common: extract shared unicode path/string helpers (ggml-org#29415) - common,rpc: simplify fs_create_directory_with_parents() (ggml-org#29432) - rpc: include nb in the get_alloc_size cache key (ggml-org#29283) - [SYCL] support sparse FA (ggml-org#28796) - musa: fix PH1 operator failures and build issues (ggml-org#29193) - HIP: bump HIP_VERSION required for fp8 (ggml-org#29231) - opencl: add q5_k bin kernel (ggml-org#29401) - hexagon: add q5_k quant type support (ggml-org#29123) - hexagon: use DMA for contiguous dim1 CONCAT (ggml-org#29404) - mtmd: fix mel preprocessor in LFM2 audio (ggml-org#29403) - vulkan: fix legacy GLSLC without cooperativeMatrix (ggml-org#29409) - gguf-py: ByteLevel processing defaults bos/eos to False (ggml-org#29422) - gguf-py: TemplateProcessing has final word on add_special_token (ggml-org#29417) Assisted-by: Pi
…at ggml_nbytes (ggml-org#29283) * rpc : include nb in the get_alloc_size cache key and floor the result at ggml_nbytes * cont : remove redundant comment * cont : add TODO --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…at ggml_nbytes (ggml-org#29283) * rpc : include nb in the get_alloc_size cache key and floor the result at ggml_nbytes * cont : remove redundant comment * cont : add TODO --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com>
…at ggml_nbytes (ggml-org#29283) * rpc : include nb in the get_alloc_size cache key and floor the result at ggml_nbytes * cont : remove redundant comment * cont : add TODO --------- Co-authored-by: Georgi Gerganov <ggerganov@gmail.com> (cherry picked from commit 66963a8)
Hey there!
Overview
I am fairly new to this codebase, so please do let me know if I am barking up the wrong tree here; I encountered allocation issues with my local RPC setup and think I've chased this down to this nb include issue.
error occurs at
ggml-alloc.c:607, GGML_ASSERT(parent_size >= node_size), exit 134. RI've added nb to the cache key and never return less than ggml_nbytes.
Additional information
Currently, the memo added in #18626 keys RPC_CMD_GET_ALLOC_SIZE results on {device, type, op, op_params, ne} and leaves nb out.
Two tensors with identical ne but different strides therefore share one entry, and the second caller receives the first tensor's size. When that size is smaller than ggml_nbytes, the buffer-type contract documented in #27960 and #28038 is violated and allocation fails downstream.
I've reproduced against a local ggml-rpc-server -d CPU: a packed tensor reports 16384/16384 and a strided view with the same ne reports nbytes 32512, alloc_size 16384, then aborts; with this change the second call reports 32512 and the run completes. The regression is folded into tests/test-rpc-multi-server.
ref: #28360
ref: #18626
ref: #27960
Requirements
Warmly,
-Jess