The application relates to a parallel
tensor cache
system based on conflict-free computation and a
data processing method. The
system comprises: creating and maintaining two four-dimensional tensors in the memory, simultaneously constructing multiple groups of independent and uniform
hash function groups, and providing a basic structure for key-value storage and mapping. For each position of the input sequence, multiple bucket indexes are generated through the
hash function group, corresponding key and value vectors are accumulated into the corresponding bucket of the
tensor, distributed storage of the key-value state is realized, and conflicts are avoided. A view interface is constructed, when querying, the bucket index is obtained through the
hash function group, the bucket content is extracted and the approximate key-value vector is reconstructed; when performing calculation, if there is an attention
mask, only the key-value to be calculated is reconstructed and sparse operation is performed, and if an unsupported operation is encountered, the key-value is automatically completely reconstructed into a dense
tensor. By using the method, efficient storage of dynamic sparse tensor data and conflict-robust reconstruction can be realized under a constant memory budget.