Transformer Latency Prediction for DNN Source Code Feedback
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing software development tools lack efficient methods for providing instant feedback on the computational complexity of program code, particularly for Deep Neural Networks (DNNs), which is crucial for manual and automatic design of efficient DNNs.
Innovation Solution
A system utilizing a transformer-encoder to translate source code into latency predictions, combined with a Graph Convolutional Network (GCN) to estimate DNN latency directly from its source code representation, without requiring explicit graph representations or additional effort for new layer types.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If traditional code analysis methods are used, then code can be analyzed without execution, but instant feedback on computational complexity is not provided
Solution Approach 1:
The patent replaces traditional mechanical code execution and analysis with a deep learning-based prediction system. The transformer-encoder model processes source code and directly predicts latency, eliminating the need for actual code execution to obtain performance metrics, thus providing instant feedback without time loss
Solution Approach 2:
The system creates a virtual copy of the code's computational behavior through the trained transformer model. Instead of executing the actual code to measure latency, the model predicts latency based on code representations, providing immediate feedback while maintaining accuracy
2Ease of manufacture
If DNN latency prediction is performed without explicit graph representations, then additional effort for new layer types is avoided, but prediction accuracy must be maintained
Solution Approach 1:
The transformer-encoder model is designed with universal capability to handle various DNN layer types without requiring explicit graph representations. The model processes code representations and automatically adapts to new layer types through its learned patterns, maintaining prediction accuracy across different architectural components
Solution Approach 2:
The system changes the approach from graph-based parameters to code-based parameters for latency prediction. By processing source code representations directly through the transformer model, the system adapts to new layer types through parameter learning rather than structural modification, maintaining accuracy while improving adaptability
Data Source
AI summary
A system comprising a latency predictor which is configured to translate the output of a transformer-encoder into a latency prediction for a code segment of a source code.


