Multi-Architecture Co-Processor Code Compilation
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Modern computer systems face long compile times for co-processor enabled application programs due to increased complexity, leading to unacceptably protracted start-up times and lack of forward compatibility with new GPU architectures.
Innovation Solution
A method is introduced that compiles and links device source code into virtual assembly code, which is then translated into machine code for specific co-processor architectures, allowing the application program to store both forms within the application and use a driver to select the appropriate code for execution, ensuring compatibility with multiple architectures without recompilation.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Loss of time
If pre-compiled GPU machine code is incorporated into the application program as a code bundle, then application start-up time is reduced, but forward compatibility with new GPU architectures is lost
Solution Approach 1:
The patent divides the code into two segments: a code bundle containing pre-compiled machine code for known GPU architectures, and a just-in-time (JIT) compilation component for handling new architectures. This segmentation allows the system to use pre-compiled code for supported GPUs (fast start-up) while falling back to JIT compilation for new architectures (forward compatibility).
Solution Approach 2:
The patent performs preliminary compilation of GPU code during the application build process, creating a code bundle with pre-compiled machine code for known GPU architectures. This preliminary action eliminates the need for compilation at runtime for supported architectures, achieving fast start-up times while maintaining compatibility through the bundled code.
2Adaptability or versatility
If source code is compiled using just-in-time (JIT) regime, then forward compatibility with new GPU architectures is maintained, but application start-up time increases due to long compile times
Solution Approach 1:
The patent applies partial compilation strategy by pre-compiling code for known GPU architectures into a code bundle, while reserving JIT compilation only for new architectures that are not yet supported. This partial action approach optimizes performance for the majority of cases (known architectures) while maintaining compatibility for edge cases (new architectures).
Solution Approach 2:
The patent introduces a code bundle as an intermediary layer between the application and the GPU. This code bundle contains pre-compiled machine code that serves as a cache or lookup table, allowing the system to quickly determine whether pre-compiled code is available for the current GPU architecture before resorting to full JIT compilation.
3Reliability
If a new GPU driver is developed for each new GPU architecture, then compatibility with specific GPU architectures is ensured, but development complexity and time increase
Solution Approach 1:
The patent creates a universal code bundle that can serve multiple GPU architectures simultaneously. Instead of developing separate drivers for each architecture, the system uses a single code bundle containing pre-compiled code for multiple known architectures, reducing driver development complexity while maintaining broad compatibility.
Solution Approach 2:
The patent uses code copying by duplicating pre-compiled machine code for different GPU architectures within the same code bundle. This allows the system to share common compilation logic and infrastructure while providing architecture-specific optimizations through copied and adapted code versions.
Data Source
AI summary
One embodiment of the present invention sets forth a technique for representing and managing a multi-architecture co-processor application program. Source code for co-processor functions is compiled in two stages. The first stage incorporates a majority of the computationally intensive processing steps associated with co-processor code compilation. The first stage generates virtual assembly code from the source code. The second stage generates co-processor machine code from the virtual assembly. Both the virtual assembly and co-processor machine code may be included within the co-processor enabled application program. A co-processor driver uses a description of the currently available co-processor to select between virtual assembly and co-processor machine code. If the virtual assembly code is selected, then the co-processor driver compiles the virtual assembly into machine code for the current co-processor.


