Patents
Literature
Patsnap Eureka AI that helps you search prior art, draft patents, and assess FTO risks, powered by patent and scientific literature data.

954 results about "Matrix multiplication" patented technology

In mathematics, matrix multiplication or matrix product is a binary operation that produces a matrix from two matrices with entries in a field, or, more generally, in a ring or even a semiring. The matrix product is designed for representing the composition of linear maps that are represented by matrices. Matrix multiplication is thus a basic tool of linear algebra, and as such has numerous applications in many areas of mathematics, as well as in applied mathematics, statistics, physics, economics, and engineering.

Converting quasi-affine expressions to matrix operations

A computer-implemented method includes generating, based on a representation of a tensor mapping between an input tensor and an output tensor, a list of mappings from elements of the input tensor to elements of the output tensor, and generating groups of mappings from the list of mappings, where each of the groups of mappings corresponds to a respective set of matrix multiplications, a matrix transpose, or both. The computer-implemented method also includes generating a respective expression for each of the groups of mappings and generating code for summing results of the respective expressions, where each respective expression includes the respective set of matrix multiplications, the matrix transpose, or both.
Owner:AMAZON TECH INC

Attention operation processing method and device

The invention provides an attention operation processing method and device, and the method comprises the steps: dividing a query matrix, a key matrix and a value matrix into a query matrix block, a key matrix block and a value matrix block, and scheduling the blocks into a register; reading the query matrix block and the key matrix block from the register through a tensor processor, performing matrix multiplication operation on the query matrix block and the key matrix block to obtain a sub-product matrix, and writing the sub-product matrix back to the register; performing index processing based on the sub-product matrix in the register through an index processing unit to obtain a sub-index matrix and writing the sub-index matrix back to the register; reading the sub-index matrix and the value matrix block from the register, and performing matrix multiplication operation based on the sub-index matrix and the value matrix block to generate an attention operation result sub-block; and obtaining an attention operation result matrix based on each attention operation result sub-block. Based on the attention operation processing method disclosed by the invention, the memory access overhead in the attention operation process can be reduced, and the attention operation efficiency is improved.
Owner:SUZHOU YIZHU INTELLIGENT TECH CO LTD

Processor and electronic equipment

The invention discloses a processor and electronic equipment. The processor includes a computing unit including a tensor core configured to perform a matrix multiplication operation using a scaling factor, and a memory, the computing unit further including a scaling factor processing module configured to determine and cache a scaling factor for each tensor associated with the matrix multiplication operation, the computing unit further comprises at least one storage module arranged on a data path between the tensor core and the memory, and the at least one storage module is exclusively occupied by the tensor core when the tensor core executes tensor related operation. And the scaling factor processing module is arranged on the at least one storage module. At present, scaling factors and floating-point number quantization are completed by a vector calculation core, so that performance is reduced, and delay becomes high, and a scaling factor processing module arranged on a storage module in a calculation unit can improve the overall execution efficiency of low-precision matrix multiplication using the scaling factors.
Owner:SHANGHAI BIREN TECH CO LTD

Multi-core system-based task scheduling method and apparatus, and related product

A multi-core system-based task scheduling method and apparatus, and a related product. A task comprises a matrix multiplication operation task. A multi-core system comprises a plurality of operation units, each operation unit comprises one or more processing cores, and each processing core is provided with a local memory. The method comprises: determining the number T of operation units capable of scheduling; on the basis of the operation units capable of scheduling, splitting the matrix multiplication operation task in a row-column grid manner; according to a splitting scheme, determining the amount of data the operation units need to exchange with an external circuit; determining an optimization parameter of the splitting scheme so as to minimize the amount of data for exchange; and according to the optimization parameter, scheduling the matrix multiplication operation task to be executed in parallel over the operation units. The method can effectively reduce the data IO, and improve the processing efficiency.
Owner:CAMBRICON TECH CO LTD

Cylindrical thin-walled structure displacement field reconstruction method

The invention discloses a cylindrical thin-wall structure displacement field reconstruction method, which belongs to the technical field of displacement field reconstruction, and comprises the following steps: dispersing a cylindrical thin-wall structure into a plurality of inverse shell units; selecting an optimal point as a measuring point position in each inverse shell unit by using a loop optimization algorithm; constructing a least square functional comprising structural coupling strain and lateral shear strain of a single-side surface; differentiating the constructed least square functional through a variational principle, and determining a basic mathematical model of an inverse finite element method; determining a mapping relation from decoupled strain to node displacement through the constraint of the selected measuring point position and the boundary area of the structure; obtaining a decoupled strain vector through the selected measuring point position, the constraint of the boundary region of the structure and the strain measurement value; displacement of each node is obtained according to matrix multiplication, and assembling of an overall matrix is carried out. The method can effectively reduce the ill-conditioned degree of a displacement field reconstruction mathematical model, reduces the calculation amount, and improves the recognition precision.
Owner:烟台哈尔滨工程大学研究院

Parameter-efficient large-language fine-tuning federated learning framework

Provided in the present invention is a parameter-efficient large-language fine-tuning federated learning framework, comprising the following steps: performing modeling on LoRA adapters of different edge clouds; since different weights exhibit different average performances on the LoRA adapters, using singular values to quantify the importance of the weights, and therefore, before each round of independent training of the LoRA adapters using N edge clouds, using a matrix singular value to decompose a BA matrix in the LoRA adapter for each trainable weight; configuring heterogeneous LoRA adapters on the basis of the importance of the weights; and using different numbers of quantization bits to quantize a pre-trained model, and performing high-precision inverse quantization on the pre-trained model only when matrix multiplication is executed, wherein the pre-trained model is quantized to the maximum number of quantization bits on the basis of the memory budget of the edge clouds. The present invention has the following beneficial effects: the present invention determines the optimal fine-tuning model structure, thereby improving the performance of LLM fine-tuning, and adapts to heterogeneous and resource-constrained edge clouds.
Owner:FUDAN UNIVERSITY

Method for improving reasoning solution and training speed of deep operator network model

The invention belongs to the technical field of artificial intelligence and high-performance computing, and particularly relates to a method for improving the reasoning solution and training speed of a deep operator network model. According to the method, multi-level optimization is carried out on the PI-DeepONet model, and the reasoning solving speed and the training speed of the PI-DeepONet model are improved. According to the method, the SGEMM operator is customized, and compared with the best single-precision matrix multiplication in a basic linear algebraic library of a CUDA (Compute Unified Device Architecture) computing platform, the SGEMM operator can obtain a speed-up ratio of 1.5 times at most in a common model size range of PI-DeepONet. A fusion operator is designed according to the special structure of the modified MLP used in the model, the speed-up ratio of the end-to-end reasoning speed of the model is more than two times, and the calculation time of a graphics processor can be shortened by 5.7 times at most. According to the method, data parallel is used for carrying out distributed training on the model, a communication concealment strategy is used, and the expandability is kept at 83%-85%.
Owner:CHINA UNIV OF PETROLEUM (EAST CHINA)

Tensor core matrix multiplication and accumulation with hardware-based statistics collection and outlier suppression

An apparatus providing tensor core matrix multiplication and accumulation (MMA) with hardware-based statistics collection and outlier suppression is disclosed. The apparatus includes processor circuitry comprising at least one processor core comprising matrix multiplication circuitry to: execute a matrix multiplication operation on first input data from a first set of registers and on second input data from a second set of registers; collect, as part of executing the matrix multiplication operation via statistics collection hardware circuitry of the matrix multiplication circuitry, output statistics data corresponding to the matrix multiplication operation; and output the output statistics data along with a result of the matrix multiplication operation; and output statistics storage to store the output statistics data.
Owner:INTEL CORP

Hardware accelerator for sparse accumulation in column-wise sparse general matrix-matrix multipliction algorithms

A system and method of performing sparse accumulation in column-wise sparse general matrix-matrix multiplication (SpGEMM) algorithms. The method includes receiving a request to perform SpGEMM based on a first matrix and a second matrix. The method includes accumulating, in a hardware buffer, a hash key and an intermediate multiplication result of the first matrix and the second matrix. The method includes performing a probe search of a hardware cache to identify a match between the hash key and a partial sum associated with the first matrix and the second matrix. The method includes generating, by a hardware adder, a multiplication result based on the partial sum and the intermediate multiplication result from the accumulation waiting buffer.
Owner:RGT UNIV OF CALIFORNIA

Attention mechanism calculation optimization method and device, storage medium and program product

The embodiment of the invention provides an attention mechanism calculation optimization method and device, a storage medium and a program product, and relates to the technical field of artificial intelligence, and the method comprises the steps: executing a forward re-calculation operator based on a query block and a key block, and obtaining a forward normalization result. Executing a first matrix multiplication operator based on the output gradient block and the forward normalization result to obtain a value intermediate result, and executing a point multiplication summation operator in parallel based on the forward output block and the output gradient block to obtain an intermediate tensor; executing a first type of transformation operator on the value intermediate result to obtain value gradient blocks; and meanwhile, a gradient back propagation operator is executed in parallel based on the output gradient block, the value block, the intermediate tensor and the forward normalization result, and a reverse normalization result is obtained. And finally, on the basis of a reverse normalization result, the key blocks and the query blocks, obtaining query gradient blocks and key gradient blocks, so that effective pipeline processing is performed on different operators, and the overall performance of attention mechanism calculation is improved.
Owner:SHANGHAI BIREN TECH CO LTD

Cache resource reuse method and device, storage medium and program product

The embodiment of the invention provides a cache resource reuse method and device, a storage medium and a program product, and relates to the technical field of artificial intelligence, the method comprises the following steps: carrying out matrix multiplication calculation on query representation and key representation to obtain a first calculation result; and storing the first calculation result in a first cache region in the on-chip cache. And reading the first calculation result from the first cache region, and performing normalization operation to obtain a normalization result. The data type of the first calculation result is the same as that of the normalization result, the subsequent attention mechanism calculation does not need the first calculation result any more, and the output tensor is obtained by performing matrix multiplication calculation on the normalization result and the value representation, so that a first cache region which originally stores the first calculation result can be reused to store the normalization result, and the calculation efficiency is improved. In this way, the accuracy of attention mechanism calculation is guaranteed, meanwhile, the cache resources are reused, and the situation that the cache resources are used tensely in the operator implementation process is effectively relieved.
Owner:北京壁仞科技开发有限公司 +1

Mixed data precision matrix multiplication and addition unit and calculation method

The invention provides a mixed data precision matrix multiplication and addition unit and a calculation method, the matrix multiplication and addition unit comprises a calculation unit, and the calculation unit comprises a format division module, a multiplication array module, an addition tree module, an accumulator module, a normalization module and a shift register module. The calculation unit converts the first input matrix and the second input matrix into input data in a middle floating point format; executing parallel multiplication operation on the input data to generate an intermediate product result; performing index alignment and accumulation on the intermediate product result to generate an intermediate accumulated value; accumulating the intermediate product result and the value of the third input matrix in a form of accumulating an intermediate accumulated value, and outputting an accumulated result; and converting an accumulation result into a normalized result and outputting the normalized result. The format division module supports various precisions and converts data with different widths into an intermediate floating point format, so that other hardware units can be reused, and the problems that hardware resources are complex and different model reasoning scenes are difficult to meet are solved.
Owner:NANJING UNIV

Tensor core, processor, data processing method, electronic device and storage medium

The invention discloses a tensor core, a processor, a data processing method, electronic equipment and a storage medium, and is applied to the field of tensor processing. The tensor kernel comprises a first dot multiplication unit and a scaling factor matrix multiplication processing module, the scaling factor matrix multiplication processing module comprises a second dot multiplication unit, and the first dot multiplication unit and the second dot multiplication unit support dot multiplication operations of different floating-point number precisions. The tensor core is configured to receive a first tensor, a second tensor, a scaling factor of the first tensor, a scaling factor of the second tensor, an offset term of the first tensor, and an offset term of the second tensor, perform a matrix multiplication operation using the scaling factor and the offset term using a first dot multiplication unit and a scaling factor matrix multiplication processing module, and obtaining a matrix multiplication operation result of the first tensor and the second tensor. Matrix multiplication operation using scaling factors is executed by multiplexing dot multiplication units with different precisions in a tensor kernel, extra hardware area cost is reduced, and existing hardware resources are fully multiplexed.
Owner:SHANGHAI BIREN TECH CO LTD

Single-precision matrix multiplication calculation method based on Atlas800 server platform

The invention discloses a single-precision matrix multiplication calculation method based on an Atlas800 server platform. The single-precision matrix multiplication calculation method comprises the following steps that calculation tasks are evenly distributed to all calculation cores of an NPU of an Atlas800 server for parallel calculation; reading two single-precision matrixes to be multiplied from a global memory according to a preset data arrangement mode; a Cube operation unit is called to complete multiplication of a single-precision matrix; and a Vector operation unit is used to complete multiplication and addition of the result matrix and obtain the result matrix. The method has the beneficial effects that a calculation task is divided into a plurality of parallel subtasks in advance, input data is read according to specific data arrangement, a high-speed Cube calculation unit is called to complete classical matrix multiplication, then intermediate result data is copied to a host memory, and final calculation is completed by a Vector calculation unit; the hardware computing power of the Atlas800 server is utilized to the maximum extent, the calculation efficiency of single-precision matrix multiplication is greatly improved, and compared with a traditional matrix multiplication calculation method, the method has obvious advantages.
Owner:GUANGDONG ARTIFICIAL INTELLIGENCE & DIGITAL ECONOMY LAB (GUANGZHOU) +1

Sparse Mixer Architecture

Improved multi-layer machine learning model architectures are provided that exhibit increased accuracy, decreased training time, decreased inference compute cost, and / or increased stability while training. These improved models include a plurality of sequential layers, each layer comprising a mixing layer that feeds into a feedforward layer. These improved models achieve these benefits by ‘enhancing’ a subset of the feedforward layers with mixture-of-experts or other sparse multi-network architectures while ‘degrading’ a subset of the mixing layers to be simple linear mixing layers (e.g., that multiply inputs by one or more mixing matrices) rather than more complicated attentional mixing mechanisms (e.g., including a number of matrix multiplications, dot products, and nonlinear operations). Such a combination of mixing layer modifications and feedforward layer modifications in a single multi-layer model exhibits synergistic improvements with respect to training time, inference computational cost, and training stability for a given level of model accuracy.
Owner:GOOGLE LLC

AI compiler and compiling method based on multistage intermediate representation framework

PendingCN120560627ABiological modelsIntelligent editorsActivation functionComposite operator
The invention relates to the technical field of artificial intelligence compilers, in particular to an AI compiler and compiling method based on a multi-level intermediate representation framework, and the compiler comprises a high-level semantic retention layer which converts models of different AI frameworks into Lalg-on-Tensor IR intermediate representations; the hardware perception optimization layer comprises a tensor packaging and propagation module which is used for performing block packaging, layout propagation and folding of redundant packaging / unpackaging operation on the input tensor; the dynamic partitioning module is used for automatically selecting the partitioning size based on the cache capacity and the core number of the target hardware; the microkernel fusion module is used for fusing matrix multiplication, bias addition and an activation function into a single composite operator; and the microkernel collaboration layer is in butt joint with the hardware acceleration library through the XSMM dialect to generate a target hardware code. The hardware perception optimization layer can perform optimization according to different hardware characteristics, so that codes generated by the compiler can better adapt to target hardware, and the hardware utilization rate is improved.
Owner:SHANDONG INSPUR SCI RES INST CO LTD

Calculation acceleration method and device for model reasoning, medium and program product

The embodiment of the invention discloses a model reasoning calculation acceleration method and device, a medium and a program product, and the method comprises the steps: dividing the number of heads in multi-head attention processing into each processor core group according to the number of processor core groups in a processor in the multi-head attention processing of model reasoning; when the processor core group performs operation between a query vector and a key vector in multi-head attention processing, according to the total amount of the operation tasks and the number of the slave cores in the processor core group, the operation tasks are divided into the slave cores with uniform data volume; when an operation task is jointly processed by at least two slave cores, matrix segmentation is carried out on a query vector and a key vector in the operation task, and each slave core reads a corresponding vector according to a matrix segmentation result to carry out matrix multiplication operation; and caching the first matrix multiplication operation sub-result obtained by calculation of each slave core to a high-speed cache of a specified first target slave core to generate a first matrix multiplication operation result. The calculation efficiency can be improved by balancing the data volume of each slave core.
Owner:太初(无锡)电子科技有限公司

Method and system for weight memory mapping for streaming operation of giant generative artifical intelligence hardware

Provided is a method and system for weight memory mapping for a streaming operation of giant generative artificial intelligence hardware. A weight memory mapping system may include a weight memory configured to store a weight matrix for a pretrained artificial intelligence model; an input register configured to store a plurality of input data; a first hardware operator configured to process a matrix multiplication operation between the plurality of input data and the weight matrix and to compute a lane-level final sum during the progress of the matrix multiplication operation by reusing a partial sum of the matrix multiplication operation; and a second hardware operator configured to preprocess a next matrix multiplication operation during the progress of the matrix multiplication operation using the final sum.
Owner:HYPERACCEL CO LTD

Optimization method of hybrid expert system, computer equipment, readable storage medium and program product

The invention relates to an optimization method of a hybrid expert system, computer equipment, a readable storage medium and a program product. A plurality of experts contained in the MOE are deployed in a plurality of artificial intelligence chips in groups, and the method comprises the following steps: carrying out routing calculation on an original input tensor to obtain a routing calculation result; determining input element grouping information corresponding to each expert based on expert index information and expert weight information in the routing calculation result; taking the expert dimension as a parallel dimension, executing rearrangement operation for the original input tensor in parallel based on the input element grouping information, taking a rearrangement result as input information of an expert, executing matrix multiplication and accumulation operation, and taking the expert dimension as the parallel dimension, and based on the input element grouping information, executing anti-rearrangement operation of the matrix multiplication and accumulation operation result in parallel to obtain a final operation result. By adopting the method, the MOE reasoning performance can be improved.
Owner:SHANGHAI BIREN TECH CO LTD

Optimization method and optimization equipment for quantization matrix multiplication of large model and readable storage medium

The invention provides an optimization method and optimization equipment for quantization matrix multiplication of a large model and a readable storage medium. The optimization method comprises the following steps: step 1, obtaining first quantized data, mask data and magic data, wherein the first quantized data has first precision and is obtained by quantizing original data based on a quantization parameter; 2, logical operation is carried out on the first quantized data, the mask data and the magic number data to obtain second quantized data with second precision, and the logical operation comprises bitwise AND calculation and bitwise OR calculation; and step 3, based on the second quantized data and the quantized parameter, carrying out dequantization calculation to obtain dequantized data. Based on the optimization method for quantization matrix multiplication for the large model, the calculation efficiency of quantization matrix multiplication can be improved.
Owner:SHANGHAI INFINIGENCE AI INTELLIGENT TECHNOLOGY CO LTD

Matrix multiplication in a dynamically spatially and dynamically temporally dividable architecture

A data processing apparatus includes input circuitry that receives a matrix having values in a first format. Output circuitry outputs the matrix having the values in a second format while adjustment circuitry performs a modification of the matrix from the first format to the second format. The second format is computationally contiguous in respect of a data processing apparatus having the first and second vector registers both configured to be dynamically spatially and dynamically temporally divided, performing a matrix multiplication.
Owner:ARM LTD

Attention mechanism calculation method and device, storage medium and product

The invention discloses an attention mechanism calculation method and device, a storage medium and a product, and the method comprises the steps: carrying out matrix multiplication operation through employing a query matrix block of a first register block and a key matrix block of a shared memory, obtaining a first product matrix block, and writing the first product matrix block into a second register block; performing exponential operation by using the first product matrix blocks to obtain sub-matrix blocks, writing the sub-matrix blocks into a second register block in a covering manner, and writing the sub-matrix blocks into a third register block in the form of a target precision type; performing matrix multiplication operation by using the sub-matrix blocks of the third register block and the value matrix blocks of the shared memory to obtain second product matrix blocks, and writing the second product matrix blocks into a second register block; performing softmax operation by using the second product matrix blocks to obtain attention result matrix blocks, and writing the attention result matrix blocks into a fourth register block; and writing the attention result matrix of the fourth register group into the shared memory in blocks. According to the embodiment of the invention, overflow of the register can be avoided, and the utilization of hardware resources is maximized.
Owner:SHANGHAI BIREN TECH CO LTD

Attention mechanism calculation method and device, medium and product

The invention discloses an attention mechanism calculation method and device, a medium and a product. The method comprises the steps that a second thread bundle group is controlled to load an ith query matrix block; controlling the second thread bundle group to perform matrix multiplication operation and exponential operation by using the ith query matrix block and the transposed jth key matrix block to obtain a jth attention score matrix block; and controlling the first thread bundle group and the second thread bundle group to alternately use different sub-blocks of the jth value matrix block to perform attention mechanism operation of the jth attention score matrix block until the last sub-block of the jth attention result matrix block is obtained. By adopting the embodiment of the invention, sufficient register resources can be provided for the calculation of the attention mechanism, so that the calculation efficiency is improved.
Owner:SHANGHAI BIREN TECH CO LTD

Matrix multiplication and accumulation operation unit and operation method, hardware accelerator and electronic equipment

