Algorithm Graph Rewriting to Reduce CPU-GPU Data Copying
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing data processing methods require frequent switching between CPU and GPU, leading to significant computing and memory overheads due to multiple data copies, which affects processing efficiency.
Innovation Solution
A data processing method that involves obtaining an algorithm directed graph, re-editing algorithms meeting specific conditions to support GPU execution, and invoking processors accordingly to minimize data copying by executing algorithms on the GPU where possible.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Productivity
If data is copied multiple times between CPU and GPU during algorithm execution, then the task can be completed using both processors, but the computing and memory overheads increase significantly
Solution Approach 1:
The algorithm directed graph is segmented into CPU-executable nodes and GPU-executable nodes based on computational characteristics. This segmentation allows each processor type to handle tasks最适合其 capabilities, reducing unnecessary data copying between processors and optimizing the balance between processing efficiency and resource overhead.
Solution Approach 2:
Different algorithms within the directed graph are assigned to different processors based on their specific computational requirements. GPU-accelerated algorithms are identified and rewritten to run on GPU, while others remain on CPU. This local optimization reduces the frequency of CPU-GPU switching and associated data copying overheads.
2Loss of energy
If algorithms are rewritten to execute on GPU, then data copying between CPU and GPU is reduced, but the complexity of algorithm processing increases
Solution Approach 1:
The system performs preliminary analysis of the algorithm directed graph to identify which algorithms are suitable for GPU execution. Algorithms meeting specific conditions are pre-rewritten and marked for GPU execution before the actual task processing begins. This preliminary preparation reduces the complexity burden during runtime by establishing the execution plan in advance.
Solution Approach 2:
The patent introduces an intermediary mechanism that automatically identifies and rewrites algorithms suitable for GPU execution. This intermediary layer handles the complexity of determining which algorithms to rewrite and how to rewrite them, shielding the user from the complexity while enabling optimized GPU execution.
Data Source
AI summary
Embodiments of the present disclosure disclose a data processing method and apparatus, a device, and a storage medium. The method includes: obtaining an algorithm directed graph corresponding to a target task, where the algorithm directed graph includes a plurality of algorithm nodes, and one algorithm node corresponds to one processing algorithm; re-editing a processing algorithm that meets a set condition, to obtain a rewritten processing algorithm; and invoking a first processor to execute a processing algorithm that is not re-edited, and invoking a second processor to execute the rewritten processing algorithm, according to an execution sequence of the algorithm directed graph.


