Heterogeneous Code Loader Architecture for CPU GPU Relocation

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Compiling and executing programs that include instructions for heterogeneous architectures, such as central processing units (CPUs) and graphics processing units (GPUs), is more complex than for programs targeted to a single architecture, requiring improved techniques to efficiently handle multiple architectures.

Innovation Solution

The techniques involve a compiler that generates heterogeneous code objects, which are loaded into specific memories for each architecture, with a loader performing relocations to ensure correct execution across different architectures, including name mangling and heterogeneous function pointer transformations to facilitate cross-architecture functionality.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Device complexity

If a single loader is used for both CPU and GPU code objects, then device complexity is reduced, but manufacturing precision deteriorates due to architecture-specific loading requirements

Engineering Contradiction:
Improveloader complexityVSAvoidloading accuracy
Core Design Contradiction:
Device complexityVSManufacturing precision

Solution Approach 1:

The patent divides the loading process into separate phases: a generic loader performs initial loading and basic relocations, while architecture-specific relocation handlers perform precise address adjustments. This segmentation allows the main loader to remain simple while accuracy is maintained through specialized sub-components.

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent introduces architecture-specific relocation handlers as intermediary components between the generic loader and the final execution. These handlers act as mediators that translate generic load information into architecture-specific address mappings, preserving both simplicity and precision.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Manufacturing precision

If architecture-specific relocation handlers are implemented, then manufacturing precision is improved, but device complexity increases

Engineering Contradiction:
Improverelocation accuracyVSAvoidsystem complexity
Core Design Contradiction:
Manufacturing precisionVSDevice complexity

Solution Approach 1:

The patent implements self-service mechanisms where each architecture-specific relocation handler contains its own logic for performing relocations. The handlers automatically identify their target architecture and execute appropriate relocation routines without external intervention, reducing the burden on the main loader and improving modularity.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent performs preliminary identification of the target architecture during the loading phase, before executing architecture-specific relocations. This preliminary action allows the system to prepare the appropriate relocation handler in advance, ensuring accurate relocations while maintaining a clean separation of concerns.

Inventive Principle:
Principle #10Preliminary action

3Manufacturing precision

If separate loading procedures are used for CPU and GPU, then manufacturing precision is improved, but ease of operation deteriorates

Engineering Contradiction:
Improveloading accuracyVSAvoidloading convenience
Core Design Contradiction:
Manufacturing precisionVSEase of operation

Solution Approach 1:

The patent creates a universal loader that can handle both CPU and GPU code objects through a common interface. The loader uses architecture identification mechanisms to automatically select the appropriate relocation handler, providing a unified loading procedure that maintains precision across different architectures without requiring user intervention.

Inventive Principle:
Principle #6Universality (Multi-functionality)

4Manufacturing precision

If architecture identification is performed during loading, then manufacturing precision is improved, but productivity decreases due to additional processing steps

Engineering Contradiction:
Improvearchitecture-specific loading accuracyVSAvoidloading speed
Core Design Contradiction:
Manufacturing precisionVSProductivity

Solution Approach 1:

The patent performs architecture identification as a preliminary step during the initial loading phase, before executing architecture-specific relocations. By identifying the target architecture early in the process, the system can prepare the appropriate relocation handler in advance, avoiding repeated identification checks and minimizing the impact on loading speed.

Inventive Principle:
Principle #10Preliminary action

Solution Approach 2:

The architecture-specific relocation handlers contain embedded identification logic that automatically detects the target architecture without requiring external queries. This self-service approach eliminates the need for complex architecture detection routines in the main loader, reducing overhead and improving loading efficiency.

Inventive Principle:
Principle #25Self-service

Data Source

PatentUS12039344B2Loader and runtime operations for heterogeneous code objects
Publication Date: 2024.07.16 BAY6 SOLUTIONS INC
  • US12039344B2 patent drawing
  • US12039344B2 patent drawing
  • US12039344B2 patent drawing

AI summary

Described herein are techniques for executing a heterogeneous code object executable. According to the techniques, a loader identifies a first memory appropriate for loading a first architecture-specific portion of the heterogeneous code object executable, wherein the first architecture specific portion includes instructions for a first architecture, identifies a second memory appropriate for loading a second architecture-specific portion of the heterogeneous code object executable, wherein the second architecture specific portion includes instructions for a second architecture that is different than the first architecture, loads the first architecture-specific portion into the first memory and the second architecture-specific portion into the second memory, and performs relocations on the first architecture-specific portion and on the second architecture-specific portion.