The embodiment of the invention provides a matrix multiplication and accumulation operation unit and method, a hardware accelerator and electronic equipment, and the matrix multiplication and accumulation operation unit comprises a data loading storage engine, a tensor register file and a matrix multiplication engine. The data loading and storage engine is used for loading data of a plurality of matrixes to be subjected to matrix multiplication and accumulation calculation; the tensor register file is used for storing data of a plurality of matrixes acquired from the data loading storage engine; the tensor register file comprises at least three tensor register groups, each tensor register group comprises a plurality of tensor registers, and different tensor register groups are used for storing data of different matrixes in the plurality of matrixes; and the matrix multiplication engine is used for carrying out matrix multiplication accumulation calculation based on the data of the plurality of matrixes stored in the tensor register file. According to the embodiment of the invention, more efficient MMA calculation is realized under the conditions of low cost, low power consumption and less occupied space.
Owner:ALIBABA (CHINA) CO LTD

Method for decomposing high-precision matrix multiplication into multiple matrix multiplications of different data types

In some examples, a method of performing matrix multiplication using mixed precision decomposition of operands includes converting a first matrix including a plurality of elements having a first precision to a second matrix, where the second matrix includes a plurality of elements having a second precision, the second precision being lower than the first precision; generating a first output matrix comprising a product of the second matrix and a third matrix, where the third matrix comprises a plurality of elements having the second precision, the elements of the first output matrix being stored at the first precision or converted to the first precision; calculating a residual value matrix using the first matrix and the second matrix, where the residual value matrix comprises elements representing respective differences between elements of the first matrix and elements of the second matrix; the elements of the residual matrix are scaled using a first scaling factor to generate a first scaled matrix.
Owner:HUAWEI TECH CO LTD

Method for accelerating batch matrix multiplication running in computing platform

The invention provides an acceleration method for batch matrix multiplication running in a computing platform. The method comprises the steps that a batch result matrix is segmented into task blocks with the maximum number, the batch result matrix comprises a plurality of result matrixes, and any result matrix is obtained by multiplying two matrixes; determining a balanced division strategy according to the maximum number of task blocks, the balanced division strategy being a strategy for averagely distributing the plurality of task blocks to a plurality of computing cores of a neural network processing unit (NPU) in the computing platform; and calling the calculation units in the calculation core according to a balanced division strategy, and carrying out matrix multiplication operation on all task blocks to obtain a calculation result of the batch result matrix. According to the method, the problem of low calculation efficiency of a batch matrix multiplication calculation method in the prior art is solved.
Owner:ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD

Multi-precision matrix calculation unit and use method thereof

The invention discloses a multi-precision matrix calculation unit and a use method thereof, and relates to the technical field of integrated circuits, the multi-precision matrix calculation unit comprises a control logic unit, a cache module and a calculation array; wherein the control logic unit is used for configuring a computing array and controlling the cache module to read in and read out data; the cache module comprises three first cache sub-modules and one second cache sub-module; wherein the three first cache sub-modules are respectively used for caching a first to-be-processed matrix, a second to-be-processed matrix and a third to-be-processed matrix, and the second cache sub-module is used for caching a result matrix; and the calculation array is used for carrying out multiplication and addition operation on different types of to-be-processed matrixes to obtain a result matrix and writing the result matrix back to the cache module. The method can serve as a basic operation core for integrated processing of large-scale matrix multiplication and can also be integrated in processors such as RISC-V for matrix operation, universality is higher, and the method can adapt to fast and efficient calculation scenes.
Owner:SUN YAT SEN UNIV

Triangular matrix multiplication acceleration method based on atlas 800 platform

The invention relates to the field of high-performance computing and computing power optimization, in particular to an acceleration method of triangular matrix multiplication based on an atlas 800 platform, which comprises the following steps of: segmenting a result matrix into a plurality of task blocks, and presetting a balanced division strategy based on the plurality of task blocks; a mask matrix is generated on the vector calculation unit, and the mask matrix is stored in a global memory; reading the matrix and the mask matrix from the global memory, and adopting a vector calculation unit to realize matrix triangle masking to obtain a triangle matrix A after triangle masking; and based on the triangular matrix A after triangle masking, calling a cube calculation unit according to a preset equilibrium division strategy to complete matrix multiplication of all task blocks, and obtaining a result matrix. According to the method, triangular matrix multiplication is completed by adopting a mix method in which a vector calculation unit and a cube calculation unit are combined, the calculation efficiency of triangular matrix multiplication on NPU is improved, the calculation power of Huawean atlas 800NPU can be fully exerted, triangular matrix multiplication calculation is accelerated, and calculation power support is provided for the fields of deep learning, scientific calculation and the like.
Owner:HUAWEI TECH CO LTD