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

[Pass] Support two-stage softmax #2220

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

MasterJH5574
Copy link
Member

This PR introduces the compiler pass that rewrites the normal softmax to a two-stage softmax. This is based on our finding that when vocabulary size is large, the normal softmax cannot have high-enough parallelism on GPU. So we partition the workload into two stages for better parallelism and better performance.

@MasterJH5574 MasterJH5574 marked this pull request as draft April 25, 2024 16:59
@MasterJH5574
Copy link
Member Author

MasterJH5574 commented Apr 25, 2024

Depending on apache/tvm#16923. Mark as draft for now.

This PR introduces the compiler pass that rewrites the normal softmax
to a two-stage softmax. This is based on our finding that when
vocabulary size is large, the normal softmax cannot have high-enough
parallelism on GPU. So we partition the workload into two stages
for better parallelism and better performance.
@MasterJH5574 MasterJH5574 force-pushed the 04-25-two-stage-softmax branch from 876f399 to 7176219 Compare April 25, 2024 21:57
@MasterJH5574 MasterJH5574 marked this pull request as ready for review April 26, 2024 14:27
@tqchen tqchen merged commit ff72113 into mlc-ai:main Apr 26, 2024
2 checks passed
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