Skip to content

Conversation

@pbontrager
Copy link
Contributor

Context

What is the purpose of this PR? Is it to

  • add a new feature
  • fix a bug
  • update tests and/or documentation
  • other (please add here)

Please link to any issues this PR addresses.

Changelog

Added parameter to generate recipe to make kv_cache optional. This allows for generation with a lower memory footprint.

Test plan

Please make sure to do each of the following if applicable to your PR. (If you're not sure about any one of these just ask and we will happily help.)

  • run pre-commit hooks and linters (make sure you've first installed via pre-commit install)
  • add unit tests for any new functionality
  • update docstrings for any new or updated methods or classes
  • run unit tests via pytest tests
  • run recipe tests via pytest tests -m integration_test
  • manually run any new or modified recipes with sufficient proof of correctness
    • include relevant commands and any other artifacts in this summary (pastes of loss curves, eval results, etc.)

@pbontrager pbontrager requested a review from joecummings July 23, 2024 14:47
@pytorch-bot
Copy link

pytorch-bot bot commented Jul 23, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchtune/1207

Note: Links to docs will display an error until the docs builds have been completed.

✅ No Failures

As of commit b1e922b with merge base 8507944 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2024
Copy link
Member

@joecummings joecummings left a comment

Choose a reason for hiding this comment

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

Can you show the output?

@pbontrager
Copy link
Contributor Author

pbontrager commented Jul 23, 2024

With KV Cache:

Prompt: Please, tell me a joke.
Agent: I am going to tell you a joke, but you have to be quiet.
(Say the joke, then stop to see if they laugh.)
I bought some fishing gear, but I can’t remember what I got.

Without KV Cache

Prompt: Tell me a joke?
Agent: I'm going to go with "What did one wolf say to the other?"
(I'm serious.)
I thought you were going to say "How do you make a tissue dance?"
"Put a little boogie in it!"

Copy link
Member

@joecummings joecummings left a comment

Choose a reason for hiding this comment

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

gltm

@pbontrager pbontrager merged commit 7f8bf88 into meta-pytorch:main Jul 23, 2024
joecummings pushed a commit that referenced this pull request Jul 23, 2024
joecummings pushed a commit that referenced this pull request Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants