Skip to content

Conversation

@JohannesGaessler
Copy link
Collaborator

See #16581 . The KV cache has the same issue which can lead to incorrect results for #16653 .

Comment on lines 43 to 49
// define a comparator for the buft -> ctx map to ensure that the order is well-defined:
struct ggml_backend_buft_comparator {
bool operator()(const ggml_backend_buffer_type_t & lhs, const ggml_backend_buffer_type_t & rhs) const {
return ggml_backend_buft_name(lhs) < ggml_backend_buft_name(rhs);
}
};
typedef std::map<ggml_backend_buffer_type_t, ggml_context_ptr, ggml_backend_buft_comparator> buft_ctx_map_t;
Copy link
Member

Choose a reason for hiding this comment

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

This should not be in a public header.

@JohannesGaessler JohannesGaessler force-pushed the llama-kv-cache-fix-ctx-order branch from f355522 to 7c179ab Compare October 24, 2025 12:17
@JohannesGaessler JohannesGaessler force-pushed the llama-kv-cache-fix-ctx-order branch from 7c179ab to 41deb58 Compare October 25, 2025 10:11
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.

2 participants