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

Enable concatenation of unpadded prompts and a few other optimizations #1178

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

Conversation

sixiang-google
Copy link
Collaborator

Description

-Based on #1162 and #1168, allow unpadded seqs to attend to each other.
-Enable overloading under len of 1024.
-Sorted data for less slot idle.
-Reconfigured garbage collection.

Tests

Please describe how you tested this change, and include any instructions and/or
commands to reproduce.

Checklist

Before submitting this PR, please make sure (put X in square brackets):

  • I have performed a self-review of my code.
  • I have necessary comments in my code, particularly in hard-to-understand areas.
  • I have run end-to-end tests tests and provided workload links above if applicable.
  • I have made or will make corresponding changes to the doc if needed.

.compile()
)
min_num_prompts = max_length // length
max_num_prompts = max_length // (length // 2)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Did not understand this part?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Save the compiled prefill_insert_batch function based on (padded_length, num_prompts). For example, if we have 12 sequences of length 80 (padded to 128), we now concatenate them into a sequence of length 960 and would invoke compile(128, 12)

@sixiang-google sixiang-google force-pushed the sixiang-prefill-packing branch from 653be9c to 0394b0d Compare January 17, 2025 22:50
@sixiang-google sixiang-google force-pushed the sixiang-prefill-packing branch from 0394b0d to e35f3cd Compare January 17, 2025 23:08
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.

2 participants