deepseek-ai/DeepSelect

DeepSelect: TopK kernels for DeepSeek Sparse Attention (DSA) and Samplers

Open original source ↗

Older snapshot: check the original source for current information.

From the publisher

README & documentation

Source preview

Read the project’s overview, installation instructions and usage examples. The original README is the source of truth.

DeepSelect is a high performance implementation of the TopK kernel used in DeepSeek Sparse Attention (DSA) (which is used in DeepSeek V3.2, DeepSeek V4, and DeepSeek V4.1 models) and the sampler. It supports NVIDIA CUDA and Huawei Ascend platforms, and achieves 2 20x speedup compared to vanilla torch.topk. DeepSelect 是为 DeepSeek 稀疏注意力(DeepSeek Sparse Attention, DSA)和采样器(Sampler)定制的高性能 TopK 算子,支持 NVIDIA CUDA 平台与华为昇腾(Ascend)平台。与原生 torch.topk 相比,它可实现 2~20 倍的加速。 TopK workloads vary widely, and the fastest algorithm & implementation highly depends on the input dtype, batchsize, vocabsize, and topk. This repository only focuses on the following cases: This scenario covers: Recommendations: This scenario covers: Currently, only the CUDA implementation supports torch.float32 as the input dtype. The Ascend implementation supports torch.bfloat16 only. Measured with the benchmark in tests/test.py (python3 tests/test.py --perf-only), which reports the ratio against torch.topk on the same input. The metric is effective memory bandwidth: TopK does no floating-point math, so a FLOP rate…

deepseek-ai/DeepSelect on GitHub A short preview, not the full document.

Read the full README ↗ · Preview checked 2026-10-31T05:58:09.536Z

Inside the original README — Document outline
  1. DeepSelect
  2. News
  3. Supported Cases
  4. Lightning Indexer Scenario
  5. Sampling Scenario
  6. Performance
  7. Lightning Indexer Scenario (CUDA)
  8. Lightning Indexer Scenario (Ascend)
  9. Sampling Scenario (CUDA)
  10. Installation
  11. Usage
  12. Variable-length rows

Headings are captured from the source. Links open the publisher’s document, not a locally hosted copy.

Links from the README

References supplied by the publisher, not independently verified endorsements. Check the destination before downloading files or entering credentials.

Documentation belongs to its respective authors. Reported project/model license: MIT. A listing is not a grant of reuse or training rights. Confirm the document’s own terms at the source.

What this repository does

DeepSelect: TopK kernels for DeepSeek Sparse Attention (DSA) and Samplers

Repository facts

Owner
deepseek-ai
Primary language
Cuda
Stars
357
Forks
23
Open issues + pull requests
17
License
MIT
Archived
No
Default branch
main
Created
2026-09-09T14:38:04.000Z
Last push
2026-09-10T15:46:16.000Z

Topics and intended use

No topics were included in the latest source metadata.

Review the README for scope, installation, examples and limitations. We do not run repository code or certify it.

Evaluate before installing

Review licensing and dependencies, inspect recent commits and unresolved issues, and test in an isolated environment before production use. Stars and forks alone cannot answer these questions.

README and project files

Issues and maintenance discussion

Releases and changelog

Source and freshness

Source: GitHub. Metadata observed 2026-09-16T06:39:39.411Z. Daily imports are snapshots, not real-time monitoring.

Popularity and source listings do not establish security, suitability, licensing rights or benchmark performance.

Open original source

Related repositories

deepseek-ai/DeepGEMM

mw00/project-maya