Technology that efficiently transfers data to the processor

By introducing a new instruction set architecture directly from global memory to shared memory in multi-core processor systems, bypassing registers and caches, the problems of data transmission delay and register pressure are solved, and the efficiency and throughput of the processing system are improved.

CN112749120BActive Publication Date: 2024-09-20NVIDIA CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010490360.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-12-12
Filing Date
2020-06-02
Publication Date
2024-09-20
Estimated Expiration
2040-06-02

AI Technical Summary

Technical Problem

In the existing technology, in multi-core processor systems, there is a delay in the transmission process of data from main memory to shared memory, which leads to increased register pressure and reduces the overall processing rate of the processing system. Especially in data-intensive calculations, resource waste is serious. .

Method used

A method is proposed to directly load data from global memory and store it into shared memory through a new instruction set architecture (ISA), bypassing processor registers and cache memory, and reducing the temporary storage of data in registers and caches, thus Reduce memory access overhead.

Benefits of technology

It significantly reduces the register pressure and energy consumption of multi-processor systems, improves data transmission efficiency, improves mathematical throughput, and achieves more efficient memory bandwidth utilization.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN112749120B_ABST
    Figure CN112749120B_ABST
Patent Text Reader

Abstract

The present invention discloses a technology for efficiently transferring data to a processor, and specifically discloses a technology for block data transfer, which can reduce data transfer and memory access overhead, and significantly reduce multiprocessor activity and energy consumption. Threads executed on a multiprocessor that need data stored in a global memory can request the required data and store it in an on-chip shared memory, which the thread can access multiple times. Data can be loaded from the global memory and stored in the shared memory using instructions, which direct the data to the shared memory without storing the data in registers and / or cache memory of the multiprocessor during the data transfer.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] CROSS-REFERENCE TO RELATED APPLICATIONS

[0002] This application claims the benefit of provisional application serial number 62 / 927,417 filed on October 29, 2019 and provisional application serial number 62 / 927,511 filed on October 29, 2019, each of which is incorporated herein by reference. This application is related to commonly assigned, co-pending U.S. patent application serial number 16 / 712,236 filed on December 12, 2019. Technical Field

[0003] The technology relates to efficient use of processor memory, and a processor instruction set architecture (ISA) including instructions that facilitate such efficient use. More specifically, the technology herein relates to efficient data storage in a memory shared by multiple cores, and to dedicated or additional memory access instructions that reduce register pressure during memory transfers and / or data transfer latency. Background Art

[0004] Massively parallel high-performance multithreaded multicore processing systems (systems containing many processing cores running in parallel) can process data much faster than in the past. These processing systems can break down complex calculations into smaller tasks that can then be performed simultaneously by multiple parallel processing cores. This "divide and conquer" approach allows complex calculations to be performed in a fraction of the time it would take just one or a few processors to handle the same calculations sequentially.

[0005] As the number of concurrent processing tasks increases, the amount of data required to support these many parallel computations also increases, creating a data access bottleneck in the “nearby” on-chip memory.

[0006] One or more modern processing chips (such as GPUs) typically include large amounts of memory near parallel processors to reduce memory access latency. For example, as described herein, some NVIDIA GPUs include about 12GB or more of local on-chip high-bandwidth memory (including, for example, 4GB cache / shared memory) to serve more than 5,000 cores running in parallel.

[0007] To further reduce data access latency, modern processing systems typically organize memory into a hierarchy (e.g., level 1 (L1) cache, level 2 (L2) cache, level 3 (L3) cache, main memory, etc.). Such a memory hierarchy stores data that is currently being processed by processing cores, closer to those processing cores for easier access. The cache memory closest to the processing cores (e.g., the L1 cache) may be partitioned, distributed, or otherwise organized so that each processing core or group of processing cores has exclusive access to its own cache, thereby avoiding wait times due to memory contention with other cores. Such cache memory is typically supported by hardware circuitry that maintains tags and is responsible for automatically writing a "dirty" cache line back to main memory before flushing the line, thereby saving the software programmer the need to explicitly manage the cache.

[0008] There is also a need to share local memory between processing cores. Sometimes, one or more processing cores need to access one or more values ​​calculated by one or more different processing cores, or use memory as a communication channel to signal another processing core. While one core can write data back to main memory for access by another core, accessing main memory typically requires thousands of cycles. Hierarchical cache memory architectures can sometimes be used to share such data between processors without waiting for main memory access. However, to make data sharing between multiple processors more convenient, modern GPUs typically have local on-chip memory that is shared between processing cores. In addition, such shared memory is typically supported / accelerated by copy (direct memory access or DMA) hardware.

[0009] Using shared memory in addition to cache memory or using shared memory without cache memory can provide certain advantages. For example, applications using shared memory support more coalesced accesses and can achieve a higher degree of memory-level parallelism. For example, as explicitly stated above, see the following technical article incorporated by reference into this article: C. Li, Y. Yang, H. Dai, S. Yan, F. Mueller, and H. Zhou "Understanding the Tradeoffs Between Software-Managed and Hardware-Managed Caches in GPUs" 2014 IEEE International Symposium on Performance Analysis of Systems and Software (ISPASS), Monterey, California, 2014, pages 231-242.

[0010] In some systems, physical memory blocks can be flexibly allocated between different local memory functions (e.g., between shared memory and cache memory). In one example, an embodiment of the NVIDIA Turing / Volta GPU architecture provides software programming options for dynamically (runtime) adjusting local memory allocation. Specifically, the NVIDIA Volta architecture combines the functionality of the L1 and texture caches into a unified L1 / texture cache, which acts as a merge buffer for memory accesses, collecting data requested by threads in a warp before passing the data to the warp. In the Volta architecture, the L1 cache, texture cache, and shared memory are backed by a combined data cache. The portion of the combined data cache dedicated to shared memory (called a "carveout" in CUDA) can be selected at runtime using the CUDA instruction cudaFuncSetAttribute() together with the attribute cudaFuncAttributePreferredSharedMemoryCarveout, which effectively selects how much shared memory should be allocated to each streaming multiprocessor (SM).

[0011] The benefits of combining L1 cache with shared memory are improved latency and bandwidth. For many applications, this approach closes the performance gap between explicitly managed shared memory and direct access to device memory. Such shared memory allows parallel threads executing on the same or different processing cores to temporarily store and exchange data. Thus, shared memory provides a communication mechanism that enables independent threads to communicate with each other. In addition, the cost of register spilling is low, and the balance between occupancy and spilling can be reevaluated to provide the best performance.

[0012] Traditionally, storing data from main memory to shared memory requires a multi-step process. First, the processor executes a memory load instruction from main memory, which will cause the addressed data to be read from main memory and stored in one or more cache lines of cache memory, and then written from cache memory to one or more registers of the processor. Such registers may be allocated in a register file (which may be another block of local memory), with different registers in the register file being assigned to different processors or processor cores. The processor may then execute a store instruction to store the data in its registers into shared memory.

[0013] In situations where certain common transactions (such as matrix multiplication) require large data transfers, this traditional approach of loading data into shared memory consumes a large number of registers for an extended and often indeterminate period of time. During this time (which can last for thousands of cycles in some cases due to long latencies to main memory or other dependencies), registers may be tied up and unusable for any other purpose. This register tying prevents the associated processor from doing useful work until the registers are freed up.

[0014] Therefore, while utilizing shared memory for certain computations can reduce data availability bottlenecks, existing methods of moving data in and out of shared memory often consume resources (i.e., registers) that could otherwise be used for data processing - which can reduce the overall processing rate of the processing system when performing certain data-intensive computations. Therefore, there is a need to more efficiently manage memory bandwidth requirements while achieving higher math throughput in areas such as artificial intelligence (AI) and deep learning (DL). BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The following detailed description of exemplary, non-limiting illustrative embodiments is to be read in conjunction with the following drawings:

[0016] Figure 1A-1B An example non-limiting parallel processing architecture is described in which data is routed via caches and registers into shared memory.

[0017] Figure 2A-2B An example non-limiting parallel processing architecture is described in which data is written to a shared memory, bypassing registers.

[0018] Figure 3A-3B An example non-limiting parallel processing architecture is described in which data is written to shared memory, bypass registers, and cache.

[0019] Figure 4 An example non-limiting block diagram of a memory control system is shown.

[0020] Figure 5 An example of a shared memory is shown that includes multiple memory banks coupled to an interconnect circuit.

[0021] Figure 6 An example representation showing how data retrieved from main memory or global memory is laid out in shared memory to reduce conflicting requests.

[0022] Figure 7 An exemplary sector pattern including four sectors applicable to shared memory is shown.

[0023] Figure 8 An example parallel processing unit is described.

[0024] Fig.9A Explained Figure 8 An example general purpose processing cluster in which parallel processing units are used.

[0025] Fig. 9B Explained Figure 8 An example memory partitioning unit for a parallel processing unit.

[0026] Fig. 10A Explained Fig.9A An example streaming multiprocessor.

[0027] Fig. 10B is used Figure 8 An example conceptual diagram of a processing system implemented with a parallel processing unit (PPU).

[0028] Fig. 10C is a block diagram of an exemplary system in which the various architectures and / or functions of the various preceding embodiments may be implemented.

[0029] Fig.11 According to the embodiment, Figure 8 1. Conceptual diagram of an example graphics processing pipeline implemented by a PPU. DETAILED DESCRIPTION

[0030] The example non-limiting techniques herein provide efficient data access bandwidth to feed streaming multiprocessor core math units at the "speed of light" rate. In a streaming multiprocessor (SM), it is necessary to reduce the memory input output interface (MIO) bandwidth and reduce the register pressure for moving data operands in order to increase math throughput by 2 times over previous architectures.

[0031] The example non-limiting embodiment provides a block data transfer technique as a way to reduce data transfer and memory access overhead, thereby significantly reducing the activity and energy consumption of a multiprocessor (e.g., SM level). In a typical computing program, threads co-cooperatively load data from global memory and then store it in shared memory so that the data can be subsequently accessed and processed multiple times. The example embodiment provides a new instruction that instructs data loaded from global memory to be stored directly into shared memory. This eliminates moving data through SM registers and minimizes data movement through MIO. The example non-limiting embodiment provides an execution application to selectively (1) bypass registers and L1 cache (2) bypass registers via L1 cache or (3) direct requested data from global memory to shared memory via L1 cache and registers. In the example non-limiting embodiment, the shared memory is software managed and the L1 cache memory is hardware managed.

[0032] Thus, one aspect of the exemplary non-limiting technology herein provides an instruction set architecture (ISA) that provides (at least) the following three different types of load-from-memory and store-to-memory instructions or instruction sequences:

[0033] (a) a typical conventional load instruction, where data is retrieved from main or global memory and written to a cache line of an on-chip cache memory (which may be managed by hardware), and then the data is written from the cache memory to one or more registers of the processing core (once resident in the one or more registers of the processing core, the data may then be stored from the one or more registers to the on-chip shared memory using a conventional store to memory instruction); or

[0034] a first type or kind of load-from-memory side-load instruction that bypasses one or more processor core registers, i.e., data written to a cache line is copied to shared memory without first being written to one or more processor core registers; or

[0035] A second type or kind of sideload instruction bypasses one or more processor core registers and cache memory, whereby data retrieved from main or global memory is written directly to shared memory without first being stored in processor core registers or cache memory.

[0036] Developers can select different of these instructions to perform load from memory operations based on the needs and performance requirements.

[0037] For example, in many cases where it is important to maintain memory coherency using hardware support for on-chip caches, developers will want to explicitly control the storage of individual values ​​to specific shared memory locations using application-defined addresses. In these cases, developers will enable the execution of traditional load and store instructions to provide a traditional memory load path of global memory > cache > registers > shared memory.

[0038] On the other hand, in some cases, developers want to gain the benefits of hardware-maintained cache memory, but the application does not need the data being loaded as a value loaded by a specific thread. It only needs to be loaded and explicitly synchronized as data in shared memory. In this case, the developer can enable the execution of the first type or kind of sideload instructions to provide a memory load path of global memory > cache > shared memory.

[0039] In other cases, the developer wants to load data into shared memory as efficiently as possible and wants to do so while consuming the least amount of other resources, in which case the developer can enable a second type or kind of sideload instruction to provide a global memory > shared memory memory load path.

[0040] A typical traditional load instruction, where data is retrieved from main memory or global memory and written to a cache line of on-chip cache memory, is implemented by two separate instructions. A load from global memory instruction followed by a separate store to shared memory instruction. The load from global memory instruction loads data from global memory into the data register of the requesting thread. The store to shared memory stores the data in the register into shared memory.

[0041] Example non-limiting embodiments provide a fused load and store instruction (LDGSTS), which can load data (LDG) from global memory and store the data in shared memory (STS) bypassing processor core registers. The fused load and store instruction (LDGSTS) can load data from global memory and store the data in shared memory, and has the option of bypassing one or more processor core registers or bypassing one or more processor core registers and cache memory. The first type or kind of load / store instruction is LDGSTS.ACCESS, which bypasses one or more processor core registers. The second type or kind of load / store instruction is LDGSTS.BYPASS, which bypasses one or more processor core registers and cache memory. The LDGSTS.ACCESS instruction and the LDGSTS.BYPASS instruction may include two address operands, a destination shared memory address, and a source global address. The instruction code LDGSTS.ACCESS and / or LDGSTS.BYPASS for traditional load and store can be loaded into the instruction register, and the instruction decoder can convert the instruction into a setting for the hardware. A load data from global memory and store to shared memory instruction may control the hardware to bypass one or more processor core registers and / or cache memory based on the type or kind of instruction issued.

[0042] In some example non-limiting embodiments, the decision of which of the different types or kinds of load from memory instructions to use may be made by an optimizing compiler, for example, based on switches included by the developer in the source code, tracking of what happened to the data (e.g., whether the data was ever changed and written back to main memory or global memory), and / or whether the data was accessed after the load from memory instruction was executed by multiple cores / multiple threads / multiple thread warps (rather than a single core / single thread / single thread warp), and / or other optimization factors.

[0043] In some examples, the decision of which of the different types or kinds of load from memory instructions to use can be made dynamically at runtime by the developer evaluating conditions in the source code. For example, the decision can be made using a memory descriptor (included as an instruction parameter). This is a hint to convert LDGSTS.ACCESS to LDGSTS.BYPASS (if possible). For example, LDGSTS.ACCESS may be overridden in a variant with a memory descriptor. If the memory descriptor has l1InVDontAllocate set, and .sz is specified as 128, then the global memory access will be treated as if .BYPASS was specified. There may be instruction attributes, such as operand sizes that are supported by LDGSTS.ACCESS but not by LDGSTS.BYPASS in some embodiments, which prevent this conversion.

[0044] Those skilled in the art will appreciate that the same execution thread may use any or all of these different memory load instructions, depending on the context. Thus, the same execution thread may use conventional load instructions to load some values ​​from global memory into shared memory, it may use the first type of bypass load instructions to load other values ​​from global memory into shared memory, and it may still use the second type of bypass load instructions to load other values ​​from global memory into shared memory.

[0045] Example non-limiting embodiments provide one or more of the following:

[0046] Multi-threaded copy with asynchronous DMA-like behavior. The copy can be directed to access through the L1 cache or bypass it.

[0047] Detection and encoding of fill patterns. Data is "swizzled" as it is stored to shared memory to allow for subsequent conflict-free access. Rather than staging data via SM registers and swizzling it when stored to shared memory, example embodiments detect swizzling patterns generated between cooperating threads and encode them for use when filling data.

[0048] Byte-level zero-fill results that are out of bounds.

[0049] · The programming model allows, among other things, efficient software pipelining.

[0050] The example non-limiting techniques herein provide block data transfer techniques that reduce data transfer and memory access overhead, thereby significantly reducing streaming multiprocessor SM-level activity and energy consumption. In a typical computing program, threads cooperatively load data from global memory and then store it in shared memory so that the data can be accessed and processed multiple times later.

[0051] Figure 1A-Figure 3B An example non-limiting parallel processing architecture is illustrated showing software controlled transfer of data from global memory 511 to multiple functional units 5120-512. N The parallel processing architecture includes multiple SMs 440 (SM0-SMN) that can access a global memory 511 external to the SMs 440. The global memory 511 can include a hierarchical cache memory (e.g., a level 2 cache and / or a level 3 cache) and / or DRAM memory. In some examples, reference Figure 8-10C , the global memory 511 may include a memory management unit (MMU) 490 , an X-Bar 370 , a memory partition unit 380 , and / or memory 304 .

[0052] Each SM 440 includes multiple cores, such as functional units 5120-512 N , which is configured to process multiple threads in parallel. A thread (e.g., an execution thread) is an instance of an instruction set that is configured to be executed by functional units 5120-512 N Executed on a specific data set. Threads in a thread block can be executed simultaneously and multiple thread blocks can be executed simultaneously. In some embodiments, a single instruction, multiple data (SIMD) instruction issuance technique is used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In other embodiments, a single instruction, multiple thread (SIMT) technique is used to support the parallel execution of a large number of usually synchronized threads, using a general instruction unit configured to issue instructions to a group of cores. Unlike a SIMD execution architecture (where all cores usually execute the same instructions), SIMT execution allows different threads to more easily follow different execution paths through a given program. It will be appreciated by those of ordinary skill in the art that a SIMD processing architecture represents a functional subset of a SIMT processing architecture.

[0053] Each functional unit 5120-512 N The 572 cache memory (which may be a level 1 (L1) cache) and the shared memory 574 are coupled to the cache memory 572, the shared memory 574, and the register file 520 via an interconnection network, such as a hierarchical crossbar switch having one or more read and / or write crossbar switches. The cache memory 572 (which may be a level 1 (L1) cache) and the shared memory 574 are provided in each functional unit 5120-512 N Low latency on-chip memory is provided nearby. Register file 520 may include registers that can be assigned to multiple functional units 5120-512 by software. N Register file 520 is a register file for data registers of different functional units and / or different thread warps executed by SM 440. Register file 520 is a register file for data registers of different functional units 5120-512 NProvides temporary storage.

[0054] The parallel processing architecture may support multiple address spaces, including local, shared, and global, to support data visibility for threads. Additional read-only address spaces may be supported, including constants and textures. Each thread may have its own per-thread local or private memory, which may be controlled through register allocation (e.g., see U.S. Pat. No. 8,555,035 and U.S. Pat. No. 7,634,621, which are hereby incorporated by reference as if expressly set forth).

[0055] Each thread in the same thread block or in a different thread block can access global memory 511 using a hierarchical cache memory. Each thread in the same thread block can access an allocated portion of shared memory 574, which can be considered per block of shared memory. Each executed thread block can have an allocated portion of shared memory 574. Shared memory 574 is a software-managed cache used to load data from global memory in order to reduce the number of off-chip memory accesses by the executing thread. The software explicitly allocates and accesses shared memory 574. Threads in a thread block are synchronized (e.g., after collaboratively loading data from global memory to shared memory) to avoid conflicts in the use of critical resources.

[0056] When multiple threads in a block are expected to use the same data from global memory 511, shared memory 574 can be used to store this data, thereby reducing the number of requests to global memory 511. Shared memory 14 can also be used to avoid non-coalesced memory accesses by loading and storing data in a coalesced pattern from global memory 11 and then reordering the data in shared memory 14 to improve thread access to data.

[0057] In some embodiments, the unified cache system 570 may include a data memory that is configurable as both a shared memory 574 and a local cache memory 572. The unified cache system may be provided in the same on-chip memory (e.g., SRAM) for both the L1 cache and the shared memory, and includes a mechanism for allocating how much unified memory is dedicated to the L1 cache and the shared memory for each kernel call. Combining the L1 data cache with the shared memory into a unified memory may reduce latency and provide higher bandwidth. In some examples, the unified cache system may also include a dynamically configurable register file (e.g., register file 520). For information about the unified cache system and how to configure it, see the following references, which are incorporated herein by reference as if explicitly set forth: U.S. Patent Application Publication No. 2018 / 0322078; and CUDA C Programming Guide, PG-02829-001_v10.1|May 2019.

[0058] When running on one or more functional units 5120-512 N When software on needs data stored in global memory 511, the software starts a thread with a "load from memory" command. The load from memory command loads data from global memory 511 and stores the data in shared memory 574, making it visible to all threads (e.g., all threads in a block). Once the data is stored in shared memory, the thread can access the data multiple times.

[0059] Figure 1A and Figure 1B The conventional stages of transferring data from global memory (eg, L2) through the hierarchical crossbar switch to the SM's shared memory 574 are illustrated. Each SM 440 may have one or more such read ports, each of which is connected to a 32-byte fill bandwidth.

[0060] Data is loaded using a global memory load (LDG) operation followed by a store to shared memory (STS) operation. In some examples, the L1 cache of the SM has a unified physical data random access memory (RAM) for tagging both data and shared memory. For example, the organization of this data RAM may have, for example, 32 banks of 32 bits each. However, even with unified memory, conventional approaches have temporarily stored data through multiple memory locations (i.e., L1 cache and registers) before storing it in shared memory.

[0061] In previous GPUs, incoming read port data (32-byte sector fill) is first written back to cache memory 572 (e.g., L1 cache). An L1 cache line can be 128 bytes with 4 32-byte sectors. The incoming fill sector will be directed to one of the 4 cache line sectors. When all sectors associated with the load operation are received, the load operation is completed and the data is read back from the fill sector in L1, aligned to the requesting thread through the read crossbar, and then written back to the destination register. An STS operation is then issued where the data is read from the SM register file and then written back to the shared memory data store after traversing the write crossbar to align it to the shared memory address. Therefore, this entire sequence has 2-width RAM reads and writes and 2 traversals through the local crossbar.

[0062] like Figure 1A and Figure 1BAs shown, both cache memory 572 and register file 520 are used during the data transfer process. This approach can hurt performance for a number of reasons. When a load from global memory 511 operation is issued, registers are assigned to the thread to represent the result. Since a load operation can request data from a hundred different locations, and the latencies should overlap as much as possible, a hundred different registers will be tied. Furthermore, these registers will be tied as long as the load is outstanding, which can be thousands of cycles. Although fewer registers can be assigned, allocating fewer registers for such load operations will serialize the memory read and load operations, increasing the transfer time.

[0063] Example code to load data into shared memory via a load global memory (LDG) and then a store to shared memory (STS) instruction may include:

[0064]

[0065]

[0066] As shown in the above code, the LDG instruction loads data from global memory into registers, and the STS instruction stores data from registers into shared memory. Following the LDG and STS instructions, a shared memory window load instruction (LDS) is executed to load data into registers for performing fused multiplication-addition operations FFMA. Matrix multiplication is a key calculation in many scientific applications, especially in deep learning. For more information on efficient matrix multiplication on GPUs, see, for example, CUTLASS: Fast Linear Algebra in CUDA C++, December 5, 2017 (updated May 21, 2018), which is incorporated herein by reference. The current technology is not limited to the FFMA instruction, and can also be implemented using other instructions that use data loaded into shared memory.

[0067] To optimize loading data into shared memory, the example non-limiting embodiment does not require staging data through the SM's register file. In the example non-limiting embodiment, this is implemented as a single LDGSTS.ACCESS instruction with two address operands, the destination shared memory address and the source global address.

[0068] Figure 2A and Figure 2BThe data is loaded into the shared memory 574 without first loading the data into the register 520 during the data transfer. The data is transferred using a fused instruction that loads from the global memory 511 and stores the data in the shared memory 574 via the cache memory 572. In this embodiment, a normal load is performed using a global address, and the incoming fill data sector is written back to the data cache. The data is then extracted from the data line of the cache, aligned by the read data crossbar, and written back to the shared memory destination location. The write crossbar (which usually aligns the stored data) can be used to align the write address. From an energy efficiency perspective, the instruction eliminates the read and write energy of the register file compared to the separate LDG and STS instructions. In addition, from a performance perspective, the instruction reduces register pressure by not having to reserve registers for long delayed load returns. Since registers are no longer needed to hold transient load values, they can be used for other tasks. The only registers required for the fused memory load and store operations may include the address of the SM arithmetic.

[0069] As will be discussed in more detail below, example non-limiting embodiments allow tracking of completion of instructions in an asynchronous copy / DMA manner, independent of other memory operations.

[0070] Example code to bypass registers via L1 cache using fused LDGSTS may include:

[0071]

[0072] To further optimize loading data into shared memory, the example non-limiting embodiment eliminates the need to temporarily store data through the SM's register file and L1 cache. Figure 3A and Figure 3B It illustrates loading data into shared memory 574 without first loading the data into register file 520 and cache memory 572 during the data transfer. This instruction has a single LDGSTS.BYPASS instruction.

[0073] In this example non-limiting embodiment, energy can be further reduced by writing the incoming padding data directly back to the final shared memory destination. Additionally, this can eliminate Figure 2A and Figure 2BL1 data random access memory read and write energy in the illustrated embodiment. From a performance perspective, this example embodiment also translates into reduced shared memory crossbar and L1DATA bandwidth requirements. In dense math cores such as GEneral matrix-matrix multiplication (GEMM), using thread-bundle-wide matrix multiply-accumulate (MMA) instructions, L1DATA can become a bottleneck. By implementing the data path without having to temporarily store data in registers and L1, a full-blown data crossbar from the read port can be utilized (as an artifact in the example embodiment, the read port cannot be stalled). Figure 2A In, the interface between global memory access 511 and cache memory 572 includes a read port. Figure 3B In the example, the interface between the fill steer and L1 includes a read port.

[0074] Example code to bypass L1 cache and registers using the fused LDGSTS.BYPASS instruction may include:

[0075]

[0076] In some examples, a processing system (such as a GPU) may include decoding logic for receiving and decoding instructions. The decoded instructions may be used to control hardware loading and storing data based on the instructions. The GPU may include a decoded fused load / store instruction format that specifies whether the GPU should (a) bypass processor registers or (a) bypass both processor registers and cache memory. Based on the decoding, the requested data can be loaded and stored by the hardware. In one example, in response to the decoding, the GPU can retrieve a data word from a first memory (e.g., global memory) and store the retrieved data word in a second memory (e.g., shared memory) without first storing the retrieved data in a processor register, and without first storing the retrieved data in a processor register and a cache memory (as selected by the decoded fused load / store instruction format specification). The second memory can be shared by multiple threads (e.g., multiple threads in a thread block) and / or set in a common on-chip physical memory address space together with the cache memory.

[0077] The fused load / store instruction format may include a source address (e.g., a global memory address), a destination address (e.g., an address in a second memory), and a data transfer path. In one example, the fused load / store instruction may include (i) a source word address, (ii) a destination word address, and (iii) at least one bit that specifies whether the GPU should (a) bypass processor registers or (b) bypass both processor registers and cache memory to retrieve a data word from the source word address and store the retrieved data word in the destination word address, and the decoding includes decoding the at least one bit.

[0078] Mark and Shared Memory Control System

[0079] Figure 4 An example block diagram of a memory control system that can be directed by instructions disclosed in the present application (e.g., load, store, and / or fused load and store instructions) is shown. Examples of the present technology are not limited to Figure 4 The specific memory control system shown may also be applicable to other memory control systems. Figure 4 The memory control system shown includes address logic 22, tag pipeline 24, data tag queue 26, data memory storage 30, interconnect network 580 and register file 520. Figure 4 One or more of the operations described may be performed by one or more load / store units (LSUs) 554 (e.g., Fig. 10A The data memory storage 30 may include a shared data memory storage 32 and an L1 data memory storage 34, which are provided in a configurable unified cache architecture.

[0080] The address logic 22 is configured to receive memory transactions from execution threads, generate addresses for servicing these transactions, and route memory transactions based on the type of memory transactions. In some examples, the address logic 22 may include an address generation unit (AGU). The AGU may be configured to calculate global addresses for accessing global memory and local addresses for accessing shared memory.

[0081] The memory transactions received by the address logic 22 may include load transactions, store transactions, and fused load / store transactions. The load transactions may include loads from shared memory and loads from global space. The data returned in response to the load transaction may be provided to a register file associated with the requesting thread.

[0082] A storage transaction may include a store to a shared memory and a store to a global memory. Data in registers associated with a particular functional unit may be stored in a shared memory and / or a global memory.

[0083] Depending on the type of memory instruction and system architecture, the data of the load and / or store instruction may take a specific path. For example, when the address logic 22 receives an instruction to load data from the shared memory into a register associated with a particular thread, the address logic 22 calculates the shared memory address and routes the instruction directly to the shared data memory 32 along the data path 22a, thereby providing a low latency memory transaction. Unlike external memory, where there may be hundreds or thousands of cycles between the external memory and the shared memory, there may be one cycle between the shared memory 32 and the requesting thread. The data requested from the shared data memory 32 is provided to the register file 520 associated with the requesting thread via the interconnection network 580.

[0084] As previously discussed, when data is loaded into shared memory using conventional load instructions from global memory, the data travels from global memory to the L1 cache, from the L1 cache to registers, and from registers to shared memory. The instructions disclosed in this application provide the option for the load to shared memory instructions to bypass registers and / or L1 cache as the requested data is stored from global memory to shared memory.

[0085] When the address logic 22 receives an instruction to load memory into shared memory while bypassing registers (e.g., an LDGSTS.ACCESS instruction), the instruction is broken down into two separate sub-instructions by the address generation unit (AGU) that calculates the source global address and the destination shared memory address. The source global address is used for the load operation, and the destination shared memory address is used for the store to shared memory operation. The LDG sub-instruction can be treated as a normal load in the tag stage, and 32 addresses are merged for four independent tag requests. The STS sub-instruction can be treated as a pseudo-instruction, just to be passed to the pipeline via the shared memory address.

[0086] The address logic 22 routes the load instruction to the tag pipeline 24 along the data path 22b. The tag pipeline 24 determines whether the requested data is available in the L1 data memory 34 based on the tag information. When a hit occurs because the requested data is available in the L1 data memory 34, the tag pipeline 24 routes the memory transaction to the L1 data memory 34 via the data path 24a. The data is pulled from the cache data line of the L1 data memory 34, aligned through the interconnection network 580 (e.g., a write crossbar), and then written back to the destination shared memory address of the shared data memory 32. This data path is different from a conventional load instruction in which the requested data in the L1 data memory 34 is first stored in the register file 520 via the interconnection network 580 and then moved from the register file 520 to the shared data memory 32. In the case of a hit, the store path (e.g., including the side collector) is used to synthesize an atomic operation similar to read / modify / write, which reads from the tagged line and stores to the shared memory line in the data cache.

[0087] When a miss occurs because the requested data is not available in the L1 data memory 34, the tag pipeline 24 assigns a tag and requests the missed data from the global memory interface via the data path 24b. The global memory interface may include hardware (e.g., direct memory access (DMA) I / O) for retrieving data from other caches and main memory. The memory transaction is also pushed to the queue 26, which may include a tag-to-data (t2d) first-in-first-out (FIFO). The memory transaction in the queue 26 is stalled before the missed data is returned to the L1 data memory 34 and the associated memory transaction reaches the top of the queue 26.

[0088] The tag pipeline 24 may include a merger 40, a tag memory 42, and a tag processor 44 for servicing memory transactions received from the address logic 22. The merger 40 may reorder and / or merge individual write requests (eg, sector requests) into large cache line requests.

[0089] Tag processor 44 determines whether a tag for a given memory transaction exists in tag memory 42. If tag processor 44 determines that a tag exists, and data corresponding to the tag exists in L1 data memory 34, a cache hit occurs and the memory transaction is routed to L1 data memory 34. If tag processor 44 determines that a tag does not exist, tag processor 44 assigns a tag to the data in associated locations in tag memory 42 and L1 data memory 34 when the data is returned from global memory.

[0090] When the address logic 22 receives an instruction to load memory to shared memory and bypass registers and L1 cache (e.g., LDGSTS.BYPASS instruction), the instruction is split into two separate sub-instructions by the AGU to calculate the source global address and the destination shared memory address. The source global address is used for load operations and the destination shared memory address is used for store shared memory operations. The representation of the global address and shared memory address in the instruction can be specified in the registers of the requesting thread.

[0091] The address logic 22 routes the load instruction to the tag pipeline 24 along the data path 22b. The tag pipeline 24 determines whether the requested data is stored in the L1 data memory 34 based on the tag information. When a hit occurs because the requested data is available in the L1 data memory 34, the tag pipeline 24 routes the memory transaction to the L1 data memory 34 via the data path 24a. The data is pulled from the cache data line of the L1 data memory 34, aligned through the interconnect network 580 (e.g., a write crossbar), written back to the destination shared memory address of the shared data memory 32, and the tag of the written data is invalidated. Because the data is now stored in the shared memory and the application is not expected to request the same data from the global memory in the short term, the tag can be invalidated.

[0092] When a miss occurs, the tag pipeline 24 assigns a tag and requests the missed data from the global memory interface via the data path 24b. The memory transaction is also pushed to the queue 26. The memory transaction will be stalled before the missed data is returned. When the data is returned via the data path 511b, the fill data will be written directly back to the final shared memory destination in the shared data memory 32 without storing the data in the L1 data memory 34, and the tag of the written data is invalid. The data is written directly from the read port to the shared data memory 32 via the interconnect network 580 (see about Figure 2A and Figure 2B Read port discussed).

[0093] A direct global to shared memory path (not passing through cache or registers) may not maintain line level consistency, leaving stale values ​​in the cache, which may be inconsistent with the value visible in shared memory in some implementations. To avoid inconsistencies, the example embodiments described above provide implementations in which the system snoops L1 lines and invalidates them.

[0094] In some embodiments, the interconnection network 580 may include more than one crossbar switch. For example, in one embodiment, the interconnection network 580 includes a crossbar switch for general loading and storage, and a separate crossbar switch for writing data received from the memory interface via the data path 511b to the shared data memory 32. In this embodiment, a separate crossbar switch can be used because this path functionally requires the crossbar switch, which is simpler than the crossbar switch required for general loading and storage. The data path in this example can include a data path 511b from the memory interface to the data memory storage 30 capacity through a separate fill crossbar switch. This allows simultaneous filling from memory when reading from the shared data memory 32 or the L1 data memory 34.

[0095] Loading data from shared memory provides flexibility in the granularity of the data returned. For example, if 32 words are read from shared memory, the 32 words may be received from different lines if the requested words are stored in different banks of shared memory. In the L1, the 32 words will come from the same cache line. This level of granularity cannot be obtained with the L1 even if the physical structure of the L1 is similar to shared memory because the L1 is limited in the number of tags that can be used (e.g., four tags). L1 accesses can be limited to as many different non-conflicting lines as the number of tagged banks. In the example of an L1 using four tagged banks, up to four cache lines can be accessed.

[0096] To increase bandwidth in the shared data memory 32, the on-chip memory is organized into multiple banks. Figure 5 An example of shared memory is shown, which includes multiple memory banks coupled to an interconnect network 580. Because shared memory is close to the processing core, shared memory provides higher bandwidth and lower latency than off-chip memory. However, how data is distributed among multiple shared memory banks affects bandwidth.

[0097] like Figure 5 As shown, the shared memory is divided into multiple memory banks (e.g., 32 memory banks, where each clock cycle bandwidth is 32 or 64 bits), each memory bank includes a read port and a write port from which writes and reads are processed simultaneously in multiple memory banks. A memory request consisting of N addresses falls into N different memory banks and can be processed simultaneously. For example, if a read request is made to data at A0, A1, and A3, the interconnection network 580 can read data from memory bank 0, memory bank 1, and memory bank 2 simultaneously via the corresponding read ports. If multiple addresses of a memory request fall in the same memory bank, the request will serialize the individual address requests. For example, if a read request is made to data at B0, A1, and C0, there is a memory bank conflict, and the read request to B0, A1, and C0 will be serialized into three reads.

[0098] Data may be stored in shared memory banks so that consecutive words of a returned cache line map to consecutive banks. Figure 6 An example representation is shown of how data from global memory is laid out in shared memory to reduce conflicting requests. The upper diagram represents how data is stored in global memory, and the lower diagram represents how data is stored in shared memory after fusing the LDGSTS instruction. Each row in the upper diagram corresponds to data because the data will be laid out in a cache line (L1 cache or off-chip memory). Each thread will access global memory in this linear fashion. A block of A in global memory can represent 8 two-byte elements wide and 8 elements high. A block of A can represent a block of the overall matrix.

[0099] As threads access a cache line, the data is rearranged into shared memory addresses that are "swapped". For example, a row is retrieved as it is laid out in global memory. Each element in the row is returned and stored in shared memory along different banks, using a shared address specified by each thread and encoded as a token that is sent with the request and returned with the data.

[0100] like Figure 6 As shown, the rows of A are spread across the width of the shared memory. This allows access to any sub-block in the same block in a conflict-free manner. If all data from block A were stacked vertically in shared memory, they could only be read serially. By spreading them out, all blocks of A can be accessed without conflicts. Figure 6 It is also shown how consecutive elements of block C are distributed to different specific banks of the shared memory.

[0101] By distributing data across banks, when 32 words are read from shared memory (comprising 32 banks), the 32 words can be read from different lines. Similar requests to the L1 cache will read from the same line. As discussed above, in some implementations, L1 accesses are limited to as many different non-conflicting lines as the number of tagged banks.

[0102] Figure 7 An exemplary sector pattern that can be applied to a shared memory (comprising four sectors) is shown. The merge buffer can be configured to determine the pattern between the filled sectors and the destination shared memory address. The detected pattern is optimized for common patterns observed in existing workloads.

[0103] The merge buffer may be configured to detect and apply permutation patterns and / or intra-sector swapping when processing memory transactions. In one example, a 128B global cache line is further arranged into four 32B sectors. When a global cache line sector (e.g., sector 0) is returned in response to an LDGSTS instruction, the cache line sector may be directly stored in sector 0 of the shared memory via the interconnect network, or rotated and stored in sectors 1, 2, or 3 of the shared memory.

[0104] In addition, the granularity at which the returned global cache line sectors are stored in the shared memory can be controlled. For example, the instructions can have the option to swap half of the returned global cache line sectors (e.g., store the lower 16B in the upper portion of the shared memory sector and store the lower 16B in the lower portion of the shared memory sector). In addition, the instructions can write only the lower 16B or only the upper 16B to the shared memory sector.

[0105] When multiple threads request data, the merge buffer will look at the address of the requested data and determine if the requested data belongs to the same cache line. If the address is determined to belong to the same cache line, the request for the data can be merged and the sector mode can be set so that when the data is returned, it will be stored in different banks of shared memory. As an example, the first sector is written to the upper part of the first bank, and a shift and rotation is applied so that the next sector is written to the lower part of the second bank (see e.g. Figure 6 ). If the pattern cannot be recognized, the hardware can send the data request alone.

[0106] The interconnection network 580 may include one or more crossbar switches, including a read crossbar switch and / or a write crossbar switch. The interconnection network 580 supports multiple parallel read and write operations, and supports accessing data stored in the shared data memory 32 using direct addressing and accessing data stored in the L1 data memory 34 using tag lookups. The interconnection network 580 may support multiple simultaneous reads and writes corresponding to the number of banks in the shared memory, L1 cache, and / or registers. In one example, the interconnection network 580 may support multiple simultaneous reads and writes, the number of which is equal to the number of memory banks in the data memory storage 30 (e.g., unified memory).

[0107] Split memory request

[0108] When the data requested by a thread exceeds a predetermined size, the memory request can be split into independent requests to provide a certain level of granularity for each request. For example, when the data requested by a thread is larger than a predetermined size (e.g., 16 or 32 bytes), the thread issuing the load / store request can be forked into one or more helper threads, each of which independently issues a 16-byte or 32-byte memory request. Each memory request is broken down into independently issued cache line requests. The threads can be joined after completing the individual requests.

[0109] Fill bytes to zero

[0110] LDGSTS can support an option to fill the SMEM target address with zero bytes (.ZFILL). This is useful if a thread's footprint read from global memory crosses a maximum boundary condition. It's not that the global address is invalid or the data itself is invalid, but that the data being zeroed is not applicable to the current work product of a given thread. The advantage is that the kernel can use consistent access bit sizes (e.g., sz:{.32,.64,.128}) without the need for custom code or branches using fixed-size loads.

[0111] Multiple alternatives are available for how to specify byte zeroing, for example, as an explicit mask or byte count in the instruction parameters provided by the thread. Instead, the .ZFILL option is embedded into the global address LSB, indicating the number of bytes from the end of the region being stored to zero. This maintains the same parameter movement and BW with non-.ZFILL operation, achieving minimal design disruption and the same problem performance.

[0112] When .ZFILL is specified, global address alignment checking is suspended and alignment to .sz boundaries is forced. This frees up log2(.sz accesses in bytes) least significant addressing and allows the global address LSBs to be interpreted as a count of the number of bytes from the end of the region being stored to zero. When .ZFILL is specified in an instruction, the .ZFILL parameter value can be specified per thread and can uniquely affect the region being stored per thread. The global address is defined as the final sum of (RF+UR+Imm).

[0113] Given a byte count embedded in the global address LSB to zero and the access size, a mask can be generated indicating which bytes to keep from filling data (mask bits = 1) or zeros (mask bits = 0). If .ZFILL is not used, the mask is implied to be all 1s.

[0114] Enable byte writes for storage

[0115] A complementary feature to .ZFILL can be provided for global stores to allow actual store bytes to be skipped (.WSKIP) from the data sent per thread. The same technique can be used to embed a byte count in the global address LSB, where the count indicates the number of bytes skipped from the end of the .sz access for a given thread store. This also allows the core to use a uniform .sz value (e.g., STG.128.WSKIP) to handle maximum boundary conditions, rather than staging different .sz stores.

[0116] Programming Model and Software Exposure

[0117] Simple LDG / STS / Barrier pattern: A common and relatively simple pattern is that threads cooperatively load global data, immediately store it in shared memory, and use barrier synchronization to consume the data. Although memory latency is exposed here, the application relies on the occupancy of multiple cooperative thread groups (CTAs) in the SM to hide the exposed latency. This is a relatively inefficient use of resources because all resources such as threads, register files, and shared memory are duplicated. However, the compiler can fuse LDG and STS operations. The compiler has a mechanism to make barrier synchronization dependent on STS completion. A scoreboard release capability is provided for the LDGSTS instruction so that barrier instructions can depend on scoreboard registers.

[0118] Batch Load Mode: An advanced usage pattern is for a thread to issue multiple LDG operations followed by multiple STS operations before doing a barrier synchronization. The fused LDGSTS operations can complete out of order with respect to each other. To provide correct dependency tracking for barrier operations, a new instruction called LDGDEPBAR can be added that adds a fence to the completion of all previous LDGSTS operations.

[0119] Software Pipelined Loads: A more efficient way to hide memory latency is to pre-fetch data ahead of time using software pipelining and loop unrolling. This is accomplished by allocating multiple sets of registers for multiple load batches and explicitly delaying the corresponding STS operations. This technique can be difficult for compilers to target, especially when it involves hoisting memory operations through barriers. The combination of LDGSTS and LDGDEPBAR makes this possible.

[0120] Since there are no named batches of registers to allocate / manage, the unwinding process is made easier. The LDGDEPBAR instruction is defined to have in-order semantics with the previous LDGDEPBAR instruction. This borrows the technique used for TEXTURE batch management using DEPBAR dependency tracking.

[0121] This process also enables more powerful asynchronous DMA transfer primitives and shared memory based synchronization objects. In this example,

[0122] The barrier state object is implemented in shared memory instead of in a dedicated counter.

[0123] Threads can use custom atomic operations ATOMS.ARRIVE.64. to update state. Similar to LDGDEPBAR, another fence operation

[0124] "ARRIVES.LDGSTSBAR.64" is defined, which updates the shared memory barrier object after a batch of LDGSTS operations are completed.

[0125] These constructs will allow LDGSTS to be exposed as thread-cooperative asynchronous DMA operations whose completion status can be queried by querying the shared memory barrier status object [see U.S. Provisional Patent Application Serial No. 62 / 927,511, filed October 29, 2019, and U.S. Patent Application Serial No. 16 / 712,236, filed December 12, 2019, which are incorporated herein by reference]. This allows application programmers to take advantage of asynchronous DMA transfers and easily get support from drivers / compilers.

[0126] When the LDGSTS instruction is issued, the execution thread can fork off a logical helper thread, which in turn copies data from global memory to shared memory (without using SM resources such as bundle slots and register files). However, the helper thread competes with other threads for memory bandwidth. The execution thread then marks the helper thread complete with a join operation, which takes one of three forms:

[0127] 1. ARRIVES.LDGSTSBAR with Arrive-Wait-Barrier

[0128] 2. Batch counting scoreboard implementation using LDGDEPBAR and DEPBAR.LE

[0129] 3. Write &req on the scoreboard (which is updated by the LDGSTS instruction)

[0130] Instruction issuance order

[0131] All instructions before LDGSTS may be issued before the helper thread is spawned. There is no guaranteed order of execution between a) the helper thread and b) the instructions in the execution thread between the LDGSTS instruction and the join instruction. The helper thread is guaranteed to complete before the execution thread issues instructions that continue the join operation in program order.

[0132] A BAR instruction in the executing thread (before an LDGSTS instruction, between an LDGSTS instruction and a join operation, or after a join operation) does not guarantee any other execution order for the helper thread. In other words, helper threads (which do not belong to the executing thread's CTA) do not participate in CTA-wide synchronization barriers like BAR.SYNC and BAR.SYNCALL.

[0133] Example of an example non-limiting parallel processing GPU architecture for performing the operations described above and processing as described above

[0134] An example illustrative architecture will now be described that can be directed to the shared memory instructions disclosed in this application through load and store. The following information is set forth for illustrative purposes and should not be construed as limiting in any way. Any of the following features can be optionally combined with other features described, but not excluding the other features described.

[0135] Figure 8 A parallel processing unit (PPU) 300 is shown according to one embodiment. In one embodiment, the PPU 300 is a multi-threaded processor implemented on one or more integrated circuit devices. The PPU 300 is a latency-hiding architecture designed for processing many threads in parallel. A thread (i.e., an execution thread) is an instance of an instruction set configured to be executed by the PPU 300. In one embodiment, the PPU 300 is a graphics processing unit (GPU) configured to implement a graphics rendering pipeline for processing three-dimensional (3D) graphics data to generate two-dimensional (2D) image data for display on a display device (such as a liquid crystal display (LCD) device). In other embodiments, the PPU 300 can be used to perform general-purpose computations.

[0136] One or more PPUs 300 can be configured to accelerate thousands of high-performance computing (HPC), data center, and machine learning applications. PPU 300 can be configured to accelerate numerous deep learning systems and applications, including autonomous vehicle platforms, deep learning, high-precision speech, image, and text recognition systems, intelligent video analysis, molecular simulation, drug development, disease diagnosis, weather forecasting, big data analysis, astronomy, molecular dynamics simulation, financial modeling, robotics, factory automation, real-time language translation, online search optimization, and personalized user recommendations, among others.

[0137] like Figure 8As shown, the PPU 300 includes an input / output (I / O) unit 305, a front-end unit 315, a scheduler unit 320, a work distribution unit 325, a hub 330, a crossbar switch (Xbar) 370, one or more general processing clusters (GPCs) 350, and one or more partition units 380. The PPU 300 can be connected to a host processor or other PPUs 300 via one or more high-speed NVLink 310 interconnects. The PPU 300 can be connected to a host processor or other peripheral devices via an interconnect 302. The PPU 300 can also be connected to a local memory including multiple memory devices 304. In one embodiment, the local memory can include multiple dynamic random access memory (DRAM) devices. The DRAM device can be configured as a high bandwidth memory (HBM) subsystem, in which multiple DRAM dies are stacked within each device.

[0138] The NVLink 310 interconnect enables the system to scale and include one or more PPUs 300 in conjunction with one or more CPUs, supporting cache coherency between the PPU 300 and the CPU, and CPU mastering. Data and / or commands may be sent by the NVLink 310 through the hub 330 to or from other units of the PPU 300, such as one or more copy engines, video encoders, video decoders, power management units, etc. (not explicitly shown). Fig. 10B NVLink 310 is described in more detail.

[0139] I / O unit 305 is configured to send and receive communications (e.g., commands, data, etc.) from a host processor (not shown) via interconnect 302. I / O unit 305 may communicate with the host processor directly via interconnect 302, or through one or more intermediate devices (such as a memory bridge). In one embodiment, I / O unit 305 may communicate with one or more other processors (e.g., one or more PPUs 300) via interconnect 302. In one embodiment, I / O unit 305 implements a peripheral component interconnect express (PCIe) interface for communicating over a PCIe bus, and interconnect 302 is a PCIe bus. In alternative embodiments, I / O unit 305 may implement other types of known interfaces for communicating with external devices.

[0140] The I / O unit 305 decodes packets received via the interconnect 302. In one embodiment, the packets represent commands configured to cause the PPU 300 to perform various operations. The I / O unit 305 sends the decoded commands to various other units of the PPU 300 as specified by the commands. For example, some commands may be sent to the front end unit 315. Other commands may be sent to the hub 330 or other units of the PPU 300, such as one or more copy engines, video encoders, video decoders, power management units, etc. (not explicitly shown). In other words, the I / O unit 305 is configured to route communications between and among the various logical units of the PPU 300.

[0141] In one embodiment, a program executed by a host processor encodes a command stream in a buffer that provides a workload to the PPU 300 for processing. The workload may include many instructions and data to be processed by those instructions. A buffer is an area in memory that is accessible (e.g., read / write) by both the host processor and the PPU 300. For example, the I / O unit 305 may be configured to access a buffer in a system memory connected to the interconnect 302 via a memory request transmitted through the interconnect 302. In one embodiment, the host processor writes a command stream to the buffer and then sends a pointer to the start of the command stream to the PPU 300. The front end unit 315 receives a pointer to one or more command streams. The front end unit 315 manages one or more streams, reads commands from the streams, and forwards the commands to the various units of the PPU 300.

[0142] The front end unit 315 is coupled to a scheduler unit 320, which configures the various GPCs 350 to process tasks defined by one or more streams. The scheduler unit 320 is configured to track state information related to the various tasks managed by the scheduler unit 320. The state may indicate which GPC 350 the task is assigned to, whether the task is active or inactive, a priority associated with the task, etc. The scheduler unit 320 manages the execution of multiple tasks on one or more GPCs 350.

[0143] Scheduler unit 320 is coupled to work distribution unit 325, which is configured to dispatch tasks for execution on GPC 350. Work distribution unit 325 may keep track of a number of scheduled tasks received from scheduler unit 320. In one embodiment, work distribution unit 325 manages a pending task pool and an active task pool for each GPC 350. The pending task pool may include a number of time slots (e.g., 32 time slots) containing tasks assigned to be processed by a particular GPC 350. The active task pool may include a number of time slots (e.g., 4 time slots) for tasks that are being actively processed by GPC 350. When a GPC 350 completes execution of a task, the task is evicted from the active task pool of GPC 350, and one of the other tasks from the pending task pool is selected and scheduled for execution on GPC 350. If an active task on a GPC 350 has become idle, such as while waiting for a data dependency to be resolved, then the active task may be evicted from the GPC 350 and returned to the pending task pool, while another task in the pending task pool is selected and scheduled for execution on the GPC 350 .

[0144] Work distribution unit 325 communicates with one or more GPCs 350 via XBar (crossbar) 370. XBar 370 is an interconnect network that couples many units of PPU 300 to other units of PPU 300. For example, XBar 370 can be configured to couple work distribution unit 325 to a particular GPC 350. Although not explicitly shown, one or more other units of PPU 300 can also be connected to XBar 370 via hub 330.

[0145] Tasks are managed by a scheduler unit 320 and dispatched to GPCs 350 by a work distribution unit 325. GPCs 350 are configured to process tasks and generate results. Results can be consumed by other tasks within the GPC 350, routed to different GPCs 350 via XBar 370, or stored in memory 304. Results can be written to memory 304 via a partition unit 380, which implements a memory interface for reading data from and writing data to memory 304. Results can be sent to another PPU 300 or CPU via NVLink 310. In one embodiment, a PPU 300 includes a number U of partition units 380, which is equal to the number of independent and distinct memory devices 304 coupled to the PPU 300. This will be described below in conjunction with Fig. 9B The partition unit 380 is described in more detail.

[0146] In one embodiment, the host processor executes a driver kernel that implements an application programming interface (API) that enables one or more applications to be executed on the host processor to schedule operations for execution on the PPU 300. In one embodiment, multiple computing applications are executed simultaneously by the PPU 300, and the PPU 300 provides isolation, quality of service (QoS), and independent address spaces for multiple computing applications. The application can generate instructions (e.g., API calls) that cause the driver kernel to generate one or more tasks to be executed by the PPU 300. The driver kernel outputs the tasks to one or more streams being processed by the PPU 300. Each task can include one or more related groups of threads, referred to herein as warps. In one embodiment, a warp includes 32 related threads that can execute in parallel. Collaborating threads can refer to multiple threads that include instructions to perform tasks and can exchange data through shared memory. In combination Fig. 10A Describes threads and cooperative threads in more detail.

[0147] Fig.9A According to an embodiment Figure 8 PPU 300 GPC 350. Fig.9A As shown, each GPC 350 includes multiple hardware units for processing tasks. In one embodiment, each GPC 350 includes a pipeline manager 410, a pre-raster operation unit (PROP) 415, a raster engine 425, a work distribution crossbar switch (WDX) 480, a memory management unit (MMU) 490, and one or more data processing clusters (DPCs) 420. It should be understood that Fig.9A The GPC 350 may include instead Fig.9A Other hardware units or units other than those shown in Fig.9A Other hardware units than those shown in .

[0148] In one embodiment, the operation of the GPC 350 is controlled by a pipeline manager 410. The pipeline manager 410 manages the configuration of one or more DPCs 420 for processing tasks assigned to the GPC 350. In one embodiment, the pipeline manager 410 may configure at least one of the one or more DPCs 420 to implement at least a portion of a graphics rendering pipeline. For example, a DPC 420 may be configured to execute a vertex shading program on a programmable streaming multiprocessor (SM) 440. The pipeline manager 410 may also be configured to route packets received from the work distribution unit 325 to appropriate logic units in the GPC 350. For example, some packets may be routed to fixed-function hardware units in the PROP 415 and / or the raster engine 425, while other packets may be routed to the DPC 420 for processing by the primitive engine 435 or the SM 440. In one embodiment, the pipeline manager 410 may configure at least one of the one or more DPCs 420 to implement a neural network model and / or a computational pipeline.

[0149] PROP unit 415 is configured to route data generated by raster engine 425 and DPC 420 to a raster operations (ROP) unit, in conjunction with Fig. 9B The PROP unit 415 may also be configured to perform optimization of color blending, organize pixel data, perform address translation, etc.

[0150] Graphics Processing Pipeline

[0151] In one embodiment, the PPU 300 includes a graphics processing unit (GPU). The PPU 300 is configured to receive commands specifying a shader for processing graphics data. The graphics data may be defined as a set of primitives, such as points, lines, triangles, quadrilaterals, triangle strips, etc. Typically, a primitive includes data specifying a plurality of vertices of the primitive (e.g., in a model space coordinate system) and attributes associated with each vertex of the primitive. The PPU 300 may be configured to process the primitives to generate a frame buffer (e.g., pixel data for each of the pixels of a display).

[0152] The application writes the model data (e.g., a collection of vertices and attributes) of the scene to a memory (such as system memory or memory 304). The model data defines each of the objects that may be visible on the display. The application then makes an API call to the driver kernel, which requests the model data to be rendered and displayed. The driver kernel reads the model data and writes commands to one or more streams to perform operations to process the model data. These commands may refer to different shading programs to be implemented on the SM 440 of the PPU 300, including one or more of vertex shading, hull shading, domain shading, geometry shading, and pixel shading. For example, one or more of the SM 440 may be configured to execute a vertex shading program that processes multiple vertices defined by the model data. In one embodiment, different SMs 440 may be configured to execute different shading programs simultaneously. For example, a first subset of SMs 440 may be configured to execute a vertex shading program, and a second subset of SMs 440 may be configured to execute a pixel shading program. The first subset of SMs 440 processes the vertex data to generate processed vertex data, and writes the processed vertex data to the L2 cache 460 and / or the memory 304. After the processed vertex data is rasterized (e.g., converted from three-dimensional data to two-dimensional data in screen space) to generate fragment data, a second subset of SMs 440 performs pixel shading to generate processed fragment data, which is then blended with other processed fragment data and written to a frame buffer in memory 304. Vertex shading programs and pixel shading programs can be executed simultaneously, processing different data from the same scene in a pipelined manner until all model data for the scene has been rendered to the frame buffer. The contents of the frame buffer are then transmitted to a display controller for display on a display device.

[0153] Fig.11 According to one embodiment, Figure 8 300 of FIG. 1 . Graphics processing pipeline 600 is an abstract flow chart of processing steps implemented to generate a 2D computer-generated image from 3D geometric data. As is well known, pipeline architectures can perform long latency operations more efficiently by breaking the operations into multiple stages, where the output of each stage is coupled to the input of the next consecutive stage. Thus, graphics processing pipeline 600 receives input data 601 that is passed from one stage of graphics processing pipeline 600 to the next stage to generate output data 602. In one embodiment, graphics processing pipeline 600 may represent a graphics processing pipeline composed of API-defined graphics processing pipeline. Alternatively, graphics processing pipeline 600 can be implemented in the functional and architectural context of the previous figures and / or one or more of any subsequent figures.

[0154] like Fig.11As shown, the graphics processing pipeline 600 includes a pipeline architecture including multiple stages. These stages include, but are not limited to, a data assembly stage 610, a vertex shading stage 620, a primitive assembly stage 630, a geometry shading stage 640, a viewport scale, cull, and clip (VSCC) stage 650, a rasterization stage 660, a fragment shading stage 670, and a raster operation stage 680. As described above, software shading algorithms that work in conjunction with such shading hardware can be optimized to reduce computation time.

[0155] In one embodiment, input data 601 includes commands that configure a processing unit to implement the stages of graphics processing pipeline 600 and configure geometric primitives (e.g., points, lines, triangles, quads, triangle strips or fans, etc.) to be processed by these stages. Output data 602 may include pixel data (i.e., color data) that is copied into a frame buffer or other type of surface data structure in memory.

[0156] The data assembly stage 610 receives input data 601, which specifies vertex data for high-order surfaces, primitives, etc. The data assembly stage 610 collects the vertex data in temporary storage or queues, such as by receiving a command from a host processor including a pointer to a buffer in memory and reading the vertex data from the buffer. The vertex data is then passed to the vertex shading stage 620 for processing.

[0157] The vertex shading stage 620 processes vertex data by executing a set of operations (e.g., a vertex shader or program) once for each vertex. A vertex may be specified, for example, as a 4-coordinate vector (e.g.,<x,y,z,w> ). The vertex shading stage 620 can manipulate various vertex attributes, such as position, color, texture coordinates, etc. In other words, the vertex shading stage 620 performs operations on vertex coordinates or other vertex attributes associated with the vertex. These operations typically include lighting operations (e.g., modifying the color attribute of the vertex) and transformation operations (e.g., modifying the coordinate space of the vertex). For example, a vertex can be specified using coordinates in an object coordinate space, which is transformed by multiplying the coordinates by a matrix that converts the coordinates from the object coordinate space to world space or normalized-device-coordinate (NCD) space. The vertex shading stage 620 generates transformed vertex data that is transmitted to the primitive assembly stage 630.

[0158] The primitive assembly stage 630 collects the vertices output by the vertex shading stage 620 and groups the vertices into geometric primitives for processing by the geometry shading stage 640. For example, the primitive assembly stage 630 may be configured to group every three consecutive vertices into geometric primitives (e.g., triangles) for transmission to the geometry shading stage 640. In some embodiments, particular vertices may be reused for consecutive geometric primitives (e.g., two consecutive triangles in a triangle strip may share two vertices). The primitive assembly stage 630 transmits the geometric primitives (e.g., a collection of associated vertices) to the geometry shading stage 640.

[0159] The geometry shading stage 640 processes geometric primitives by performing a set of operations (e.g., geometry shaders or programs) on the geometric primitives. A tessellation operation can generate one or more geometric primitives from each geometric primitive. In other words, the geometry shading stage 640 can subdivide each geometric primitive into a finer grid of two or more geometric primitives for processing by the rest of the graphics processing pipeline 600. The geometry shading stage 640 transmits the geometric primitives to the viewport SCC stage 650.

[0160] In one embodiment, the graphics processing pipeline 600 can operate within a streaming multiprocessor and vertex shading stage 620, primitive assembly stage 630, geometry shading stage 640, fragment shading stage 670 and / or hardware / software associated therewith, and can perform processing operations sequentially. Once the sequential processing operations are completed, in one embodiment, the viewport SCC stage 650 can utilize the data. In one embodiment, primitive data processed by one or more stages in the graphics processing pipeline 600 can be written to a cache (e.g., an L1 cache, a vertex cache, etc.). In this case, in one embodiment, the viewport SCC stage 650 can access the data in the cache. In one embodiment, the viewport SCC stage 650 and the rasterization stage 660 are implemented as fixed function circuits.

[0161] The viewport SCC stage 650 performs viewport scaling, culling, and clipping of geometric primitives. Each surface being rendered is associated with an abstract camera position. The camera position represents the position of the viewer who is viewing the scene and defines a view cone that surrounds the objects of the scene. The view cone may include a viewing plane, a back plane, and four clipping planes. Any geometric primitives that are completely outside the view cone may be culled (e.g., discarded) because they will not contribute to the final rendered scene. Any geometric primitives that are partially within the view cone and partially outside the view cone may be clipped (e.g., converted to new geometric primitives that are enclosed within the view cone). In addition, each geometric primitive may be scaled based on the depth of the view cone. All potentially visible geometric primitives are then transferred to the rasterization stage 660.

[0162] The rasterization stage 660 converts 3D geometric primitives into 2D fragments (e.g., capable of being used for display, etc.). The rasterization stage 660 can be configured to use the vertices of the geometric primitives to set a set of plane equations from which various attributes can be interpolated. The rasterization stage 660 can also calculate a coverage mask for multiple pixels, which indicates whether one or more sample positions of a pixel intercept the geometric primitive. In one embodiment, a z test can also be performed to determine whether the geometric primitive is occluded by other geometric primitives that have been rasterized. The rasterization stage 660 generates fragment data (e.g., interpolated vertex attributes associated with a specific sample position of each covered pixel), which is transmitted to the fragment shading stage 670.

[0163] The fragment shading stage 670 processes the fragment data by executing a set of operations (e.g., a fragment shader or program) on each of the fragments. The fragment shading stage 670 may generate pixel data (e.g., color values) for the fragments, such as by performing lighting operations or sampling a texture map using interpolated texture coordinates of the fragments. The fragment shading stage 670 generates pixel data, which is sent to the raster operations stage 680.

[0164] The raster operation stage 680 can perform various operations on the pixel data, such as performing an alpha test, a stencil test, and blending the pixel data with other pixel data corresponding to other fragments associated with the pixel. When the raster operation stage 680 has completed processing the pixel data (e.g., output data 602), the pixel data can be written to a rendering target, such as a frame buffer, a color buffer, etc. The raster engine 425 includes many fixed-function hardware units configured to perform various raster operations. In one embodiment, the raster engine 425 includes a setup engine, a coarse raster engine, a culling engine, a clipping engine, a fine raster engine, and a tile merging engine. The setup engine receives the transformed vertices and generates plane equations associated with the geometric primitives defined by the vertices. The plane equations are sent to the coarse raster engine to generate coverage information for the primitives (e.g., the x, y coverage mask of the tile). The output of the coarse raster engine is sent to the culling engine, where the fragments associated with the primitives that fail the z test are culled, and the unculled fragments are sent to the clipping engine, where the fragments outside the view frustum are clipped. Those fragments remaining after clipping and culling can be passed to the fine raster engine to generate properties for the pixel fragments based on the plane equations generated by the setup engine. The output of the raster engine 425 includes fragments to be processed, for example, by a fragment shader implemented in the DPC 420.

[0165] It should be appreciated that one or more additional stages may be included in the graphics processing pipeline 600 in addition to or in place of one or more of the above-described stages. Various implementations of the abstract graphics processing pipeline may implement different stages. Furthermore, in some embodiments, one or more of the above-described stages may be excluded from the graphics processing pipeline (such as the geometry shading stage 640). Other types of graphics processing pipelines are considered to be contemplated within the scope of the present disclosure. Furthermore, any stage of the graphics processing pipeline 600 may be implemented by one or more dedicated hardware units within a graphics processor (such as PPU 300). Other stages of the graphics processing pipeline 600 may be implemented by programmable hardware units (such as SM 440 of PPU 300).

[0166] The graphics processing pipeline 600 may be implemented via an application program executed by a host processor (such as a CPU). In one embodiment, a device driver may implement an application programming interface (API) that defines various functions that an application program may use in order to generate graphics data for display. A device driver is a software program that includes multiple instructions that control the operation of the PPU 300. The API provides an abstraction for programmers, allowing programmers to generate graphics data using dedicated graphics hardware (such as the PPU 300) without requiring programmers to use a specific instruction set of the PPU 300. An application may include an API call that is routed to a device driver of the PPU 300. The device driver interprets the API call and performs various operations in response to the API call. In some cases, the device driver may perform operations by executing instructions on the CPU. In other cases, the device driver may perform operations at least in part by initiating operations on the PPU 300 using an input / output interface between the CPU and the PPU 300. In one embodiment, the device driver is configured to implement the graphics processing pipeline 600 using the hardware of the PPU 300.

[0167] Various programs may be executed in the PPU 300 to implement various stages of the graphics processing pipeline 600. For example, a device driver may launch a kernel on the PPU 300 to execute the vertex shading stage 620 on one SM 440 (or multiple SMs 440). The device driver (or the initial kernel executed by the PPU 400) may also launch other kernels on the PPU 400 to execute other stages of the graphics processing pipeline 600, such as the geometry shading stage 640 and the fragment shading stage 670. In addition, certain stages of the graphics processing pipeline 600 may be implemented on fixed unit hardware, such as a rasterizer or data assembler implemented in the PPU 400. It will be appreciated that the results from one kernel may be processed by one or more intermediate fixed function hardware units before being processed by subsequent kernels on the SM 440.

[0168] Each DPC 420 included in the GPC 350 includes an M-pipeline controller (MPC) 430, a primitive engine 435, and one or more SMs 440. The MPC 430 controls the operation of the DPC 420, routing packets received from the pipeline manager 410 to appropriate units in the DPC 420. For example, packets associated with vertices may be routed to the primitive engine 435, which is configured to fetch vertex attributes associated with the vertices from the memory 304. Conversely, packets associated with shading programs may be sent to the SM 440.

[0169] SM 440 includes a programmable stream processor configured to process tasks represented by multiple threads. Each SM440 is multithreaded and is configured to execute multiple threads (e.g., 32 threads) from a specific thread group simultaneously. In one embodiment, SM 440 implements a SIMD (single instruction, multiple data) architecture, wherein each thread in a thread group (e.g., a warp) is configured to process different data sets based on the same instruction set. All threads in a thread group execute the same instruction. In another embodiment, SM 440 implements a SIMT (single instruction, multiple threads) architecture, wherein each thread in a thread group is configured to process different data sets based on the same instruction set, but wherein each thread in a thread group is allowed to diverge during execution. In one embodiment, a program counter, a call stack, and an execution state are maintained for each warp, and when threads in a warp diverge, concurrency between warps and serial execution within a warp are enabled. In another embodiment, a program counter, a call stack, and an execution state are maintained for each individual thread, thereby achieving equal concurrency between all threads within and between warps. When execution state is maintained for each individual thread, threads executing the same instructions can be converged and executed in parallel for maximum efficiency. Fig. 10ASM 440 is described in more detail.

[0170] MMU 490 provides an interface between GPC 350 and partition unit 380. MMU 490 can provide virtual address to physical address translation, memory protection, and arbitration of memory requests. In one embodiment, MMU 490 provides one or more translation lookaside buffers (TLBs) for performing translations from virtual addresses to physical addresses in memory 304.

[0171] Fig. 9B According to an embodiment Figure 8 The memory partition unit 380 of the PPU 300. Fig. 9B As shown, the memory partition unit 380 includes a raster operation (ROP) unit 450, a second level (L2) cache 460, and a memory interface 470. The memory interface 470 is coupled to the memory 304. The memory interface 470 can implement a 32, 64, 128, 1024 bit data bus, etc. for high-speed data transmission. In one embodiment, the PPU 300 incorporates U memory interfaces 470, one for each pair of partition units 380, wherein each pair of partition units 380 is connected to a corresponding memory device 304. For example, the PPU 300 can be connected to up to Y memory devices 304, such as a high bandwidth memory stack or a graphics double data rate version 5 synchronous dynamic random access memory or other types of persistent memory.

[0172] In one embodiment, memory interface 470 implements an HBM2 memory interface, and Y is equal to half of U. In one embodiment, the HBM2 memory stack is located on the same physical package as PPU 300, providing significant power and area savings compared to conventional GDDR5 SDRAM systems. In one embodiment, each HBM2 stack includes four memory dies and Y is equal to 4, where the HBM2 stack includes two 128-bit channels per die, a total of 8 channels and a data bus width of 1024 bits.

[0173] In one embodiment, memory 304 supports single error correction double error detection (SECDED) error correction code (ECC) to protect data. ECC provides higher reliability for computing applications that are sensitive to data corruption. Reliability is particularly important in large cluster computing environments where PPU 300 processes very large data sets and / or long-running applications.

[0174] In one embodiment, the PPU 300 implements a multi-level memory hierarchy. In one embodiment, the memory partition unit 380 supports unified memory to provide a single unified virtual address space for the CPU and PPU 300 memory, enabling data sharing between virtual memory systems. In one embodiment, the frequency of PPU 300 accesses to memory located on other processors is tracked to ensure that memory pages are moved to the physical memory of the PPU 300 that accesses the page more frequently. In one embodiment, the NVLink 310 supports address translation services that allow the PPU 300 to directly access the CPU's page tables and provide full access to the CPU memory by the PPU 300.

[0175] In one embodiment, the copy engine transfers data between multiple PPUs 300 or between a PPU 300 and a CPU. The copy engine can generate a page fault for an address that is not mapped to a page table. The memory partition unit 380 can then service the page fault, map the address into a page table, and then the copy engine can perform the transfer. In conventional systems, fixed memory (e.g., non-pageable) is operated for multiple copy engines between multiple processors, which significantly reduces the available memory. Due to hardware paging faults, addresses can be passed to the copy engine without worrying about whether the memory page is resident, and the copy process is transparent.

[0176] Data from memory 304 or other system memory may be retrieved by memory partition unit 380 and stored in L2 cache 460, which is located on-chip and shared between various GPCs 350. As shown, each memory partition unit 380 includes a portion of L2 cache 460 associated with a corresponding memory device 304. Lower level caches may then be implemented in multiple units within a GPC 350. For example, each SM 440 may implement a level 1 (L1) cache. An L1 cache is a dedicated memory dedicated to a particular SM 440. Data from L2 cache 460 may be retrieved and stored in each L1 cache for processing in a functional unit of the SM 440. L2 cache 460 is coupled to a memory interface 470 and an XBar 370.

[0177] The ROP unit 450 performs graphics raster operations related to pixel color such as color compression, pixel blending, etc. The ROP unit 450 also implements depth testing in conjunction with the raster engine 425, receiving the depth of a sample position associated with a pixel fragment from the culling engine of the raster engine 425. The depth of the sample position associated with the fragment is tested relative to the corresponding depth in the depth buffer. If the fragment passes the depth test for the sample position, the ROP unit 450 updates the depth buffer and sends the result of the depth test to the raster engine 425. It will be understood that the number of partition units 380 may be different than the number of GPCs 350, and thus each ROP unit 450 may be coupled to each GPC 350. The ROP unit 450 tracks packets received from different GPCs 350 and determines to which GPC 350 the results generated by the ROP unit 450 are routed via the Xbar 370. Although in Fig. 9B In the embodiment shown, ROP unit 450 is included within memory partition unit 380, but in other embodiments, ROP unit 450 may be external to memory partition unit 380. For example, ROP unit 450 may reside in GPC 350 or another unit.

[0178] Fig. 10A According to an embodiment Fig.9A The streaming multiprocessor 440. Fig. 10A As shown, SM 440 includes an instruction cache 505, one or more scheduler units 510, a register file 520, one or more processing cores 550, one or more special function units (SFU) 552, one or more load / store units (LSU) 554, an interconnection network 580, and a shared memory / L1 cache 570.

[0179] As described above, the work distribution unit 325 schedules tasks to be executed on the GPC 350 of the PPU 300. Tasks are assigned to specific DPCs 420 within the GPC 350, and if the task is associated with a shader program, the task may be assigned to the SM 440. The scheduler unit 510 receives tasks from the work distribution unit 325 and manages the scheduling of instructions assigned to one or more thread blocks assigned to the SM 440. The scheduler unit 510 schedules the thread blocks to execute as warps of parallel threads, where each thread block is assigned at least one warp. In one embodiment, each warp executes 32 threads. The scheduler unit 510 can manage a plurality of different thread blocks, assign warps to different thread blocks, and then dispatch instructions from a plurality of different cooperative groups to various functional units (i.e., core 550, SFU 552, and LSU 554) during each clock cycle.

[0180] Cooperative Groups is a programming model for organizing groups of communicating threads that allows developers to express the granularity at which threads are communicating, enabling the expression of richer and more efficient decompositions of parallelism. The cooperative launch API supports synchronization between thread blocks to execute parallel algorithms. Conventional programming models provide a single simple structure for synchronizing cooperative threads: a barrier across all threads of a thread block (e.g., the syncthreads() function). However, programmers often want to define thread groups at a granularity smaller than the thread block granularity and synchronize within the defined group, enabling higher performance, design flexibility, and software reuse in the form of a collective group-wide function interface.

[0181] Cooperative Groups enables programmers to explicitly define thread groups at sub-block (e.g., as small as a single thread) and multi-block granularity and perform collective operations such as synchronization on threads in a cooperative group. The programming model supports clean composition across software boundaries so that libraries and utility functions can safely synchronize in their local environment without making assumptions about convergence. Cooperative Groups primitives enable new patterns of cooperative parallelism, including producer-consumer parallelism, opportunistic parallelism, and global synchronization across the entire grid of thread blocks.

[0182] The dispatch unit 515 is configured to transmit instructions to one or more functional units. In this embodiment, the scheduler unit 510 includes two dispatch units 515, which enables two different instructions from the same thread warp to be scheduled during each clock cycle. In alternative embodiments, each scheduler unit 510 may include a single dispatch unit 515 or additional dispatch units 515.

[0183] Each SM 440 includes a register file 520 that provides a set of registers for the functional units of the SM 440. In one embodiment, the register file 520 is divided between each functional unit so that each functional unit is assigned a dedicated portion of the register file 520. In another embodiment, the register file 520 is divided between different warps executed by the SM 440. The register file 520 provides temporary storage for operands connected to the data paths of the functional units.

[0184] Each SM 440 includes L processing cores 550. In one embodiment, SM 440 includes a large number (e.g., 128, etc.) of different processing cores 550. Each core 550 may include a fully pipelined, single-precision, double-precision, and / or mixed-precision processing unit, including a floating-point arithmetic logic unit and an integer arithmetic logic unit. In one embodiment, the floating-point arithmetic logic unit implements the IEEE 754-2008 standard for floating-point operations. In one embodiment, core 550 includes 64 single-precision (32-bit) floating-point cores, 64 integer cores, 32 double-precision (64-bit) floating-point cores, and 8 tensor cores.

[0185] The tensor cores are configured to perform matrix operations, and in one embodiment, one or more tensor cores are included in core 550. Specifically, the tensor cores are configured to perform deep learning matrix operations, such as convolution operations for neural network training and inference. In one embodiment, each tensor core operates on a 4×4 matrix and performs a matrix multiplication and accumulation operation D=A×B+C, where A, B, C, and D are 4×4 matrices.

[0186] In one embodiment, the matrix multiplication inputs A and B are 16-bit floating point matrices, while the accumulation matrices C and D can be 16-bit floating point or 32-bit floating point matrices. The tensor cores operate on 16-bit floating point input data with 32-bit floating point accumulations. The 16-bit floating point multiplication requires 64 operations, producing full-precision products, which are then accumulated using 32-bit floating point additions with other intermediate products of the 4×4×4 matrix multiplication. In practice, tensor cores are used to perform larger two-dimensional or higher dimensional matrix operations built from these smaller elements. APIs (such as the CUDA 9 C++ API) expose specialized matrix loads, matrix multiplications and accumulations, and matrix storage operations to efficiently use tensor cores from CUDA-C++ programs. At the CUDA level, the warp-level interface assumes that the 16×16 size matrix spans all 32 threads of the warp.

[0187] In some embodiments, the transposition hardware is included in the processing core 550 or other functional unit (e.g., SFU 552 or LUS 554) and is configured to generate matrix data stored by diagonal lines and / or generate the original matrix and / or the transposed matrix by diagonal line stored matrix data. The transposition hardware can provide a load path to the register file 520 of the SM 440 within the shared memory 570.

[0188] In one example, the matrix data stored by the diagonal can be obtained from the DRAM and stored in the shared memory 570. When an instruction to perform processing using the matrix data stored by the diagonal is processed, the transposition hardware provided in the path of the shared memory 570 and the register file 520 can provide the original matrix, the transposed matrix, the compressed original matrix and / or the compressed transposed matrix. Before the instruction until the last storage, the single matrix data stored by the diagonal can be maintained, and the matrix type specified by the instruction is generated in the register file 520 as needed.

[0189] Each SM 440 also includes M SFUs 552 that perform special functions (e.g., attribute evaluation, reciprocal square root, etc.). In one embodiment, the SFUs 552 may include a tree traversal unit configured to traverse a hierarchical tree data structure. In one embodiment, the SFUs 552 may include a texture unit configured to perform texture map filtering operations. In one embodiment, the texture unit is configured to load a texture map (e.g., a 2D array of texture pixels) from memory 304 and sample the texture map to produce sampled texture values ​​for use in a shader program executed by the SM 440. In one embodiment, the texture map is stored in a shared memory / L1 cache 470. The texture unit implements texture operations, such as filtering operations using mip maps (i.e., texture maps of different levels of detail). In one embodiment, each SM 440 includes two texture units.

[0190] Each SM 440 also includes N LSUs 554 that implement load and store operations between the shared memory / L1 cache 570 and the register file 520. Each SM 440 includes an interconnect network 580 that connects each functional unit to the register file 520 and connects the LSUs 554 to the register file 520 and the shared memory / L1 cache 570. In one embodiment, the interconnect network 580 is a crossbar switch that can be configured to connect any functional unit to any register in the register file 520 and to connect the LSUs 554 to memory locations in the register file 520 and the shared memory / L1 cache 570.

[0191] The shared memory / L1 cache 570 is an on-chip memory array that allows data storage and communication between the SM 440 and the primitive engine 435, as well as between threads in the SM 440. In one embodiment, the shared memory / L1 cache 570 includes 128KB of storage capacity and is in the path from the SM 440 to the partition unit 380. The shared memory / L1 cache 570 can be used to cache reads and writes. One or more of the shared memory / L1 cache 570, the L2 cache 460, and the memory 304 is a backing store.

[0192] Combining the data cache and shared memory functions into a single memory block provides the best overall performance for both types of memory accesses. This capacity can be used by programs as a cache that does not use the shared memory. For example, if the shared memory is configured to use half of the capacity, texture and load / store operations can use the remaining capacity. Integration within the shared memory / L1 cache 570 enables the shared memory / L1 cache 570 to function as a high throughput pipeline for streaming data, while providing high bandwidth and low latency access to frequently reused data.

[0193] When configured for general parallel computing, a simpler configuration can be used compared to graphics processing. Specifically, the fixed-function graphics processing unit shown in Figure 3 is bypassed, creating a simpler programming model. In the general parallel computing configuration, the work distribution unit 325 assigns and distributes thread blocks directly to the DPC 420. The threads in the block execute the same program, use unique thread IDs in the calculation to ensure that each thread generates a unique result, use SM 440 to execute the program and perform calculations, use shared memory / L1 cache 570 to communicate between threads, and use LSU 554 to read and write global memory through shared memory / L1 cache 570 and memory partition unit 380. When configured for general parallel computing, SM 440 can also write commands that the scheduler unit 320 can use to start new work on DPC 420.

[0194] The PPU 300 may be included in a desktop computer, a laptop computer, a tablet computer, a server, a supercomputer, a smartphone (e.g., wireless, handheld device), a personal digital assistant (PDA), a digital camera, a vehicle, a head-mounted display, a handheld electronic device, etc. In one embodiment, the PPU 300 is included on a single semiconductor substrate. In another embodiment, the PPU 300 is included on a system on a chip (SoC) along with one or more other devices (such as an additional PPU 300, a memory 304, a reduced instruction set computer (RISC) CPU, a memory management unit (MMU), a digital-to-analog converter (DAC), etc.).

[0195] In one embodiment, PPU 300 may be included on a graphics card that includes one or more memory devices 304. The graphics card may be configured to interface with a PCIe slot on a motherboard of a desktop computer. In yet another embodiment, PPU 300 may be an integrated graphics processing unit (iGPU) or parallel processor included in a chipset of a motherboard.

[0196] Exemplary Computing System

[0197] Systems with multiple GPUs and CPUs are being used in a variety of industries as developers expose and exploit more parallelism in applications such as artificial intelligence computing. High-performance GPU-accelerated systems with tens of thousands to more computing nodes are deployed in data centers, research institutions, and supercomputers to solve larger problems. As the number of processing devices within high-performance systems increases, communication and data transmission mechanisms need to scale to support this increased bandwidth.

[0198] Fig. 10B According to one embodiment, the use Figure 8 The exemplary system 500 may be configured to implement the methods disclosed in the present application (eg, Figure 5 , Figure 6 or Figure 8 The processing system 500 includes a CPU 530, a switch 555, and each of the plurality of PPUs 300 and a corresponding memory 304. The NVLink 310 provides a high-speed communication link between each PPU 300. Fig. 10B 302 connections, but the number of connections connected to each PPU 300 and CPU 530 may vary. Switch 555 interfaces between interconnect 302 and CPU 530. PPU 300, memory 304, and NVLink 310 may be located on a single semiconductor platform to form parallel processing module 525. In one embodiment, switch 555 supports two or more protocols that interface between various different connections and / or links.

[0199] In another embodiment (not shown), NVLink 310 provides one or more high-speed communication links between each PPU 300 and CPU 530, and switch 555 interfaces between interconnect 302 and each PPU 300. PPU 300, memory 304, and interconnect 302 may be located on a single semiconductor platform to form parallel processing module 525. In yet another embodiment (not shown), interconnect 302 provides one or more communication links between each PPU 300 and CPU 530, and switch 555 interfaces between each PPU 300 using NVLink 310 to provide one or more high-speed communication links between PPU 300. In another embodiment (not shown), NVLink 310 provides one or more high-speed communication links between PPU 300 and CPU 530 through switch 555. In yet another embodiment (not shown), interconnect 302 provides one or more communication links directly between each PPU 300. One or more NVLink 310 high-speed communication links may be implemented as a physical NVLink interconnect or as an on-chip or on-die interconnect using the same protocol as NVLink 310 .

[0200] In the context of this specification, a single semiconductor platform may refer to a unique single semiconductor-based integrated circuit manufactured on a bare die or chip. It should be noted that the term single semiconductor platform may also refer to a multi-chip module with increased connectivity that simulates on-chip operations and is substantially improved by utilizing conventional bus implementations. Of course, various circuits or devices may also be placed separately or in various combinations of semiconductor platforms, depending on the needs of the user. Optionally, the parallel processing module 525 may be implemented as a circuit board substrate, and each of the PPU 300 and / or memory 304 may be a packaged device. In one embodiment, the CPU 530, the switch 555, and the parallel processing module 525 are located on a single semiconductor platform.

[0201] In one embodiment, the signaling rate of each NVLink 310 is 20 to 25 Gbit / s, and each PPU 300 includes six NVLink 310 interfaces (e.g., Fig. 10B As shown, each PPU 300 includes five NVLink 310 interfaces. Each NVLink 310 provides a data transfer rate of 25 Gbit / s in each direction, with six links providing 300 Gbit / s. When the CPU 530 also includes one or more NVLink 310 interfaces, the NVLink 310 can be used exclusively for example Fig. 10B PPU to PPU communication as shown, or some combination of PPU to PPU and PPU to CPU.

[0202] In one embodiment, NVLink 310 allows direct load / store / atomic access from CPU 530 to memory 304 of each PPU 300. In one embodiment, NVLink 310 supports coherency operations, allowing data read from memory 304 to be stored in the cache hierarchy of CPU 530, reducing cache access latency of CPU 530. In one embodiment, NVLink 310 includes support for address translation services (ATS), allowing PPU 300 to directly access page tables within CPU 530. One or more NVLink 310 can also be configured to operate in a low power mode.

[0203] Fig. 10C An exemplary system 565 is shown in which various architectures and / or functions of various previous embodiments can be implemented. The exemplary system 565 can be configured to implement the methods disclosed in this application (e.g., Figure 5 , Figure 6 or Figure 8 ).

[0204] As shown, a system 565 is provided that includes at least one central processing unit 530 connected to a communication bus 575. The communication bus 575 can be implemented using any suitable protocol, such as PCI (Peripheral Component Interconnect), PCI-Express, AGP (Accelerated Graphics Port), HyperTransport, or any other bus or one or more point-to-point communication protocols. The system 565 also includes a main memory 540. Control logic (software) and data are stored in the main memory 540, which can take the form of a random access memory (RAM).

[0205] The system 565 also includes an input device 560, a parallel processing system 525, and a display device 545, such as a conventional CRT (cathode ray tube), LCD (liquid crystal display), LED (light emitting diode), plasma display, etc. User input can be received from the input device 560 (e.g., keyboard, mouse, touch pad, microphone, etc.). Each of the aforementioned modules and / or devices can even be located on a single semiconductor platform to form the system 565. Optionally, the modules can also be placed separately or in various combinations of semiconductor platforms according to the needs of the user.

[0206] Furthermore, system 565 may be coupled to a network (e.g., a telecommunications network, a local area network (LAN), a wireless network, a wide area network (WAN) such as the Internet, a peer-to-peer network, a cable network, etc.) through network interface 535 for communication purposes.

[0207] The system 565 may also include auxiliary storage (not shown). The auxiliary storage 610 includes, for example, a hard disk drive and / or a removable storage drive, representative of a floppy disk drive, a tape drive, an optical disk drive, a digital versatile disk (DVD) drive, a recording device, a universal serial bus (USB) flash memory. The removable storage drive reads from and / or writes to a removable storage unit in a well-known manner.

[0208] Computer programs or computer control logic algorithms may be stored in the main memory 540 and / or the secondary storage. These computer programs, when executed, enable the system 565 to perform various functions. The memory 540, storage and / or any other storage are possible examples of computer-readable media.

[0209] The architecture and / or functionality of the various prior figures may be implemented in the context of a general purpose computer system, a circuit board system, a game console system dedicated to entertainment purposes, a dedicated system, and / or any other desired system. For example, system 565 may take the form of a desktop computer, a laptop computer, a tablet computer, a server, a supercomputer, a smartphone (e.g., a wireless, handheld device), a personal digital assistant (PDA), a digital camera, a vehicle, a head mounted display, a handheld electronic device, a mobile telephone device, a television, a workstation, a game console, an embedded system, and / or any other type of logic.

[0210] All patents and printed publications mentioned above are incorporated herein by reference as if expressly set forth.

[0211] Although the invention has been described in connection with what are presently considered to be the most practical and preferred embodiments, it is to be understood that the invention is not limited to the disclosed embodiments, but on the contrary, the invention is intended to cover various modifications and equivalent arrangements included within the spirit and scope of the appended claims.

Claims

1. A method performed by a processing system, the processing system comprising a multi-threaded processor and on-chip memory, the on-chip memory comprising cache memory and shared memory managed by software, the method comprising: executing a plurality of threads simultaneously, the plurality of threads including a thread executing a fused load and store instruction for loading data stored in an external memory of the processing system and storing the data in the shared memory, the fused load and store instruction being configurable between bypassing (1) a processor register associated with the thread executing the fused load and store instruction or (2) the processor register and the cache memory, wherein the fused load and store instruction instructs the processing system to: retrieving the data from the external memory; as well as The retrieved data is stored in the shared memory without first storing the retrieved data in the processor registers, or without first storing the retrieved data in both the processor registers and the cache memory.

2. The method of claim 1 , wherein a plurality of threads execute the fused load and store instruction, the fused load and store instruction being used to load data stored in the external memory into the shared memory, and the fused load and store instruction instructs the processing system to: determine a shared memory destination address for the data requested by the fused load and store instruction, determine a pattern between a padding sector of the retrieved data and the shared memory destination address, and store the padding sector of the retrieved data to a shared memory sector identified by the determined pattern.

3. The method of claim 1, wherein the shared memory comprises a plurality of sectors arranged in a memory bank, and data stored in at least one of the sectors is exchanged using an intra-sector exchange. 4 . The method of claim 1 , wherein the fused load and store instruction is a single instruction that identifies a destination shared memory address and a source global address.

5. The method of claim 1 , wherein when (1) the fused load and store instruction is configured to bypass the processor register and the cache memory, and (2) the data requested by the fused load and store instruction is stored in the cache memory, the fused load and store instruction instructs the processing system to: store the requested data in the cache memory into the shared memory, and invalidate a tag of the requested data in the cache memory. The method of claim 1 , wherein the fused load and store instruction is dynamically configured at runtime.

7. A processing system comprising: a multithreaded processor configured to execute multiple threads simultaneously; a plurality of data registers, each of the data registers being assigned to an execution thread; as well as an on-chip memory comprising a cache memory and a shared memory, the cache memory being configured to allow a plurality of execution threads to access tagged data stored in the cache memory, and the shared memory being configured to allow the plurality of execution threads to access untagged data stored in the shared memory, The processing system is configured to, in response to at least one of the threads executing instructions for loading data stored in an external memory of the processing system and selectively storing the data in the shared memory without first storing the data in the plurality of data registers or without first storing the data in the plurality of data registers and the cache memory, retrieve the data from the external memory and selectively store the retrieved data in the shared memory without (1) first storing the retrieved data in the plurality of data registers or (2) first storing the retrieved data in the plurality of data registers and the cache memory.

8. The processing system of claim 7 , wherein based on a dynamic selection during runtime, the retrieved data is stored in the shared memory without (1) first storing the retrieved data in the plurality of data registers, or (2) first storing the retrieved data in the plurality of data registers and the cache memory.

9. The processing system of claim 7, wherein the cache memory and the shared memory are a unified physical random access memory.

10. The processing system of claim 9, wherein the unified physical random access memory comprises a register file including the plurality of data registers dynamically assigned to the execution threads.

11. The processing system of claim 7 , wherein the processing system comprises hardware circuitry configured to: receive a plurality of instructions for loading data stored in the external memory and storing the data in the shared memory, and determine a shared memory sector fill mode for storing the retrieved data in the shared memory based on the plurality of instructions.

12. The processing system of claim 7, wherein the shared memory comprises a plurality of sectors arranged in a memory bank, and the retrieved data is stored in at least one of the sectors using intra-sector swapping.

13. The processing system of claim 7, wherein the shared memory comprises a plurality of sectors arranged in a memory bank, the portions of the retrieved data being stored in the sectors in different memory banks.

14. The processing system of claim 7, wherein the instructions load data from one sector of the external memory and store the loaded data into portions of a plurality of sectors in the shared memory.

15. The processing system of claim 7, wherein the shared memory is a software managed cache.

16. The processing system of claim 7 , wherein the retrieved data is stored in one or more cache lines of the cache memory, the processing system further comprising interconnect circuitry configured to transfer the data stored in the one or more cache lines to a sector of the shared memory without first storing the retrieved data in the plurality of data registers.

17. A method performed by a processing system, comprising: a multithreaded processor configured to execute multiple threads simultaneously; A plurality of registers assigned to a thread of execution; a hardware managed cache memory configured to allow multiple threads of execution to access tag data stored in the cache memory; and a software-managed shared memory configured to allow the plurality of execution threads to access untagged data stored in the shared memory, the method comprising: executing a plurality of threads simultaneously, wherein at least one of the threads executes instructions for loading data stored in an external memory of the processing system and storing the data in the shared memory, the instructions being configured to: (1) store the data in the shared memory without first storing the data in a register assigned to the executing thread, or (2) store the data in the shared memory without first storing the data in the register and the cache memory; in response to the instruction configured to store the data in the shared memory without first storing the data in the register, retrieving the data from the external memory and storing the retrieved data in the shared memory without first storing the retrieved data in the register; and In response to the instruction configured to store the data in the shared memory without first storing the data in the register and the cache memory, the data is retrieved from the external memory and the retrieved data is stored in the shared memory without first storing the retrieved data in the register and the shared memory.

18. The method according to claim 17, further comprising: Two or more of the execution threads execute instructions for loading data stored in the shared memory into registers assigned to the two or more execution threads and performing calculations using the data stored in the registers.

19. The method of claim 18, wherein the computation is a matrix multiplication and accumulation operation.

20. The method of claim 17, wherein the instruction for loading data stored in the external memory of the processing system and storing the data in the shared memory is a single instruction including a destination shared memory address and a source global address.

21. The method of claim 17, wherein the shared memory comprises a plurality of sectors arranged in a memory bank, and the retrieved data is stored in at least one of the sectors and intra-sector swapping is applied.

22. The method of claim 17, wherein the shared memory comprises a plurality of sectors arranged in a memory bank, and the retrieved data is stored in the sectors in a different memory bank.

23. A GPU execution method, comprising: decoding a fused load and store instruction format that specifies whether the GPU should (a) bypass processor registers or (b) bypass both the processor registers and cache memory; and In response to the decoding, a data word is retrieved from a first memory and stored in a second memory without first storing the retrieved data in the processor register, or without first storing the retrieved data in the processor register and in the cache memory, as selected by the decoded fused load and store instruction format specification.

24. The GPU execution method according to claim 23, further comprising: The second memory is shared among a plurality of threads.

25. The GPU-executed method of claim 23, wherein the cache memory and the second memory are arranged in a common on-chip physical memory address space.

26. The GPU execution method of claim 23, wherein the fused load and store instruction format comprises: (i) a source word address, (ii) a destination word address, and (iii) at least one bit that specifies whether the GPU should (a) bypass processor registers or (b) bypass both the processor registers and cache memory to retrieve a data word from the source word address and store the retrieved data word in the destination word address, and the decoding includes decoding the at least one bit.