Runtime Library Patching for GPU Workload Profiling

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Profiling operations for GPUs are labor-intensive and prone to errors due to manual code modifications required for instrumentation, slowing down development and reducing efficiency.

Innovation Solution

Automated runtime patching of code portions using patch libraries that insert profiling instrumentation without modifying developer-generated code, by replacing or modifying imported library segments with additional functionality for profiling.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Measurement precision

If manual code modifications are used to add profiling instrumentation, then profiling data can be obtained, but the process becomes labor-intensive and time-consuming

Engineering Contradiction:
Improveprofiling data accuracyVSAvoiddevelopment time
Core Design Contradiction:
Measurement precisionVSLoss of time

Solution Approach 1:

The patent creates a copy of the original code (the profiled application) and modifies only the copy by inserting profiling instrumentation through patching. This allows the original code to remain unchanged while still obtaining profiling data, eliminating the need for developers to manually modify their source code and reducing development time.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent introduces a patching mechanism as an intermediary between the original code and the profiling process. Instead of directly modifying the application code, the system applies patches that insert profiling instrumentation automatically, serving as a mediator that enables profiling without manual code changes.

Inventive Principle:
Principle #24Intermediary (Mediator)

2Measurement precision

If manual code modifications are used for profiling, then instrumentation can be added, but the process is prone to errors and requires developer skill

Engineering Contradiction:
Improveprofiling instrumentation accuracyVSAvoiddeveloper skill requirement
Core Design Contradiction:
Measurement precisionVSEase of operation

Solution Approach 1:

The patent implements self-service by allowing the profiling system to automatically identify and patch the necessary code sections without requiring developer intervention. The system autonomously determines which code portions need instrumentation and applies the appropriate patches, eliminating the need for developers to manually add profiling code and reducing the skill requirement.

Inventive Principle:
Principle #25Self-service

Solution Approach 2:

The patent performs preliminary actions by pre-defining patch templates and instrumentation patterns that can be automatically applied. The system prepares and stores profiling instrumentation code in advance, allowing it to be automatically inserted into the application without requiring developers to manually write or configure the instrumentation code.

Inventive Principle:
Principle #10Preliminary action

3Measurement precision

If manual code modifications are used for profiling, then profiling can be performed, but code changes must be reverted after profiling

Engineering Contradiction:
Improveprofiling data collectionVSAvoidworkflow complexity
Core Design Contradiction:
Measurement precisionVSDevice complexity

Solution Approach 1:

The patent creates a separate copy of the application code that contains the profiling instrumentation, leaving the original code unchanged. This allows profiling to be performed on the copied version without permanently modifying the developer's source code, eliminating the need to revert changes and simplifying the workflow.

Inventive Principle:
Principle #26Copying

Solution Approach 2:

The patent implements dynamic patching where the instrumentation can be added and removed flexibly without modifying the original codebase. The patching mechanism allows the profiling instrumentation to be dynamically applied only when needed and easily removed afterward, providing dynamic control over the profiling process without permanent code changes.

Inventive Principle:
Principle #15Dynamics

4Productivity

If automated patching is used, then manual intervention is reduced, but library code must be modified

Engineering Contradiction:
Improveprofiling efficiencyVSAvoidcode modification scope
Core Design Contradiction:
ProductivityVSDevice complexity

Solution Approach 1:

The patent applies local quality by modifying only specific portions of the library code (the imported modules that are actually called during execution) rather than the entire library. The patching is localized to only those functions and methods that are dynamically invoked, minimizing the scope of code modification while maintaining high profiling efficiency.

Inventive Principle:
Principle #3Local quality

Solution Approach 2:

The patent uses dynamic patching that automatically identifies and modifies only the library segments that are actually called during the application's execution. This dynamic approach ensures that only the necessary portions of the library code are modified for profiling, rather than statically modifying the entire library, thereby reducing the overall complexity of code modification.

Inventive Principle:
Principle #15Dynamics

Data Source

PatentUS20260056866A1Automated profile patching for workload profiling on parallel processing units
Publication Date: 2026.02.26 NVIDIA CORP
  • US20260056866A1 patent drawing
  • US20260056866A1 patent drawing
  • US20260056866A1 patent drawing

AI summary

Approaches presented herein provide systems and methods for runtime patching of one or more code portions for an application undergoing a profiling operation. The application may include code portions that are imported, such as from libraries, that include a set of original functionality. Different code portions may be identified and then patched to include additional functionality, in addition to the original functionality, within the code portions that are to be imported at runtime. When the code portions are executed, the additional functionality may then be executed without modifying or changing the underlying developer-produced code.