Convolution Data Loading via Cache Set Partitioning
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Conventional methods for accelerating convolution operations in AI algorithms using L1 cache often suffer from read-write conflicts, leading to inefficiencies due to cache hit miss tests requiring multiple cycles for data from different cache lines, resulting in reduced convolution operation efficiency.
Innovation Solution
A data loading method and apparatus that splits feature images into sub-feature images, determines target cache lines based on positional relationships, and loads data into these lines to ensure cache hit speed by placing adjacent sub-feature images in different cache sets, thereby reducing cache conflicts and improving data access efficiency.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Speed
If feature images are loaded into L1 cache for convolution operations, then data access speed is improved, but read-write conflicts occur reducing cache efficiency
Solution Approach 1:
The feature image is divided into multiple sub-feature images, each loaded into separate cache lines. This segmentation allows the cache to handle multiple data access requests in parallel, reducing read-write conflicts and improving both data access speed and convolution operation efficiency simultaneously
2Quantity of substance
If multiple cache lines are used for feature image data, then data capacity is increased, but cache hit miss tests require multiple cycles reducing efficiency
Solution Approach 1:
Multiple cache lines containing sub-feature image data are merged into a single cache set. This merging allows the cache to perform hit miss tests for all these cache lines simultaneously in one cycle, maintaining increased data capacity while eliminating the time loss from sequential testing
Data Source
AI summary
Disclosed are a data loading method and apparatus for a convolution operation, a computer device, a storage medium and a computer program product. The method includes: splitting a feature image to be loaded into the cache unit into a plurality of sub-feature images; determining a target cache line corresponding to each of the sub-feature images in each of the cache lines according to a positional relationship of each of the sub-feature images in the feature image; wherein target cache lines corresponding to at least two sub-feature images with the same positional relationship are located in the same cache set, and target cache lines corresponding to at least two sub-feature images with an adjacent positional relationship are located in different cache sets; loading a data content of each of the sub-feature images into the target cache line corresponding to each of the sub-feature images.


