WO2021023000A1 - 信息处理方法、装置、电子设备及存储介质 - Google Patents
信息处理方法、装置、电子设备及存储介质 Download PDFInfo
- Publication number
- WO2021023000A1 WO2021023000A1 PCT/CN2020/103047 CN2020103047W WO2021023000A1 WO 2021023000 A1 WO2021023000 A1 WO 2021023000A1 CN 2020103047 W CN2020103047 W CN 2020103047W WO 2021023000 A1 WO2021023000 A1 WO 2021023000A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- data
- processed
- storage space
- information
- buffer
- Prior art date
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/08—Addressing or allocation; Relocation in hierarchically structured memory systems, e.g. virtual memory systems
- G06F12/0802—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches
- G06F12/0875—Addressing of a memory level in which the access to the desired data or data block requires associative addressing means, e.g. caches with dedicated cache, e.g. instruction or stack
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N3/00—Computing arrangements based on biological models
- G06N3/02—Neural networks
- G06N3/06—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons
- G06N3/063—Physical realisation, i.e. hardware implementation of neural networks, neurons or parts of neurons using electronic means
Definitions
- the present disclosure relates to the field of computer technology, in particular to information processing methods, devices, electronic equipment and storage media.
- central processing unit central processing unit
- DSP digital signal processor
- the embodiments of the present disclosure provide information processing methods, devices, electronic equipment, and storage media.
- the first aspect provides an information processing method, including: a CPU obtains data to be processed; allocating virtual storage space for the data to be processed; storing the data to be processed in the virtual storage space; A data processing instruction for the information of the storage space, where the data processing instruction is used by the DSP to obtain the data to be processed from a virtual storage space corresponding to the information and process the data to be processed.
- the virtual storage space corresponds to the first buffer space in the buffer of the electronic device; and the storing the to-be-processed data in the virtual storage space includes: a CPU transfers the to-be-processed data to the virtual storage space.
- the data is stored in the first buffer space; the DSP acquiring the data to be processed from the virtual storage space corresponding to the information includes: the DSP acquires the data to be processed from the first buffer space corresponding to the information.
- the allocating virtual storage space for the to-be-processed data includes: applying for buffer space from the buffer of the electronic device based on the storage space required by the to-be-processed data;
- the location indication information of the first cache space returned by the cache of the electronic device determines the physical storage location of the virtual storage space.
- the data to be processed includes at least one array, and each array includes data of the same type, and the method further includes: determining the storage space required by each array in the at least one array; Based on the storage space required by each array in the at least one array, the storage space required by the data to be processed is determined.
- the method further includes: determining the deviation of each array in the at least one array in the virtual storage space according to the size of the storage space required by each array in the at least one array. Shift.
- the method further includes: determining the size of the storage space required by the data to be processed based on the data volume of the data to be processed and the result data volume corresponding to the data to be processed.
- applying for a buffer space from the buffer of the electronic device includes: sending a request for buffer space to the buffer of the electronic device The request carries information about the size of the storage space required by the data to be processed; receiving location indication information from the buffer, where the location indication information is used to indicate the base address of the first buffer space.
- the data to be processed are network parameters and input data of a network layer in a neural network.
- the second aspect provides another information processing method, including: DSP receives a data processing instruction from a CPU, the data processing instruction carries information of a virtual storage space; obtaining data to be processed from a virtual storage space corresponding to the information; The data to be processed is processed.
- the virtual storage space corresponding to the information corresponds to the first buffer space in the buffer of the electronic device; the obtaining the to-be-processed data from the virtual storage space corresponding to the information includes: The first buffer space corresponding to the information acquires the data to be processed.
- the method further includes: storing the processing result of the to-be-processed data in a first buffer space corresponding to the information.
- the data to be processed are network parameters and input data of a network layer in a neural network.
- an information processing device including: an acquisition unit for acquiring data to be processed; an allocation unit for allocating virtual storage space for the data to be processed; and a storage unit for storing the data to be processed Stored in the virtual storage space; a sending unit, configured to send a data processing instruction carrying information of the virtual storage space to the DSP, and the data processing instruction is used by the DSP to obtain all information from the virtual storage space corresponding to the information
- the data to be processed is described and the data to be processed is processed.
- a fourth aspect provides another information processing device, including: a receiving unit, configured to receive a data processing instruction from a CPU, where the data processing instruction carries information of a virtual storage space; and an acquiring unit, configured to obtain a virtual storage space corresponding to the information The storage space acquires the data to be processed; the processing unit is used to process the data to be processed.
- a fifth aspect provides an information processing device, including a processor and a memory, where the memory is used to store computer-readable instructions, and the processor is used to call the computer-readable instructions stored in the memory to execute operations as described in the first aspect or the first aspect.
- an information processing method provided by any possible implementation manner.
- a sixth aspect provides an information processing device, including a processor and a memory, the memory is configured to store computer-readable instructions, and the processor is configured to invoke the computer-readable instructions stored in the memory to execute operations as described in the second aspect or the first aspect.
- the information processing method provided by any one of the possible implementations in the two aspects.
- a seventh aspect provides an electronic device, including the information processing device provided in the fifth aspect and the information processing device provided in the sixth aspect, or the information processing device provided in the third aspect and the information processing device provided in the fourth aspect.
- An eighth aspect provides a readable storage medium, the readable storage medium stores a computer program, and the computer program includes program code that, when executed by a processor, causes the processor to execute the first aspect or the first aspect.
- a ninth aspect provides a computer program product, which is used to execute the information processing method provided in the first aspect or any one of the possible implementations of the first aspect at runtime, or the second aspect or the second aspect The information processing method provided by any possible implementation manner.
- the CPU obtains the data to be processed, allocates virtual storage space for the data to be processed, stores the data to be processed in the virtual storage space, and sends a data processing instruction carrying information of the virtual storage space to the DSP.
- the data processing instruction is used for
- the DSP obtains the data to be processed from the virtual storage space corresponding to the information and processes the data to be processed. In this way, the CPU can send data corresponding to multiple operations to the DSP at one time through the virtual storage space, thereby reducing DSP scheduling overhead and improving information processing efficiency.
- Fig. 1 is a schematic diagram of an electronic device provided by an embodiment of the present disclosure.
- Fig. 2 is a schematic flowchart of an information processing method provided by an embodiment of the present disclosure.
- FIG. 3 is a schematic flowchart of another information processing method provided by an embodiment of the present disclosure.
- FIG. 4 is a schematic flowchart of another information processing method provided by an embodiment of the present disclosure.
- FIG. 5 is a schematic flowchart of another information processing method provided by an embodiment of the present disclosure.
- Fig. 6 is a schematic structural diagram of an information processing device provided by an embodiment of the present disclosure.
- Fig. 7 is a schematic structural diagram of another information processing device provided by an embodiment of the present disclosure.
- FIG. 8 is a schematic structural diagram of another information processing device provided by an embodiment of the present disclosure.
- the embodiments of the present disclosure provide information processing methods, devices, electronic equipment, and storage media for improving data processing efficiency. Detailed descriptions are given below.
- DSP for example, hexagon
- the use of DSP has many issues that require additional consideration.
- the DSP cannot directly access the memory space on the CPU.
- the CPU cannot directly access the space opened up by the DSP.
- the address space needs to be allocated through the ION buffer.
- the fast remote procedure call Frast Remote Procedure Call, FastRPC
- the fast remote procedure call only maps the data that the CPU has to transfer to the DSP for this call to the address space allocated by the ION Buffer.
- the number of address spaces that can be mapped by a single DSP call is limited, and if a certain block of address space is not mapped in this call, even if the address space has been mapped before, the DSP cannot correctly access the data in the address space. .
- both the DSP and the CPU are applied to the data processing of the neural network model, it is necessary to call the DSP once for each operation in the neural network model. Therefore, when the depth of the neural network model is deep, the CPU cannot transfer all the data required for data processing through a single call to the DSP, but has to call the DSP multiple times. However, calling the DSP repeatedly will bring a very large overhead.
- the address space mapped on the ION Buffer may be different each time the DSP is called, and the DSP cannot correctly access the data in the address space that should be mapped for the last call.
- a virtual storage space can be maintained by the CPU.
- the virtual storage space stores the information (for example, weight parameters and input data) required by the DSP to execute the data processing of the neural network model, and the virtual storage space can be shared by the DSP .
- the CPU can transfer all the data required by the DSP for data processing of the entire neural network model to the DSP through only one or a limited number of calls, thereby minimizing the overhead caused by the DSP call.
- FIG. 1 is a schematic diagram of an electronic device applied in an embodiment of the present disclosure.
- the electronic device may include a CPU 101, a DSP 102, and a buffer 103.
- the CPU 101 is used to receive a running instruction carrying data, and schedule the DSP 102 based on the received running instruction.
- the DSP 102 is used to process data in response to the scheduling of the CPU 101.
- the buffer 103 is used to buffer data.
- the buffer 103 may be an ION buffer, or other buffers or storage modules that can be accessed by the CPU and DSP.
- FIG. 2 is a schematic flowchart of an information processing method provided by an embodiment of the present disclosure. This method can be applied to the electronic device shown in FIG. 1. Among them, the information processing method is described from the perspective of the CPU. As shown in Figure 2, the information processing method may include the following steps.
- the CPU can obtain the running instruction carrying the data to be processed, and can schedule the DSP based on the running instruction.
- the running instruction may be input by the user, generated by the electronic device to which the CPU belongs, or sent by other electronic devices or servers.
- the data to be processed can be the network parameters and input data of the network layer in the neural network, and the number of layers of the network layer is greater than one.
- the data to be processed can also be other data processed by the DSP alone or data that need to be processed jointly by the CPU and the DSP.
- the CPU After the CPU obtains the data to be processed, it allocates virtual storage space for the data to be processed.
- the electronic device cache may apply for a cache space based on the storage space required by the data to be processed, and then determine the physical storage location corresponding to the virtual storage space based on the location indication information of the first cache space returned by the electronic device cache.
- the electronic device cache refers to the cache in the electronic device to which the CPU belongs, and the cache can be accessed by the CPU and DSP.
- the buffer can be an ION buffer or other buffers that can be accessed by the CPU and DSP.
- the CPU may first send a request for applying for cache space (for example, an application instruction) to the cache in the electronic device, and the request may carry information about the size of the storage space required for the data to be processed.
- the first buffer space can be selected from the free buffer space of the buffer, the size of the first buffer space is equal to the storage space required by the data to be processed, and the location indication is allocated for the first buffer space Information, such as a pointer to the first buffer space, then returns the position indication information to the CPU.
- the CPU After the CPU receives the location indication information of the first buffer space from the buffer, it can create a virtual storage space based on the size of the storage space required by the data to be processed, allocate a base address for the virtual storage space, and establish the base address of the virtual storage space and the Correspondence between location indication information. Wherein, creating the virtual storage space based on the size of the storage space required by the data to be processed and allocating a base address for the virtual storage space may also be created before sending the request for applying for the buffer space to the buffer in the electronic device.
- the virtual storage space Before sending the request for applying for cache space to the buffer in the electronic device, the virtual storage space has been created based on the size of the storage space required for the data to be processed, and the base address is allocated for the virtual storage space, the request can also be Carry the base address of the virtual storage space.
- the buffer can establish a correspondence between the location indication information and the base address of the virtual storage space.
- the CPU receives the location indication information indicating the first cache space from the cache, it may not establish a correspondence between the base address of the virtual storage space and the location indication information.
- the location indication information of the first cache space is used to indicate the base address of the first cache space.
- the data to be processed including multiple operations can correspond to a position indication information in the buffer, such as a pointer.
- a position indication information in the buffer such as a pointer.
- data including multiple operations can be shared to the DSP at one time through the virtual storage space, thereby improving information processing efficiency.
- the first cache space is applied for based on the storage space required by the data to be processed, a suitable cache space can be applied for, that is, the cache space will not be wasted due to the application of too much cache space. Because too little cache space is requested, the data to be processed cannot be cached.
- the data to be processed may be stored in the virtual storage space, that is, the data to be processed is stored in the first cache space corresponding to the virtual storage space.
- the CPU After the CPU stores the data to be processed in the virtual storage space, it can send data processing instructions carrying the information of the virtual storage space to the DSP, so that the DSP can obtain the data to be processed from the virtual storage space corresponding to the information in the virtual storage space and process the data to be processed .
- the CPU can call the preset function library to send data processing instructions carrying the information of the virtual storage space to the DSP.
- the preset function library is a function library specially used to call DSP, such as FastRPC.
- the information of the virtual storage space may include the base address of the virtual storage space.
- the CPU can share the data of multiple operations to the DSP at one time through the virtual storage space. In this process, only one DSP scheduling is required, thereby reducing DSP scheduling overhead and improving information Processing efficiency.
- FIG. 3 is a schematic flowchart of another information processing method provided by an embodiment of the present disclosure. Among them, the information processing method is described from the perspective of the CPU. As shown in Fig. 3, the information processing method may include the following steps.
- step 301 is the same as step 201.
- step 201 please refer to step 201, which will not be repeated here.
- the size of the storage space required for the data to be processed can be determined.
- the storage space required by each array in at least one array included in the data to be processed may be determined first, and then the storage space required by each array in the at least one array is determined based on the storage space required by each array in the at least one array.
- the storage space size that is, the sum of the storage space required by each array in at least one array can be determined as the storage space required for the data to be processed.
- each array includes the same type of data.
- the amount of storage space required for the data to be processed can also be determined based on the amount of data to be processed and the amount of result data corresponding to the data to be processed (ie, the amount of result data corresponding to the data to be processed), namely The sum of the data volume of the data to be processed and the result data volume corresponding to the data to be processed can be determined as the storage space required by the data to be processed.
- the result data amount can be predetermined according to the processing parameters involved in the data to be processed.
- the amount of data in each array and the amount of result data corresponding to each array in at least one array included in the data to be processed may also be determined first, and then based on the amount of data in each array in the at least one array and each The amount of result data corresponding to the array determines the storage space required for each array in at least one array. That is, first calculate the storage space required for the data included in each array and the storage space required for the result corresponding to the data included in the array, and then the storage space required for the data included in each array and the array include The sum of the storage space required for the result corresponding to the data of the data is the storage space required for each array.
- step 303 is the same as step 202.
- the CPU may also determine the offset of each array in the at least one array in the virtual storage space according to the size of the storage space required by each array in the at least one array. Then, data can be written in the virtual storage space according to the base address and offset.
- step 304 is the same as step 203.
- step 203 please refer to step 203, which will not be repeated here.
- step 305 is the same as step 204.
- step 204 please refer to step 204, which will not be repeated here.
- the CPU can send data including multiple operations to the DSP at one time through the virtual storage space, thereby reducing DSP scheduling overhead and improving information processing efficiency.
- FIG. 4 is a schematic flowchart of yet another information processing method provided by an embodiment of the present disclosure. Among them, the information processing method is described from the perspective of DSP. As shown in Figure 4, the information processing method may include the following steps.
- the DSP After the CPU sends the data processing instruction carrying the information of the virtual storage space to the DSP, the DSP receives the data processing instruction from the CPU. Both the CPU and the DSP have the authority to access the virtual storage space corresponding to the information of the virtual storage space.
- the DSP After receiving the data processing instruction from the CPU, the DSP obtains the data to be processed from the virtual storage space corresponding to the information in the virtual storage space.
- the virtual storage space corresponding to the information of the virtual storage space corresponds to the first cache space in the cache of the electronic device, and both the CPU and the DSP have the authority to access the cache of the electronic device. Therefore, the DSP obtains the data to be processed from the first buffer space corresponding to the information in the virtual storage space.
- the DSP may first obtain the location indication information corresponding to the information of the virtual storage space, and then correspond from the location indication information To obtain the data to be processed in the first buffer space.
- the DSP can directly send the data acquisition request carrying the information of the virtual storage space to the buffer, and the buffer After receiving the data acquisition request from the DSP, obtain the location indication information corresponding to the virtual storage space information according to the information of the virtual storage space and the correspondence between the location indication information and the information of the virtual storage space.
- a buffer space acquires the data to be processed, and then returns the data to be processed to the DSP.
- the DSP After the DSP obtains the data to be processed from the virtual storage space corresponding to the information in the virtual storage space, the data to be processed is processed.
- the processing of the data to be processed may include convolution processing, and may also include other processing such as full connection processing.
- the processing result of the data to be processed may be stored in the first buffer space corresponding to the information in the virtual storage space.
- a storage instruction can be sent to the buffer, and the storage instruction carries the processing result and the information of the virtual storage space.
- the buffer receives the storage instruction from the DSP, it stores the processing result in the first buffer space.
- the DSP After the DSP stores the processing result of the data to be processed in the first buffer space corresponding to the information of the virtual storage space, it can send a processing completion response message to the CPU so that the CPU can obtain the processing result from the buffer, so that the buffer of the buffer can be cleared in time space.
- the DSP can obtain and process data from the virtual storage space at one time through the information in the virtual storage space, thereby improving the efficiency of data processing.
- FIG. 5 is a schematic flowchart of yet another information processing method provided by an embodiment of the present disclosure. Among them, the information processing method is described from the perspective of CPU and DSP. As shown in FIG. 5, the information processing method may include the following steps.
- the CPU obtains data to be processed.
- step 501 is the same as step 201.
- step 201 For detailed description, please refer to step 201, which will not be repeated here.
- the CPU determines the size of storage space required for the data to be processed.
- step 502 is the same as step 302.
- step 302 please refer to step 302, which will not be repeated here.
- the CPU sends a request for applying for cache space to the cache.
- the CPU After the CPU determines the size of the storage space required for the data to be processed, it can send a request for applying for cache space to the buffer, and the request carries information about the size of the storage space required for the data to be processed.
- the buffer sends location indication information of the first buffer space to the CPU.
- the buffer After receiving the request from the CPU, the buffer selects the first buffer space from the free buffer space according to the size of the storage space corresponding to the information, and then sends the location indication information of the first buffer space to the CPU. For example, sending a pointer to the CPU to indicate the base address of the first cache space.
- the CPU determines a physical storage address corresponding to the virtual storage space based on the location indication information.
- the CPU can allocate virtual storage space for the data to be processed, such as the offset of the data in the virtual storage space, according to the size of the storage space required by the data to be processed.
- the offset may be the offset of the data of each array in the virtual storage space, or may be the offset of the data of each array and its corresponding result data.
- the offset is determined relative to the base address of the virtual storage space.
- the physical storage address corresponding to the virtual storage space can be determined based on the location indication information, that is, the base address of the virtual storage space is determined, so as to determine the actual storage location of the data to be processed.
- the CPU stores the to-be-processed data in the virtual storage space, that is, in the first cache space indicated by the location indication information.
- step 506 is similar to step 203.
- step 203 please refer to step 203, which will not be repeated here.
- the CPU sends a data processing instruction carrying information of the virtual storage space to the DSP.
- the DSP receives data processing instructions from the CPU.
- step 507 is the same as step 204.
- step 204 please refer to step 204, which will not be repeated here.
- step 401 the data processing instruction received by the DSP from the CPU is the same as step 401.
- step 401 please refer to step 401, which will not be repeated here.
- the DSP obtains the data to be processed from the first buffer space corresponding to the information in the virtual storage space.
- step 508 is similar to step 402, for detailed description, please refer to step 402, which will not be repeated here.
- the DSP processes the data to be processed.
- step 509 is the same as step 403.
- step 403 which will not be repeated here.
- the DSP stores the processing result of the data to be processed in the first buffer space corresponding to the information in the virtual storage space.
- step 510 is the same as step 404.
- step 404 please refer to step 404, which will not be repeated here.
- the CPU is responsible for analyzing the neural network model and calculating the space required by each array related to the data processing of the neural network model.
- the CPU applies for space (ie, virtual storage space) from a virtual heap according to the calculated space size.
- space ie, virtual storage space
- the result returned by applying for space is not a usual pointer, but an offset relative to the base address of the heap.
- the CPU counts the total amount of space required, and allocates space corresponding to the total size on the ION Buffer to obtain the actual base address. Then, the CPU writes the relevant parameters and data required to run the neural network model into the virtual storage space that is applied for, that is, actually writes the space corresponding to the virtual space allocated on the ION Buffer.
- the specific write address can be passed through The base address and offset are calculated. Then, the CPU initiates a FastRPC call, and passes this virtual storage space to the DSP through FastRPC. In this way, both the CPU and the DSP can share the virtual storage space. Then, the DSP can parse the data in the ION Buffer according to the address information of the virtual storage space, and start calculation, store the calculation result in the corresponding location of the space, and return it to the CPU.
- FIG. 6 is a schematic structural diagram of an information processing apparatus according to an embodiment of the present disclosure.
- the information processing apparatus may include: an acquiring unit 601, configured to acquire data to be processed; an allocation unit 602, configured to allocate virtual storage space for the data to be processed; and a storage unit 603, configured to store the data to be processed To the virtual storage space; the sending unit 604 is used to send a data processing instruction carrying information of the virtual storage space to the DSP, and the data processing instruction is used by the DSP to obtain the data to be processed from the virtual storage space corresponding to the information in the virtual storage space and the data to be processed To process.
- the virtual storage space corresponds to the first buffer space in the buffer of the electronic device; the storage unit 603 is specifically configured to store the data to be processed in the first buffer space; the DSP corresponds to the information in the virtual storage space Obtaining the data to be processed by the virtual storage space includes: the DSP acquires the data to be processed from the first cache space corresponding to the information of the virtual storage space.
- the allocating unit 602 is specifically configured to: apply for buffer space from the buffer of the electronic device based on the size of the storage space required by the data to be processed; based on the location indication information of the first buffer space returned by the buffer of the electronic device To determine the physical storage location of the virtual storage space.
- the data to be processed includes at least one array, and each array includes data of the same type.
- the information processing apparatus may further include: a determining unit 605, configured to determine the location of each array in the at least one array. The required storage space is determined based on the storage space required by each array in the at least one array.
- the determining unit 605 is further configured to determine the offset of each array in the at least one array in the virtual storage space according to the size of the storage space required by each array in the at least one array.
- the determining unit 605 is configured to determine the size of the storage space required for the data to be processed based on the data amount of the data to be processed and the result data amount corresponding to the data to be processed.
- the allocation unit 602 applies for cache space from the cache of the electronic device including: sending a request for applying for cache space to the cache of the electronic device, and the request carries the Information about the size of the storage space required for data processing; receiving position indication information from the buffer, where the position indication information is used to indicate the base address of the first buffer space.
- the data to be processed are network parameters and input data of the network layer in the neural network.
- This embodiment may correspond to the description of the method embodiment in the embodiment of the application, and the above and other operations and/or functions of each unit are used to implement the corresponding processes in each method in FIG. 2 and FIG. 3 respectively. For the sake of brevity, it is not here. Repeat it again.
- FIG. 7 is a schematic structural diagram of another information processing apparatus provided by an embodiment of the present disclosure.
- the information processing apparatus may include: a receiving unit 701, configured to receive a data processing instruction from the CPU, the data processing instruction carrying information about a virtual storage space; an acquiring unit 702, configured to correspond to the information in the virtual storage space The data to be processed is acquired in the virtual storage space of, and the processing unit 703 is configured to process the data to be processed.
- the virtual storage space corresponding to the information of the virtual storage space corresponds to the first cache space in the cache of the electronic device; the obtaining unit 702 is specifically configured to obtain the first cache space corresponding to the information of the virtual storage space Pending data.
- the information processing apparatus may further include: a storage unit 704, configured to store the processing result of the to-be-processed data in the first cache space corresponding to the information in the virtual storage space.
- the data to be processed are network parameters and input data of the network layer in the neural network.
- This embodiment may correspond to the description of the method embodiment in the embodiment of the present application, and the above and other operations and/or functions of each unit are used to implement the corresponding flow in each method in FIG. 4, and are not repeated here for brevity.
- FIG. 8 is a schematic structural diagram of another information processing device provided by an embodiment of the present disclosure.
- the information processing apparatus can realize various functions of the CPU in the electronic device shown in FIG. 1.
- the information processing apparatus may include: at least one processor 801, such as a CPU, a transceiver 802, and at least one bus 803.
- the bus 803 is used to implement connection and communication between these components.
- the processor 801 is configured to perform the following operations: obtain the data to be processed; allocate virtual storage space for the data to be processed; store the data to be processed in the virtual storage space; the transceiver 802 is configured to send the virtual storage space to the DSP
- the data processing instruction of the information in the storage space is used by the DSP to obtain the data to be processed from the virtual storage space corresponding to the information in the virtual storage space and process the data to be processed.
- the virtual storage space corresponds to the first cache space in the cache of the electronic device; the processor 801 storing the to-be-processed data in the virtual storage space includes: storing the to-be-processed data in the first cache space; and the DSP from the virtual storage
- the obtaining of the data to be processed by the virtual storage space corresponding to the information of the space includes: the DSP obtains the data to be processed from the first buffer space corresponding to the information of the virtual storage space.
- the processor 801 allocating virtual storage space for the data to be processed includes: applying for buffer space from the buffer of the electronic device based on the storage space required by the data to be processed;
- the location indication information of the cache space determines the physical storage location of the virtual storage space.
- the data to be processed includes at least one array, and each array includes data of the same type, and the processor 801 is further configured to perform the following operations: determine the size of storage space required by each array in the at least one array; Based on the storage space required by each array in the at least one array, the storage space required by the data to be processed is determined.
- the processor 801 is further configured to perform the following operations: determine the deviation of each array in the at least one array in the virtual storage space according to the storage space required by each array in the at least one array. Shift.
- the processor 801 is further configured to perform the following operations: based on the data volume of the data to be processed and the result data volume corresponding to the data to be processed, determine the size of the storage space required for the data to be processed.
- the processor 801 based on the size of the storage space required by the data to be processed, requesting cache space from the cache of the electronic device includes: sending a request for applying for cache space to the cache of the electronic device, and the request carries Information about the size of the storage space required by the data to be processed; receiving position indication information from the buffer, where the position indication information is used to indicate the base address of the first buffer space.
- the data to be processed are network parameters and input data of the network layer in the neural network.
- step 201-step 203, step 301-step 304, and step 501-step 504 can be executed by the processor 801 in the CPU, and step 204, step 305, and step 505 can be executed by the transceiver 802 in the CPU.
- the acquisition unit 601, the allocation unit 602, the storage unit 603, and the determination unit 605 may be implemented by the processor 801 in the CPU, and the sending unit 604 may be implemented by the transceiver 802 in the CPU.
- the foregoing information processing apparatus may also be used to execute various methods performed in the foregoing method embodiments, and details are not described herein again.
- the information processing apparatus can implement various functions of the DSP in the electronic device shown in FIG. 1.
- the transceiver 802 is used to receive data processing instructions from the CPU, and the data processing instructions carry information of the virtual storage space
- the processor 801 is used to perform the following operations: obtain the data to be processed from the virtual storage space corresponding to the information in the virtual storage space ; Process the data to be processed.
- the virtual storage space corresponding to the information of the virtual storage space corresponds to the first cache space in the cache of the electronic device; the processor 801 obtaining the data to be processed from the virtual storage space corresponding to the information of the virtual storage space includes: Obtain the data to be processed from the first cache space corresponding to the information of the virtual storage space.
- the processor 801 is further configured to perform the following operation: store the processing result of the to-be-processed data in the first cache space corresponding to the information of the virtual storage space.
- the data to be processed are network parameters and input data of the network layer in the neural network.
- steps 402 to 404 and steps 506 to 508 can be executed by the processor 801, and the steps of receiving data processing instructions in step 204, step 305, and step 505 and step 401 can be executed by the transceiver 802.
- the acquiring unit 702, the processing unit 703, and the storage unit 704 may be implemented by the processor 801, and the receiving unit 701 may be implemented by the transceiver 802.
- the foregoing information processing apparatus may also be used to execute various methods performed in the foregoing method embodiments, and details are not described herein again.
- a storage medium is provided, the storage medium is used to store an application program, and the application program is used to execute the information processing method in FIGS. 2 to 4 at runtime.
- an application program is provided, and the application program is used to execute the information processing method of FIGS. 2 to 4 at runtime.
- the program can be stored in a computer-readable memory.
- the memory can include: flash disk, ROM, RAM, magnetic disk or CD, etc.
Abstract
Description
Claims (27)
- 一种信息处理方法,其特征在于,包括:中央处理单元CPU获取待处理数据;为所述待处理数据分配虚拟存储空间;将所述待处理数据存储至所述虚拟存储空间;向数字信号处理器DSP发送携带所述虚拟存储空间的信息的数据处理指令,所述数据处理指令用于所述DSP从所述信息对应的虚拟存储空间获取所述待处理数据并对所述待处理数据进行处理。
- 根据权利要求1所述的方法,其特征在于,所述虚拟存储空间对应于所述CPU所属电子设备的缓存器中的第一缓存空间;所述将所述待处理数据存储至所述虚拟存储空间包括:所述CPU将所述待处理数据存储至所述第一缓存空间;所述DSP从所述信息对应的虚拟存储空间获取所述待处理数据包括:所述DSP从所述信息对应的所述第一缓存空间获取所述待处理数据。
- 根据权利要求2所述的方法,其特征在于,所述为所述待处理数据分配虚拟存储空间包括:基于所述待处理数据所需的存储空间大小,向所述电子设备的缓存器申请缓存空间;基于所述电子设备的缓存器返回的所述第一缓存空间的位置指示信息,确定所述虚拟存储空间的物理存储位置。
- 根据权利要求3所述的方法,其特征在于,所述基于所述待处理数据所需的存储空间大小,向所述电子设备的缓存器申请缓存空间包括:向所述电子设备的缓存器发送用于申请缓存空间的请求,所述请求携带所述待处理数据所需的存储空间大小的信息;接收来自所述缓存器的位置指示信息,所述位置指示信息用于指示所述第一缓存空间的基地址。
- 根据权利要求1至3中任一项所述的方法,其特征在于,所述待处理数据包括至少一个数组,每个数组包括同一类型的数据,所述方法还包括:确定所述至少一个数组中每个数组所需的存储空间大小;基于所述至少一个数组中每个数组所需的存储空间大小,确定所述待处理数据所需的存储空间大小。
- 根据权利要求5所述的方法,其特征在于,所述方法还包括:根据所述至少一个数组中每个数组所需的存储空间大小,确定所述至少一个数组中每个数组在所述虚拟存储空间中的偏移量。
- 根据权利要求1至3中任一项所述的方法,其特征在于,所述方法还包括:基于所述待处理数据的数据量和所述待处理数据对应的结果数据量,确定所述待处理数据所需的存储空间大小。
- 根据权利要求1-7任一项所述的方法,其特征在于,所述待处理数据包括神经网络模型中目标网络层的网络参数和输入数据。
- 一种信息处理方法,其特征在于,包括:数字信号处理器DSP接收来自中央处理单元CPU的数据处理指令,所述数据处理指令携带虚拟存储空间的信息;从所述信息对应的虚拟存储空间获取待处理数据;对所述待处理数据进行所述数据处理指令指示的处理操作。
- 根据权利要求9所述的方法,其特征在于,所述信息对应的虚拟存储空间对应于所述CPU所属电子设备的缓存器中的第一缓存空间;所述从所述信息对应的虚拟存储空间获取待处理数据包括:从所述信息对应的第一缓存空间获取待处理数据。
- 根据权利要求9或10所述的方法,其特征在于,所述方法还包括:将所述待处理数据的处理结果存储在所述信息对应的第一缓存空间。
- 根据权利要求9-11任一项所述的方法,其特征在于,所述待处理数据为神经网络模型中目标网络层的网络参数和输入数据。
- 一种信息处理装置,其特征在于,包括:获取单元,用于获取待处理数据;分配单元,用于为所述待处理数据分配虚拟存储空间;存储单元,用于将所述待处理数据存储至所述虚拟存储空间;发送单元,用于向数字信号处理器DSP发送携带所述虚拟存储空间的信息的数据处理指令,所述数据处理指令用于所述DSP从所述信息对应的虚拟存储空间获取所述待处理数据并对所述待处理数据进行处理。
- 根据权利要求13所述的装置,其特征在于,所述虚拟存储空间对应于电子设备的缓存器中的第一缓存空间;所述存储单元,具体用于将所述待处理数据存储至所述第一缓存空间;所述DSP从所述信息对应的虚拟存储空间获取所述待处理数据包括:所述DSP从所述信息对应的所述第一缓存空间获取所述待处理数据。
- 根据权利要求14所述的装置,其特征在于,所述分配单元具体用于:基于所述待处理数据所需的存储空间大小,向所述电子设备的缓存器申请缓存空间;基于所述电子设备的缓存器返回的所述第一缓存空间的位置指示信息,确定所述虚拟存储空间的物理存储位置。
- 根据权利要求15所述的装置,其特征在于,所述分配单元基于所述待处理数据所需的存储空间大小,向所述电子设备的缓存器申请缓存空间包括:向所述电子设备的缓存器发送用于申请缓存空间的请求,所述请求携带所述待处理数据所需的存储空间大小的信息;接收来自所述缓存器的位置指示信息,所述位置指示信息用于指示所述第一缓存空间的基地址。
- 根据权利要求13至15中任一项所述的装置,其特征在于,所述待处理数据包括至少一个数组,每个数组包括同一类型的数据,所述装置还包括:第一确定单元,用于确定所述至少一个数组中每个数组所需的存储空间大小;所述第一确定单元,还用于基于所述至少一个数组中每个数组所需的存储空间大小,确定所述待处理数据所需的存储空间大小。
- 根据权利要求16所述的装置,其特征在于,所述第一确定单元,还用于根据所述至少一个数组中每个数组所需的存储空间大小,确定所述至少一个数组中每个数组在所述虚拟存储空间中的偏移量。
- 根据权利要求13至15任一项所述的装置,其特征在于,所述装置还包括:第二确定单元,用于基于所述待处理数据的数据量和所述待处理数据对应的结果数据量,确定所述待处理数据所需的存储空间大小。
- 根据权利要求13-19任一项所述的装置,其特征在于,所述待处理数据包括神经网络模型中目标网络层的网络参数和输入数据。
- 一种信息处理装置,其特征在于,包括:接收单元,用于接收来自中央处理单元CPU的数据处理指令,所述数据处理指令携带虚拟存储空间的信息;获取单元,用于从所述信息对应的虚拟存储空间获取待处理数据;处理单元,用于对所述待处理数据进行处理。
- 根据权利要求21所述的装置,其特征在于,所述信息对应的虚拟存储空间对应于电子设备的缓存器中的第一缓存空间;所述获取单元,具体用于从所述信息对应的第一缓存空间获取待处理数据。
- 根据权利要求21或22所述的装置,其特征在于,所述装置还包括:存储单元,用于将所述待处理数据的处理结果存储在所述信息对应的第一缓存空间。
- 根据权利要求21-23任一项所述的装置,其特征在于,所述待处理数据为神经网络模型中目标网络层的网络参数和输入数据。
- 一种信息处理装置,其特征在于,包括处理器和存储器,所述存储器用于存储计算机指令,所述处理器用于调用所述存储器存储的计算机指令,执行如权利要求1-12任一项所述的信息处理方法。
- 一种电子设备,其特征在于,包括如权利要求13-20任一项所述的信息处理装置和如权利要求21-24任一项所述的信息处理装置。
- 一种可读存储介质,其特征在于,所述可读存储介质存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1-12任一项所述的信息处理方法。
Priority Applications (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
KR1020217019945A KR20210094629A (ko) | 2019-08-06 | 2020-07-20 | 정보 처리 방법, 장치, 전자 디바이스 및 기록 매체 |
JP2021535674A JP2022514382A (ja) | 2019-08-06 | 2020-07-20 | 情報処理方法、装置、電子デバイス、及び記録媒体 |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910733625.1A CN110489356B (zh) | 2019-08-06 | 2019-08-06 | 信息处理方法、装置、电子设备及存储介质 |
CN201910733625.1 | 2019-08-06 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2021023000A1 true WO2021023000A1 (zh) | 2021-02-11 |
Family
ID=68549633
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2020/103047 WO2021023000A1 (zh) | 2019-08-06 | 2020-07-20 | 信息处理方法、装置、电子设备及存储介质 |
Country Status (5)
Country | Link |
---|---|
JP (1) | JP2022514382A (zh) |
KR (1) | KR20210094629A (zh) |
CN (1) | CN110489356B (zh) |
TW (1) | TWI782304B (zh) |
WO (1) | WO2021023000A1 (zh) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110489356B (zh) * | 2019-08-06 | 2022-02-22 | 上海商汤智能科技有限公司 | 信息处理方法、装置、电子设备及存储介质 |
CN113342553A (zh) * | 2021-07-06 | 2021-09-03 | 阳光保险集团股份有限公司 | 一种数据的获取方法、装置、电子设备及存储介质 |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040034748A1 (en) * | 2002-08-13 | 2004-02-19 | Renesas Technology Corp. | Memory device containing arbiter performing arbitration for bus access right |
CN104601711A (zh) * | 2015-01-27 | 2015-05-06 | 曙光云计算技术有限公司 | 用于云服务器的基于fpga的数据存储方法和系统 |
CN105589829A (zh) * | 2014-09-15 | 2016-05-18 | 华为技术有限公司 | 基于多核处理器芯片的数据处理方法、装置以及系统 |
CN106339258A (zh) * | 2016-08-10 | 2017-01-18 | 西安诺瓦电子科技有限公司 | 可编程逻辑器件与微处理器共享内存的管理方法及装置 |
CN108920413A (zh) * | 2018-06-28 | 2018-11-30 | 中国人民解放军国防科技大学 | 面向gpdsp的卷积神经网络多核并行计算方法 |
CN110489356A (zh) * | 2019-08-06 | 2019-11-22 | 上海商汤智能科技有限公司 | 信息处理方法、装置、电子设备及存储介质 |
Family Cites Families (15)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US7873810B2 (en) * | 2004-10-01 | 2011-01-18 | Mips Technologies, Inc. | Microprocessor instruction using address index values to enable access of a virtual buffer in circular fashion |
US20060179273A1 (en) * | 2005-02-09 | 2006-08-10 | Advanced Micro Devices, Inc. | Data processor adapted for efficient digital signal processing and method therefor |
CN101000596A (zh) * | 2007-01-22 | 2007-07-18 | 北京中星微电子有限公司 | 一种可实现芯片内多核间通信的芯片及通信方法 |
US8359453B2 (en) * | 2010-09-13 | 2013-01-22 | International Business Machines Corporation | Real address accessing in a coprocessor executing on behalf of an unprivileged process |
US9164804B2 (en) * | 2012-06-20 | 2015-10-20 | Memory Technologies Llc | Virtual memory module |
US9218289B2 (en) * | 2012-08-06 | 2015-12-22 | Qualcomm Incorporated | Multi-core compute cache coherency with a release consistency memory ordering model |
CN104317768B (zh) * | 2014-10-15 | 2017-02-15 | 中国人民解放军国防科学技术大学 | 面向cpu+dsp异构系统的矩阵乘加速方法 |
US10049327B2 (en) * | 2014-12-12 | 2018-08-14 | Qualcomm Incorporated | Application characterization for machine learning on heterogeneous core devices |
CN105045763B (zh) * | 2015-07-14 | 2018-07-13 | 北京航空航天大学 | 一种基于fpga+多核dsp的pd雷达信号处理系统及其并行实现方法 |
US9626295B2 (en) * | 2015-07-23 | 2017-04-18 | Qualcomm Incorporated | Systems and methods for scheduling tasks in a heterogeneous processor cluster architecture using cache demand monitoring |
US20190004878A1 (en) * | 2017-07-01 | 2019-01-03 | Intel Corporation | Processors, methods, and systems for a configurable spatial accelerator with security, power reduction, and performace features |
CN107463510B (zh) * | 2017-08-21 | 2020-05-08 | 北京工业大学 | 一种面向高性能的异构多核共享cache缓冲管理方法 |
CN109034382A (zh) * | 2017-10-30 | 2018-12-18 | 上海寒武纪信息科技有限公司 | 场景或物体的识别方法及相关产品 |
CN108959103A (zh) * | 2018-07-31 | 2018-12-07 | 西安电子科技大学 | 基于bwdsp库函数的软件测试方法 |
CN109947680A (zh) * | 2019-01-16 | 2019-06-28 | 佛山市顺德区中山大学研究院 | 一种基于dsp的软件运行速度优化方法 |
-
2019
- 2019-08-06 CN CN201910733625.1A patent/CN110489356B/zh active Active
-
2020
- 2020-07-20 WO PCT/CN2020/103047 patent/WO2021023000A1/zh active Application Filing
- 2020-07-20 KR KR1020217019945A patent/KR20210094629A/ko not_active Application Discontinuation
- 2020-07-20 JP JP2021535674A patent/JP2022514382A/ja active Pending
- 2020-08-03 TW TW109126147A patent/TWI782304B/zh active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20040034748A1 (en) * | 2002-08-13 | 2004-02-19 | Renesas Technology Corp. | Memory device containing arbiter performing arbitration for bus access right |
CN105589829A (zh) * | 2014-09-15 | 2016-05-18 | 华为技术有限公司 | 基于多核处理器芯片的数据处理方法、装置以及系统 |
CN104601711A (zh) * | 2015-01-27 | 2015-05-06 | 曙光云计算技术有限公司 | 用于云服务器的基于fpga的数据存储方法和系统 |
CN106339258A (zh) * | 2016-08-10 | 2017-01-18 | 西安诺瓦电子科技有限公司 | 可编程逻辑器件与微处理器共享内存的管理方法及装置 |
CN108920413A (zh) * | 2018-06-28 | 2018-11-30 | 中国人民解放军国防科技大学 | 面向gpdsp的卷积神经网络多核并行计算方法 |
CN110489356A (zh) * | 2019-08-06 | 2019-11-22 | 上海商汤智能科技有限公司 | 信息处理方法、装置、电子设备及存储介质 |
Also Published As
Publication number | Publication date |
---|---|
CN110489356A (zh) | 2019-11-22 |
TW202107288A (zh) | 2021-02-16 |
JP2022514382A (ja) | 2022-02-10 |
KR20210094629A (ko) | 2021-07-29 |
TWI782304B (zh) | 2022-11-01 |
CN110489356B (zh) | 2022-02-22 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7818503B2 (en) | Method and apparatus for memory utilization | |
US8266289B2 (en) | Concurrent data processing in a distributed system | |
US9639459B2 (en) | I/O latency and IOPs performance in thin provisioned volumes | |
WO2021023000A1 (zh) | 信息处理方法、装置、电子设备及存储介质 | |
US10116746B2 (en) | Data storage method and network interface card | |
US10235047B2 (en) | Memory management method, apparatus, and system | |
CN106161110A (zh) | 一种网络设备中的数据处理方法及系统 | |
US20210117333A1 (en) | Providing direct data access between accelerators and storage in a computing environment, wherein the direct data access is independent of host cpu and the host cpu transfers object map identifying object of the data | |
CN109240617A (zh) | 分布式存储系统写请求处理方法、装置、设备及存储介质 | |
CN104951239B (zh) | 高速缓存驱动器、主机总线适配器及其使用的方法 | |
CN113760560A (zh) | 一种进程间通信方法以及进程间通信装置 | |
US7660964B2 (en) | Windowing external block translations | |
WO2022062833A1 (zh) | 内存分配方法及相关设备 | |
WO2018119709A1 (zh) | 用于多操作系统的内存访问方法、装置和电子设备 | |
US20140149528A1 (en) | Mpi communication of gpu buffers | |
WO2018103022A1 (zh) | 帧缓存实现方法、装置、电子设备和计算机程序产品 | |
EP1557755A1 (en) | Method for transferring data in a multiprocessor system, multiprocessor system and processor carrying out this method. | |
CN113296691B (zh) | 数据处理系统、方法、装置以及电子设备 | |
CN109558250A (zh) | 一种基于fpga的通信方法、设备、主机及异构加速系统 | |
CN107209738A (zh) | 储存存储器直接访问 | |
US11609869B2 (en) | Systems, methods, and devices for time synchronized storage delivery | |
EP1839148A2 (en) | Transferring data between system and storage in a shared buffer | |
TWI530787B (zh) | 電子裝置以及資料寫入方法 | |
US20140143457A1 (en) | Determining a mapping mode for a dma data transfer | |
CN109992217A (zh) | 一种服务质量控制方法、装置、电子设备和存储介质 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 20850823 Country of ref document: EP Kind code of ref document: A1 |
|
ENP | Entry into the national phase |
Ref document number: 2021535674 Country of ref document: JP Kind code of ref document: A |
|
ENP | Entry into the national phase |
Ref document number: 20217019945 Country of ref document: KR Kind code of ref document: A |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20850823 Country of ref document: EP Kind code of ref document: A1 |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20850823 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 09.09.2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 20850823 Country of ref document: EP Kind code of ref document: A1 |