Closed
[Requirement|需求建议]: TopK支持RadixSelect算法 #1499
刘奕哲Add on  Apr 27Closed at  Apr 28
刘奕哲
刘奕哲
Apr 27 Create

Thanks for sending an requirement! Please fill in the following template to help quickly solve your problem.

Background(背景信息)

TopK支持新算法RadixSelect。
该算法通过先选择第k个数,再取出大于或小于该数的其他元素,最后排序得到结果。
该算法下支持BF16、FP16和FP32的数据类型。

Origin(信息来源)

PyPTO Vector

Benefit / Necessity(价值/作用)

Design(设计方案)

Find MSD Histogram (output [X, 256])
Find the Bucket Index that fulfil TopK (output [X, 1])
Find the remaining entries in LSD to fulfil TopK value (output [X, 1])
Find LSD Histogram with (2) Result (output [X, 256])
Using (3) and (4) output to find out exact Bitmask to get TopK entries (output [X, 1])
Using (5) result to output Greater List and directly store back, and output each row ValidCol (output [X, 1])
Using (4) result to calculate the number of (6) total size (output [X, 1])
Using (5) and (7) result to output Equal List and directly store back and stop til K

likedislike
CANN-robotCANN-robotCollaborators
Apr 28 Close issue
CANN-robotCANN-robotCollaborators
Apr 28 Added label: resolved