Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KV-cache for T5 model #1358

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

KV-cache for T5 model #1358

wants to merge 1 commit into from

Conversation

YK-Fu
Copy link

@YK-Fu YK-Fu commented Jan 17, 2025

The current Megatron-core only implements the KV-cache mechanism for decoder-only models. I have implemented the KV-cache for seq2seq (T5) model to integrate with NeMo (NVIDIA/NeMo#11881). The main changes include setting the KV-cache input for cross_attention to None, as it doesn't require a KV-cache. Additionally, I added the KV-cache offset to the T5 model's position ID in each forward step.

@YK-Fu YK-Fu mentioned this pull request Jan 17, 2025
6 tasks
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