Data processing method and device, medium, equipment and computer program product
By splitting the target feature map and performing inference calculations on multiple graphics cards in parallel, the problem of increasing inference delay in image or video generation is solved, achieving more efficient inference calculations and better user experience.
Patent Information
- Application Number
- CN202411998555.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-04-18
AI Technical Summary
During the image or video generation process, with the increase in image resolution and the increase in video scene sequence length, the inference time consumed significantly, resulting in an increase in inference delay.
By determining the target video storage required for the target feature map and splitting the target feature map based on the total number of graphics cards of multiple graphics cards, multiple sub-feature maps are formed. These sub-feature maps can be used for inference calculations in parallel to ensure the load balance of graphics cards and improve inference efficiency.
This method effectively improves the parallel inference efficiency of the target feature map, improves the accuracy and efficiency of the inference calculation of the target model, and improves the user experience.
Smart Images

Figure CN119847467A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of computer technology, and in particular, to a data processing method, apparatus, medium, device, and computer program product. Background Art
[0002] Diffusion models are widely used in scenarios where images and videos are generated from text. Currently, with the increase in image resolution and the increase in the length of video scene sequences, the time required for reasoning in the image or video generation process has increased significantly, resulting in increased reasoning latency. Summary of the invention
[0003] This summary is provided to introduce concepts in a brief form that will be described in detail in the detailed description below. This summary is not intended to identify key features or essential features of the claimed technical solution, nor is it intended to limit the scope of the claimed technical solution.
[0004] In a first aspect, the present disclosure provides a data processing method, the method comprising: Determining a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; Splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; Distributing the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation to obtain an inference result of each of the sub-feature graphs; The inference results of each of the sub-feature graphs are fused to obtain the inference result of the target feature graph.
[0005] In a second aspect, the present disclosure provides a data processing device, the device comprising: A determination module, used to determine a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; A splitting module, used for splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; A processing module, used for distributing the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation, and obtaining an inference result of each of the sub-feature graphs; The fusion module is used to fuse the inference results of each of the sub-feature graphs to obtain the inference result of the target feature graph.
[0006] In a third aspect, the present disclosure provides a computer-readable medium having a computer program stored thereon, which implements the steps of the method described in the first aspect when the computer program is executed by a processing device.
[0007] In a fourth aspect, the present disclosure provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in the first aspect.
[0008] In a fifth aspect, the present disclosure provides a computer program product, including a computer program, which implements the steps of the method described in the first aspect when executed by a processor.
[0009] In the above technical scheme, the target feature map is split by determining the target video memory required for the target feature map and the total number of graphics cards of multiple graphics cards, so that it can be split into multiple sub-feature maps. Then, parallel reasoning calculation of multiple sub-feature maps can be implemented based on multiple graphics cards, which ensures the load balancing of the graphics cards while effectively improving the parallel reasoning efficiency of the target feature map, thereby improving the reasoning calculation accuracy and efficiency of the target model and enhancing the user experience.
[0010] Other features and advantages of the present disclosure will be described in detail in the following detailed description. BRIEF DESCRIPTION OF THE DRAWINGS
[0011] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale. In the drawings: Figure 1 It is a flowchart of a data processing method provided according to an embodiment of the present disclosure.
[0012] Figure 2 It is a block diagram of a data processing device provided according to an embodiment of the present disclosure.
[0013] Figure 3 A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. DETAILED DESCRIPTION
[0014] Embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although certain embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be construed as being limited to the embodiments described herein, which are instead provided for a more thorough and complete understanding of the present disclosure. It should be understood that the drawings and embodiments of the present disclosure are only for exemplary purposes and are not intended to limit the scope of protection of the present disclosure.
[0015] It should be understood that the various steps described in the method embodiments of the present disclosure may be performed in different orders and / or in parallel. In addition, the method embodiments may include additional steps and / or omit the steps shown. The scope of the present disclosure is not limited in this respect.
[0016] The term "including" and its variations used herein are open inclusions, i.e., "including but not limited to". The term "based on" means "based at least in part on". The term "one embodiment" means "at least one embodiment"; the term "another embodiment" means "at least one additional embodiment"; the term "some embodiments" means "at least some embodiments". The relevant definitions of other terms will be given in the following description.
[0017] It should be noted that the concepts such as "first" and "second" mentioned in the present disclosure are only used to distinguish different devices, modules or units, and are not used to limit the order or interdependence of the functions performed by these devices, modules or units.
[0018] It should be noted that the modifications of "one" and "plurality" mentioned in the present disclosure are illustrative rather than restrictive, and those skilled in the art should understand that unless otherwise clearly indicated in the context, it should be understood as "one or more".
[0019] The names of the messages or information exchanged between multiple devices in the embodiments of the present disclosure are only used for illustrative purposes and are not used to limit the scope of these messages or information.
[0020] It is understandable that before using the technical solutions disclosed in the embodiments of the present disclosure, the types, scope of use, usage scenarios, etc. of the personal information involved in the present disclosure should be informed to the user and the user's authorization should be obtained in an appropriate manner in accordance with relevant laws and regulations.
[0021] For example, in response to receiving an active request from a user, a prompt message is sent to the user to clearly prompt the user that the operation requested to be performed will require obtaining and using the user's personal information. Thus, the user can autonomously choose whether to provide personal information to software or hardware such as an electronic device, application, server, or storage medium that performs the operation of the technical solution of the present disclosure according to the prompt message.
[0022] As an optional but non-limiting implementation, in response to receiving an active request from the user, the prompt information may be sent to the user in the form of a pop-up window, in which the prompt information may be presented in text form. In addition, the pop-up window may also carry a selection control for the user to choose "agree" or "disagree" to provide personal information to the electronic device.
[0023] It is understandable that the above notification and the process of obtaining user authorization are merely illustrative and do not constitute a limitation on the implementation of the present disclosure. Other methods that meet the relevant laws and regulations may also be applied to the implementation of the present disclosure.
[0024] At the same time, it is understandable that the data involved in this technical solution (including but not limited to the data itself, the acquisition or use of the data) shall comply with the requirements of relevant laws, regulations and relevant provisions.
[0025] Figure 1 As shown, it is a flow chart of a data processing method provided according to an embodiment of the present disclosure, as shown Figure 1 As shown, the method may include: In step 11, a target amount of video memory required for performing inference calculations on a target feature map based on a target model is determined, wherein the target model performs inference calculations based on multiple graphics cards.
[0026] Among them, the target feature map is the feature map that the target model needs to perform inference calculation. For example, in the diffusion model, the automatic generation of images or videos is usually achieved through three parts, such as a text encoding module, a denoising module, and a variational autoencoder VAE (Variational Autoencoder). Among them, the text encoding module can be implemented based on the encoder Encoder to encode the user input text. The denoising model can be implemented based on the U-Net or DiT (DiffusionTransformer) model to combine the features of the user input text and the noise image for denoising to obtain the corresponding feature map. Among them, U-Net is an architecture based on convolutional neural networks (CNN, Convolutional Neural Networks), and the DiT model is the application of Transformer in the diffusion model. VAE can perform inference calculation on the feature map to obtain the inference result of the feature map, and then perform post-processing based on the inference result to obtain the generated image or video.
[0027] As an example, the target model may be a variational autoencoder VAE, and the target feature map may be a feature map input into the model for inference calculation. In order to improve the efficiency of inference calculation of feature maps, multiple graphics cards may be used for parallel calculation. However, inference calculations for VAE are usually performed on a single card, resulting in a certain degree of waste of GPU resources. In this step, the target video memory required for inference calculation of the target feature map based on the target model may be determined first, and then the target feature map may be split according to the target video memory so that multiple graphics cards may perform load balancing during inference calculations.
[0028] In step 12, the target feature map is split based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature maps.
[0029] Among them, the total number of graphics cards of the multiple graphics cards can be determined based on the hardware and environment in which the target model is deployed, so that the target feature map can be split based on the total number of graphics cards so that each graphics card can process part of the feature map, ensuring balanced utilization of video memory, so as to improve the parallel efficiency of inference calculations.
[0030] In step 13, the multiple sub-feature graphs are distributed to multiple graphics cards for inference calculation to obtain the inference results of each sub-feature graph.
[0031] For example, when the target model is VAE, the target feature map may be a latent space feature map, and the inference result of the sub-feature map is a new feature map obtained by decoding the latent space feature map.
[0032] As an example, if the number of multiple sub-feature maps is the same as the total number of graphics cards in the multiple graphics cards, one sub-feature map can be distributed to each graphics card respectively, so that each graphics card only needs to perform inference calculations on the sub-feature map it receives to obtain the inference results of each sub-feature map.
[0033] As another example, if the number of sub-feature maps exceeds the total number of graphics cards, one sub-feature map can be distributed to each graphics card first. After each graphics card completes the inference calculation of the sub-feature map it receives, another sub-feature map is distributed to each graphics card until the inference result of each sub-feature map is obtained.
[0034] In step 14, the inference results of each sub-feature map are fused to obtain the inference result of the target feature map.
[0035] As an example, in this step, the inference results can be spliced according to the positions of their corresponding sub-feature maps in the target feature map to obtain the inference result of the target feature map.
[0036] In the above technical scheme, the target feature map is split by determining the target video memory required for the target feature map and the total number of graphics cards of multiple graphics cards, so that it can be split into multiple sub-feature maps. Then, parallel reasoning calculation of multiple sub-feature maps can be implemented based on multiple graphics cards, which ensures the load balancing of the graphics cards while effectively improving the parallel reasoning efficiency of the target feature map, thereby improving the reasoning calculation accuracy and efficiency of the target model and enhancing the user experience.
[0037] In some embodiments, the target video memory required for inference calculation of the target feature map based on the target model may include: inputting the target feature map into the target model for inference calculation, and counting the video memory occupancy during the inference calculation process, and using the counted video memory occupancy as the target video memory amount.
[0038] In some embodiments, determining the target amount of video memory required for performing inference calculation on the target feature map based on the target model may include: The size of the target feature map is scaled according to a preset scaling factor to obtain a scaled map corresponding to the target feature map.
[0039] In some embodiments, the scaling factor can be set based on the actual application scenario. Considering that directly performing model memory occupancy statistics based on the target feature map may cause memory overflow, the width and height of the target feature map are scaled based on the scaling factor. If the scaling factor is K, the width and height of the target feature map can be reduced by K times to obtain a scaled map.
[0040] Perform inference calculation on the zoomed graph based on the target model to obtain the amount of video memory required for the inference calculation on the zoomed graph.
[0041] For example, the zoomed image may be sent to the target model, and the video memory occupancy of the zoomed image during the inference calculation process may be counted, and the counted video memory occupancy may be used as the video memory amount required for the zoomed image.
[0042] The target video memory amount is determined based on the video memory amount corresponding to the zoom image, the model parameter amount of the target model and the zoom factor.
[0043] As an example, the target video memory amount may be determined based on the video memory amount corresponding to the zoom map, the model parameter amount of the target model, and the zoom factor in the following manner:
[0044] in, G total Used to indicate the target video memory amount; K used to represent the scaling factor; GrUsed to indicate the amount of video memory corresponding to the zoomed image; P A model parameter quantity used to represent the target model; BW The bit width used to represent the model parameters of the target model. If float16 half-precision reasoning is used during the reasoning calculation, the bit width is 2; if float32 precision reasoning is used during the reasoning calculation, the bit width is 4.
[0045] Therefore, through the above technical solution, the video memory occupancy statistics can be performed based on the zoom map of the target feature map, which can ensure the accuracy of the target video memory amount while improving the efficiency of determining the target video memory amount.
[0046] In some embodiments, splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs may include: The amount of sub-video memory required for a feature map obtained by evenly splitting the target feature map is determined according to the total number of graphics cards and the target video memory amount of the target feature map.
[0047] As an example, when splitting the target feature map, a non-overlapping manner can be used. For example, if the size information of the target feature map is H×W, that is, the height of the target feature map is H and the width is W. If it can be split according to the width, and the total number of graphics cards is N, then it can be split to obtain sub-feature maps with a height of H and a width of W / N, that is, each sub-feature map is directly split and tiling is performed in width according to the total number of graphics cards.
[0048] In this scenario, the target video memory of the target feature map can be directly evenly distributed based on the total number of graphics cards to determine the sub-video memory required for the feature map obtained by evenly splitting the target feature map. G total / N.
[0049] As an example, when splitting the target feature map, a non-overlapping manner can be used. For example, if the size information of the target feature map is H×W, that is, the height of the target feature map is H and the width is W. If it can be split according to the width, and the total number of graphics cards is N, then a feature map with a height of H and a width of W / N can be obtained, that is, each sub-feature map is directly split and tiling is performed in width according to the total number of graphics cards.
[0050] In this scenario, the target video memory of the target feature map can be directly evenly distributed based on the total number of graphics cards to determine the sub-video memory required for the feature map obtained by evenly splitting the target feature map. G total / N.
[0051] As another example, there are overlapping parts between adjacent sub-feature maps obtained by splitting the target feature map along the splitting direction. As shown above, the target feature map is split along the width direction, and the adjacent feature maps obtained by splitting contain overlapping parts, and the overlapping parts can be pixel areas widened to both sides in the splitting direction. If the overlapping part is tiling along the width direction during splitting, and L pixels are widened to both sides in the width direction, then in this scenario, a feature map with a height of H and a width of W / N+2L can be split.
[0052] Accordingly, the step of determining the amount of sub-graphics memory required for a feature map obtained by evenly splitting the target feature map according to the total number of graphics cards and the target amount of graphics memory of the target feature map includes: Based on the target video memory and the total number of graphics cards, a first video memory required for the non-overlapping portion of the sub-feature graph is determined. The first video memory can be expressed as G total / N.
[0053] Based on the target video memory amount and the overlap ratio between the overlapped portion and the target feature map, a second video memory amount required for the overlapped portion is determined.
[0054] As an example, the second video memory amount required for the overlapping portion may be determined based on the target video memory amount and the overlap ratio between the overlapping portion and the target feature map in the following manner:
[0055] in, G o Used to indicate the amount of the second video memory; 2× L Used to represent the number of pixels in the overlapping part along the splitting direction; Q Used to represent the total number of pixels along the splitting direction in the target feature map; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
[0056] The target video memory includes the video memory required for the feature values of the target feature map and the model parameters of the target model. The video memory occupancy required for the eigenvalues of the target feature map can be represented. Therefore, based on the ratio between the pixels of the overlapping part and the pixels of the target feature map, based on the video memory occupancy required for the eigenvalues of the target feature map for inference calculation, the second video memory required for the overlapping part can be determined, the efficiency and accuracy of the calculation of the second video memory can be improved, and effective data support can be provided for the subsequent splitting of the target feature map.
[0057] The sum of the first video memory amount and the second video memory amount is determined as the sub-video memory amount.
[0058] In this scenario, the sub-graphics memory can be expressed as G total / N+ G o Thus, the amount of sub-graphics memory required for the feature graph obtained by evenly splitting the target feature graph once can be determined. Afterwards, the target feature graph can be split based on the amount of sub-graphics memory and the amount of graphics memory of the graphics card to obtain the sub-feature graph.
[0059] Among them, by comparing the sub-graphics memory and the graphics card's graphics memory, it can be determined that the feature map obtained by average splitting the target feature map can be directly inferred and calculated in a single graphics card, thereby realizing the splitting of the target feature map to obtain the corresponding sub-feature map, which ensures the load balancing of multiple graphics cards while effectively improving the resource utilization of the graphics cards and the efficiency of the target feature map reasoning calculation.
[0060] In some embodiments, splitting the target feature map based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature map may include: If the amount of the sub-graphics memory is smaller than the amount of the graphics card's graphics memory, the target feature map is split according to the total number of graphics cards and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of graphics cards.
[0061] If the amount of sub-graphics memory is smaller than the amount of graphics memory of the graphics card, it means that the feature maps obtained by directly splitting the target feature map can all complete the inference calculation on a single graphics card. In this case, the target feature map can be directly split evenly according to the total number of graphics cards and the size of the target feature map.
[0062] As an example, if the sub-feature maps do not overlap, they can be split in the width direction or the height direction. For example, if they are split in the width direction, the target feature map can be evenly divided into N parts in the width direction to obtain N sub-feature maps with a height of H and a width of W / N.
[0063] As an example, if there is overlap in the sub-feature maps, they can be split in the width direction first, such as the target feature map can be evenly divided into N parts in the width direction, and further for each sub-feature map, the target feature map is widened by L pixels to the left and right sides along the width direction, and N sub-feature maps with a height of H and a width of W / N+2L can be obtained. If the sub-feature map is located at the edge of the target feature map, it can be processed according to the overlap segmentation method commonly used in the art, which is not limited here.
[0064] The above splitting method is for illustrative purposes only and does not limit the present disclosure. For example, the splitting may also be performed in the height direction.
[0065] Therefore, through the above technical scheme, the target feature map can be directly divided to obtain multiple sub-feature maps, and the target feature map can be quickly divided. By evenly splitting the target feature map, the load balancing of different graphics cards is ensured, and support is provided for the subsequent parallel processing of multiple sub-feature maps based on multiple graphics cards, thereby improving the parallel processing efficiency of reasoning on the target feature map.
[0066] In some embodiments, splitting the target feature map based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature map may include: If the sub-graphics memory is greater than or equal to the graphics memory of the graphics card, the splitting ratio of the sub-feature graphs that can be used for inference calculation by each of the graphics cards is determined.
[0067] If the sub-graphics memory is greater than or equal to the graphics card's graphics memory, it means that the graphics memory required to directly split the target feature map is also large, and the inference calculation cannot be completed on a single graphics card. In this scenario, the maximum possible sub-feature map ratio that can be calculated by a single graphics card can be determined based on the graphics card's graphics memory, that is, the split ratio.
[0068] As an example, determining the splitting ratio of the sub-feature graphs that can be used for inference calculation by each graphics card includes:
[0069] in, p r Used to indicate the split ratio; G Used to indicate the amount of video memory of the graphics card; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
[0070] Afterwards, the target feature map may be split based on the split ratio and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of the graphics cards.
[0071] As an example, if the sub-feature maps do not overlap, they can be split in width or height. For example, if they are split in width, the target feature map can be split into N sub-feature maps with a width of W× p r , a sub-feature map with a height of H.
[0072] As an example, if there is overlap in the sub-feature maps, they can be split in the width direction first. For example, the target feature map can be split into N sub-feature maps with a width of W× p r , a sub-feature map with a height of H. Further, for each sub-feature map, the target feature map is widened by L pixels to the left and right sides along the width direction, and N sub-feature maps with a height of H and a width of W× p r The specific implementation of segmentation is the same as above and will not be repeated here.
[0073] Afterwards, the remaining feature map after splitting the target feature map into the multiple sub-feature maps is determined, and the amount of video memory required for the remaining feature map is determined based on the split ratio.
[0074] Among them, the above steps split N widths of W× p r The sub-feature map of the target feature map can be used as the remaining feature map after the N sub-feature maps are subtracted from the target feature map. For example, the feature map with a height of H and a width of W×(1- p r ×N) feature map as the remaining feature map. Accordingly, the amount of display memory of the remaining feature map can be determined in the same way, such as the amount of display memory of the remaining feature map Gs It can be expressed as G total × (1- p r × N).
[0075] Furthermore, the remaining feature map can be used as a new target feature map, and the amount of video memory required for the remaining feature map can be used as a new target video memory. The step of returning to the target video memory based on the total number of graphics cards and the target feature map to determine the amount of sub-video memory required for the feature map obtained by evenly splitting the target feature map is performed.
[0076] As an example, the remaining feature maps can be used as new target feature maps to split the remaining feature maps again. For example, the remaining feature maps can be evenly split based on the total number of graphics cards to obtain the required sub-graphics memory of the feature maps. The calculation process has been described in detail above and will not be repeated here, until the sub-graphics memory required for each split feature map is less than the graphics memory of the graphics card.
[0077] As an example, the height of the sub-feature map split in the first splitting round is H and the width is W× p r In the second split round, the split ratio is calculated by the above method: p r ’ , the height of the sub-feature map split in the second splitting round is H, and the width is W×(1- p r ×N)× p r ’ If the amount of sub-graphics memory required for the feature map evenly split in the third splitting round is less than the amount of graphics memory of the graphics card, the remaining feature maps in the third splitting round are split based on the total number of graphics cards. The height of the sub-feature maps split in the third splitting round is H and the width is (WW× p r ×N-W×(1- p r ×N)× p r ’ ) / N.
[0078] In this embodiment, the sub-feature graphs can be distributed to each graphics card in sequence according to the splitting rounds of the sub-feature graphs. For example, the N sub-feature graphs split out in the first splitting round are first distributed to the N graphics cards. After each graphics card completes the inference calculation of the received sub-feature graphs, the N sub-feature graphs split out in the second splitting round can be distributed to the N graphics cards, and so on, until the inference calculation of each split sub-feature graph is completed.
[0079] Therefore, through the above technical solution, the target feature map can be split into multiple rounds to split the target feature map into multiple sub-feature maps with an average amount of required video memory, so that the load between different graphics cards is relatively balanced when they are subsequently distributed to multiple graphics cards. This can not only improve the resource utilization of the graphics cards, but also improve the efficiency of parallel reasoning of the graphics cards, save the time required for the target model to perform inference calculations on the target feature map, reduce user waiting time, and improve user experience.
[0080] In some embodiments, if there are overlapping parts in the sub-feature maps, fusing the inference results of the sub-feature maps to obtain the inference result of the target feature map may include: The overlapping parts of the inference results corresponding to the sub-feature graphs are deleted to obtain the target inference results of the sub-feature graphs.
[0081] As an example, for the inference result of each sub-feature map, L pixels are cropped from the left and right sides in the splitting direction according to the pixel values of the overlapping part, so as to obtain the target inference result of the sub-feature map.
[0082] For example, for a width of W× p r The inference result of the sub-feature map of +2L is to crop L pixels from the leftmost side in the width direction and crop L pixels from the rightmost side to obtain a width of W× p r The target reasoning result.
[0083] The target inference results of each of the sub-feature graphs are fused to obtain the inference result of the target feature graph.
[0084] In this step, the target inference result can be spliced according to the position of its corresponding sub-feature map in the target feature map to obtain the inference result of the target feature map.
[0085] Therefore, through the above technical scheme, the sub-feature map contains overlapping parts, which can make the accuracy of the edge position data in the inference results of different sub-feature maps, and can guarantee the continuity and accuracy of the features between adjacent sub-feature maps to a certain extent. The overlapping parts are deleted during fusion to ensure the accuracy of the inference results of the target feature map obtained, avoid the redundant information contained therein, and provide effective data support for subsequent post-processing to obtain the corresponding images and videos.
[0086] Based on the same inventive concept, the present disclosure also provides a data processing device, such as Figure 2 As shown, the device 10 comprises: A determination module 100 is used to determine a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; A splitting module 200 is used to split the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; The processing module 300 is used to distribute the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation to obtain an inference result of each of the sub-feature graphs; The fusion module 400 is used to fuse the inference results of each of the sub-feature graphs to obtain the inference result of the target feature graph.
[0087] Optionally, the determining module includes: A first processing submodule is used to scale the size of the target feature map according to a preset scaling factor to obtain a scaled map corresponding to the target feature map; A second processing submodule is used to perform inference calculation on the zoomed image based on the target model to obtain the amount of video memory required for the inference calculation on the zoomed image; The first determination submodule is used to determine the target video memory based on the video memory corresponding to the zoom image, the model parameter amount of the target model and the zoom factor.
[0088] Optionally, the first determination submodule determines the target video memory amount based on the video memory amount corresponding to the zoom image, the model parameter amount of the target model and the zoom factor in the following manner:
[0089] in, G total Used to indicate the target video memory amount; K used to represent the scaling factor; Gr Used to indicate the amount of video memory corresponding to the zoomed image; P A model parameter quantity used to represent the target model; BW The bit width used to represent the model parameters of the target model.
[0090] Optionally, the splitting module includes: A second determination submodule is used to determine the amount of sub-graphics memory required for a feature map obtained by evenly splitting the target feature map according to the total number of graphics cards and the target graphics memory amount of the target feature map; The first splitting submodule is used to split the target feature map based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature map.
[0091] Optionally, the first splitting submodule includes: The second splitting submodule is used to split the target feature map according to the total number of graphics cards and the size of the target feature map to obtain multiple sub-feature maps if the sub-graphics memory is less than the graphics memory of the graphics card, wherein the number of the sub-feature maps is the same as the total number of graphics cards.
[0092] Optionally, the first splitting submodule includes: A third determination submodule is used to determine the splitting ratio of the sub-feature graphs that can be used for inference calculation by each graphics card if the sub-graphics memory is greater than or equal to the graphics memory of the graphics card; A third splitting submodule is used to split the target feature map based on the splitting ratio and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of the graphics cards; The fourth determination submodule is used to determine the remaining feature map after splitting the target feature map into the multiple sub-feature maps, and determine the amount of video memory required for the remaining feature map based on the split ratio; use the remaining feature map as a new target feature map, and use the amount of video memory required for the remaining feature map as a new target video memory, triggering the second determination submodule to determine the amount of sub-video memory required for the feature map obtained by evenly splitting the target feature map based on the total number of graphics cards and the target video memory of the target feature map.
[0093] Optionally, the third determining submodule determines the splitting ratio of the sub-feature graphs that can be used for inference calculation by each of the graphics cards in the following manner:
[0094] in, p r Used to indicate the split ratio; G Used to indicate the amount of video memory of the graphics card; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
[0095] Optionally, there are overlapping parts between adjacent sub-feature graphs obtained by splitting the target feature graph along the splitting direction; The second determining submodule includes: a fifth determination submodule, configured to determine a first video memory amount required for a non-overlapping portion in the sub-feature graph based on the target video memory amount and the total number of the graphics cards; a sixth determination submodule, configured to determine a second video memory amount required for the overlapping portion based on the target video memory amount and an overlap ratio between the overlapping portion and the target feature map; The seventh determining submodule is configured to determine the sum of the first video memory amount and the second video memory amount as the sub-video memory amount.
[0096] Optionally, the sixth determination submodule determines the amount of second video memory required for the overlapping portion based on the target video memory amount and an overlap ratio between the overlapping portion and the target feature map in the following manner:
[0097] in, G o Used to indicate the amount of the second video memory; 2× L Used to represent the number of pixels in the overlapping part along the splitting direction; Q Used to represent the total number of pixels along the splitting direction in the target feature map; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
[0098] Optionally, the fusion module includes: A third processing submodule is used to delete the overlapping parts of the inference results corresponding to the sub-feature graphs to obtain the target inference results of the sub-feature graphs; The fusion submodule is used to fuse the target inference results of each of the sub-feature graphs to obtain the inference result of the target feature graph.
[0099] Optionally, the target model is a variational autoencoder.
[0100] Reference below Figure 3 , which shows a schematic diagram of the structure of an electronic device (such as a terminal device or a server) 600 suitable for implementing the embodiment of the present disclosure. The terminal device in the embodiment of the present disclosure may include but is not limited to mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc. Figure 3 The electronic device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0101] like Figure 3 As shown, the electronic device 600 may include a processing device (e.g., a central processing unit, a graphics processing unit, etc.) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage device 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the electronic device 600 are also stored. The processing device 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.
[0102] Typically, the following devices may be connected to the I / O interface 605: an input device 606 including, for example, a touch screen, a touch pad, a keyboard, a mouse, a camera, a microphone, an accelerometer, a gyroscope, etc.; an output device 607 including, for example, a liquid crystal display (LCD), a speaker, a vibrator, etc.; a storage device 608 including, for example, a magnetic tape, a hard disk, etc.; and a communication device 609. The communication device 609 may allow the electronic device 600 to communicate with other devices wirelessly or by wire to exchange data. Although Figure 3 The electronic device 600 is shown with various devices, but it should be understood that it is not required to implement or possess all the devices shown. More or fewer devices may be implemented or possessed instead.
[0103] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device 609, or installed from a storage device 608, or installed from a ROM 602. When the computer program is executed by the processing device 601, the above-mentioned functions defined in the method of the embodiment of the present disclosure are executed.
[0104] It should be noted that the computer-readable medium mentioned above in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to an electromagnetic signal, an optical signal, or any suitable combination of the above. Computer readable signal media may also be any computer readable medium other than computer readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer readable medium may be transmitted using any appropriate medium, including but not limited to: wires, optical cables, RF (radio frequency), etc., or any suitable combination of the above.
[0105] In some embodiments, the client and the server may communicate using any currently known or future developed network protocol such as HTTP (HyperText Transfer Protocol), and may be interconnected with any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include a local area network ("LAN"), a wide area network ("WAN"), an internet (e.g., the Internet), and a peer-to-peer network (e.g., an ad hoc peer-to-peer network), as well as any currently known or future developed network.
[0106] The computer-readable medium may be included in the electronic device, or may exist independently without being incorporated into the electronic device.
[0107] The computer-readable medium carries one or more programs. When the one or more programs are executed by the electronic device, the electronic device: determines the target video memory required for inference calculation of the target feature map based on the target model, wherein the target model is inference calculated based on multiple graphics cards; splits the target feature map based on the target video memory and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature maps; distributes the multiple sub-feature maps to the multiple graphics cards for inference calculation to obtain the inference result of each sub-feature map; and fuses the inference results of each sub-feature map to obtain the inference result of the target feature map.
[0108] Computer program code for performing the operations of the present disclosure may be written in one or more programming languages or a combination thereof, including, but not limited to, object-oriented programming languages, such as Java, Smalltalk, C++, and conventional procedural programming languages, such as "C" or similar programming languages. The program code may be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computer (e.g., through the Internet using an Internet service provider).
[0109] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present disclosure. In this regard, each square box in the flow chart or block diagram can represent a module, a program segment or a part of a code, and the module, the program segment or a part of the code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some implementations as replacements, the functions marked in the square box can also occur in a sequence different from that marked in the accompanying drawings. For example, two square boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each square box in the block diagram and / or flow chart, and the combination of the square boxes in the block diagram and / or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0110] The modules involved in the embodiments described in the present disclosure may be implemented by software or hardware. The name of the module does not limit the module itself in some cases. For example, the determination module may also be described as "a module for determining the target amount of video memory required for inference calculation of the target feature map based on the target model".
[0111] The functions described above herein may be performed at least in part by one or more hardware logic components. For example, without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), complex programmable logic devices (CPLDs), and the like.
[0112] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or device, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0113] According to one or more embodiments of the present disclosure, Example 1 provides a data processing method, wherein the method includes: Determining a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; Splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; Distributing the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation to obtain an inference result of each of the sub-feature graphs; The inference results of each of the sub-feature graphs are fused to obtain the inference result of the target feature graph.
[0114] According to one or more embodiments of the present disclosure, Example 2 provides the method of Example 1, wherein determining the target amount of video memory required for performing inference calculation on the target feature map based on the target model includes: Scaling the size of the target feature map according to a preset scaling factor to obtain a scaled map corresponding to the target feature map; Performing inference calculation on the zoomed graph based on the target model to obtain the amount of video memory required for the inference calculation on the zoomed graph; The target video memory amount is determined based on the video memory amount corresponding to the zoom image, the model parameter amount of the target model and the zoom factor.
[0115] According to one or more embodiments of the present disclosure, Example 3 provides the method of Example 2, wherein the target video memory amount is determined based on the video memory amount corresponding to the zoom map, the model parameter amount of the target model, and the zoom factor in the following manner:
[0116] in, G total Used to indicate the target video memory amount; K used to represent the scaling factor; Gr Used to indicate the amount of video memory corresponding to the zoomed image; P A model parameter quantity used to represent the target model; BW The bit width used to represent the model parameters of the target model.
[0117] According to one or more embodiments of the present disclosure, Example 4 provides the method of Example 1, wherein the step of splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs includes: Determining the amount of sub-graphics memory required for a feature map obtained by evenly splitting the target feature map according to the total number of graphics cards and the target graphics memory amount of the target feature map; The target feature map is split based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature map.
[0118] According to one or more embodiments of the present disclosure, Example 5 provides the method of Example 4, wherein the step of splitting the target feature map based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature map includes: If the amount of the sub-graphics memory is smaller than the amount of the graphics card's graphics memory, the target feature map is split according to the total number of graphics cards and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of graphics cards.
[0119] According to one or more embodiments of the present disclosure, Example 6 provides the method of Example 4, wherein the step of splitting the target feature map based on the sub-graphics memory amount and the graphics memory amount of the graphics card to obtain the sub-feature map includes: If the sub-graphics memory is greater than or equal to the graphics memory of the graphics card, determine the splitting ratio of the sub-feature graphs that can be used for inference calculation by each of the graphics cards; Splitting the target feature map based on the splitting ratio and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of the graphics cards; Determine a remaining feature map after splitting the target feature map into the plurality of sub-feature maps, and determine an amount of video memory required for the remaining feature map based on the split ratio; The remaining feature map is used as a new target feature map, the amount of video memory required for the remaining feature map is used as a new target video memory, and the step of returning to determine the amount of sub-video memory required for the feature map obtained by evenly splitting the target feature map based on the total number of graphics cards and the target video memory of the target feature map is returned.
[0120] According to one or more embodiments of the present disclosure, Example 7 provides the method of Example 6, wherein determining the split ratio of the sub-feature graphs that can be used for inference calculation by each graphics card includes:
[0121] in, p r Used to indicate the split ratio; G Used to indicate the amount of video memory of the graphics card; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
[0122] According to one or more embodiments of the present disclosure, Example 8 provides the method of Example 4, wherein there are overlapping parts between adjacent sub-feature maps obtained by splitting the target feature map along the splitting direction; The step of determining the amount of sub-graphics memory required for a feature map obtained by evenly splitting the target feature map according to the total number of graphics cards and the target graphics memory amount of the target feature map includes: Determine a first video memory amount required for the non-overlapping portion in the sub-feature graph based on the target video memory amount and the total number of the graphics cards; Determining a second video memory amount required for the overlapping portion based on the target video memory amount and an overlap ratio between the overlapping portion and the target feature map; The sum of the first video memory amount and the second video memory amount is determined as the sub-video memory amount.
[0123] According to one or more embodiments of the present disclosure, Example 9 provides the method of Example 8, wherein determining the second video memory required for the overlapping portion based on the target video memory amount and the overlap ratio between the overlapping portion and the target feature map includes:
[0124] in, G o Used to indicate the amount of the second video memory; 2× L Used to represent the number of pixels in the overlapping part along the splitting direction; Q Used to represent the total number of pixels along the splitting direction in the target feature map; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
[0125] According to one or more embodiments of the present disclosure, Example 10 provides the method of Example 8, wherein the fusing the inference results of each of the sub-feature graphs to obtain the inference result of the target feature graph includes: Deleting overlapping parts of the inference results corresponding to the sub-feature graphs to obtain target inference results of the sub-feature graphs; The target inference results of each of the sub-feature graphs are fused to obtain the inference result of the target feature graph.
[0126] According to one or more embodiments of the present disclosure, Example 11 provides the method of Example 1, wherein the target model is a variational autoencoder.
[0127] According to one or more embodiments of the present disclosure, Example 12 provides a data processing device, the device comprising: A determination module, used to determine a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; A splitting module, used for splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; A processing module, used for distributing the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation, and obtaining an inference result of each of the sub-feature graphs; The fusion module is used to fuse the inference results of each of the sub-feature graphs to obtain the inference result of the target feature graph.
[0128] According to one or more embodiments of the present disclosure, Example 12 provides a computer-readable medium having a computer program stored thereon, which implements the steps of any of the methods described in Examples 1-11 when executed by a processing device.
[0129] According to one or more embodiments of the present disclosure, Example 14 provides an electronic device, including: a storage device having a computer program stored thereon; A processing device is used to execute the computer program in the storage device to implement the steps of the method described in any one of Examples 1-11.
[0130] According to one or more embodiments of the present disclosure, Example 15 provides a computer program product, including a computer program, which implements the steps of any one of the methods of Examples 1-11 when executed by a processor.
[0131] The above description is only a preferred embodiment of the present disclosure and an explanation of the technical principles used. Those skilled in the art should understand that the scope of disclosure involved in the present disclosure is not limited to the technical solutions formed by a specific combination of the above technical features, but should also cover other technical solutions formed by any combination of the above technical features or their equivalent features without departing from the above disclosed concept. For example, the above features are replaced with the technical features with similar functions disclosed in the present disclosure (but not limited to) by each other to form a technical solution.
[0132] In addition, although each operation is described in a specific order, this should not be understood as requiring these operations to be performed in the specific order shown or in a sequential order. Under certain circumstances, multitasking and parallel processing may be advantageous. Similarly, although some specific implementation details are included in the above discussion, these should not be interpreted as limiting the scope of the present disclosure. Some features described in the context of a separate embodiment can also be implemented in a single embodiment in combination. On the contrary, the various features described in the context of a single embodiment can also be implemented in multiple embodiments individually or in any suitable sub-combination mode.
[0133] Although the subject matter has been described in language specific to structural features and / or method logic actions, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. On the contrary, the specific features and actions described above are merely example forms of implementing the claims. Regarding the device in the above embodiment, the specific manner in which each module performs the operation has been described in detail in the embodiment related to the method, and will not be elaborated here.
Claims
1. A data processing method, characterized in that: The method comprises: Determining a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; Splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; Distributing the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation to obtain an inference result of each of the sub-feature graphs; The inference results of each of the sub-feature graphs are fused to obtain the inference result of the target feature graph.
2. The method according to claim 1, characterized in that The determining of the target amount of video memory required for performing inference calculation on the target feature map based on the target model includes: Scaling the size of the target feature map according to a preset scaling factor to obtain a scaled map corresponding to the target feature map; Performing inference calculation on the zoomed graph based on the target model to obtain the amount of video memory required for the inference calculation on the zoomed graph; The target video memory amount is determined based on the video memory amount corresponding to the zoom image, the model parameter amount of the target model and the zoom factor.
3. The method according to claim 2, characterized in that The target video memory amount is determined based on the video memory amount corresponding to the zoom image, the model parameter amount of the target model and the zoom factor in the following manner: in, G total Used to indicate the target video memory amount; K used to represent the scaling factor; Gr Used to indicate the amount of video memory corresponding to the zoomed image; P A model parameter quantity used to represent the target model; BW The bit width used to represent the model parameters of the target model.
4. The method according to claim 1, characterized in that The step of splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs includes: Determining the amount of sub-graphics memory required for a feature map obtained by evenly splitting the target feature map according to the total number of graphics cards and the target graphics memory amount of the target feature map; The target feature map is split based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature map.
5. The method according to claim 4, characterized in that The step of splitting the target feature graph based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature graph includes: If the amount of the sub-graphics memory is smaller than the amount of the graphics card's graphics memory, the target feature map is split according to the total number of graphics cards and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of graphics cards.
6. The method according to claim 4, characterized in that The step of splitting the target feature graph based on the sub-graphics memory and the graphics memory of the graphics card to obtain the sub-feature graph includes: If the sub-graphics memory is greater than or equal to the graphics memory of the graphics card, determine the splitting ratio of the sub-feature graphs that can be used for inference calculation by each of the graphics cards; Splitting the target feature map based on the splitting ratio and the size of the target feature map to obtain a plurality of sub-feature maps, wherein the number of the sub-feature maps is the same as the total number of the graphics cards; Determine a remaining feature map after splitting the target feature map into the plurality of sub-feature maps, and determine an amount of video memory required for the remaining feature map based on the split ratio; The remaining feature map is used as a new target feature map, the amount of video memory required for the remaining feature map is used as a new target video memory, and the step of returning to determine the amount of sub-video memory required for the feature map obtained by evenly splitting the target feature map based on the total number of graphics cards and the target video memory of the target feature map is returned.
7. The method according to claim 6, characterized in that The determining of the splitting ratio of the sub-feature graphs that can be used for inference calculation by each graphics card includes: in, p r Used to indicate the split ratio; G Used to indicate the amount of video memory of the graphics card; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
8. The method according to claim 4, characterized in that There are overlapping parts between adjacent sub-feature graphs obtained by splitting the target feature graph along the splitting direction; The step of determining the amount of sub-graphics memory required for a feature map obtained by evenly splitting the target feature map according to the total number of graphics cards and the target graphics memory amount of the target feature map includes: Determine a first video memory amount required for the non-overlapping portion in the sub-feature graph based on the target video memory amount and the total number of the graphics cards; Determining a second video memory amount required for the overlapping portion based on the target video memory amount and an overlap ratio between the overlapping portion and the target feature map; The sum of the first video memory amount and the second video memory amount is determined as the sub-video memory amount.
9. The method according to claim 8, characterized in that The determining, based on the target video memory amount and the overlap ratio between the overlapped portion and the target feature map, the second video memory amount required for the overlapped portion includes: in, G o Used to indicate the amount of the second video memory; 2× L Used to represent the number of pixels in the overlapping part along the splitting direction; Q Used to represent the total number of pixels along the splitting direction in the target feature map; P A model parameter quantity used to represent the target model; BW is used to represent the bit width of the model parameters of the target model; G total Used to indicate the target video memory amount.
10. The method according to claim 8, characterized in that The fusing the inference results of the sub-feature graphs to obtain the inference result of the target feature graph includes: Deleting overlapping parts of the inference results corresponding to the sub-feature graphs to obtain target inference results of the sub-feature graphs; The target inference results of each of the sub-feature graphs are fused to obtain the inference result of the target feature graph.
11. The method according to claim 1, characterized in that The target model is a variational autoencoder.
12. A data processing device, characterized in that: The device comprises: A determination module, used to determine a target amount of video memory required for performing inference calculations on a target feature map based on a target model, wherein the target model performs inference calculations based on multiple graphics cards; A splitting module, used for splitting the target feature graph based on the target video memory amount and the total number of graphics cards of the multiple graphics cards to obtain multiple sub-feature graphs; A processing module, used for distributing the plurality of sub-feature graphs to the plurality of graphics cards for inference calculation, and obtaining an inference result of each of the sub-feature graphs; The fusion module is used to fuse the inference results of each of the sub-feature graphs to obtain the inference result of the target feature graph.
13. A computer readable medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processing device, the steps of the method according to any one of claims 1 to 11 are implemented.
14. An electronic device, characterized in that: include: a storage device having a computer program stored thereon; A processing device, configured to execute the computer program in the storage device to implement the steps of the method according to any one of claims 1 to 11.
15. A computer program product comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 11 are implemented.