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 #11881

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

KV-cache for T5 model #11881

wants to merge 1 commit into from

Conversation

YK-Fu
Copy link

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

What does this PR do?

Improve the T5 generation related issues and T5 attention mask bugs. This PR should be used with NVIDIA/Megatron-LM#1358

Collection: nlp T5

Changelog

  • Add kv-cache mechanism for Megatron-core T5 model.
  • Fix the attention mask bugs for Megatron-core local implementations (when mcore_t5 is true, and transformer_engine is False)
  • Improve the generation of T5 to be better aligned with that in GPT

Usage

  • Implement kv-cache in generation of T5, improving its efficiency
  • Fix local mcore t5 model attention mask bugs (not from transformer_engine)
  • In original T5 decode method, you can only generate fix length sequence, even when the EOS token is generated, it will still generate tokens until the predefined number of tokens are reached, which is very inconvenience and inefficient. This pull request raise enables variable length generation.
python examples/nlp/language_modeling/tuning/megatron_gpt_finetuning.py <datasets and checkpoints override>

GitHub Actions CI

The Jenkins CI system has been replaced by GitHub Actions self-hosted runners.

The GitHub Actions CI will run automatically when the "Run CICD" label is added to the PR.
To re-run CI remove and add the label again.
To run CI on an untrusted fork, a NeMo user with write access must first click "Approve and run".

Before your PR is "Ready for review"

Pre checks:

  • Make sure you read and followed Contributor guidelines
  • Did you write any new necessary tests?
  • Reviewer: Does the PR have correct import guards for all optional libraries?

PR Type:

  • New Feature
  • Bugfix
  • Documentation

If you haven't finished some of the above items you can still open "Draft" PR.

Who can review?

Anyone in the community is free to review the PR once the checks have passed.
Contributor guidelines contains specific people who can review PRs to various areas.

Additional Information

  • Related to # (issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant