]> git.djapps.eu Git - pkg/ggml/sources/llama.cpp/commit
ggml-alloc : fix discrepency between measure&eval (#2639)
authorShouzheng Liu <redacted>
Thu, 17 Aug 2023 07:35:53 +0000 (03:35 -0400)
committerGitHub <redacted>
Thu, 17 Aug 2023 07:35:53 +0000 (10:35 +0300)
commita872a2b28eaefc8d464eaa535c94deeb501666f9
tree43ab875e96aa7fd724b9a92424904270b3ddd7fd
parent0919a0f73d95cfb93a1646a1d1741a0615fe2c5e
ggml-alloc : fix discrepency between measure&eval (#2639)

The GGML memory allocator consistently places a tensor within the
optimal-fit memory block, which is the smallest block capable of
accommodating the tensor's size. During the measurement phase, the final
block is generously sized, ensuring it never qualifies as the
optimal-fit block as long as there exists another block capable of
accommodating the tensor. Nevertheless, in the evaluation phase, the
last block is constrained in size and could potentially qualify as the
optimal-fit block. Consequently, there exists the possibility of a
tensor being allocated to a different region during evaluation, leading
to more memory fragmentation in our scratch buffer.

This recent commit guarantees uniform behavior of the allocator across
both the measurement and evaluation phases, eliminating discrepancies
between the two.
ggml-alloc.c