Skip to content

Support page size > 1 #4356

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

Merged
merged 21 commits into from
Mar 13, 2025
Merged

Support page size > 1 #4356

merged 21 commits into from
Mar 13, 2025

Conversation

merrymercy
Copy link
Contributor

@merrymercy merrymercy commented Mar 12, 2025

  • This PR implements PagedTokenToKVPoolAllocator. It has almost the same interface as the old TokenToKVPoolAllocator, but it guarantees that the returned kv cache locations of one request are always page aligned. It is compatible with prefix cache.
  • Some other cleanup (e.g., move batch_is_full to ScheduleBatch)

Page size = 1, 4, 8, 16 shows no perf diff, because the page table management is all overlapped with GPU computation.
This PR will enable the integration of more attention kernels (e.g., FlashMLA and CuDNN attention)

Todos for the next PRs:

  • Change the attention kernel calls
  • Support speculative decoding

@merrymercy merrymercy mentioned this pull request Mar 13, 2025
67 tasks
@merrymercy merrymercy merged commit c76040e into main Mar 13, 2025
45 of 57 checks passed
@merrymercy merrymercy deleted the lianmin/page-size branch March 13, 2025 05:22
hebiao064 pushed a commit to hebiao064/sglang that referenced this pull request Mar 13, 2025
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