Skip to content
This repository was archived by the owner on Sep 10, 2025. It is now read-only.

Conversation

@lessw2020
Copy link
Contributor

@lessw2020 lessw2020 commented Sep 11, 2024

This PR:
1 - enables single or batch prompt prefill and decoding.
2 - adds three supporting functions for this (encode string, create padded prompt, batch decode next tokens).
Single:
Screenshot 2024-09-11 at 2 41 11 PM

Batch - prompts:
Screenshot 2024-09-11 at 6 17 45 PM

and batch decode:
Screenshot 2024-09-11 at 6 17 07 PM

3 - enables single prompt decoding up to max_tokens with formatted output:

what_is-Pytorch_example

@pytorch-bot
Copy link

pytorch-bot bot commented Sep 11, 2024

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/torchchat/1133

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

✅ No Failures

As of commit 9242dfb with merge base 7a4f0d1 (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 Meta Open Source bot. label Sep 11, 2024
@lessw2020 lessw2020 changed the title [distributed] prefill functions and decoding (single prompt) [distributed] prefill functions - encoding and decoding for single or batch Sep 12, 2024
@lessw2020 lessw2020 requested a review from kwen2501 September 12, 2024 01:29
Copy link
Contributor

@kwen2501 kwen2501 left a comment

Choose a reason for hiding this comment

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

Thank for the big effort. LGTM. Would appreciate it if the code can be cleaned up more (please see comments in line)

@kwen2501
Copy link
Contributor

Minor comment:
For PR description, would be easier to preserve info in git history if using text than images.

@lessw2020 lessw2020 changed the title [distributed] prefill functions - encoding and decoding for single or batch [distributed] prefill (single and multi-prompt) and single prompt generation and decoding Sep 15, 2024
@Jack-Khuu
Copy link
Contributor

Rebasing to pick up CI fix

@lessw2020 lessw2020 merged commit a645f8e into main Sep 15, 2024
51 checks passed
@lessw2020 lessw2020 deleted the lessw2020/prefill branch September 15, 2024 03:23
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants