Coalescing Memory Barrier Operations Across Parallel Threads

Resolve Bottlenecks,
Find Innovative Solutions
Generate Solutions

Solution Overview

Problem

Conventional parallel processing architectures face significant throughput reduction due to the long latency of memory barrier instructions, which are necessary for proper ordering and visibility of memory transactions across multiple parallel threads, especially in systems with many threads and processors.

Innovation Solution

The solution involves coalescing memory barrier operations by promoting different types of memory barrier instructions, such as committing memory transactions to a CTA affinity level, a global affinity level, or a system level, to reduce the latency and idle time of multiple threads, allowing for efficient synchronization and communication across threads and processors.

Engineering Contradictions & Design Principles

VSEngineering Contradiction Analysis

1Reliability

If conventional memory barrier instructions are executed to ensure proper ordering and visibility of memory transactions across multiple parallel threads, then memory transaction ordering and visibility are guaranteed, but instruction processing throughput is significantly reduced due to long round-trip latency to the system memory commit point

Engineering Contradiction:
Improvememory transaction ordering and visibilityVSAvoidinstruction processing throughput
Core Design Contradiction:
ReliabilityVSProductivity

Solution Approach 1:

The patent segments the memory barrier operation into two independent parts: (1) a lightweight local barrier operation that provides immediate ordering guarantees within the processing unit, and (2) a separate system memory commit operation that provides visibility to other processors. This segmentation allows threads to continue execution after the local barrier without waiting for the long-latency system memory commit, thereby resolving the contradiction between ensuring memory ordering (reliability) and maintaining instruction throughput (productivity).

Inventive Principle:
Principle #1Segmentation

Solution Approach 2:

The patent performs preliminary memory transaction ordering and local visibility establishment before the threads need to proceed to system memory commits. By establishing the barrier effect locally in advance at the processing unit level, threads can continue execution without idle waiting, thus improving throughput while maintaining the necessary ordering guarantees that will be finalized when system memory commits occur.

Inventive Principle:
Principle #10Preliminary action

2Reliability

If memory barrier instructions are frequently executed in parallel processing systems with thousands of threads to ensure proper synchronization, then thread synchronization and communication are guaranteed, but the cumulative latency of multiple threads waiting for memory barriers significantly reduces overall system throughput

Engineering Contradiction:
Improvethread synchronization and communicationVSAvoidcumulative thread idle time
Core Design Contradiction:
ReliabilityVSLoss of time

Solution Approach 1:

The patent merges multiple individual memory barrier operations from different threads into a single coordinated barrier operation at the processing unit level. Instead of each thread independently waiting for its own barrier (causing cumulative idle time), threads are grouped and their barrier operations are combined, so they all proceed together after a single barrier completion. This merging dramatically reduces the cumulative thread idle time while maintaining proper synchronization guarantees.

Inventive Principle:
Principle #5Merging (Combining)

Solution Approach 2:

The patent creates a local copy or replica of the memory barrier functionality at the processing unit level, separate from the system memory commit point. This local barrier copy provides the necessary ordering and synchronization effects immediately to participating threads, eliminating their idle wait time, while the original system memory barrier operations continue in the background to provide visibility to other processors. This copying approach resolves the time loss without sacrificing synchronization reliability.

Inventive Principle:
Principle #26Copying

3Reliability

If memory barrier operations are performed at the system memory commit point to ensure visibility to all threads and processors, then global memory visibility is achieved, but the long round-trip latency causes requesting threads to remain idle for hundreds of cycles

Engineering Contradiction:
Improveglobal memory visibilityVSAvoidthread execution efficiency
Core Design Contradiction:
ReliabilityVSEase of operation

Solution Approach 1:

The patent introduces an intermediary local barrier mechanism at the processing unit level that mediates between thread execution and system memory commits. This intermediary provides immediate ordering guarantees to threads without requiring them to wait for the long-latency system memory commit, thus improving ease of operation and thread execution efficiency. The intermediary then coordinates with the system memory barrier operations to ensure that global visibility is eventually achieved, maintaining reliability while reducing thread idle time.

Inventive Principle:
Principle #24Intermediary (Mediator)

Data Source

PatentUS9223578B2Coalescing memory barrier operations across multiple parallel threads
Publication Date: 2015.12.29 NVIDIA CORP
  • US9223578B2 patent drawing
  • US9223578B2 patent drawing
  • US9223578B2 patent drawing

AI summary

One embodiment of the present invention sets forth a technique for coalescing memory barrier operations across multiple parallel threads. Memory barrier requests from a given parallel thread processing unit are coalesced to reduce the impact to the rest of the system. Additionally, memory barrier requests may specify a level of a set of threads with respect to which the memory transactions are committed. For example, a first type of memory barrier instruction may commit the memory transactions to a level of a set of cooperating threads that share an L1 (level one) cache. A second type of memory barrier instruction may commit the memory transactions to a level of a set of threads sharing a global memory. Finally, a third type of memory barrier instruction may commit the memory transactions to a system level of all threads sharing all system memories. The latency required to execute the memory barrier instruction varies based on the type of memory barrier instruction.