summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorShouzheng Liu <lshzh.hi@gmail.com>2023-08-17 03:35:53 -0400
committerGitHub <noreply@github.com>2023-08-17 10:35:53 +0300
commita872a2b28eaefc8d464eaa535c94deeb501666f9 (patch)
tree43ab875e96aa7fd724b9a92424904270b3ddd7fd /examples
parent0919a0f73d95cfb93a1646a1d1741a0615fe2c5e (diff)
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.
Diffstat (limited to 'examples')
0 files changed, 0 insertions, 0 deletions