This application discloses a
data processing apparatus, a
data processing method, a
chip, and an electronic device, relating to the field of
data processing technology. The data
processing apparatus includes: a storage module configured to store x sets of
original data vectors, each
original data vector containing m data elements, where x and m are positive integers; and a computation module including a single instruction multiple data (
SIMD)
execution unit and a vector register group, the
SIMD execution unit being coupled to the vector register group, and the vector register group being coupled to the storage module. The computation module is configured to: determine whether x is an integer multiple of the
SIMD processing capability, split x, and obtain the top-k data elements in the
original data vectors based on different data strategies. The
algorithm of this application is flexible, requires no dedicated hardware
sorting network, avoids dependence on dedicated hardware, and improves
programming flexibility and versatility, facilitating the expansion and migration of large models across different hardware platforms.