Skip to content

Reduce number of map lookups for KV cache buffers.#1811

Open
copybara-service[bot] wants to merge 1 commit intomainfrom
litert_lm_pr_892511158
Open

Reduce number of map lookups for KV cache buffers.#1811
copybara-service[bot] wants to merge 1 commit intomainfrom
litert_lm_pr_892511158

Conversation

@copybara-service
Copy link
Copy Markdown
Contributor

Reduce number of map lookups for KV cache buffers.

This change modifies how the special handling for KV cache buffers 19 is implemented. Instead of using map's operator[], it now uses find() to get an iterator and then assigns the newly created buffer to the existing map entry, ensuring that there are only 2 map lookups instead of the original 5.

This change modifies how the special handling for KV cache buffers 19 is implemented. Instead of using map's operator[], it now uses `find()` to get an iterator and then assigns the newly created buffer to the existing map entry, ensuring that there are only 2 map lookups instead of the original 5.

LiteRT-LM-PiperOrigin-RevId: 892511158
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant