---
id: pr-flashinfer-2119
repo: flashinfer-ai/flashinfer
pr: 2119
title: 'perf: bunch of features and optimizations for top-k (sampling + sparse attention)'
author: yzh119
date: '2025-12-12'
url: https://github.com/flashinfer-ai/flashinfer/pull/2119
source_category: upstream-code
architectures:
- sm100
tags:
- attention
techniques: []
hardware_features: []
kernel_types:
- attention
languages:
- cuda-cpp
captured_at: '2026-04-27'
status: merged
merge_sha: f6a9899d157522a2651c886cbfb68c6210e11918
inclusion_reason: kernel file changes
changed_paths:
- csrc/flashinfer_sampling_binding.cu
- csrc/flashinfer_topk_binding.cu
- csrc/renorm.cu
- csrc/topk.cu
- csrc/tvm_ffi_utils.h
- flashinfer/__init__.py
- flashinfer/aot.py
- flashinfer/jit/core.py
- flashinfer/jit/topk.py
- flashinfer/logits_processor/operators.py
- flashinfer/sampling.py
- flashinfer/topk.py
- flashinfer/utils.py
- include/flashinfer/sampling.cuh
- include/flashinfer/utils.cuh
- scripts/task_jit_run_tests_part3.sh
- tests/utils/test_logits_processor.py
- tests/utils/test_sampling.py
- tests/utils/test_topk.py
head_ref_oid: 63f07f1c8d6295bd21fef6cf7388caefa87ca8dd
artifact_dir: evidence/pull-bundles/flashinfer/gh-2119
---
# perf: bunch of features and optimizations for top-k (sampling + sparse attention)

- Repository: `flashinfer-ai/flashinfer`
- PR: [2119](https://github.com/flashinfer-ai/flashinfer/pull/2119)
- Decision: `kernel file changes`
- Reason: kernel file changes

## Changed Paths

- `csrc/flashinfer_sampling_binding.cu`
- `csrc/flashinfer_topk_binding.cu`
- `csrc/renorm.cu`
- `csrc/topk.cu`
- `csrc/tvm_ffi_utils.h`
- `flashinfer/__init__.py`
- `flashinfer/aot.py`
- `flashinfer/jit/core.py`
- `flashinfer/jit/topk.py`
- `flashinfer/logits_processor/operators.py`
- `flashinfer/sampling.py`
- `flashinfer/topk.py`
- `flashinfer/utils.py`
- `include/flashinfer/sampling.cuh`
- `include/flashinfer/utils.cuh`
- `scripts/task_jit_run_tests_part3.sh`
- `tests/utils/test_logits_processor.py`
- `tests/utils/test_sampling.py`
- `tests/utils/test_topk.py`

## Evidence Bundle

`evidence/pull-bundles/flashinfer/gh-2119`
