---
id: pr-tensorrt-llm-12581
repo: NVIDIA/TensorRT-LLM
pr: 12581
title: '[https://nvbugs/5983390][perf] Multiple host perf optimizations for DSA part'
author: hyukn
date: '2026-04-02'
url: https://github.com/NVIDIA/TensorRT-LLM/pull/12581
source_category: upstream-code
architectures:
- sm100
tags:
- DSA
- attention kernel
- attention_kv
- benchmark_test
- compiler_runtime
- memory_primitives
techniques:
- cache-policy
hardware_features: []
kernel_types:
- attention
- compiler
- memory
languages:
- cuda-cpp
- triton
captured_at: '2026-05-16'
status: merged
merge_sha: edbb4b2c1d3d067077ba16c3563430dc9579e76e
inclusion_reason: 'Transfer primitive policy carefully: coalescing, shared-memory staging, partial tiles, and determinism are part of the contract.'
changed_paths:
- cpp/tensorrt_llm/kernels/IndexerKCacheGather.h
- cpp/tensorrt_llm/kernels/convertReqIndexToGlobal.cu
- cpp/tensorrt_llm/kernels/convertReqIndexToGlobal.h
- cpp/tensorrt_llm/kernels/indexerKCacheGather.cu
- cpp/tensorrt_llm/thop/CMakeLists.txt
- cpp/tensorrt_llm/thop/IndexerKCacheGatherOp.cpp
- cpp/tensorrt_llm/thop/convertReqIndexToGlobalOp.cpp
- tensorrt_llm/_torch/attention_backend/sparse/dsa.py
- tensorrt_llm/_torch/attention_backend/sparse/kernel.py
- tensorrt_llm/_torch/custom_ops/cpp_custom_ops.py
- tensorrt_llm/_torch/speculative/mtp.py
- tests/unittest/_torch/attention/sparse/test_cpp_custom_ops.py
- tests/unittest/_torch/attention/sparse/test_triton_gather_k_cache.py
artifact_dir: evidence/pull-bundles/tensorrt-llm/gh-12581
head_ref_oid: 66f6b07de0243d15bc1ad212e70c84058e74bb2c
---
# [https://nvbugs/5983390][perf] Multiple host perf optimizations for DSA part

- Repository: `NVIDIA/TensorRT-LLM`
- PR: [12581](https://github.com/NVIDIA/TensorRT-LLM/pull/12581)
- Decision: `Transfer primitive policy carefully: coalescing, shared-memory staging, partial tiles, and determinism are part of the contract.`
- Reason: Transfer primitive policy carefully: coalescing, shared-memory staging, partial tiles, and determinism are part of the contract.

## Changed Paths

- `cpp/tensorrt_llm/kernels/IndexerKCacheGather.h`
- `cpp/tensorrt_llm/kernels/convertReqIndexToGlobal.cu`
- `cpp/tensorrt_llm/kernels/convertReqIndexToGlobal.h`
- `cpp/tensorrt_llm/kernels/indexerKCacheGather.cu`
- `cpp/tensorrt_llm/thop/CMakeLists.txt`
- `cpp/tensorrt_llm/thop/IndexerKCacheGatherOp.cpp`
- `cpp/tensorrt_llm/thop/convertReqIndexToGlobalOp.cpp`
- `tensorrt_llm/_torch/attention_backend/sparse/dsa.py`
- `tensorrt_llm/_torch/attention_backend/sparse/kernel.py`
- `tensorrt_llm/_torch/custom_ops/cpp_custom_ops.py`
- `tensorrt_llm/_torch/speculative/mtp.py`
- `tests/unittest/_torch/attention/sparse/test_cpp_custom_ops.py`
- `tests/unittest/_torch/attention/sparse/test_triton_gather_k_cache.py`

## Evidence Bundle

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