Conversation
5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds an optimized SM90 build and runtime path for Hopper GPUs such as H20 and H100, while preserving the existing SM100/SM103 defaults.
SM90 uses an 8-CTA cluster for small-batch, long-sequence BF16 Top-K workloads. The cluster path is enabled from a vocabulary size of 128K, based on measurements on an 8×H20 machine. SM100 and SM103 continue to use the existing 16-CTA cluster and 512K threshold.
Changes
DEEP_SELECT_CUDA_ARCHSto select90a,100a, and/or103aat build time.sm_100aandsm_103a.int32andint64output indicessorted_indexenabled and disabledreturn_valueenabled and disabledbatch_size <= 6vocab_size >= 128Ktopk <= 1024nvidia-smi -Lfor CUDA platform detection whenlspciis unavailable in a container.std::formatdependency in the C++ binding so the extension builds with older host standard libraries commonly found in CUDA containers.DEEP_SELECT_CUDA_ARCHS=90a pip install -v .Performance
Measured on NVIDIA H20 with BF16 input,
batch_size1 and 6, andtopk512 and 1024. Each result is the median of 100 cold-cache runs.The improvement column compares the new 8-CTA cluster with the existing single-CTA path compiled for SM90.
torch.topkShort-sequence and large-batch workloads continue to use the existing normal kernel. Their measured speedup over
torch.topkremains 4.88×–6.27×.Validation
cuobjdumpregister-spill check passed with no spills.int32andint64indicessorted_indexendtorch.topkfor every case.