Skip to content

Commit af697ef

Browse files
author
Zhuoming Chen
committed
comments and docs
1 parent 29174fe commit af697ef

9 files changed

Lines changed: 27 additions & 9 deletions

docs/api/vortex_torch.cache.mask.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
========================
33

44
.. automodule:: vortex_torch.cache.mask
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

docs/api/vortex_torch.cache.reduce_interleave.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
======================================
33

44
.. automodule:: vortex_torch.cache.reduce_interleave
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

docs/api/vortex_torch.cache.reshape.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
===========================
33

44
.. automodule:: vortex_torch.cache.reshape
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

docs/api/vortex_torch.flow.algorithms.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
vortex\_torch.flow.algorithms
22
=============================
33

4+
.. automodule:: vortex_torch.flow.algorithms
5+
46
.. currentmodule:: vortex_torch.flow.algorithms
57

68
Ready-made sparse-attention flows. Each entry shows the routing **math**

docs/api/vortex_torch.indexer.kron.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
==========================
33

44
.. automodule:: vortex_torch.indexer.kron
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

docs/api/vortex_torch.indexer.mask.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
==========================
33

44
.. automodule:: vortex_torch.indexer.mask
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

docs/api/vortex_torch.indexer.reshape.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
=============================
33

44
.. automodule:: vortex_torch.indexer.reshape
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

docs/api/vortex_torch.indexer.select.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22
============================
33

44
.. automodule:: vortex_torch.indexer.select
5+
:members:
6+
:show-inheritance:
57

68

79
.. rubric:: Classes

vortex_torch/indexer/select.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,15 +40,17 @@ class TopK(vOp):
4040
into ``block_tables[i, :block_len]`` and set ``seqlens[i] =
4141
dense_seqlens[i]``. No selection — the row is already small
4242
enough to fit the budget.
43-
* Otherwise → write
44-
- ``[0:bos)`` ← first ``bos`` dense blocks
45-
- ``[bos:bos+k)`` ← top-``k`` blocks by score over
46-
``[bos, block_len-eos)`` of the dense row
47-
- ``[bos+k:bos+k+eos)`` ← last ``eos`` dense blocks
48-
and set ``seqlens[i] = (bos+k+eos-1) * block_size + last_block_len``
49-
where ``last_block_len`` is the per-row trailing block's token
50-
count (so the last block — the dense path's last — contributes
51-
the exact token count trtllm decode expects).
43+
* Otherwise → write a sparse row of ``bos + k + eos`` blocks:
44+
45+
- ``[0:bos)`` ← first ``bos`` dense blocks
46+
- ``[bos:bos+k)`` ← top-``k`` blocks by score over
47+
``[bos, block_len-eos)`` of the dense row
48+
- ``[bos+k:bos+k+eos)`` ← last ``eos`` dense blocks
49+
50+
and set ``seqlens[i] = (bos+k+eos-1) * block_size + last_block_len``,
51+
where ``last_block_len`` is the per-row trailing block's token count
52+
(so the last block contributes the exact token count trtllm decode
53+
expects).
5254
5355
Constructor
5456
-----------

0 commit comments

Comments
 (0)