Matrix and Vector Multiplication Operation Method and Apparatus
AssigneeHuawei Technologies Co., Ltd.
InventorsJiajin Tu, Fan Zhu, Qiang Lin, Hu Liu
Life of this patent
Estimating the term…
Abstract
A matrix and vector multiplication operation method includes obtaining first indication information of a matrix element, reading a matrix element value of a non-zero element from a preset matrix based on the first indication information, and determining a first location mark code of the read matrix element value, obtaining second indication information of a vector element, reading, from input vector data based on the second indication information, a vector element value of a second location mark code corresponding to the first location mark code, and obtaining a multiplication operation value of the matrix element value and the vector element value.
Claims20
A matrix and vector multiplication operation method, comprising:
- obtaining first indication information of a matrix element, wherein the first indication information indicates a non-zero element in a preset matrix;
- reading a matrix element value of the non-zero element from the preset matrix based on the first indication information;
- obtaining second indication information of a vector element, wherein the second indication information indicates to-be-read vector data information;
- reading a vector element value of a second location mark code corresponding to a first location mark code of the read matrix element value from input vector data based on the second indication information, wherein the first location mark code is a location mark of the matrix element value in matrix data;
- and
- obtaining a multiplication operation value of the matrix element value and the vector element value.
A matrix and vector multiplication operation apparatus, comprising:
- a memory configured to store a preset matrix, first indication information of a matrix element of the preset matrix, input vector data, and second indication information of a vector element of the input vector data, wherein the first indication information indicates a non-zero element in the preset matrix, and wherein the second indication information indicates to-be-read vector data information;
- a scheduling unit coupled to the memory and configured to:
- obtain the first indication information from the memory;
- read a matrix element value of the non-zero element from the preset matrix based on the first indication information;
- read the second indication information from the memory;
- and
- read a vector element value of a second location mark code corresponding to a first location mark code of the read matrix element value from the input vector data based on the second indication information, wherein the first location mark code is a location mark of the matrix element value in matrix data;
- and
- an arithmetic logical unit coupled to the memory and the scheduling unit, wherein the arithmetic logical unit is configured to calculate a multiplication operation value of the matrix element value and the vector element value.
Dependencies are inferred from the claim text.