---
id: pr-tensorrt-llm-12385
repo: NVIDIA/TensorRT-LLM
pr: 12385
title: '[None][feat] Temporally-Correlated Heuristic-guided Indexer TopK for Sparse Attention'
author: longcheng-nv
date: '2026-04-03'
url: https://github.com/NVIDIA/TensorRT-LLM/pull/12385
source_category: upstream-code
architectures:
- sm100
tags:
- DSA
- attention kernel
- attention_kv
- benchmark kernel
- benchmark_test
- cuda kernel
- cute dsl
- moe_routing
- scheduler_autotune
techniques:
- autotuning
- tile-scheduling
hardware_features: []
kernel_types:
- attention
- decode
- moe
- scheduler
languages:
- cuda-cpp
- cute-dsl
captured_at: '2026-05-16'
status: merged
merge_sha: 29fac6b6737a63651e88e2075e4b4d44a5fd2b66
inclusion_reason: Preserve page/KV/layout and plan-run contracts; profile memory traffic separately from math utilization.
changed_paths:
- cpp/tensorrt_llm/kernels/IndexerTopK.h
- cpp/tensorrt_llm/kernels/heuristicTopKDecode.cu
- cpp/tensorrt_llm/kernels/heuristicTopKDecode.h
- cpp/tensorrt_llm/kernels/heuristic_topk.cuh
- cpp/tensorrt_llm/kernels/indexerTopK.cu
- cpp/tensorrt_llm/thop/IndexerTopKOp.cpp
- examples/longbench/eval_longbench_v1.py
- tensorrt_llm/_torch/attention_backend/sparse/dsa.py
- tensorrt_llm/_torch/custom_ops/cpp_custom_ops.py
- tensorrt_llm/_torch/model_config.py
- tensorrt_llm/llmapi/llm_args.py
- tests/integration/defs/accuracy/test_llm_api_pytorch.py
- tests/unittest/_torch/attention/sparse/test_dsa_indexer.py
- tests/unittest/_torch/thop/parallel/test_indexer_topk.py
artifact_dir: evidence/pull-bundles/tensorrt-llm/gh-12385
head_ref_oid: 5f59b9998aab3b01ef8d80160e4c096e80fdb1c0
---
# [None][feat] Temporally-Correlated Heuristic-guided Indexer TopK for Sparse Attention

- Repository: `NVIDIA/TensorRT-LLM`
- PR: [12385](https://github.com/NVIDIA/TensorRT-LLM/pull/12385)
- Decision: `Preserve page/KV/layout and plan-run contracts; profile memory traffic separately from math utilization.`
- Reason: Preserve page/KV/layout and plan-run contracts; profile memory traffic separately from math utilization.

## Changed Paths

- `cpp/tensorrt_llm/kernels/IndexerTopK.h`
- `cpp/tensorrt_llm/kernels/heuristicTopKDecode.cu`
- `cpp/tensorrt_llm/kernels/heuristicTopKDecode.h`
- `cpp/tensorrt_llm/kernels/heuristic_topk.cuh`
- `cpp/tensorrt_llm/kernels/indexerTopK.cu`
- `cpp/tensorrt_llm/thop/IndexerTopKOp.cpp`
- `examples/longbench/eval_longbench_v1.py`
- `tensorrt_llm/_torch/attention_backend/sparse/dsa.py`
- `tensorrt_llm/_torch/custom_ops/cpp_custom_ops.py`
- `tensorrt_llm/_torch/model_config.py`
- `tensorrt_llm/llmapi/llm_args.py`
- `tests/integration/defs/accuracy/test_llm_api_pytorch.py`
- `tests/unittest/_torch/attention/sparse/test_dsa_indexer.py`
- `tests/unittest/_torch/thop/parallel/test_indexer_topk.py`

## Evidence Bundle

`evidence/pull-bundles/tensorrt-llm/gh-12385`
