Compilation technology using metrics

A compiler-based approach optimizes data movement between memory and registers by analyzing software programs and applying register allocation techniques, addressing inefficiencies in existing technologies and enhancing performance.

DE102024112792A1Pending Publication Date: 2024-11-14NVIDIA CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
DE102024112792
Authority / Receiving Office
DE · DE
Patent Type
Applications
Current Assignee / Owner
Priority Date
2023-05-09
Filing Date
2024-05-07
Publication Date
2024-11-14

AI Technical Summary

Technical Problem

Existing technologies face challenges in optimizing data movement between memory and registers during program execution, leading to inefficiencies in performance costs.

Method used

A compiler-based approach that analyzes software programs to identify potential transformations, estimates performance metrics, and applies register allocation and mapping techniques to minimize register pressure and optimize data movement.

Benefits of technology

This method reduces unnecessary transformations, improves program performance by minimizing register pressure, and enhances execution speed by effectively managing data movement between memory and registers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

Devices, systems, and techniques for mapping and / or assigning registers. In at least one embodiment, registers are assigned, at least partially, based on a set of estimated performance metrics associated with transformations generated prior to a register mapping phase of compilation.
Need to check novelty before this filing date? Find Prior Art

Description

AREA

[0001] At least one embodiment relates to processing resources used to execute one or more programs written for a parallel computing platform. For example, at least one embodiment relates to processors or computing systems that cause information to be stored in registers during execution of a software program. BACKGROUND

[0002] Modifying instructions for moving data to and from memory requires consideration of one or more performance costs resulting from these modifications. Modifying instructions for moving data to and from memory while considering performance costs can be improved. BRIEF DESCRIPTION OF THE DRAWINGS Fig. 1 illustrates a process including one or more operations performed by a compiler to analyze, at least in part, potential transformations the compiler may implement with respect to register allocation and mapping, according to at least one embodiment; Fig. 2 illustrates a process including one or more operations performed by a compiler to analyze, at least in part, potential transformations prior to a register allocation phase, according to at least one embodiment; Fig. 3 illustrates a process including one or more operations performed by a compiler to, at least in part, record and / or reverse transformations, according to at least one embodiment; Fig. 4 illustrates a process including one or more operations performed by a compiler to analyze, at least in part, potential transformations related to register preference tasks, according to at least one embodiment; Fig. 5 illustrates a process including one or more operations performed by a compiler to analyze, at least in part, various types of potential transformations to be performed by a compiler to reduce a number of required registers, according to at least one embodiment; Fig. 6 illustrates a process including one or more operations performed by a compiler to analyze, at least in part, how many register blocks to use, according to at least one embodiment; Fig. 7 is a block diagram of a computing system including a compiler, according to at least one embodiment; Fig. 8 illustrates an exemplary data center, according to at least one embodiment; Fig. 9 illustrates a processing system according to at least one embodiment; Fig. 10 illustrates a computer system according to at least one embodiment; Fig. 11 illustrates a system according to at least one embodiment; Fig. 12 illustrates an exemplary integrated circuit, according to at least one embodiment; Fig. 13 illustrates a computer system according to at least one embodiment; Fig. 14 illustrates an APU, according to at least one embodiment; Fig. 15 illustrates a CPU, according to at least one embodiment; Fig. 16 illustrates an exemplary accelerator integration slice, according to at least one embodiment; Fig. 17A and Fig. 17B illustrate example graphics processors, according to at least one embodiment; Fig. 18A illustrates a graphics core, according to at least one embodiment; Fig. 18B illustrates a GPGPU, according to at least one embodiment; Fig. 19A illustrates a parallel processor, according to at least one embodiment; Fig. 19B illustrates a processing cluster, according to at least one embodiment; Fig. 19C illustrates a graphics multiprocessor, according to at least one embodiment; Fig. 20 illustrates a graphics processor, according to at least one embodiment; Fig. 21 illustrates a processor, according to at least one embodiment; Fig. 22 illustrates a processor, according to at least one embodiment; Fig. 23 illustrates a graphics processor core, according to at least one embodiment; Fig. 24 illustrates a PPU, according to at least one embodiment; Fig. 25 illustrates a GPC, according to at least one embodiment; Fig. 26 illustrates a streaming multiprocessor, according to at least one embodiment; Fig. 27 illustrates a software stack of a programming platform, according to at least one embodiment; Fig. 28 presents a CUDA implementation of a software stack of Fig. 27, according to at least one embodiment; Fig. 29 represents a ROCm implementation of a software stack of Fig. 27, according to at least one embodiment; Fig. 30 represents an OpenCL implementation of a software stack of Fig. 27, according to at least one embodiment; Fig. 31 illustrates software supported by a programming platform, according to at least one embodiment; Fig. 32 represents compilation code that runs on programming platforms from Fig. 27- Fig. 30 is to be carried out, according to at least one embodiment; Fig. 33 shows detailed compilation code that runs on programming platforms from Fig. 27- Fig. 30 is to be carried out, according to at least one embodiment; Fig. 34 illustrates translating source code before compiling source code, according to at least one embodiment; Fig. 35A illustrates a system configured to compile and execute CUDA source code using various types of processing units, according to at least one embodiment; Fig. 35B illustrates a system configured to extract CUDA source code from Fig. 35A using a CPU and a CUDA-enabled GPU, according to at least one embodiment; Fig. 35C illustrates a system configured to execute CUDA source code from Fig. 35A using a CPU and a non-CUDA-capable GPU, according to at least one embodiment; Fig. 36 shows an example core generated by the CUDA-to-HIP translation tool of Fig. 35C, according to at least one embodiment; Fig. 37 represents a non-CUDA capable GPU from Fig. 35C in more detail, according to at least one embodiment; Fig. 38 illustrates how threads of an exemplary CUDA grid are allocated to different compute units of Fig. 37, according to at least one embodiment; and Fig. 39 illustrates how to migrate existing CUDA code to data-parallel C++ code, according to at least one embodiment. DETAILED DESCRIPTION

[0003] In the following description, numerous specific details are set forth to provide a more thorough understanding of at least one embodiment. However, it will be apparent to one skilled in the art that the inventive concepts may be practiced without one or more of these specific details, and that any two or more embodiments described herein may be combined.

[0004] Fig. 1 illustrates a process 100 for analyzing one or more software program modifications that may be made by a compiler, according to at least one embodiment. In at least one embodiment, a compiler makes modifications to instructions. In at least one embodiment, a compiler makes modifications to instruction sequences. In at least one embodiment, a compiler, such as compiler 714 of Fig. 7, performs one or more operations of process 100 prior to a compilation phase, such as a register allocation phase, which is further described herein. In at least one embodiment, a register is a type of memory used to receive, hold, and transfer data to be accessed by a processor, and is described herein at least in connection with Fig. 9. In at least one embodiment, one or more operations of any process described herein, including those associated with the Fig. 1-6, performed in a different order than shown, performed concurrently, not performed in their entirety, or omitted. In at least one embodiment, modifications to a software program are referred to as transformations or edits, which are further described herein. In at least one embodiment, a compiler performs one or more operations of process 100 based at least in part on one or more embodiments of process 200, process 300, process 400, process 500, process 600, or a combination thereof.

[0005] In at least one embodiment, a compiler performs one or more aspects of process 100 to, at least in part, analyze transformations that can be applied to software program code, such as intermediate representation (IR) code, where IR code includes one or more data structures used by a compiler or virtual machine to represent source code. In at least one embodiment, a data structure is any data format capable of organizing, processing, retrieving, storing information, or a combination thereof. In at least one embodiment, a data format is a data format such as an array, vector, matrix, tree, hash, table, map, graph, or a combination thereof. In at least one embodiment, when a compiler performs one or more aspects of a process, it is said to be performing automatically.In at least one embodiment, software program code is referred to as program code or code. In at least one embodiment, code includes source code, which is code written using a human-readable programming language. In at least one embodiment, a software program is referred to as a computer program, software, or a program. In at least one embodiment, a compiler performs one or more aspects of process 100 to store, at least in part, estimated performance costs that would be incurred by implementing transformations to IR code. In at least one embodiment, a compiler uses one or more aspects of process 100 to estimate which transformations, if applied, would result in a threshold level of program performance.In at least one embodiment, a compiler uses one or more aspects of process 100 to select which transformations to implement during one or more phases of compilation. In at least one embodiment, a compiler uses one or more aspects of process 100 to at least partially allocate and / or assign registers. In at least one embodiment, a process of allocating registers includes selecting variable values ​​to be stored in registers versus other memory types. In at least one embodiment, a process of allocating registers includes operations that assign specific variable values ​​to specific registers that are virtual and / or physical.In at least one embodiment, operations referred to as register allocation operations are referred to as assignment operations; and / or operations referred to as assignment operations are referred to as allocation operations. In at least one embodiment, a compiler performs one or more aspects of process 100 to, at least in part, allocate and / or assign registers to one or more functions. In at least one embodiment, a compiler performs one or more aspects of process 100 to, at least in part, assist a user in setting a power budget for the performance of a program, a power budget being further described herein.

[0006] In at least one embodiment, a compiler performs one or more aspects of the process 100 to allocate and / or assign a thread to a register. In at least one embodiment, allocating a thread to a register refers to allocating a register for use by a thread. In at least one embodiment, allocating a thread to a register refers to assigning an identifier, such as a thread identifier (thread ID), to be stored in that register. In at least one embodiment, a thread refers to a sequence of instructions within an IR. In at least one embodiment, a thread refers to a path of control flow through a control flow graph (CFG). In at least one embodiment, a thread is a set of instructions that can be managed independently of an operating system.In at least one embodiment, an instruction causes other instructions to be executed. In at least one embodiment, an instruction may refer to a macroinstruction, which includes a sequence of instructions and / or other macroinstructions provided to the processor for execution. In at least one embodiment, an instruction may refer to a microinstruction, which includes an instruction resulting from decoding a macroinstruction by a decoder of a processor. In at least one embodiment, a processor's decoder reads an instruction from memory and translates and / or sends one or more portions of that instruction to other memory, such as an instruction register.

[0007] In at least one embodiment, a thread is referred to as a software thread. In at least one embodiment, a thread is referred to as program code. In at least one embodiment, a thread is referred to as a program or process. In at least one embodiment, a kernel is a function executing on a graphics processing unit (GPU), such as GPU 1710, in conjunction with at least the Fig. 17A and Fig. 17B. In at least one embodiment, a kernel includes one or more threads. In at least one embodiment, a kernel is referred to as a program or process. In at least one embodiment, a kernel is referred to as a software kernel, software program, software, or program. In at least one embodiment, a control flow refers to a sequence in which individual instructions of a software program are executed, where a software program includes one or more sequences of instructions in a programming language implemented by a computing device, such as device 704, as described herein at least in connection with Fig. 7 can be described, explained or interpreted in more detail.

[0008] In at least one embodiment, a software program is any set of ordered operations or instructions that a computing device is to perform, such as threads, kernels, warps, or any combination thereof. In at least one embodiment, a computer program is a computer file. In at least one embodiment, a computer program includes any type of code, such as high-level programming code, low-level machine code, or any combination thereof. In at least one embodiment, a computer program is referred to as a program. In at least one embodiment, code is referred to as a programming language. In at least one embodiment, code is written in a programming language. In at least one embodiment, code includes instructions to be performed or executed by a computing device.

[0009] In at least one embodiment, a transformation refers to any modification to instructions of a program. In at least one embodiment, a transformation is referred to as editing. In at least one embodiment, a transformation is a modification and / or translation of program code into lower-level code by a compiler. In at least one embodiment, a transformation includes any technique used to allocate and / or assign a register. In at least one embodiment, a transformation includes any register allocation technique, such as instruction reordering, overflow, backfill, flush, or a combination thereof, as further described herein.In at least one embodiment, overflowing includes moving information stored in a register to slower memory, such as a cache, where caches and registers are used herein at least in connection with. Fig. 9. In at least one embodiment, refilling includes moving information stored in a cache into a register. In at least one embodiment, flushing includes clearing the use of a register. In at least one embodiment, clearing the use of a register occurs after the last use of a specific value. In at least one embodiment, register allocation tasks include register scheduling and / or register allocation tasks.In at least one embodiment, a transformation is a form of code movement in which a section of code within a program is moved to a different location in that program in order to affect the performance of a program, such as improving the execution speed of a program, maximizing the number of threads that can be processed by registers, a combination thereof, or otherwise. In at least one embodiment, a transformation refers to loop unrolling, which aims to improve the performance of code that repeats until a condition is met, for example, by replicating each iteration of the loop in hardware and executing them concurrently. In at least one embodiment, a transformation is one or more instructions used to implement one or more register mapping and / or allocation techniques.In at least one embodiment, register allocation and / or assignment includes selecting which data values ​​are stored in registers at each point in a program. In at least one embodiment, a point in a program is referred to as a program point. In at least one embodiment, register allocation and / or assignment includes a compiler selecting which variable values ​​are to be stored in a register at each program point. In at least one embodiment, a compiler organizes multiple transformations into a set of transformations. In at least one embodiment, a set of transformations is referred to as a processing set. In at least one embodiment, a set of transformations includes transformations to be implemented in an order, concurrently, or a combination thereof.

[0010] In at least one embodiment, process 100 begins with a compiler reading or processing program code to analyze that code with operation 102. In at least one embodiment, reading a program includes lexical analysis, parsing, semantic analysis, or any combination thereof. In at least one embodiment, when a compiler reads a program, that compiler stores various parameters in memory that indicate properties of a kernel's code, including function locations, used values, live ranges of values, numbers of used values, or any combination thereof. In at least one embodiment, a value is referred to as a variable. In at least one embodiment, values ​​are data represented by a variable.In at least one embodiment, a live region refers to one or more points within a program, also referred to as program points, where a variable is live, which is described in more detail below at least in connection with operation 104. In at least one embodiment, a process for storing information in memory is referred to as recording information. In at least one embodiment, a compiler performs a read of a program prior to a register allocation phase of compilation. In at least one embodiment, a compiler performs a read of a program prior to an optimization phase of compilation. In at least one embodiment, an optimization phase of compilation includes a register allocation phase. In at least one embodiment, a compiler performs a read of an intermediate representation (IR) of program code.

[0011] In at least one embodiment, a compiler continues process 100 by identifying live ranges of variables with operation 104 based at least in part on the analysis of that compiler's program code with operation 102. In at least one embodiment, a range of a live variable begins at a program point where that variable is defined and ends at a program point where that variable would no longer be used during the execution of that program. In at least one embodiment, a live range of a variable is referred to as a live range. In at least one embodiment, a point within a program is referred to as a location. In at least one embodiment, a variable is live at a point after that value has been defined. In at least one embodiment, a variable is live at a point after that variable's value has been set to a register.In at least one embodiment, a variable is live at a program point if its value can later be read before being written again. In at least one embodiment, a variable is live at a program point if it must be available by a program for tasks such as reading from and / or writing to memory. In at least one embodiment, a variable is live at a program point if that variable holds a value that may be needed in the future and / or if its value can be read before the next time that variable is written. In at least one embodiment, a live scope of a variable refers to a not necessarily contiguous set of instructions that extends from a program point where that variable is defined to a program point where it would no longer be used by a program.In at least one embodiment, a segment of a live area is referred to as a live area segment. In at least one embodiment, a live area refers to a live area segment.

[0012] In at least one embodiment, a compiler continues process 100 by identifying, with operation 106, potential transformations that can be applied to live scopes of variables identified with operation 104. In at least one embodiment, a potential transformation is a transformation that can be legally applied to a piece of software. In at least one embodiment, a transformation can be legally applied if a compiler can implement that transformation without causing a software program to inadvertently fail while executing. In at least one embodiment, a compiler identifies two or more types of transformations that can be combined for one or more live scopes. In at least one embodiment, a compiler identifies different combinations of transformations that can be applied to live scopes.In at least one embodiment, a combination of different types of transformations is referred to as a set of heterogeneous transformations. In at least one embodiment, a set of transformations of one type is referred to as a set of homogeneous transformations. In at least one embodiment, examples of types of transformations include transformations that cause various mapping and / or assignment techniques to be performed, such as overflow, splitting, renaming, copying, merging, rematerializing, or reordering, which are further described herein. In at least one embodiment, a compiler records a combination of transformations that can be applied to live regions as a set of these transformations. In at least one embodiment, a compiler records multiple sets of combined transformations.

[0013] In at least one embodiment, a compiler continues process 100 by calculating computational performance metrics with operation 108 for one or more potential transformations identified with operation 106. In at least one embodiment, when a compiler generates computational performance metrics or otherwise generates any values, modifications, instructions, comparisons of values, comparisons of instructions, identifications of instructions, identifications of sets of instructions, identifications of modifications, identifications of portions of software, or any combination thereof, this generation is referred to as a computation. In at least one embodiment, computational performance metrics are referred to as performance metrics or performance costs.In at least one embodiment, performance metrics are values ​​associated with factors that indicate program performance, such as runtime, power consumption, memory requirements, or a combination thereof. In at least one embodiment, performance metrics refer to the types of values ​​used in estimating the performance of a transformation to be implemented in a program. In at least one embodiment, calculating a performance metric refers to estimating a performance metric. In at least one embodiment, a measured performance metric refers to an estimated performance metric calculated by a compiler and used, in part, to select which transformations to apply.In at least one embodiment, an estimated performance metric is calculated by a compiler using one or more heuristics, as opposed to implementing modifications to code and executing that code while measuring the performance effects of those modifications. In at least one embodiment, a heuristic is a method for solving a problem that is not guaranteed to find an optimal or exact solution, but is designed to find a satisfactory solution within a reasonable amount of time. In at least one embodiment, an estimated performance metric is calculated using a heuristic.In at least one embodiment, a measured performance metric refers to a performance metric observed by a compiler during the execution of a program via equipment such as load sensors, temperature sensors, performance monitors, or a combination thereof. In at least one embodiment, a measured performance metric refers to a metric based on observed and / or estimated results. In at least one embodiment, results are referred to as data. In at least one embodiment, a compiler estimates performance metrics for potential transformations before those potential transformations are implemented by the compiler. In at least one embodiment, a potential transformation refers to transformations that can be applied to a program but have not yet been implemented.In at least one embodiment, a compiler calculates performance metrics related to any computational constraint, such as computation time, number of instructions required, use of computational resources, financial budget, thermal budget, power budget, or a combination thereof.

[0014] In at least one embodiment, performance metrics include values ​​associated with compiler performance characteristics, such as throughput, code quality, or a combination thereof. In at least one embodiment, a performance metric is a property and / or value that indicates the throughput of a compiler, which refers to a number of software instructions that can be processed by a compiler for a given period of time. In at least one embodiment, a compiler processes software instructions by modifying those instructions. In at least one embodiment, a performance metric is a property and / or value that indicates the throughput of a compiler, which refers to a number of software instructions that can be processed by a compiler for a given period of time.Indicates code quality, where code quality includes factors such as a number of repetitive instructions, a number of conditional instruction loops that can be performed, a percentage of code that runs during software performance tests, code size, a number of control flow paths, or a combination thereof. In at least one embodiment, code size refers to an average number of instructions per function, which is a section of code that performs one or more tasks when executed.

[0015] In at least one embodiment, a compiler selects transformations to be implemented based on a threshold performance metric value that should not be exceeded during execution of a program. In at least one embodiment, a compiler selects transformations to be implemented based on comparing performance metrics associated with different transformations. In at least one embodiment, a compiler performs a comparison by measuring a difference between two or more performance metrics of two or more transformations, such as potential transformations and already implemented transformations. In at least one embodiment, a compiler selects transformations to be implemented by performing a cost-benefit analysis. In at least one embodiment, a compiler compares estimated performance metrics of different combinations of transformations.In at least one embodiment, a compiler uses cost estimation heuristics to calculate costs of one or more potential transformations. In at least one embodiment, cost estimates or cost estimates are referred to as computational performance metrics. In at least one embodiment, a heuristic is a method for solving a problem that is not guaranteed to find an optimal solution, but is designed to find a satisfactory solution within a reasonable amount of time. In at least one embodiment, an estimated cost of applying a potential transformation, such as an overflow instruction, is based at least in part on a weighted sum of a number of uses for a variable, where each use is weighted proportional to its occurrence at a particular loop nesting depth.In at least one embodiment, an estimated cost of applying a potential transformation is based at least in part on a number of definitions, memory writes, memory reads, copies between registers, rematerialization computations, or a combination thereof. In at least one embodiment, a loop nesting depth is a value indicating an extent to which a variable in a loop is contained within one or more other loops. In at least one embodiment, a compiler records costs of different combinations of transformations in a set. In at least one embodiment, a compiler computes and records a set of transformations and respective performance metrics for a portion of a program, such as a live scope of a variable or a live segment.In at least one embodiment, a set of transformations and / or respective performance metrics is referred to as a processing set.

[0016] In at least one embodiment, a compiler continues process 100 by applying one or more transformations with operation 110 based at least in part on performance metrics calculated with operation 108. In at least one embodiment, a compiler decides to apply a transformation based at least in part on an estimated cost that is lowest among a set of potential transformations. In at least one embodiment, a compiler decides to apply a combination of transformations based at least in part on an estimated cost that is lowest among a set of potential combined transformations.In at least one embodiment, a combination of transformations refers to multiple transformations that each cause a different register allocation and / or assignment technique to be performed, such as a combination of splitting and renaming transformations. In at least one embodiment, a compiler selects a set of operations and applies its transformations to program code during an optimization phase of compilation. In at least one embodiment, a compiler applies a transformation by inserting, removing, and / or otherwise modifying program instructions to effect an intended effect of that transformation, such as assigning a variable value to a specific register.

[0017] Fig. 2 illustrates a process 200 for a compiler to estimate and reduce register pressure for portions of a program prior to performing a register allocation phase of that compiler, according to at least one embodiment. In at least one embodiment, one or more operations of process 200 cause memory to be mapped and / or allocated to a software program based on future modifications to the software program. In at least one embodiment, a modification to software includes a modification to one or more software instructions, such as inserting an instruction, removing an instruction, moving an instruction, or otherwise manipulating an instruction.

[0018] In at least one embodiment, a compiler performs one or more aspects of process 200 to reduce register pressure at least partially earlier in a compilation process than without process 200. In at least one embodiment, a compiler performs one or more aspects of process 200 to at least partially use any combination of register pressure reduction techniques. In at least one embodiment, a compiler performs one or more aspects of process 200 to use cost estimates to select from multiple register pressure reduction transformation options for a live region.In at least one embodiment, a compiler performs one or more aspects of process 200 to adjust a target register pressure threshold based at least in part on a prediction and / or expectation that a register pressure reduction phase occurring after a future transformation will be able to reduce a certain amount of pressure at a low cost, where cost may be referred to as a performance penalty. In at least one embodiment, a future modification refers to a compiler modifying software at a later time during a compilation process, such as during a later phase of compilation.In at least one embodiment, a future modification refers to a modification to one or more instructions of software during a compilation phase, such as an optimization phase, that follows a compilation phase in which a compiler is currently performing operations, such as an intermediate representation (IR) code generation phase. In at least one embodiment, a future modification refers to a modification performed during any compilation phase following a phase in which a compiler is currently operating, where this future modification is performed automatically by that compiler.In at least one embodiment, a future modification refers to a modification performed during any compilation phase following a phase in which a compiler is currently operating, where the current phase and the following phase are to be performed during a single pass. In at least one embodiment, a single pass of a compiler refers to a compiler performing each phase of compilation once. In at least one embodiment, a future modification refers to a modification performed during any compilation phase following a phase in which a compiler is currently operating, where the current phase and the following phase are to be performed between multiple passes.In at least one embodiment, compilation phases are referred to as phases of lexical analysis, syntactic analysis, parsing, semantic analysis, intermediate code generation, code optimization, pre-register allocation, register allocation, code generation, or any combination thereof.

[0019] In at least one embodiment, causing memory to be allocated and / or assigned to one or more software programs refers to a processor causing a compiler to perform operations such as inserting, removing, moving, or otherwise manipulating software instructions to assign variables to registers and manage data transfer to and from registers. In at least one embodiment, register allocation, which is described herein at least in connection with Fig. 1, a compiler determines which variable values ​​are stored in registers instead of being stored in slower memory. In at least one embodiment, the register mapping described herein at least in connection with Fig. 1, a compiler determines which specific variable values ​​are stored in which specific register. In at least one embodiment, register mapping is referred to as register assignment and vice versa. In at least one embodiment, register mapping and / or assignment includes modifications or operations applied to software instructions, such as overflow, splitting, renaming, copying, merging, rematerializing, reordering, or a combination thereof, and as described herein at least in connection with Fig. 4 further described.

[0020] In at least one embodiment, a processor, such as central processing unit (CPU) 1500, operating at least in conjunction with Fig. 15, a compiler performs register allocation and / or assignment operations. In at least one embodiment, a processor causes a compiler to perform operations by executing a compiler, which is a program that translates code written in one programming language into another programming language and optimizes that code by modifying that code, where such optimizations may be measured by performance metrics described herein at least in connection with Fig. 1. In at least one embodiment, a processor causes a compiler to perform operations by reading and / or executing a compiler program stored on a non-transitory computer-readable storage medium, which is described herein at least in conjunction with Fig. 7. In at least one embodiment, a system, such as computer system 1000, as described herein at least in connection with Fig. 10 further describes a compiler performing register allocation and / or assignment operations. In at least one embodiment, a system causes a compiler to perform operations by reading, retrieving, or otherwise obtaining an instruction from a compiler program stored in memory and executing that instruction using hardware, such as a CPU.

[0021] In at least one embodiment, memory refers to any type of virtual or physical memory, such as registers, and allocating memory to a software program involves allocating memory to one or more variables of that software program. In at least one embodiment, register pressure is the number of values ​​at a program point that require registers. In at least one embodiment, register pressure is said to be excessive when a number of values ​​exceeds a certain number of available registers. In at least one embodiment, register pressure specifies a number of available registers relative to a number of values ​​of live variables to be stored in memory.In at least one embodiment, register pressure increases as a number of available registers decreases relative to a number of values ​​to be stored; register pressure decreases as a number of available registers increases relative to a number of values ​​to be stored.

[0022] In at least one embodiment, one or more aspects of one or more embodiments associated with Fig. 2, with one or more aspects of one or more embodiments described herein and at least in connection with Fig. 1 and Fig. 3-7. In at least one embodiment, a compiler, such as compiler 714, used in conjunction with Fig. 7, one or more operations of process 200 based at least in part on one or more embodiments of process 100, process 300, process 400, process 500, process 600, or a combination thereof. In at least one embodiment, a compiler identifies live ranges of variables with operation 201, described herein at least in connection with operation 104 of Fig. 1. In at least one embodiment, a compiler performs process 200 during a phase of compilation, such as an IR code generation phase, to better select transformations to be applied relative to other transformations likely to be applied during a subsequent phase of compilation, such as a register allocation phase. In at least one embodiment, a compiler calculates which live regions are likely to receive transformations based at least in part on calculating which transformations will incur a performance cost below a threshold. In at least one embodiment, a threshold refers to a performance-related value that the compiled program must equal or exceed to meet a performance standard, such as an average number of instructions per function set by a user.In at least one embodiment, a threshold refers to a performance-related value that the compiled program must be equal to or less than in order to meet a performance standard, such as a runtime limit set by a user. In at least one embodiment, a compiled program is a program that has been at least partially translated, modified, or otherwise processed by a compiling program. In at least one embodiment, a compiler calculates which live regions are likely to receive transforms based at least in part on a probability value that exceeds a threshold probability value. In at least one embodiment, a register allocation phase is included in a code optimization phase.

[0023] In at least one embodiment, a compiler analyzes code to estimate and / or reduce register pressure in portions of a program prior to a register allocation phase. In at least one embodiment, a compiler selects which transformations to implement to reduce register pressure prior to a register allocation phase based at least in part on predicting register pressure reduction transformations that will be implemented during that register allocation phase with operation 202. In at least one embodiment, a compiler implements selected transformations prior to and / or during a register allocation phase.In at least one embodiment, selecting register pressure reduction transformations based on predicted transformations better optimizes the performance of a program by, in part, reducing the likelihood that a compiler will select transformations that are redundant and / or unnecessary, where unnecessary transformations can slow the performance of a program. In at least one embodiment, reducing unnecessary transformations reduces unnecessary code that, if implemented, would incur a performance cost that exceeds any benefit of reducing the number of registers required during the performance of a program.

[0024] In at least one embodiment, predicting transformations likely to be implemented during a register allocation phase with operation 202 is referred to as predictive analysis. In at least one embodiment, determining which transformations to apply before a register allocation phase is referred to as pre-register allocation pressure reduction, where pressure reduction refers to register pressure reduction. In at least one embodiment, preventing unnecessary transformations from being applied to a program prevents the overall performance of a program from slowing down. In at least one embodiment, a compiler selects transformations to apply based on a performance metric, such as a cost, as a threshold that a program should not exceed.In at least one embodiment, a compiler selects transformations to apply based on a minimum threshold above which a program should remain.

[0025] In at least one embodiment, a compiler performs operation 202 by identifying or marking which live regions identified with operation 201 are likely to receive a transformation during a register allocation phase of compilation. In at least one embodiment, a compiler performs operation 202 based at least in part on a probability that it will implement a transformation during a future compilation phase. In at least one embodiment, a probability is represented by a probability value. In at least one embodiment, operation 202 includes identifying which transformations may be applied to one or more portions of a program. In at least one embodiment, a transformation that may be applied is referred to as a legal transformation.In at least one embodiment, a compiler predicts which live regions are likely to receive register pressure reduction transforms based at least in part on calculating which transforms will incur a performance cost below a threshold. In at least one embodiment, a compiler predicts which transforms would be applied during a register allocation phase based on a transformation hypothetically applied before that register allocation phase. In at least one embodiment, transforms estimated to incur a performance cost below a threshold are referred to as low-cost transforms. In at least one embodiment, a transform is low-cost if it falls within a range of costs and / or a percentage of a threshold cost.In at least one embodiment, operation 202 includes predicting which transformations, when applied to a live domain, are estimated to result in a performance cost above and / or below a threshold performance cost.

[0026] In at least one embodiment, a compiler identifies low-cost legal transformations that can be applied to a live region during a pre-phase analysis, where a pre-phase analysis refers to a compiler's analysis performed before a register allocation phase. In at least one embodiment, a low-cost transformation is any transformation that applies a register allocation or assignment technique that results in a performance cost below a user-set threshold. In at least one embodiment, identifying which low-cost transformations can be applied to a live region is referred to as predictive analysis because, at least conceptually, this compiler predicts which transformations the compiler may apply during a register allocation phase.In at least one embodiment, predictive analysis enables a compiler to analyze which transformations should be implemented before a register allocation phase by considering transformations that may be performed during a register allocation phase.

[0027] In at least one embodiment, a low-cost transformation applies a register pressure reduction technique. In at least one embodiment, increased register pressure indicates an increased shortage of registers with respect to a number of variable values ​​requiring storage in memory. In at least one embodiment, a register pressure reduction technique reduces a program's demand for registers to store its variables. In at least one embodiment, live space that includes more live variables than available registers is referred to as excess space. In at least one embodiment, a live variable is a variable in program code whose value can be used by the program during execution of that program, but before the value of that variable is redefined.In at least one embodiment, a live variable and / or live region is identified prior to execution of a program by analyzing code of the program. In at least one embodiment, demand refers to a live region that requires a register pressure reduction transformation to be applied to it. In at least one embodiment, a compiler identifies a live region as demand during liveness analysis, which is an analysis of points at which variables are live.

[0028] In at least one embodiment, a compiler continues process 200 by calculating performance costs with operation 204 based at least in part on predictions of low-cost transformations generated with operation 202. In at least one embodiment, a compiler calculates performance costs of implementing pre-phase transformations in combination with low-cost transformations predicted to be implemented during a register allocation phase. In at least one embodiment, a compiler stores performance costs of multiple pre-phase transformations in combination with predicted low-cost transformations.

[0029] In at least one embodiment, a compiler continues process 200 by comparing performance costs calculated with operation 204 with a performance cost budget with operation 206. In at least one embodiment, a user or program sets a performance cost budget for transformations that a compiler will apply. In at least one embodiment, a user or program sets register demand levels that a compiler should satisfy with transformations it applies. In at least one embodiment, a performance cost budget includes thresholds related to various metrics and / or constraints, such as a number of allowable overflow instructions, runtime of a program, a number of allowable transformations, or a combination thereof.

[0030] In at least one embodiment, a compiler continues process 200 by applying transformations selected with operation 208 based at least in part on performance cost comparisons performed with operation 206. In at least one embodiment, a compiler selects transformations based at least in part on a set of performance costs associated with various combinations of pre-phase and register allocation phase transformations. In at least one embodiment, a compiler selects transformations based on associated performance costs that are lowest among a set of performance costs. In at least one embodiment, a compiler applies transformations as described at least with operation 110 during a pre-register allocation phase.In at least one embodiment, a pre-register allocation phase is referred to as a pre-register allocation (pre-RA) reducer pass. In at least one embodiment, a compiler applies transformations before and / or during a register allocation phase. In at least one embodiment, a compiler performs one or more embodiments of operations 201, 202, 204, 206, 208, or a combination thereof, as part of a pre-RA reducer pass. In at least one embodiment, a compiler uses a pre-RA reducer pass to calculate where one or more transformations can be applied to reduce register pressure. In at least one embodiment, a compiler only performs register pressure reduction that fits within specifications of a user's specification, where a user's specification includes limits such as desired demand levels and / or cost budget.In at least one embodiment, a user is referred to as a client. In at least one embodiment, process 200 is performed during multiple phases of compilation, with a user setting different performance metrics and cost budgets for each phase of compilation.

[0031] Fig. 3 illustrates a process 300 for logging register allocation operations performed by a compiler, according to at least one embodiment. In at least one embodiment, a compiler performs process 300 to partially modify software to be compiled based on estimated performance metrics of the software, wherein logging modifications to that software enables a compiler to revert a modification if estimated performance metrics corresponding to the modification are calculated to be undesirable by a user, that software, or other software. In at least one embodiment, one or more aspects of one or more embodiments associated with Fig. 3, with one or more aspects of one or more embodiments described herein and at least in connection with Fig. 1-2 and Fig. 4-7. In at least one embodiment, a compiler, such as compiler 714, performs one or more operations of process 300 based at least in part on one or more embodiments of process 100, process 200, process 400, process 500, process 600, or a combination thereof. In at least one embodiment, a compiler performs one or more aspects of process 300 to, at least in part, enable a compiler to revert to a previous version of a compiler's intermediate representation (IR) without having to reimplement one or more modifications required to produce that previous version. In at least one embodiment, process 300 enables a compiler to revert to a previous version of a compiler's IR by reading previously computed and stored values, rather than recomputing those values.In at least one embodiment, a compiler performs one or more operations of process 300 to at least partially undo a transformation that has been applied. In at least one embodiment, a compiler performs one or more operations of process 300 to at least partially undo a previously applied transformation to revert an IR to an earlier point in a register allocation process. In at least one embodiment, process 300 begins with a compiler calculating whether transformations can be applied with operation 302 as part of a process to generate an IR. In at least one embodiment, if a compiler determines that transformations can be applied, process 300 continues with operation 304.In at least one embodiment, if a transformation can be applied, that transformation is said to be a legal transformation. In at least one embodiment, process 300 ends if a compiler determines that no new transformations can be applied.

[0032] In at least one embodiment, a compiler performs one or more aspects of process 300 for unmodifying software during compilation, based at least in part on one or more estimated performance metrics of the software, as further described herein. In at least one embodiment, during compilation refers to any part or phase, or any combination of parts or phases, of a compilation process performed by a compiler. In at least one embodiment, unmodifying software is referred to as undoing a transformation. In at least one embodiment, a compiler performs one or more aspects of process 300 to use a backtrace search of previous transformations applied to software to perform register allocation and register pressure reduction operations.In at least one embodiment, a compiler performs one or more aspects of process 300 to record a sequence of applied edits and their performance, as further described herein. In at least one embodiment, a compiler performs one or more aspects of process 300 to replay an applied edit sequence and to continue searching down an applied branch edit sequence if it is determined to be better than considered alternative edit sequences.

[0033] In at least one embodiment, a compiler applies a set of transformations with operation 304 to generate a new version of an IR, wherein a set of transformations is used herein at least in conjunction with Fig. 1. In at least one embodiment, a compiler applies a set of transformations with operation 304 after transitioning to another program point in an IR. In at least one embodiment, a compiler applies one or more types of transformations to one or more live areas, as described herein at least in connection with Fig. 1. In at least one embodiment, a set of transformations is a heterogeneous set of transformations. In at least one embodiment, a set of transformations is a homogeneous set of transformations. In at least one embodiment, when a compiler applies a set of transformations with operation 304, that compiler calculates one or more costs resulting from applying that set of transformations, wherein calculating costs is performed herein at least in connection with operation 108 of Fig. 1 is further described.

[0034] In at least one embodiment, process 300 continues with a compiler recording information about a transformation during operation 306 after applying a set of transformations with operation 304. In at least one embodiment, a compiler stores information in memory necessary to undo a transformation. For example, in at least one embodiment, when a transformation moves a piece of code from one location to another, a compiler records information about the current location and the previous location of that piece of code. In at least one embodiment, a compiler records information about a transformation or set of transformations in a data structure in addition to another data structure that stores information about IR code.

[0035] In at least one embodiment, a compiler calculates whether to retain a set of transformations with operation 308. In at least one embodiment, a compiler calculates whether to retain a set of transformations applied with operation 304. In at least one embodiment, a compiler calculates whether to retain a set of transformations based at least in part on costs of those transformations. In at least one embodiment, a compiler calculates whether to retain a set of transformations based at least in part on a cost budget. In at least one embodiment, if a compiler retains a set of transformations, that compiler returns to operation 302 of process 300 and records information about an IR and that set of transformations.In at least one embodiment, a compiler includes a measurement function that tracks costs resulting from applying one or more sets of transformations as they are applied. In at least one embodiment, a compiler records a set of transformations and their performance metrics. In at least one embodiment, a compiler records an order in which a set of transformations was performed. In at least one embodiment, a compiler applies multiple sets of transformations to a single live scope.

[0036] In at least one embodiment, when a compiler does not retain a set of transformations, that compiler reverses one or more sets of transformations applied in an IR to return to a previous point in that IR. In at least one embodiment, a previous point in an IR refers to a program point within the instruction stream of that IR. In at least one embodiment, a previous point in an IR refers to a previous version of that IR. In at least one embodiment, reversing one or more transformations or sets of transformations is referred to as returning to a previous version of code or undoing those transformations. In at least one embodiment, undoing a transformation is referred to as unmodifying software.In at least one embodiment, undoing a transformation is referred to as reverting to a previous version of software. In at least one embodiment, reverting to a previous version of software is referred to as unmodifying software. In at least one embodiment, if a compiler does not retain a set of transformations, that compiler reverts to a previous version of that compiler's IR with operation 310. In at least one embodiment, a compiler reverts to a previous version of that compiler's IR by reading previously computed and stored values ​​rather than recomputing those values. In at least one embodiment, a compiler calculates whether to unmodify software based at least in part on an evaluation of replacing one or more modifications with one or more other modifications.In at least one embodiment, an evaluation of replacing one or more modifications with one or more other modifications is based at least in part on information indicating effects of those modifications on computational performance. In at least one embodiment, information indicating effects of modifications is referred to as performance metrics of the software. In at least one embodiment, a compiler reverts to a previous version of that compiler's IR by reading previously computed and stored values ​​rather than recalculating a register interference graph, where a register interference graph indicates at least in part which variables may share a register at which points within a program.In at least one embodiment, a compiler returns to a previous version of that compiler's IR by reading previously stored information indicating previous transformations performed on that IR. In at least one embodiment, a register interference graph indicates, at least in part, which variables cannot share a register at which points within a program. In at least one embodiment, a compiler returns to a previous version of that compiler's IR that does not immediately precede an application of a set of transformations; for example, a compiler returns to a version of IR that existed before one or more intervening versions. In at least one embodiment, a compiler returns to a previous version of that compiler's IR by, at least conceptually, removing one or more applications of transformation sets.In at least one embodiment, a compiler returns an application of a set of transformations to a previous point in an IR. In at least one embodiment, after a compiler returns to a previous point in an IR with operation 310, this compiler performs operation 302 to determine whether new transformations can be applied.

[0037] Fig. 4 illustrates a process 400 for a compiler to assign values ​​to specific registers, according to at least one embodiment. In at least one embodiment, one or more aspects of one or more embodiments associated with Fig. 4, with one or more aspects of one or more embodiments described herein and at least in connection with Fig. 1-3 and Fig. 5-7. In at least one embodiment, a compiler performs process 400 to replace memory locations assigned to data values ​​with replacement memory locations based on estimated performance metrics of the one or more replacement memory locations. In at least one embodiment, a memory location refers to a memory address, physical memory, or a combination thereof. In at least one embodiment, a memory location includes a register address, a physical register, a virtual register, a group of registers, or a combination thereof. In at least one embodiment, a replacement memory location is a memory location that is assigned and / or associated to store a variable value in place of another memory location previously assigned to store that value.In at least one embodiment, a compiler replaces memory locations with replacement memory locations based on estimated performance metrics of the replacement memory locations by estimating how well these replacement memory locations would perform upon implementation and / or during program execution. In at least one embodiment, a compiler replaces memory locations with replacement memory locations based on estimated performance metrics of the memory locations by estimating and / or observing how well these memory locations perform and / or would perform upon implementation and / or during program execution.

[0038] In at least one embodiment, a compiler performs one or more aspects of process 400 to assign a memory location, such as a register, to a variable corresponding to a first portion of a computer program, independent of an assignment of a different memory location to that variable corresponding to a second portion of that computer program. In at least one embodiment, a portion of a computer program refers to a segment of a live area. In at least one embodiment, a portion of a computer program refers to a live area.In at least one embodiment, a compiler assigns a memory location of a variable corresponding to a first section of a computer program regardless of its assignment of a memory location to that variable corresponding to a second section refers to assigning a register to a segment of a live range of a variable regardless of any other assignment of a register to a different segment of that live range of that variable. In at least one embodiment, a compiler assigns a memory location of a variable corresponding to a first section of a computer program regardless of its assignment of a memory location to that variable corresponding to a second section refers to assigning a register to a live range of a variable regardless of any other assignment of a register to a different live range of that variable.In at least one embodiment, a compiler does not make independent assignments of registers to a variable corresponding to different sections of a computer program, and instead uses, at least in part, computational performance metrics to make such assignments.

[0039] In at least one embodiment, a compiler performs one or more aspects of process 400 to select from multiple register allocation options based on estimated performance effects of multiple transformations that cause the register allocation. In at least one embodiment, a compiler performs one or more aspects of process 400 to pre-plan allocation of multiple webs at once, which may refer to, for example, allocating multiple webs without repeating a specific compilation phase. In at least one embodiment, a compiler performs one or more aspects of process 400 to allocate a register to only a portion of one or more webs. In at least one embodiment, a compiler performs one or more aspects of process 400 to modify a previous allocation of a register.In at least one embodiment, a compiler performs one or more aspects of process 400 to apply non-assignment transformations during a register allocation process.

[0040] In at least one embodiment, specific registers are better suited to storing specific types of data values, making software performance dependent on which registers are used to store which data values. In at least one embodiment, a compiler, such as compiler 714 of Fig. 7, one or more operations of process 400 based at least in part on one or more embodiments of process 100, process 200, process 300, process 500, process 600, or a combination thereof. In at least one embodiment, a compiler performing one or more operations of 400 combines heterogeneous types of transformations on different live domains. In at least one embodiment, heterogeneous types of transformations refer to different types of modifications to a computer program. In at least one embodiment, a type of modification refers to one or more modifications to software instructions that, when a processor executes those modified software instructions, achieves a particular goal, such as overflow, reassignment, or rematerialization, as discussed further herein.In at least one embodiment, a compiler performs one or more operations of process 400 to apply transformations to live regions, live segments, live webs, or a combination thereof. In at least one embodiment, a live segment is a portion of a live region. In at least one embodiment, a live web is two or more live regions. In at least one embodiment, a live region, a live segment, and a live web are computed using data structures such as control flow graphs. In at least one embodiment, live regions that need to be mapped and / or assigned to various registers are determined using data structures such as interference graphs.In at least one embodiment, a compiler performing one or more aspects of process 400 applies one or more allocation transformations to one or more live regions that do not require a common register; for example, a compiler may apply a transformation that renames live region B so that live region A can consistently use register B that was previously allocated to live region B. In at least one embodiment, one or more aspects of process 400 are applied to map intermediate representation (IR) virtual registers to physical resources, such as physical registers, during a compilation process.

[0041] In at least one embodiment, a compiler performs process 400 to select and / or implement transformations to perform register preference tasks, which is further described herein at least in connection with operation 408. In at least one embodiment, performing register preference tasks is referred to as register preferences. In at least one embodiment, process 400 is used to assign values ​​of certain variables or variable types to certain registers based on factors such as frequency of use, data type, or a combination thereof. In at least one embodiment, process 400 is used to assign a value to a register. In at least one embodiment, process 400 is used to add an instruction to move a value in a register to another location.In at least one embodiment, register preference improves the performance of a program.

[0042] In at least one embodiment, the process 400 begins with a compiler calculating specific registers 402 available for each live area, as described herein at least in connection with operation 104 of Fig. 1. In at least one embodiment, a compiler performs operation 403 to create a processing set for each available register that can be used by each live segment, where a processing set is a set of transformations described herein at least in connection with Fig. 2 is further described. In at least one embodiment, an edit set is referred to as an edit sequence. In at least one embodiment, an edit set includes one or more edits, where an edit is a transformation. In at least one embodiment, an edit set includes one or more transformations that can conceptually be applied to a live region, a live segment, a live web, or a combination thereof. In at least one embodiment, an edit set includes one or more transformations that can conceptually be applied to a register.In at least one embodiment, an operation is a set of instructions used, at least in part, to allocate and / or assign one or more registers to a specific live region, live segment, live web, or a combination thereof. In at least one embodiment, an operation is a set of instructions used, at least in part, to modify program code to allocate and / or assign one or more registers. In at least one embodiment, an operation set includes one or more operations, such as allocation, reallocation, web splitting, renaming, or a combination thereof. In at least one embodiment, an allocation is a no-cost operation, where the allocation imposes no cost on the performance of a program.In at least one embodiment, web splitting is a free edit that changes an allocation from one physical register to another physical register. In at least one embodiment, web splitting refers to breaking apart a static single allocation (SSA) web, which is a graphical representation of data, as it is processed by a program. In at least one embodiment, SSA refers to a variable that is defined once before that variable is used by a program. In at least one embodiment, SSA refers to a variable that has a single point of definition. In at least one embodiment, web splitting is an edit that inserts a copy between two or more sections of an SSA web. In at least one embodiment, web splitting is part of a modification to a control flow of a program.

[0043] In at least one embodiment, a compiler continues process 400 by calculating edit sets for live webs, if any, with operation 404. In at least one embodiment, a live web is referred to as a web. In at least one embodiment, a web is a set of connected live segments, where connected live segments are live segments that include a variable whose value can be shared by a single register. In at least one embodiment, connected live segments are live segments that share at least one register preference, which is further described herein at least in connection with operation 408. In at least one embodiment, a compiler constructs webs from connected live segments.In at least one embodiment, a compiler performs a construction pass, where a compiler creates a web for each set of connected live segments that share a set of register preferences. In at least one embodiment, a shared set of register preferences is referred to as equal preferences. In at least one embodiment, a compiler computes an available edit set for each live segment as part of a construction pass. In at least one embodiment, a compiler computes an available set for each web as the intersection of the available sets for all live segments in a web.

[0044] In at least one embodiment, a compiler performs a self-conflict resolution pass as part of operation 406, where a compiler calculates whether a single web has one or more problems that prevent register allocation. In at least one embodiment, a compiler calculates whether two or more live segments and their associated register allocations conflict with each other. In at least one embodiment, a compiler calculates whether an available edit set for a web is empty. In at least one embodiment, a compiler breaks a web into subwebs to resolve problems such as two or more live segments conflicting with each other and / or an empty available set for a web. In at least one embodiment, a compiler breaks a web into subwebs by inserting copy instructions between member live segments.In at least one embodiment, a compiler computes one or more copy insertion options and places them in a priority queue. In at least one embodiment, a compiler removes and applies edit sets until all issues are resolved.

[0045] In at least one embodiment, a compiler performs one or more aspects of operation 404 and operation 406, respectively, to complete an allocation pass that includes two or more passes: allocation of the entire web and problem resolution. In at least one embodiment, a pass is referred to as a mode. In at least one embodiment, an allocation pass transitions between two or more modes. In at least one embodiment, a compiler performs one or more aspects of operation 404 as part of an overall web allocation pass. In at least one embodiment, throughout the web allocation, a compiler adds all webs to a priority queue and removes those webs in order from highest to lowest priority. In at least one embodiment, a compiler removes each available register from an available set for a web and allocates that available register.In at least one embodiment, a compiler performs one or more aspects of a self-conflict resolution pass during problem resolution, such as one or more aspects of operation 406. In at least one embodiment, a compiler generates a priority queue of edits, further described herein. In at least one embodiment, a priority queue includes performance metrics indicating costs of particular edits. In at least one embodiment, a compiler generates a set of preferences for each web, such as preferences for using particular registers or using a number of registers. In at least one embodiment, a compiler uses a function to calculate a priority ordering of edits.In at least one embodiment, a function for calculating a priority order of edits is based on the size of a set of available registers. In at least one embodiment, a compiler may prioritize one edit set over another edit set because it is larger than the other edit set.

[0046] In at least one embodiment, when a set of available registers for a web becomes empty after its edits have been selected for application to one or more webs, a compiler performs a transitive reallocation of registers from one web to another web with operation 408. In at least one embodiment, transitive reallocation refers to edits used in allocating registers to one web that can be used to allocate those same registers to another web. In at least one embodiment, operation 408 includes register allocation operations associated with live regions and / or live webs that require two or more registers during program execution.In at least one embodiment, a compiler performs one or more aspects of operation 408 as part of a transitive reallocation pass, where a compiler reallocates registers to two or more live regions and / or webs. In at least one embodiment, a transitive reallocation occurs, for example, when no register for live region A is available throughout its lifetime, while one or more live regions, B1...Bn, overlap with and are all allocated to register Rx, a compiler constructs a single edit set that renames each live region B1...Bn to other available registers and allocates live region A to use register Rx.

[0047] In at least one embodiment, a compiler performs process 400 by placing all edit sets computed with operation 402 and / or operation 404 into a priority queue. In at least one embodiment, a priority queue refers to a data structure that specifies an order in which edits are to be assigned, performed, or applied. In at least one embodiment, a priority queue data structure is any data structure capable of holding information specifying a priority order in which edits are to be applied, such as an array, vector, matrix, tree, hash, or a combination thereof.In at least one embodiment, the priority level of a process is based at least in part on constraints applied to register mapping to live regions, live segments, live webs, or a combination thereof. In at least one embodiment, constraints applied to register mapping to live regions are conventions defined by a binary application interface, which are rules by which program code is written to operate specific hardware.

[0048] In at least one embodiment, a priority level for an edit is based at least in part on the suitability of a register for performing a program function, sometimes referred to as register preference or register affinity. In at least one embodiment, a priority level for an edit is based at least in part on a constraint on which physical registers can be allocated to a live element, such as a live web, live region, or live segment. In at least one embodiment, a type of register preference is referred to as a required or must-have preference, in which a compiler must allocate a specific physical register for a specific live element. In at least one embodiment, a required preference is due to an application binary interface (ABI), a constraint on a specific instruction, or a combination thereof.In at least one embodiment, an ABI is referred to as a calling convention. In at least one embodiment, two or more live elements have a shared required preference or affinity, where a compiler must assign a single specific register to each of these live elements. In at least one embodiment, a compiler must assign a single specific register to two or more live elements when resolving phi nodes. In at least one embodiment, a phi node is part of the SSA shape. In at least one embodiment, a phi node is an instruction used to select a value depending on a preceding section of code.

[0049] In at least one embodiment, a type of register preference is referred to as advantageous preference, preferred preference, or preferential preference, where assigning a specific register to a live element would result in better performance than assigning a different register to that live element, but assigning that different register would still allow execution of at least a portion of a program. In at least one embodiment, two or more live elements have a shared advantageous preference or affinity, where assigning a specific register to those live elements would result in better performance than assigning two or more different registers to those live regions. In at least one embodiment, a type of register preference is referred to as do-not-care preference, where a compiler can assign any register to a live region.

[0050] In at least one embodiment, a compiler continues process 400 by removing a work set from a priority queue and applying it to a live segment with operation 410. In at least one embodiment, when a compiler removes each work set from a priority queue, that compiler deletes all other work sets associated with that live segment. In at least one embodiment, a compiler checks whether a work set is legal before removing that work set from a priority queue. In at least one embodiment, a compiler will insert copy instructions when registers allocated between live segments interfere. In at least one embodiment, non-copy and copy versions of work sets are added to a priority queue.In at least one embodiment, a copy version of an edit set is an edit set copied from a previously computed edit set. In at least one embodiment, a compiler performs two passes and adds only non-copy versions of edit sets. In at least one embodiment, when a priority queue is exhausted and one or more live segments are not yet allocated, a compiler performs a second pass adding only copy versions of edit sets. In at least one embodiment, when a compiler creates an edit set for each available register and each live segment, this process is referred to as per-segment allocation. In at least one embodiment, when a set of live segments allocated to a single edit sequence is a subset of a live web, copy instructions are inserted between live segments.In at least one embodiment, prioritization factors for considering live segments to be added to an edit sequence include a type of preference, a size of an available set, or a combination thereof.

[0051] In at least one embodiment, one or more aspects of process 400 transform live webs, regions, segments, or a combination thereof to make one or more physical registers available for use in an allocation. For example, in at least one embodiment, a live web W1 has a must-have affinity for register R6, and W1 interferes with the live web W2 that is already allocated to R6. In at least one embodiment, multiple edit sequences could be created: one in which an edit sequence renames a portion of W2 so that R6 becomes available to all of W1; another in which an edit sequence copies data to and from R6 for W1 in locations where W1 and W2 do not interfere and allocates an available register to regions of W1 that interfere with W2; and another in which an edit sequence modifies allocations for portions of each of W1 and W2.

[0052] In at least one embodiment, any type of affinity does not play a role in register allocation. In at least one embodiment, any number of registers may be allocated to any number of live webs or live segments, or a combination thereof. In at least one embodiment, transformations traditionally categorized as mapping transformations, such as splitting or rematerialization, may be created and applied. In at least one embodiment, transformations traditionally categorized as mapping transformations are used, at least in part, in performing allocation tasks. In at least one embodiment, allocation and assignment tasks are solved concurrently or in a fine-grained nested manner. In at least one embodiment, an intermediate representation prior to register allocation and assignment is not extracted from the SSA form.In at least one embodiment, it is preferred to either maintain an intermediate representation in SSA form or to delete or make optional copy operations prior to mapping and assignment. In at least one embodiment, prioritizing the selection and application of edit sequences is based on the affinity type, whether an edit is traditionally considered a mapping or assignment task, the cost of inserted instructions, the size of availability sets, the number of allocated live segments, the amount of register pressure reduced by mapping-related edits, or a combination thereof.

[0053] Fig. 5 illustrates a process 500 for a compiler to allocate registers, according to at least one embodiment. In at least one embodiment, one or more aspects of the process 500 are used to perform heterogeneous register pressure reductions, which are various types of transformations implemented by a compiler to reduce register pressure. In at least one embodiment, a compiler performs the process 500 to select heterogeneous register pressure reductions based on estimated performance metrics of the modified software, described herein at least in connection with operation 108 of Fig. 1. In at least one embodiment, a compiler performs process 500 to replace one or more memory operations with replacement memory operations based on estimated performance metrics of those memory operations and replacement memory operations. In at least one embodiment, a memory operation is one or more instructions that map and / or assign registers to live regions, live segments, live webs, or a combination thereof. In at least one embodiment, a memory operation is a transform that maps and / or assigns registers to live regions, live segments, live webs, or a combination thereof. In at least one embodiment, a replacement memory operation is a memory operation implemented by a compiler to remove another memory operation.In at least one embodiment, a storage operation includes mapping and / or assignment operations such as overflow, split, rename, copy, merge, rematerialize, and reorder, described herein at least in connection with. Fig. 4 will be described further.

[0054] In at least one embodiment, a compiler performs one or more aspects of process 500 to reduce register pressure in a compiler using any combination of register pressure reduction techniques. In at least one embodiment, a compiler performs one or more aspects of process 500 to use cost estimates to select from multiple register pressure reduction options for a specific live area.

[0055] In at least one embodiment, one or more aspects of one or more embodiments associated with Fig. 5, with one or more aspects of one or more embodiments described herein and at least in connection with Fig. 1-4 and Fig. 6-7. In at least one embodiment, a compiler, such as compiler 714, performs one or more operations of process 500 based at least in part on one or more embodiments of process 100, process 200, process 300, process 400, process 600, or a combination thereof. In at least one embodiment, register pressure refers to a number of registers available to store a number of live elements, where a lower number of available registers results in a higher register pressure. In at least one embodiment, register pressure refers to a number of concurrently live elements at an instruction. In at least one embodiment, a higher register pressure refers to a higher number of concurrently live elements, such as variables or data values, at an instruction.In at least one embodiment, process 500 begins with a compiler identifying available registers with operation 502. In at least one embodiment, a compiler identifies all registers available for each live area, as described herein at least in connection with operation 104 of FIG. Fig. 1. In at least one embodiment, a compiler performing one or more aspects of process 500 applies assignment and / or allocation transformations to a group of related live areas at once. In at least one embodiment, a compiler performing one or more aspects of process 500 combines heterogeneous types of assignment and / or allocation transformations on different live segments of one or more related live areas.

[0056] In at least one embodiment, process 500 continues with a compiler generating sets of edits with operation 504 for each available register identified with operation 502. In at least one embodiment, a compiler places sets of edits in a priority queue, as described herein at least in connection with Fig. 4. In at least one embodiment, a compiler performs a pass to analyze all live regions that are members of one or more excessive regions. In at least one embodiment, an excessive region is a section of a program in which there are not a sufficient number of registers available to execute a program that meets required performance metrics, as determined by a user. In at least one embodiment, an excessive region is a section of code in which there are not enough registers to store all live elements in that section of code. In at least one embodiment, an analysis examines each live segment of each live region.

[0057] In at least one embodiment, a compiler generates a set of heterogeneous register pressure reduction transformations with operation 504. In at least one embodiment, a register pressure reduction transformation refers to any transformation implemented by a compiler to reduce register pressure. In at least one embodiment, an example of a register pressure reduction is an overflow instruction, which is an instruction to store a value other than a register in memory, which is typically memory that operates slower than registers. In at least one embodiment, a compiler considers all applicable reduction transformations for a live segment to see if those reduction transformations can legally be applied to that live segment.In at least one embodiment, a compiler analyzes reduction transformations for a live segment to determine whether that reduction transformation is cost-effective. In at least one embodiment, a compiler selects one or more legal transformations. In at least one embodiment, a compiler places transformations for all excessive live segments into a single edit set. In at least one embodiment, multiple transformations are possible for one or more live segments, and a compiler creates multiple edit sets. In at least one embodiment, a single edit set includes multiple types of transformations, with each transformation applied to a different live segment.In at least one embodiment, transformations include any type of transformation used at least in part in allocating and / or allocating registers, including overflow, splitting, renaming, copying, merging, rematerializing, and reordering. In at least one embodiment, a compiler applies a single overflow per definition (def) of a variable and a single fill per use of a variable. In at least one embodiment, a split instruction includes a single overflow instruction covering multiple defs and / or a single fill instruction covering multiple uses. In at least one embodiment, a rename transformation includes changing an allocation of a previously allocated live space.In at least one embodiment, a copy-insert transformation involves changing an assignment of an appropriate subset of live segments of a live space by inserting copy instructions. In at least one embodiment, a rematerialization transformation involves inserting a sequence of instructions to recalculate one or more values ​​from currently available values. In at least one embodiment, a merge transformation removes move instructions that move an assignment of a data value from one register to another register by assigning that data value to a register. In at least one embodiment, a reorder transformation involves changing an order of existing instructions to reduce register pressure.In at least one embodiment, a compiler treats all potential transformations uniformly, without preference for one transformation over another. In at least one embodiment, all legal transformations may be applied during a main reduction pass, which includes a pass in which a compiler implements transformations to reduce register pressure.

[0058] In at least one embodiment, process 500 continues by applying a set of reduction transformations with operation 506 according to a priority queue described herein at least in connection with operation 304 of Fig. 3. In at least one embodiment, a compiler applies a heterogeneous set of transformations to a single live region, a single live segment, a single live web, or a combination thereof. In at least one embodiment, a compiler applies a heterogeneous set of transformations to cause a single variable value to be stored in one or more specific registers.

[0059] Fig. 6 illustrates a process 600 for a compiler to allocate registers, according to at least one embodiment. In at least one embodiment, a compiler performs process 600 to cause a plurality of processor register configurations to be selected for allocation to threads based on previously measured performance metrics associated with the register allocation configurations. In at least one embodiment, a register configuration refers to a specific number of register blocks. In at least one embodiment, a register block is some type of grouping of registers. In at least one embodiment, a register block is referred to as a register group. In at least one embodiment, a register configuration refers to how registers are grouped for use by software, such as how many register blocks are allocated and / or assigned to each thread.In at least one embodiment, a replacement register configuration refers to a new register configuration for a thread that replaces another register configuration for the same thread. In at least one embodiment, a processor's registers are grouped into register blocks, where each register block contains an identical number of registers. In at least one embodiment, a compiler performs process 600 to reduce a number of register blocks required by one or more threads. In at least one embodiment, a compiler performs process 600 to increase a number of threads that can be executed in parallel.In at least one embodiment, a compiler performs process 600 to increase a number of threads that can be executed in parallel while estimating that these threads, if executed, will still exceed one or more performance values.

[0060] In at least one embodiment, a compiler performs one or more aspects of process 600 to allocate a first plurality of processor registers to be allocated to one or more software threads based at least in part on one or more computational performance metrics associated with a second plurality of allocated registers, wherein the computational performance metrics are to be measured before allocating the first plurality of processor registers. In at least one embodiment, a plurality of registers refers to a configuration of registers, such as a block of registers. In at least one embodiment, a compiler allocates a plurality of registers as part of an iterative process that repeatedly allocates a plurality of registers to identify a plurality of registers that optimizes computational performance.

[0061] In at least one embodiment, one or more aspects of one or more embodiments associated with Fig. 6, with one or more aspects of one or more embodiments described herein and at least in connection with Fig. 1-5 and Fig. 7. In at least one embodiment, a compiler, such as compiler 714 of Fig. 7, one or more operations of process 600 based at least in part on one or more embodiments of process 100, process 200, process 300, process 400, process 500, or a combination thereof. In at least one embodiment, a compiler performs one or more aspects of process 600 to allocate a number of registers to a thread. In at least one embodiment, a compiler performs one or more aspects of process 600 to allocate a number of register blocks to a thread. In at least one embodiment, a register block is a fixed number of registers that can be allocated to a thread; for example, if a register block consists of 8 registers and a thread requires 9 registers, a compiler must allocate two blocks of 8 registers each to that thread.In at least one embodiment, a compiler allocates a number of registers that can be assigned to a thread. In at least one embodiment, a compiler begins process 600 by identifying all live areas 602 within a program described herein, at least in connection with operation 104 of FIG. Fig. 1 is further described.

[0062] In at least one embodiment, a compiler continues process 600 by generating a set of transformations that would allow a number of register blocks to be allocated to more threads with operation 604. In at least one embodiment, a compiler generates a set of transformations that would allow a fewer number of register blocks to be allocated to a number of threads. In at least one embodiment, a compiler generates sets of transformations for each live region that spans an overflow region, where an overflow region refers to a section of a program in which there are not enough registers available to store all of the data values ​​allocated to that section. In at least one embodiment, an overflow region refers to a region of an application's program code in which register demand is higher than one or more register targets.In at least one embodiment, a register target is a desired number of registers that a compiler or user aims to use in a region of an application's program code. In at least one embodiment, a compiler reduces register demand by selecting and applying a set of reduction transformations. In at least one embodiment, a compiler creates and maintains a separate data structure for representing and / or information regarding transformations implemented during an intermediate representation (IR) compilation phase that reduces a number of register blocks, while maintaining a separate interference graph for representing other transform intermediate representation (IR) transformations.

[0063] In at least one embodiment, implementing transformations that reduce the number of register blocks required to perform a number of threads is referred to as moving down a cliff or cliff rappelling. In at least one embodiment, increasing the number of register blocks required to perform a number of threads is referred to as moving up a cliff. In at least one embodiment, a number of register blocks is referred to as a cliff or register cliff; for example, a cliff may be 5 register blocks, while a lower cliff would be 4 register blocks, and a higher cliff would be 6 register blocks. In at least one embodiment, a particular processor register configuration is referred to as a cliff.

[0064] In at least one embodiment, a compiler continues process 600 by calculating a transition to a higher register cliff, lower register cliff, or maintaining a current register cliff with operation 606. In at least one embodiment, a compiler performs operation 606 to allocate an additional block of registers to a thread, deallocate a block of registers from a thread, or maintain a current allocation of a block of registers with operation 606. In at least one embodiment, allocating an additional block of registers is referred to as a transition to a higher register cliff. In at least one embodiment, deallocate a block of registers is referred to as a transition to a lower register cliff.In at least one embodiment, calculating whether to transition from a higher register cliff to a lower register cliff, or vice versa, is based at least in part on the performance cost of implementing reduction transformations required to transition from one cliff to another. In at least one embodiment, a user provides input to a compiler that sets a threshold number of transformations acceptable to that user. In at least one embodiment, a user inputs a number of overflows and / or inserted instructions acceptable to reach a target cliff.

[0065] In at least one embodiment, a compiler continues process 600 by identifying whether a transition improves performance with operation 607, where a transition refers to a transition to a higher or lower register cliff calculated with operation 606. In at least one embodiment, if a compiler identifies that a transition will improve performance, that compiler applies associated transformations with operation 608. In at least one embodiment, if a compiler identifies that a transition will not improve performance, process 600 ends. In at least one embodiment, if a compiler identifies that a transition to a different register cliff will not improve performance, a most recent transition to a register cliff is applied with operation 608.

[0066] In at least one embodiment, a compiler continues the process 600 by applying a selected set of transformations with operation 608. In at least one embodiment, transformations are applied according to a priority queue described herein at least in connection with Fig. 4. In at least one embodiment, a compiler applies transformations as described herein at least in connection with operation 304 of Fig. 3. In at least one embodiment, after a compiler completes operation 608, that compiler performs operation 602 in another iteration of a portion of process 600 to identify a register cliff that is optimal for performance.

[0067] Fig. 7 illustrates a block diagram illustrating a system 700 for causing one or more circuits to allocate and / or assign registers to live regions, live segments, live webs, or a combination thereof, according to at least one embodiment. In at least one embodiment, one or more aspects of one or more embodiments associated with Fig. 7, one or more embodiments of process 100, process 200, process 300, process 400, process 500, process 600, or a combination thereof. In at least one embodiment, host 702 is a computer system including a processor 706, such as a CPU, and memory 708. In at least one embodiment, set of instructions 710 includes one or more definitions of one or more functions.

[0068] In at least one embodiment, processor 706 is to implement a compiler 714 to generate code 716 based at least in part on instructions 710. In at least one embodiment, the set of instructions 710 is referred to as source code or as a representation of a function, kernel, or program. In at least one embodiment, compiler 714 translates code in one programming language to another programming language. In at least one embodiment, compiler 714 translates code from a high-level programming language (e.g., Python, Fortran, C++, C#, Java, Visual Basic, JavaScript) to a low-level programming language, such as machine language and assembly language (e.g., AMD® GCN, Intel® x64 Assembly, NVIDIA® PTX). In at least one embodiment, compiler 714 includes more than one type of compiler, such as a host compiler, interpreter, cross-compiler, incremental compiler, or any combination thereof.In at least one embodiment, compiler 714 is a compiler such as AMD® Optimizing C / C++ Compiler (AOCC), Intel® oneAPI DPC++ / C++ Compiler, NVIDIA® CUDA® Compiler (NVCC), NVIDIA® NVFORTRAN, NVIDIA® NVC++, NVIDIA® NVC, or any combination thereof. In at least one embodiment, compiler 714 is an optimizing compiler. In at least one embodiment, compiler 714 is configured for parallel computing. In at least one embodiment, compiler 714 is configured for high performance computing (HPC) in various fields, such as scientific research (e.g., meteorology), media and entertainment (e.g., graphics rendering), oil and gas (e.g., identifying where to drill), artificial intelligence (e.g., autonomous driving), financial services (e.g., automated trading), or any combination thereof.

[0069] In at least one embodiment, terms such as "module" and nominalized verbs (e.g., compiler, model preference generator, model selector, performance monitor, model trainer, encoder, decoder, downlink channel estimator, beamformer, controller, and / or other terms) as used in any implementation described herein, unless otherwise clear from context or explicitly indicated to the contrary, each refer to any combination of software logic, firmware logic, hardware logic, and / or circuitry configured to provide the functionality described herein.In at least one embodiment, software may be embodied as a software package, code, and / or instruction set or instructions, and "hardware" as used in any implementation described herein may include, for example, individually or in any combination, hard-wired circuits, programmable circuits, state machine circuits, fixed-function circuits, execution unit circuits, and / or firmware storing instructions executed by programmable circuits. In at least one embodiment, modules may be embodied collectively or individually as circuits that form part of a larger system, for example, an integrated circuit (IC), a system-on-chip (SoC), and so on.

[0070] In at least one embodiment, system 700 includes a computer-readable storage medium and / or code stored on the computer-readable storage medium in the form of a computer program that includes a plurality of computer-readable instructions executable by one or more processors. In at least one embodiment, a computer-readable storage medium is a non-transitory computer-readable medium. In at least one embodiment, at least some computer-readable instructions usable to perform operations related to process 100 of Fig. 1 are not stored exclusively using volatile signals (e.g., a propagating transient electrical or electromagnetic transmission). In at least one embodiment, a non-transitory computer-readable medium does not necessarily include non-transitory data storage circuits (e.g., buffers, caches, and queues) within transient signal transceivers. In at least one embodiment, system 700 is implemented at least in part as a non-transitory computer-readable storage medium storing executable instructions that, when executed by one or more processors of a computer system, cause the computer system to cause a compiler to allocate and / or assign registers to a live area, live segment, live web, or a combination thereof, at least as described herein in connection with process 100 of Fig. 1 further described.

[0071] In at least one embodiment, code 716 is referred to as instructions, executable instructions, or a representation of a function, kernel, or program. In at least one embodiment, code 716 is an intermediate representation of a function, kernel, or program. In at least one embodiment, code 716 is an executable version of a function, kernel, or program. In at least one embodiment, the type of memory (e.g., constant, shared, device, and / or other suitable type of memory) is not a specific location defined in hardware, but is a label for a particular portion of memory to be handled and / or treated in a particular manner.

[0072] In at least one embodiment, processor 706 executes an application programming interface (API) 717 to implement one or more aspects of one or more embodiments described herein, including those described at least in connection with Fig. 1-7. In at least one embodiment, API 717 is one or more APIs described herein at least in connection with Fig. 24 and Fig. 27-29. In at least one embodiment, an input to API 717 includes an indication, such as a flag, that a user sets to enable one or more aspects of one or more embodiments described herein. In at least one embodiment, an input to API 717 includes any type of metric or value, which may include thresholds, a number of registers, or any combination thereof, as further described herein.

[0073] In at least one embodiment, compiler 714 generates processing sets 718, such as processing sets described herein at least in connection with Fig. 1-6. In at least one embodiment, processing sets 718 are stored in memory 708. In at least one embodiment, host 702 is to launch one or more kernels based at least in part on processing sets 718. In at least one embodiment, a set of threads 724 is to execute one or more launched kernels, with performance based at least in part on processing sets 718. In at least one embodiment, processor 720 is to execute a kernel using the set of threads 724, with performance based at least in part on processing sets 718.

[0074] In at least one embodiment, device 704 is an accelerator that includes a processor 720 (e.g., one or more parallel processors) and memory 722. In at least one embodiment, device 704 is a parallel processing unit (PPU) or a graphics processing unit (GPU). In at least one embodiment, host 702 is to initiate operations and / or instructions to be performed on device 704 (e.g., by initiating parallel processing framework instructions, such as Compute Unified Device Architecture (CUDA) kernels). In at least one embodiment, parallel processing framework instructions for a framework other than CUDA are used (e.g., instructions for Radeon Open Compute Platform ("ROCm"), HIP, OpenCL (OpenCL™ is developed by the Khronos group), SYCL, or Intel One API).In at least one embodiment, an executor (not shown for clarity) running on host 702 is intended to launch instructions. In at least one embodiment, the executor runs on a CPU, such as processor 706, and launches instructions, for example, as kernels, on a parallel processing unit (e.g., a GPU). In at least one embodiment, the executor is a virtual machine running on processor 706 (e.g., a CPU).

[0075] In at least one embodiment, a different number of processors (e.g., more than one processor 706 and / or more than one processor 720), a different number of devices (e.g., more than one device 704), and / or a different number of memories (e.g., more than one memory 708 and / or more than one memory 722) are included in the computer system 700. In at least one embodiment, the computer system 700 includes one or more other components not shown for clarity (e.g., a network interface card, a persistent storage device, one or more input devices, one or more output devices, and / or several other suitable components).

[0076] In at least one embodiment, the host 702 is to launch one or more functions (e.g., kernels). In at least one embodiment, the host 702 is to launch one or more kernels. In at least one embodiment, a set of threads 724 is to execute one or more launched kernels. In at least one embodiment, the processor 720 is to execute a kernel using the set of threads 724. In at least one embodiment, the set of threads 724 is specified at kernel launch (e.g., by the host 702). In at least one embodiment, one or more functions and / or kernels are to be launched on the host 702 and not on the device 704 (e.g.,using a multi-threaded and / or multi-core processor to execute multiple threads, where processor 706 may be a multi-threaded and / or multi-core processor and memory 708 may include one or more types of memory, such as constant, shared, and / or device memory. In at least one embodiment, one or more other sets of threads (e.g., grids of threads), not shown for clarity, are executed by device 704 (e.g., to execute one or more other kernels concurrently).

[0077] In at least one embodiment, the set of threads 724 is referred to as a grid of threads or an array of threads. In at least one embodiment, the set of threads 724 is referred to as a first stage of threads. In at least one embodiment, the set of threads 724 includes one or more subsets of threads (e.g., a subset of threads 726 and a subset of threads 728). In at least one embodiment, the subset of threads 726 is referred to as a first block of threads, and the subset of threads 728 is referred to as a second block of threads. In at least one embodiment, the first subset of threads 726 and the second subset of threads 728 are referred to as a second stage of threads. In at least one embodiment, the set of threads 724 includes one or more additional stages of threads (e.g., a third stage of threads).In at least one embodiment, the third stage of threads includes sets of threads that are subsets of groupings of threads at the second stage of threads. In at least one embodiment, the first subset of threads 726 includes a subset of threads 730 and a subset of threads 732. In at least one embodiment, the second subset of threads 728 includes a subset of threads 734 and a subset of threads 736. In at least one embodiment, the subsets of threads 730, the subset of threads 732, the subset of threads 734, and the subset of threads 736 are each referred to as cooperative thread arrays (CTAs). In at least one embodiment, each CTA includes a plurality of individual threads, not shown for clarity.

[0078] In at least one embodiment, one or more labels are associated with memory 722. In at least one embodiment, labels are referred to as types of memory. In at least one embodiment, labels include constant memory 738, shared memory 740, and device memory 742. In at least one embodiment, a different number and / or type of labels are used. In at least one embodiment, one or more labels refer to how values ​​stored in memory associated with those labels should be treated (e.g., values ​​stored in memory labeled constant should use hardware and / or software optimizations to perform accelerated operations using constant values).In at least one embodiment, one or more labels may be used for more than one type, location, and / or level of memory (e.g., off-chip, on-chip, various cache levels, and / or other suitable memory type). Data center

[0079] Fig. 8 illustrates an exemplary data center 800, according to at least one embodiment. In at least one embodiment, the data center 800 includes, without limitation, a data center infrastructure layer 810, a framework layer 820, a software layer 830, and an application layer 840.

[0080] In at least one embodiment, as in Fig. 8, the data center infrastructure layer 810 may include a resource orchestrator 812, clustered compute resources 814, and node compute resources ("Node CRs") 816(1)-816(N), where "N" represents any whole positive integer. In at least one embodiment, the Node CRs 816(1)-816(N) may include, but are not limited to, any number of central processing units ("CPUs") or other processors (including accelerators, field-programmable gate arrays ("FPGAs"), data processing units ("DPUs") in network devices, graphics processors, etc.), memory devices (e.g., dynamic read-only memory), storage devices (e.g., solid-state or disk drives), network input / output devices ("NW I / O"), network switches, virtual machines ("VMs"), power modules and cooling modules, etc. In at least one embodiment, one or more node CRs may be selected from the nodes CRs 816(1)-816(N) may be a server that has one or more of the computing resources listed above.

[0081] In at least one embodiment, the grouped computing resources 814 may include separate groupings of node CRs housed in one or more racks (not shown), or multiple racks housed in data centers in different geographic locations (also not shown). Separate groupings of node CRs within the grouped computing resources 814 may include grouped computing, networking, storage, or memory resources that may be configured or assigned to support one or more workloads. In at least one embodiment, multiple node CRs including CPUs or processors may be grouped in one or more racks to provide computing resources to support one or more workloads.In at least one embodiment, one or more racks may also include any number of power modules, cooling modules, and network switches in any combination.

[0082] In at least one embodiment, resource orchestrator 812 may configure or otherwise control one or more node CRs 816(1)-816(N) and / or grouped computing resources 814. In at least one embodiment, resource orchestrator 812 may include a software design infrastructure ("SDI") management entity for data center 800. In at least one embodiment, resource orchestrator 812 may include hardware, software, or any combination thereof.

[0083] In at least one embodiment, as in Fig. 8, the framework layer 820 includes, without limitation, a job scheduler 832, a configuration manager 834, a resource manager 836, and a distributed file system 838. In at least one embodiment, the framework layer 820 may include a framework to support software 852 of the software layer 830 and / or one or more applications 842 of the application layer 840. In at least one embodiment, the software 852 or application(s) 842 may each include web-based service software or applications, such as those provided by Amazon Web Services, Google Cloud, and Microsoft Azure. In at least one embodiment, the framework layer 820 may be, but is not limited to, some type of free and open source software web application framework, such as Apache Spark™ (hereinafter "Spark"), which may utilize the distributed file system 838 for large-scale data processing (e.g., "Big Data").In at least one embodiment, job scheduler 832 may include a Spark driver to facilitate scheduling workloads supported by different layers of data center 800. In at least one embodiment, configuration manager 834 may be capable of configuring different layers, such as software layer 830 and framework layer 820, including Spark and distributed file system 838, to support large-scale computing. In at least one embodiment, resource manager 836 may be capable of managing clustered or grouped compute resources mapped to or allocated to support distributed file system 838 and job scheduler 832. In at least one embodiment, clustered or grouped compute resources may include clustered compute resource 814 on data center infrastructure layer 810.In at least one embodiment, the resource manager 836 may coordinate with the resource orchestrator 812 to manage these mapped or allocated compute resources.

[0084] In at least one embodiment, the software 852 included in the software layer 830 may include software used by at least portions of the node CRs 816(1)-816(N), the clustered computing resources 814, and / or the distributed file system 838 of the framework layer 820. One or more types of software may include, but are not limited to, Internet website search software, email virus scanning software, database software, and streaming video content software.

[0085] In at least one embodiment, the application(s) 842 included in the application layer 840 may include one or more types of applications used by at least portions of the node CRs 816(1)-816(N), the clustered computing resources 814, and / or the distributed file system 838 of the framework layer 820. At least one or more types of applications may include, without limitation, CUDA applications.

[0086] In at least one embodiment, any of the configuration manager 834, the resource manager 836, and the resource orchestrator 812 may implement any number and type of self-modifying actions based on any amount and type of data collected in any technically feasible manner. In at least one embodiment, self-modifying actions may relieve a data center operator of the data center 800 from making potentially poor configuration decisions and potentially avoid underutilized and / or poorly performing portions of a data center.

[0087] In at least one embodiment, at least one component related to Fig. 8 is used to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, the server 812 causes a compiler to allocate registers to live areas based on estimated performance costs, as described herein at least in connection with the process 100 of Fig. 1 is described in more detail. Computer-based systems

[0088] The following figures set forth, without limitation, exemplary computer-based systems that may be used to implement at least one embodiment.

[0089] Fig. 9 illustrates a processing system 900, according to at least one embodiment. In at least one embodiment, the processing system 900 includes one or more processors 902 and one or more graphics processors 908, and may be a single-processor desktop system, a multiprocessor workstation system, or a server system with a large number of processors 902 or processor cores 907. In at least one embodiment, the processing system 900 is a processing platform integrated within a system-on-a-chip ("SoC") integrated circuit for use in mobile, handheld, or embedded devices. In at least one embodiment, a processor core 907 is referred to as a computational unit or computational unit.

[0090] In at least one embodiment, processing system 900 may include or be integrated with a server-based gaming platform, a gaming console, a media console, a mobile gaming console, a handheld gaming console, or an online gaming console. In at least one embodiment, processing system 900 is a mobile phone, a smartphone, a tablet computing device, or a mobile internet device. In at least one embodiment, processing system 900 may also include, be coupled to, or integrated with a wearable device, such as a wearable smartwatch device, a smartglass device, an augmented reality device, or a virtual reality device.In at least one embodiment, processing system 900 is a television or set-top box device having one or more processors 902 and a graphical interface generated by one or more graphics processors 908.

[0091] In at least one embodiment, one or more processors 902 each include one or more processor cores 907 to process instructions that, when executed, perform operations for system and user software. In at least one embodiment, each of one or more processor cores 907 is configured to process a specific instruction set 909. In at least one embodiment, the instruction set 909 may facilitate Complex Instruction Set Computing ("CISC"), Reduced Instruction Set Computing ("RISC"), or Very Long Instruction Word ("VLIW") computing. In at least one embodiment, the processor cores 907 may each process a different instruction set 909, which may include instructions to facilitate emulation of other instruction sets.In at least one embodiment, the processor core 907 may also include other processing devices, such as a digital signal processor (“DSP”).

[0092] In at least one embodiment, processor 902 includes a cache memory ("cache") 904. In at least one embodiment, processor 902 may have a single internal cache or multiple levels of internal cache. In at least one embodiment, the cache memory is shared by various components of processor 902. In at least one embodiment, processor 902 also uses an external cache (e.g., a level 3 ("L3") cache or a last level cache ("LLC")) (not shown), which may be shared by processor cores 907 using known cache coherence techniques. In at least one embodiment, register file 906 is additionally included within processor 902, which may include various types of registers for storing various types of data (e.g., integer registers, floating-point registers, status registers, and an instruction pointer register).In at least one embodiment, register file 906 may include general purpose registers or other registers.

[0093] In at least one embodiment, one or more processors 902 are coupled to one or more interface buses 910 for communicating communication signals, such as address, data, or control signals, between the processor 902 and other components in the processing system 900. In at least one embodiment, the interface bus 910 may be a processor bus, such as a version of a Direct Media Interface ("DMI") bus. In at least one embodiment, the interface bus 910 is not limited to a DMI bus and may include one or more peripheral component interconnect buses (e.g., "PCI," PCI Express ("PCIe")), memory buses, or other types of interface buses. In at least one embodiment, the processor(s) 902 include an integrated memory controller 916 and a platform control hub 930.In at least one embodiment, memory controller 916 facilitates communication between a memory device and other components of processing system 900, while platform control hub ("PCH") 930 provides connections to input / output ("I / O") devices via a local I / O bus. In at least one embodiment, one or more peripheral component interconnect buses include PCIe Gen 5, which provides an interface for processors.

[0094] In at least one embodiment, memory device 920 may be a dynamic random access memory ("DRAM") device, a static random access memory ("SRAM") device, a flash memory device, a phase-change memory device, or other memory device with suitable performance to serve as processor memory. In at least one embodiment, memory device 920 may operate as system memory for processing system 900 to store data 922 and instructions 921 for use when one or more processors 902 are executing an application or process. In at least one embodiment, memory controller 916 is also coupled to an optional external graphics processor 912 that can communicate with one or more graphics processors 908 in processors 902 to perform graphics and media operations.In at least one embodiment, a display device 911 may connect to the processor(s) 902. In at least one embodiment, the display device 911 may include one or more of an internal display device, such as in a mobile electronic device or a laptop device, or an external display device attached via a display interface (e.g., DisplayPort, etc.). In at least one embodiment, the display device 911 may include a head-mounted display ("HMD"), such as a stereoscopic display device, for use in virtual reality ("VR") or augmented reality ("AR") applications.

[0095] In at least one embodiment, the platform control hub 930 enables peripherals to connect to the storage device 920 and the processor 902 via a high-speed I / O bus. In at least one embodiment, I / O peripherals include, but are not limited to, an audio controller 946, a network controller 934, a firmware interface 928, a wireless transceiver 926, touch sensors 925, and a data storage device 924 (e.g., hard disk drive, flash memory, etc.). In at least one embodiment, the data storage device 924 may connect via a storage interface (e.g., SATA) or via a peripheral bus, such as PCI or PCIe. In at least one embodiment, the touch sensors 925 may include touchscreen sensors, pressure sensors, or fingerprint sensors.In at least one embodiment, the wireless transceiver 926 may be a Wi-Fi transceiver, a Bluetooth transceiver, or a cellular network transceiver, such as a 3G, 4G, or Long Term Evolution ("LTE") transceiver. In at least one embodiment, the firmware interface 928 enables communication with system firmware and may be, for example, a Unified Extensible Firmware Interface ("UEFTI"). In at least one embodiment, the network controller 934 may enable a network connection to a wired network. In at least one embodiment, a high-performance network controller (not shown) is coupled to the interface bus 910. In at least one embodiment, the audio controller 946 is a multi-channel high-resolution audio controller. In at least one embodiment, the processing system 900 includes an optional legacy I / O controller 940 for coupling legacy devices (e.g.,Personal System 2 ("PS / 2")) to the processing system 900. In at least one embodiment, the platform control hub 930 may also be connected to one or more Universal Serial Bus ("USB") controllers 942 that connect input devices, such as keyboard and mouse combinations 943, a camera 944, or other USB input devices.

[0096] In at least one embodiment, an instance of the memory controller 916 and the platform control hub 930 may be integrated into a discrete external graphics processor, such as the external graphics processor 912. In at least one embodiment, the platform control hub 930 and / or the memory controller 916 may be external to one or more processors 902. For example, in at least one embodiment, the processing system 900 may include an external memory controller 916 and a platform control hub 930, which may be configured as a memory control hub and a peripheral control hub within a system chipset in communication with the processor(s) 902.

[0097] In at least one embodiment, at least one component related to Fig. 9 is used to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, the processor(s) 902 cause a compiler to allocate registers to live areas based on estimated performance costs, as described herein at least in connection with the process 100 of Fig. 1 is described in more detail.

[0098] Fig. 10 illustrates a computer system 1000, according to at least one embodiment. In at least one embodiment, the computer system 1000 may be a system with interconnected devices and components, a SOC, or a combination thereof. In at least one embodiment, the computer system 1000 is formed with a processor 1002, which may include execution units for executing an instruction. In at least one embodiment, the computer system 1000 may include, without limitation, a component such as the processor 1002 to employ execution units including logic for performing algorithms for processing data. In at least one embodiment, the computer system 1000 may include processors, such as PENTIUM ® Processor family, Xeon™, Itanium ® , XScale™ and / or StrongARM™, Intel ® Core™ or Intel ®Nervana™ microprocessors available from Intel Corporation of Santa Clara, California, although other systems (including PCs with other microprocessors, engineering workstations, set-top boxes, and the like) may be used. In at least one embodiment, computer system 1000 may run a version of the WINDOWS operating system available from Microsoft Corporation of Redmond, Washington, although other operating systems (e.g., UNIX and Linux), embedded software, and / or graphical user interfaces may also be used.

[0099] In at least one embodiment, computer system 1000 may be used in other devices, such as handheld devices and embedded applications. Some examples of handheld devices include cellular phones, Internet Protocol devices, digital cameras, personal digital assistants ("PDAs"), and handheld PCs. In at least one embodiment, embedded applications may include a microcontroller, a digital signal processor (DSP), an SoC, network computers ("NetPCs"), set-top boxes, network hubs, wide area network ("WAN") switches, or any other system capable of performing one or more instructions.

[0100] In at least one embodiment, computer system 1000 may include, without limitation, processor 1002, which may include, without limitation, one or more execution units 1008 that may be configured to execute a Compute Unified Device Architecture ("CUDA") (CUDA® is developed by NVIDIA Corporation of Santa Clara, CA) program. In at least one embodiment, a CUDA program is at least a portion of a software application written in a CUDA programming language. In at least one embodiment, computer system 1000 is a single-processor desktop or server system. In another embodiment, computer system 1000 may be a multiprocessor system.In at least one embodiment, processor 1002 may include, without limitation, a CISC microprocessor, a RISC microprocessor, a VLIW microprocessor, a processor implementing a combination of instruction sets, or any other processor device, such as a digital signal processor. In at least one embodiment, processor 1002 may be coupled to a processor bus 1010 that may communicate data signals between processor 1002 and other components in computer system 1000.

[0101] In at least one embodiment, processor 1002 may include, without limitation, a Level 1 ("L1") internal cache memory ("cache") 1004. In at least one embodiment, processor 1002 may have a single internal cache or multiple levels of internal cache. In at least one embodiment, cache memory may be located external to processor 1002. In at least one embodiment, processor 1002 may also include a combination of both internal and external caches. In at least one embodiment, a register file 1006 may store various types of data in various registers, including, without limitation, integer registers, floating-point registers, status registers, and instruction pointer registers.

[0102] In at least one embodiment, execution unit 1008, including without limitation logic for performing integer and floating-point operations, is also located in processor 1002. Processor 1002 may also include microcode ("ucode") read-only memory ("ROM") that stores microcode for certain macroinstructions. In at least one embodiment, execution unit 1008 may include logic for handling a packed instruction set 1009. In at least one embodiment, by incorporating packed instruction set 1009 into an instruction set of a general-purpose processor, along with associated instruction execution circuitry, operations used by many multimedia applications can be performed using packed data in a general-purpose processor 1002.In at least one embodiment, many multimedia applications may be accelerated and executed more efficiently by using a full width of a processor's data bus to perform operations on packed data, which may eliminate the need to transfer smaller units of data across that processor's data bus to perform one or more operations one data item at a time.

[0103] In at least one embodiment, execution unit 1008 may also be used in microcontrollers, embedded processors, graphics devices, DSPs, and other types of logic circuits. In at least one embodiment, computer system 1000 may include, among other things, a memory 1020. In at least one embodiment, memory 1020 may be implemented as a DRAM device, an SRAM device, a flash memory device, or another storage device. Memory 1020 may store instruction(s) 1019 and / or data 1021 represented by data signals that may be executed by processor 1002.

[0104] In at least one embodiment, a system logic chip may be coupled to the processor bus 1010 and the memory 1020. In at least one embodiment, the system logic chip may include, among other things, a memory control hub ("MCH") 1016, and the processor 1002 may communicate with the MCH 1016 via the processor bus 1010. In at least one embodiment, the MCH 1016 may provide a high-bandwidth memory path 1018 to the memory 1020 for instruction and data storage and for storing graphics commands, data, and textures. In at least one embodiment, the MCH 1016 may route data signals between the processor 1002, the memory 1020, and other components in the computer system 1000, and may bridge data signals between the processor bus 1010, the memory 1020, and a system I / O interface 1022. In at least one embodiment, a system logic chip may provide a graphics port for coupling to a graphics controller.In at least one embodiment, the MCH 1016 may be coupled to the memory 1020 through the high-bandwidth memory path 1018, and a graphics / video card 1012 may be coupled to the MCH 1016 through an accelerated graphics port ("AGP") connection 1014.

[0105] In at least one embodiment, computer system 1000 may use system I / O 1022, which is a proprietary hub interface bus, to couple MCH 1016 to an I / O control hub ("ICH") 1030. In at least one embodiment, ICH 1030 may provide direct connections to some I / O devices via a local I / O bus. In at least one embodiment, a local I / O bus may include, without limitation, a high-speed I / O bus for connecting peripherals to memory 1020, a chipset, and processor 1002. Examples may include, but are not limited to, an audio controller 1029, a firmware hub (“flash BIOS”) 1028, a wireless transceiver 1026, a data store 1024, a legacy I / O controller 1023 including a user input interface 1025 and a keyboard interface, a serial expansion port 1027, such as a USB, and a network controller 1034.Data storage 1024 may include a hard disk drive, a floppy disk drive, a CD-ROM device, a flash memory device, or other mass storage device.

[0106] In at least one embodiment, Fig. 10 illustrates a system including interconnected hardware devices or "chips." In at least one embodiment, Fig. 10 illustrate an exemplary SoC. In at least one embodiment, Fig. 10 may be connected using proprietary connections, standardized connections (e.g., PCIe), or a combination thereof. In at least one embodiment, one or more components of system 1000 are interconnected using Compute Express Link (CXL) connections.

[0107] In at least one embodiment, at least one in Fig. 10 is used to describe or describe the components used herein and at least in connection with the Fig. 1-7. In at least one embodiment, the processor 1002 causes a compiler to calculate registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described, to assign live areas.

[0108] Fig. 11 illustrates a system 1000 according to at least one embodiment. In at least one embodiment, system 1000 is an electronic device employing a processor 1110. In at least one embodiment, system 1100 may be, for example, and without limitation, a notebook, a master server, a rack server, a blade server, an edge device communicatively coupled to one or more on-premises or cloud service providers, a laptop, a desktop, a tablet, a mobile device, a phone, an embedded computer, or any other suitable electronic device.

[0109] In at least one embodiment, system 1100 may include, without limitation, processor 1110 communicatively coupled to any suitable number or type of components, peripherals, modules, or devices. In at least one embodiment, processor 1110 is coupled using a bus or interface, such as an I 2 C-Bus, a System Management Bus (“SM-Bus”), a Low Pin Count (“LPC”) Bus, a Serial Peripheral Interface (“SPI”), a High Resolution Audio (“HDA”) Bus, a Serial Advanced Technology Port (“SATA”) Bus, a USB (versions 1, 2, 3), or a Universal Asynchronous Receiver / Transmitter (“UART”) Bus. In at least one embodiment, Fig. 11 illustrates a system including interconnected hardware devices or "chips." In at least one embodiment, Fig. 11 illustrate an exemplary SoC. In at least one embodiment, Fig. 11 may be connected to proprietary connections, standardized connections (e.g., PCIe), or a combination thereof. In at least one embodiment, one or more components of Fig. 11 connected using CXL connections.

[0110] In at least one embodiment, Fig. 11 a display 1124, a touchscreen 1125, a touchpad 1130, a near field communication unit (“NFC”) 1145, a sensor hub 1140, a thermal sensor 1146, an express chipset (“EC”) 1135, a trusted platform module (“TPM”) 1138, BIOS / firmware / flash memory (“BIOS, FW Flash”) 1122, a DSP 1160, a solid state disk (“SSD”) or a hard disk drive (“HDD”) 1120, a wireless local area network unit (“WLAN”) 1150, a Bluetooth unit 1152, a wireless wide area network unit (“WWAN”) 1156, a global positioning system (“GPS”) 1155, a camera (“USB 3.0 camera”) 1154, such as a B. a USB 3.0 camera, or a Low-Power Double Data Rate ("LPDDR") memory unit ("LPDDR3") 1115, for example, implemented in the LPDDR3 standard. These components may each be implemented in any suitable manner.

[0111] In at least one embodiment, other components may be communicatively coupled to processor 1110 through components discussed above. In at least one embodiment, an accelerometer 1141, an ambient light sensor ("ALS") 1142, a compass 1143, and a gyroscope 1144 may be communicatively coupled to sensor hub 1140. In at least one embodiment, thermal sensor 1139, a fan 1137, a keyboard 1136, and a touchpad 1130 may be communicatively coupled to EC 1135. In at least one embodiment, a speaker 1163, headphones 1164, and a microphone ("mic") 1165 may be communicatively coupled to an audio unit ("audio codec and Class-D amplifier") 1162, which in turn may be communicatively coupled to DSP 1160. In at least one embodiment, the audio unit 1162 may include, for example and without limitation, an audio encoder / decoder ("codec") and a Class D amplifier.In at least one embodiment, a SIM card ("SIM") 1157 may be communicatively coupled to the WWAN unit 1156. In at least one embodiment, components such as the WLAN unit 1150 and the Bluetooth unit 1152, as well as the WWAN unit 1156, may be implemented in a next-generation form factor ("NGFF").

[0112] In at least one embodiment, at least one component related to Fig. 11, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, processor 1110 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0113] Fig. 12 illustrates an example integrated circuit 1200 according to at least one embodiment. In at least one embodiment, the example integrated circuit 1200 is a SoC that can be manufactured using one or more IP cores. In at least one embodiment, the integrated circuit 1200 includes one or more application processors 1205 (e.g., CPUs, DPUs), at least one graphics processor 1210, and may additionally include an image processor 1215 and / or a video processor 1220, each of which may be a modular IP core. In at least one embodiment, the integrated circuit 1200 includes peripheral or bus logic that includes a USB controller 1225, a UART controller 1230, an SPI / SDIO controller 1235, and an I 2 S / I 2C controller 1240. In at least one embodiment, the integrated circuit 1200 may include a display device 1245 coupled to one or more of a High Definition Multimedia Interface ("HDMI") controller 1250 and a Mobile Industry Processor Interface ("MIPI") display interface 1255. In at least one embodiment, memory may be provided by a flash memory subsystem 1260 that includes flash memory and a flash memory controller. In at least one embodiment, a memory interface may be provided via a memory controller 1265 for accessing SDRAM or SRAM memory devices. In at least one embodiment, some integrated circuits additionally include an embedded security engine 1270.

[0114] Fig. 13 illustrates a computing system 1300 according to at least one embodiment. In at least one embodiment, the computing system 1300 includes a processing subsystem 1301 having one or more processors 1302 and a system memory 1304 communicating via an interconnect path that may include a memory hub 1305. In at least one embodiment, the memory hub 1305 may be a separate component within a chipset component or may be integrated within one or more processors 1302. In at least one embodiment, the memory hub 1305 is coupled to an I / O subsystem 1311 via a communications link 1306. In at least one embodiment, the I / O subsystem 1311 includes an I / O hub 1307 that may enable the computing system 1300 to receive input from one or more input devices 1308.In at least one embodiment, the I / O hub 1307 may enable a display controller, which may be included in one or more processors 1302, to provide outputs to one or more display devices 1310A. In at least one embodiment, one or more display devices 1310A coupled to the I / O hub 1307 may include a local, internal, or embedded display device.

[0115] In at least one embodiment, processing subsystem 1301 includes one or more parallel processors 1312 coupled to storage hub 1305 via a bus or other communication link 1313. In at least one embodiment, communication link 1313 may be one of any number of standards-based communication link technologies or protocols, such as, but not limited to, PCIe, or may be a vendor-specific communication interface or communication structure. In at least one embodiment, one or more parallel processors 1312 form a computationally focused parallel or vector processing system, which may include a large number of processing cores and / or processing clusters, such as a multi-processor or integrated core compute units.In at least one embodiment, one or more parallel processors 1312 form a graphics processing subsystem that can output pixels to one or more display devices 1310A coupled via I / O hub 1307. In at least one embodiment, one or more parallel processors 1312 may also include a display controller and a display interface (not shown) to enable direct connection to one or more display devices 1310B.

[0116] In at least one embodiment, a system storage unit 1314 may connect to the I / O hub 1307 to provide a storage mechanism for the computing system 1300. In at least one embodiment, an I / O switch 1316 may be used to provide an interface mechanism to enable connections between the I / O hub 1307 and other components, such as a network adapter 1318 and / or a wireless network adapter 1319 that may be integrated into a platform, and various other devices that may be added via one or more add-on devices 1320. In at least one embodiment, the network adapter 1318 may be an Ethernet adapter or other wired network adapter.In at least one embodiment, the wireless network adapter 1319 may include one or more of a Wi-Fi, Bluetooth, NFC, or other network device that includes one or more wireless radios.

[0117] In at least one embodiment, computing system 1300 may include other components not explicitly shown, including USB or other port connections, optical storage drives, video capture devices, and the like, which may also be connected to I / O hub 1307. In at least one embodiment, communication paths connecting various components in Fig. 13 interconnect, be implemented using any suitable protocols, such as PCI-based protocols (e.g., PCIe) or other bus or point-to-point communication interfaces and / or protocol(s), such as NVLink high-speed interconnect or link protocols.

[0118] In at least one embodiment, one or more parallel processors 1312 include circuitry optimized for graphics and video processing, including, for example, video output circuitry, and form a graphics processing unit ("GPU"). In at least one embodiment, one or more parallel processors 1312 include circuitry optimized for general-purpose processing. In at least one embodiment, components of computing system 1300 may be integrated with one or more other system elements on a single integrated circuit. For example, in at least one embodiment, one or more parallel processors 1312, memory hub 1305, processor(s) 1302, and I / O hub 1307 may be integrated into an SoC integrated circuit. In at least one embodiment, components of computing system 1300 may be integrated into a single package to form a system-in-package ("SIP") configuration.In at least one embodiment, at least a portion of the components of computing system 1300 may be integrated into a multi-chip module ("MCM"), which may be interconnected with other multi-chip modules to form a modular computing system. In at least one embodiment, I / O subsystem 1311 and display devices 1310B are omitted from computing system 1300. In at least one embodiment, one or more parallel processors 1312 include one or more tensor memory accelerator (TMA) units capable of transferring data blocks between global memory and shared memory. In at least one embodiment, one or more processors use or access one or more TMAs to perform bidirectional copy operations, e.g., from global memory to shared memory and vice versa.

[0119] In at least one embodiment, at least one component related to Fig. 13, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, the processor(s) 1302 cause a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with the process 100 of Fig. 1 described in more detail. Processing systems

[0120] The following figures illustrate, without limitation, exemplary processing systems that may be used to implement at least one embodiment.

[0121] Fig. 14 illustrates an accelerated processing unit ("APU") 1400 according to at least one embodiment. In at least one embodiment, APU 1400 is developed by AMP Corporation of Santa Clara, CA. In at least one embodiment, APU 1400 may be configured to execute an application program, such as a CUDA program. In at least one embodiment, APU 1400 includes, without limitation, a core complex 1410, a graphics complex 1440, a fabric 1460, I / O interfaces 1470, memory controllers 1480, a display controller 1492, and a multimedia engine 1494. In at least one embodiment, APU 1400 may include, without limitation, any number of core complexes 1410, any number of graphics complexes 1450, any number of display controllers 1492, and any number of multimedia engines 1494 in any combination.For purposes of explanation, multiple instances of the same object are referred to herein with reference numbers that identify the object and parenthetical numbers that identify the instance where needed.

[0122] In at least one embodiment, core complex 1410 is a CPU, graphics complex 1440 is a GPU, and APU 1400 is a processing unit that integrates, without limitation, 1410 and 1440 on a single chip. In at least one embodiment, some tasks may be assigned to core complex 1410 and other tasks may be assigned to graphics complex 1440. In at least one embodiment, core complex 1410 is configured to execute main control software associated with APU 1400, such as an operating system. In at least one embodiment, core complex 1410 is the main processor of APU 1400, which controls and coordinates operations of other processors. In at least one embodiment, core complex 1410 issues instructions that control the operation of graphics complex 1440.In at least one embodiment, core complex 1410 may be configured to execute host executable code derived from CUDA source code, and graphics complex 1440 may be configured to execute device executable code derived from CUDA source code.

[0123] In at least one embodiment, core complex 1410 includes, without limitation, cores 1420(1)-1420(4) and an L3 cache 1430. In at least one embodiment, core complex 1410 may include, without limitation, any number of cores 1420 and any number and type of caches in any combination. In at least one embodiment, cores 1420 are configured to execute instructions of a particular instruction set architecture ("ISA"). In at least one embodiment, each core 1420 is a CPU core. In at least one embodiment, core 1420 is referred to as a compute unit or compute unit.

[0124] In at least one embodiment, each core 1420 includes, without limitation, a fetch / decode unit 1422, an integer execution engine 1424, a floating-point execution engine 1426, and an L2 cache 1428. In at least one embodiment, the fetch / decode unit 1422 fetches instructions, decodes those instructions, generates micro-operations, and dispatches separate micro-instructions to the integer execution engine 1424 and the floating-point execution engine 1426. In at least one embodiment, the fetch / decode unit 1422 may concurrently dispatch one micro-instruction to the integer execution engine 1424 and another micro-instruction to the floating-point execution engine 1426. In at least one embodiment, the integer execution engine 1424 performs, without limitation, integer and memory operations. In at least one embodiment, the floating-point engine 1426 performs, without limitation, floating-point and vector operations.In at least one embodiment, fetch / decode unit 1422 dispatches microinstructions to a single execution engine that replaces both integer execution engine 1424 and floating point execution engine 1426.

[0125] In at least one embodiment, each core 1420(i), where i is an integer representing a particular instance of core 1420, may access L2 cache 1428(i) included in core 1420(i). In at least one embodiment, each core 1420 included in core complex 1410(j), where j is an integer representing a particular instance of core complex 1410, is connected to other cores 1420 included in core complex 1410(j) via L3 cache 1430(j) included in core complex 1410(j). In at least one embodiment, the cores 1420 included in core complex 1410(j), where j is an integer representing a particular instance of core complex 1410, may access the entire L3 cache 1430(j) included in core complex 1410(j). In at least one embodiment, L3 cache 1430 may include any number of slices, without limitation.

[0126] In at least one embodiment, graphics complex 1440 may be configured to perform computational operations in a highly parallel manner. In at least one embodiment, graphics complex 1440 is configured to perform graphics pipeline operations such as drawing commands, pixel operations, geometric calculations, and other operations associated with rendering an image on a display. In at least one embodiment, graphics complex 1440 is configured to perform non-graphics operations. In at least one embodiment, graphics complex 1440 is configured to perform both graphics-related and non-graphics-related operations.

[0127] In at least one embodiment, the graphics complex 1440 includes, without limitation, any number of compute units 1450 and an L2 cache 1442. In at least one embodiment, the compute units 1450 share the L2 cache 1442. In at least one embodiment, the L2 cache 1442 is partitioned. In at least one embodiment, the graphics complex 1440 includes, without limitation, any number of compute units 1450 and any number (including zero) and type of caches. In at least one embodiment, the graphics complex 1440 includes, without limitation, any amount of dedicated graphics hardware.

[0128] In at least one embodiment, each compute unit 1450 includes, without limitation, any number of SIMD units 1452 and a shared memory 1454. In at least one embodiment, each SIMD unit 1452 implements a SIMD architecture and is configured to perform operations in parallel. In at least one embodiment, each compute unit 1450 can execute any number of thread blocks, but each thread block executes on a single compute unit 1450. In at least one embodiment, a thread block includes, without limitation, any number of threads of execution. In at least one embodiment, a workgroup is a thread block. In at least one embodiment, each SIMD unit 1452 executes a different warp. In at least one embodiment, a warp is a group of threads (e.g.,16 threads), where each thread in the warp belongs to a single thread block and is configured to process a different data set based on a single instruction set. In at least one embodiment, prediction can be used to deactivate one or more threads in a warp. In at least one embodiment, a trace is a thread. In at least one embodiment, a work item is a thread. In at least one embodiment, a wavefront is a warp. In at least one embodiment, different wavefronts in a thread block can synchronize with each other and communicate via shared memory 1454.In at least one embodiment, each compute unit 1450 includes one or more thread block clusters, where a thread block cluster may enable programmatic control of locality at a granularity greater than a single thread block of a single streaming multiprocessor (SM). In at least one embodiment, thread block clusters (also referred to as "clusters") enable multiple thread blocks running concurrently across streaming multiprocessors to synchronize and collaboratively retrieve, exchange, or otherwise use data.

[0129] In at least one embodiment, structure 1460 is a system interconnect that enables data and control transfers across core complex 1410, graphics complex 1440, I / O interfaces 1470, memory controllers 1480, display controller 1492, and multimedia engine 1494. In at least one embodiment, APU 1400 may include, without limitation, any number and type of system interconnect in addition to or in place of structure 1460 that enables data and control transfers across any number and type of directly or indirectly linked components that may be internal or external to APU 1400. In at least one embodiment, I / O interfaces 1470 are representative of any number and type of I / O interfaces (e.g., PCI, PCI-Extended ("PCI-X"), PCIe, Gigabit Ethernet ("GBE"), USB, etc.).In at least one embodiment, peripheral devices coupled to the I / O interfaces 1470 may include, without limitation, keyboards, mice, printers, scanners, joysticks or other types of gaming controllers, media recording devices, external storage devices, network interface cards, and so forth.

[0130] In at least one embodiment, the display controller AMD92 displays images on one or more display devices, such as a liquid crystal display ("LCD") device. In at least one embodiment, the multimedia engine 1494 includes, without limitation, any amount and type of multimedia-related circuitry, such as a video decoder, a video encoder, an image signal processor, etc. In at least one embodiment, the memory controllers 1480 enable data transfers between the APU 1400 and a unified system memory 1490. In at least one embodiment, the core complex 1410 and the graphics complex 1440 share the unified system memory 1490.

[0131] In at least one embodiment, the APU 1400 implements a memory subsystem, including, without limitation, any quantity and type of memory controllers 1480 and memory devices (e.g., shared memory 1454) that may be dedicated to a component or shared among multiple components. In at least one embodiment, the APU 1400 implements a cache subsystem, including, without limitation, one or more caches (e.g., L2 caches 1528, L3 cache 1430, and L2 cache 1442), each of which may be private or shared among any number of components (e.g., cores 1420, core complex 1410, SIMD units 1452, compute units 1450, and graphics complex 1440).

[0132] In at least one embodiment, at least one component related to Fig. 14, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, core 1420(1) causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0133] Fig. 15 illustrates a CPU 1500 according to at least one embodiment. In at least one embodiment, CPU 1500 may be configured to execute an application program. In at least one embodiment, CPU 1500 is developed by AMD Corporation of Santa Clara, CA. In at least one embodiment, CPU 1500 is configured to execute main control software, such as an operating system. In at least one embodiment, CPU 1500 issues instructions that control the operation of an external GPU (not shown). In at least one embodiment, CPU 1500 may be configured to execute host executable code derived from CUDA source code, and an external GPU may be configured to execute device executable code derived from such CUDA source code.In at least one embodiment, CPU 1500 includes, without limitation, any number of core complexes 1510, a fabric 1560, I / O interfaces 1570, and memory controllers 1580.

[0134] In at least one embodiment, core complex 1510 includes, without limitation, cores 1520(1)-1520(4) and an L3 cache 1530. In at least one embodiment, core complex 1510 may include, without limitation, any number of cores 1520 and any number and type of caches in any combination. In at least one embodiment, cores 1520 are configured to execute instructions of a particular ISA. In at least one embodiment, each core 1520 is a CPU core.

[0135] In at least one embodiment, each core 1520 includes, without limitation, a fetch / decode unit 1522, an integer execution engine 1524, a floating-point execution engine 1526, and an L2 cache 1528. In at least one embodiment, the fetch / decode unit 1522 fetches instructions, decodes those instructions, generates micro-operations, and dispatches separate micro-instructions to the integer execution engine 1524 and the floating-point execution engine 1526. In at least one embodiment, the fetch / decode unit 1522 may concurrently dispatch one micro-instruction to the integer execution engine 1524 and another micro-instruction to the floating-point execution engine 1526. In at least one embodiment, the integer execution engine 1524 performs, without limitation, integer and memory operations. In at least one embodiment, the floating-point engine 1526 performs, without limitation, floating-point and vector operations.In at least one embodiment, fetch / decode unit 1522 dispatches microinstructions to a single execution engine that replaces both integer execution engine 1524 and floating point execution engine 1526.

[0136] In at least one embodiment, each core 1520(i), where i is an integer representing a particular instance of core 1520, may access L2 cache 1528(i) included in core 1520(i). In at least one embodiment, each core 1520 included in core complex 1510(j), where j is an integer representing a particular instance of core complex 1510, is connected to other cores 1520 in core complex 1510(j) via L3 cache 1530(j) included in core complex 1510(j). In at least one embodiment, the cores 1520 included in core complex 1510(j), where j is an integer representing a particular instance of core complex 1510, may access the entire L3 cache 1530(j) included in core complex 1510(j). In at least one embodiment, L3 cache 1530 may include any number of slices, without limitation.

[0137] In at least one embodiment, structure 1560 is a system interconnect that enables data and control transfers across core complexes 1510(1)-1510(N) (where N is an integer greater than zero), I / O interfaces 1570, and memory controllers 1580. In at least one embodiment, CPU 1500 may include, without limitation, any number and type of system interconnect in addition to or in place of structure 1560 that enables data and control transfers across any number and type of directly or indirectly linked components that may be internal or external to CPU 1500. In at least one embodiment, I / O interfaces 1570 are representative of any number and type of I / O interfaces (e.g., PCI, PCI-X, PCIe, GBE, USB, etc.).In at least one embodiment, peripheral devices coupled to the I / O interfaces 1570 may include, without limitation, displays, keyboards, mice, printers, scanners, joysticks or other types of gaming controllers, media recording devices, external storage devices, network interface cards, and so forth.

[0138] In at least one embodiment, memory controllers 1580 enable data transfers between CPU 1500 and system memory 1590. In at least one embodiment, core complex 1510 and graphics complex 1540 share system memory 1590. In at least one embodiment, CPU 1500 implements a memory subsystem, including, without limitation, any number and type of memory controllers 1580 and memory devices that may be dedicated to a component or shared among multiple components. In at least one embodiment, CPU 1500 implements a cache subsystem, including, without limitation, one or more caches (e.g., L2 caches 1528 and L3 caches 1530), each of which may be private or shared among any number of components (e.g., cores 1520 and core complex 1510).

[0139] In at least one embodiment, at least one component related to Fig. 15, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, CPU 1500 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0140] Fig. 16 shows an example accelerator integration slice 1690 according to at least one embodiment. As used herein, a "slice" comprises a particular portion of the processing resources of an accelerator integration circuit. In at least one embodiment, the accelerator integration circuit provides cache management, memory access, context management, and interrupt management services for multiple graphics processing engines included in a graphics acceleration module. The graphics processing engines may each comprise a separate GPU. Alternatively, the graphics processing engines may comprise different types of graphics processing engines within a GPU, such as graphics execution units, media processing engines (e.g., video encoders / decoders), samplers, and blit engines. In at least one embodiment, the graphics acceleration module may be a GPU with multiple graphics processing engines.In at least one embodiment, the graphics processing engines may be individual GPUs integrated on a common package, line card, or die.

[0141] An application effective address space 1682 within system memory 1614 stores process elements 1683. In one embodiment, the process elements 1683 are stored in response to GPU calls 1681 from applications 1680 executing on the processor 1607. A process element 1683 contains the process state for the corresponding application 1680. A work descriptor ("WD") 1684 contained within the process element 1683 may be a single job requested by an application or may contain a pointer to a queue of jobs. In at least one embodiment, the WD 1684 is a pointer to a job request queue in an application effective address space 1682.

[0142] The graphics acceleration module 1646 and / or individual graphics processing engines may be shared by all or a subset of processes in a system. In at least one embodiment, an infrastructure for establishing process state and sending a WD 1684 to a graphics acceleration module 1646 to start a job in a virtualized environment may be included.

[0143] In at least one embodiment, a dedicated process programming model is implementation-specific. In this model, a single process owns the graphics acceleration module 1646 or a single graphics processing engine. Because the graphics acceleration module 1646 is owned by a single process, a hypervisor initializes the accelerator integration circuit for an owning partition, and an operating system initializes the accelerator integration circuit for an owning process when the graphics acceleration module 1646 is assigned.

[0144] In operation, a WD fetch unit 1691 in the accelerator integration slice 1690 fetches the next WD 1684, which includes an indication of the work to be performed by one or more graphics processing engines of the graphics acceleration module 1646. Data from the WD 1684 may be stored in registers 1645 and used by a memory management unit ("MMLT") 1639, the interrupt management circuitry 1647, and / or the context management circuitry 1648, as illustrated. For example, one embodiment of the MMU 1639 includes segment / page walk circuitry for accessing segment / page tables 1686 within the OS virtual address space 1685. The interrupt management circuitry 1647 may process interrupt events ("INT") 1692 received from the graphics acceleration module 1646.When performing graphics operations, an effective address 1693 generated by a graphics processing engine is translated into a real address by the MMU 1639.

[0145] In one embodiment, a similar set of registers 1645 is duplicated for each graphics processing engine and / or the graphics acceleration module 1646 and may be initialized by a hypervisor or operating system. Each of these duplicated registers may be included in an accelerator integration slice 1690. Example registers that may be initialized by a hypervisor are shown in Table 1. Table 1 - Hypervisor-initialized registers 1 Slice-Steuerregister 2 Real-Address(RA)-Scheduled-Processes-Area-Pointer 3 Authority-Mask-Override-Register 4 Interrupt-Vector-Table-Entry-Offset 5 Interrupt-Vector-Table-Entry-Limit 6 State-Register 7 Logical-Partition-ID 8 Real-Address(RA)-Hypervisor-Beschleuniger-Nutzungsdatensatz-Pointer 9 Speicherbeschreibungs-Register

[0146] Example registers that can be initialized by an operating system are shown in Table 2. Table 2 - Operating system initialized registers 1 Prozess- und Thread-Identifikation 2 Effektiver-Adress (EA)-Kontext-Speicher- / Wiederherstellungs-Pointer 3 Virtueller-Adress (VA)-Beschleuniger-Nutzungsdatensatz-Pointer 4 Virtueller-Adress (VA)-Speichersegment-Tabellen-Pointer 5 Authority-Mask 6 Arbeitsdeskriptor

[0147] In one embodiment, each WD 1684 is specific to a particular graphics acceleration module 1646 and / or a particular graphics processing engine. It contains all the information required by a graphics processing engine to perform the work, or it may be a pointer to a memory location where an application has established a command queue of work to be completed.

[0148] In at least one embodiment, at least one in Fig. 16 is used to describe or describe the components used herein and at least in connection with the Fig. 1-7. In at least one embodiment, the processor 1607 causes a compiler to optimize registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described to assign live areas.

[0149] The Fig. 17A and Fig. 17B illustrate example graphics processors according to at least one embodiment. In at least one embodiment, each of the example graphics processors may be fabricated using one or more IP cores. In addition to what is illustrated, other logic and circuitry may be included in at least one embodiment, including additional graphics processors / cores, peripheral interface controllers, or general-purpose processor cores. In at least one embodiment, the example graphics processors are intended for use in an SoC.

[0150] Fig. 17A illustrates an exemplary graphics processor 1710 of an SoC integrated circuit that may be manufactured using one or more IP cores, according to at least one embodiment. Fig. 17B illustrates an additional exemplary graphics processor 1740 of an integrated SoC circuit that may be fabricated using one or more IP cores, according to at least one embodiment. In at least one embodiment, the graphics processor 1710 is Fig. 17A, a low-power graphics processor core. In at least one embodiment, the graphics processor 1740 is Fig. 17B, ​​a higher performance graphics processor core. In at least one embodiment, each of the graphics processors 1710, 1740 may be variants of the graphics processor 1210 of Fig. be 12.

[0151] In at least one embodiment, graphics processor 1710 includes a vertex processor 1705 and one or more fragment processors 1715A-1715N (e.g., 1715A, 1715B, 1715C, 1715D through 1715N-1, and 1715N). In at least one embodiment, graphics processor 1710 may execute different shader programs via separate logic, such that vertex processor 1705 is optimized to perform operations for vertex shader programs, while one or more fragment processors 1715A-1715N perform fragment (e.g., pixel) shading operations for fragment or pixel shader programs. In at least one embodiment, vertex processor 1705 performs a vertex processing stage of a 3D graphics pipeline and generates primitives and vertex data.In at least one embodiment, fragment processors 1715A-1715N use primitive and vertex data generated by vertex processor 1705 to generate a framebuffer displayed on a display device. In at least one embodiment, fragment processors 1715A-1715N are optimized to execute fragment shader programs, as provided in an OpenGL API, which can be used to perform similar operations as a pixel shader program, as provided in a Direct 3D API.

[0152] In at least one embodiment, graphics processor 1710 additionally includes one or more MMU(s) 1720A-1720B, cache(s) 1725A-1725B, and circuit interconnect(s) 1730A-1730B. In at least one embodiment, one or more MMU(s) 1720A-1720B provide virtual-to-physical address mapping for graphics processor 1710, including vertex processor 1705 and / or fragment processors 1715A-1715N, which may reference vertex or image / texture data stored in memory in addition to vertex or image / texture data stored in one or more caches 1725A-1725B. In at least one embodiment, one or more MMU(s) 1720A-1720B may be synchronized with other MMUs within the system, including one or more MMUs that are synchronized with one or more application processor(s) 1205, image processor(s) 1215, and / or video processor(s) 1220 of Fig. 12, so that each processor 1205-1220 can participate in a shared or unified virtual memory system. In at least one embodiment, one or more circuit interconnects 1730A-1730B enable the graphics processor 1710 to interface with other IP cores within the SoC, either via an internal bus of the SoC or via a direct connection.

[0153] In at least one embodiment, the graphics processor 1740 includes one or more MMU(s) 1720A-1720B, caches 1725A-1725B, and circuit interconnects 1730A-1730B of the graphics processor 1710 of Fig. 17A. In at least one embodiment, graphics processor 1740 includes one or more shader cores 1755A-1755N (e.g., 1755A, 1755B, 1755C, 1755D, 1755E, 1755F through 1755N-1, and 1755N), providing a unified shader core architecture in which a single core or type of core can execute all types of programmable shader code, including shader program code to implement vertex shaders, fragment shaders, and / or compute shaders. In at least one embodiment, the number of shader cores may vary.In at least one embodiment, the graphics processor 1740 includes an inter-core task manager 1745 that acts as a thread dispatcher to dispatch execution threads to one or more shader cores 1755A-1755N, and a tiling unit 1758 to accelerate tiling operations for tile-based rendering, in which rendering operations for a scene are partitioned into image space, for example, to exploit local spatial coherence within a scene or to optimize the use of internal caches.

[0154] In at least one embodiment, at least one in the Fig. 17A-17B for implementing the components described herein and at least in connection with the Fig. 1-7. In at least one embodiment, the graphics processor 1710 causes a compiler to load registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described to assign live areas.

[0155] Fig. 18A illustrates a graphics core 1800 according to at least one embodiment. In at least one embodiment, the graphics core 1800 may be implemented in the graphics processor 1210 of Fig. 12. In at least one embodiment, the graphics core 1800 may be a unified shader core 1755A-1755N as shown in Fig. 17B. In at least one embodiment, the graphics core 1800 includes a shared instruction cache 1802, a texture unit 1818, and a cache / shared memory 1820, which are common execution resources within the graphics core 1800. In at least one embodiment, the graphics core 1800 may include multiple slices 1801A-1801N or partitions for each core, and a graphics processor may include multiple instances of the graphics core 1800. The slices 1801A-1801N may include support logic including a local instruction cache 1804A-1804N, a thread scheduler 1806A-1806N, a thread dispatcher 1808A-1808N, and a set of registers 1810A-1810N.In at least one embodiment, slices 1801A-1801N may include a set of additional functional units ("AFUs") 1812A-1812N, floating-point units ("FPUs") 1814A-1814N, integer arithmetic logic units ("ALUs") 1816-1816N, address calculation units ("ACUs") 1813A-1813N, double-precision floating-point units ("DPFPUs") 1815A-1815N, and matrix processing units ("MPUs") 1817A-1817N. In at least one embodiment, graphics core 1800 is referred to as a compute unit or compute unit.

[0156] In at least one embodiment, the FPUs 1814A-1814N can perform single-precision (32-bit) and half-precision (16-bit) floating-point operations, while the DPFPUs 1815A-1815N can perform double-precision (64-bit) floating-point operations. In at least one embodiment, the ALUs 1817A-1816N can perform 8-bit, 18-bit, and 32-bit variable-precision integer operations and can be configured for mixed-precision operations. In at least one embodiment, the MPUs 1817A-1817N can also be configured for mixed-precision matrix operations, including half-precision integer and 8-bit floating-point operations.In at least one embodiment, the MPUs 1817-1817N may perform a variety of matrix operations to accelerate CUDA programs, including enabling support for accelerated general purpose matrix-matrix multiplication ("GEMM"). In at least one embodiment, the AFUs 1812A-1812N may perform additional logic operations not supported by floating-point or integer units, including trigonometric operations (e.g., sine, cosine, etc.).

[0157] Fig. 18B illustrates a general-purpose graphics processing unit ("GPGPU") 1830 according to at least one embodiment. In at least one embodiment, the GPGPU 1830 is highly parallel and suitable for deployment on a multi-chip module. In at least one embodiment, the GPGPU 1830 may be configured to enable highly parallel computational operations to be performed by an array of GPUs. In at least one embodiment, the GPGPU 1830 may be directly linked to other instances of the GPGPU 1830 to create a multi-GPU cluster to improve execution time of CUDA programs. In at least one embodiment, the GPGPU 1830 includes a host interface 1832 to enable connection to a host processor. In at least one embodiment, the host interface 1832 is a PCIe interface.In at least one embodiment, host interface 1832 may be a vendor-specific communications interface or communications structure. In at least one embodiment, GPGPU 1830 receives instructions from a host processor and uses a global scheduler 1834 to dispatch execution threads associated with those instructions to a set of compute clusters 1836A-1836H. In at least one embodiment, compute clusters 1836A-1836H share a cache 1838. In at least one embodiment, cache 1838 may serve as a higher-level cache for caches within compute clusters 1836A-1836H.

[0158] In at least one embodiment, GPGPU 1830 includes memory 1844A-1844B coupled to compute clusters 1836A-1836H via a set of memory controllers 1842A-1842B. In at least one embodiment, memory 1844A-1844B may include various types of memory devices, including DRAM or graphics random access memory, such as synchronous graphics random access memory ("SGRAM"), including double data rate graphics memory ("GDDR").

[0159] In at least one embodiment, the compute clusters 1836A-1836H each include a set of graphics cores, such as the graphics core 1800 of Fig. 18A, which may include multiple types of integer and floating-point logic units capable of performing computational operations with a range of precisions, including those suitable for computations associated with CUDA programs. For example, in at least one embodiment, at least a subset of floating-point units in each of compute clusters 1836A-1836H may be configured to perform 18-bit or 32-bit floating-point operations, while another subset of floating-point units may be configured to perform 64-bit floating-point operations.

[0160] In at least one embodiment, multiple instances of GPGPU 1830 may be configured to operate as a compute cluster. Compute clusters 1836A-1836H may implement any technically feasible communication technology for synchronization and data exchange. In at least one embodiment, multiple instances of GPGPU 1830 communicate via host interface 1832. In at least one embodiment, GPGPU 1830 includes an I / O hub 1839 that couples GPGPU 1830 to a GPU interconnect 1840 that enables direct connection to other instances of GPGPU 1830. In at least one embodiment, GPU interconnect 1840 is coupled to a dedicated GPU-to-GPU bridge that enables communication and synchronization between multiple instances of GPGPU 1830.In at least one embodiment, GPU interconnect 1840 couples to a high-speed interconnect to transmit and receive data to other GPGPUs or parallel processors. In at least one embodiment, multiple instances of GPGPU 1830 reside in separate computing systems and communicate via a network device accessible via host interface 1832. In at least one embodiment, GPU interconnect 1840 may be configured to enable connection to a host processor in addition to, or as an alternative to, host interface 1832. In at least one embodiment, GPGPU 1830 may be configured to execute a CUDA program.

[0161] In at least one embodiment, at least one in the Fig. 18A-18B is used to describe the components shown or described herein and at least in connection with the Fig. 1-7. In at least one embodiment, the general-purpose graphics processing unit 1830 causes a compiler to load registers based on the estimated performance cost, as described herein at least in connection with the process 100 of Fig. 1 described to assign live areas.

[0162] Fig. 19A illustrates a parallel processor 1900 according to at least one embodiment. In at least one embodiment, various components of the parallel processor 1900 may be implemented using one or more integrated circuit devices, such as programmable processors, application-specific integrated circuits (“ASICs”), or FPGAs.

[0163] In at least one embodiment, parallel processor 1900 includes a parallel processing unit 1902. In at least one embodiment, parallel processing unit 1902 includes an I / O unit 1904 that enables communication with other devices, including other instances of parallel processing unit 1902. In at least one embodiment, I / O unit 1904 may be directly connected to other devices. In at least one embodiment, I / O unit 1904 connects to other devices through the use of a hub or switching interface, such as storage hub 1905. In at least one embodiment, connections between storage hub 1905 and I / O unit 1904 form a communication link.In at least one embodiment, the I / O unit 1904 connects to a host interface 1906 and a storage crossbar 1916, where the host interface 1906 receives commands directed to performing processing operations and the storage crossbar 1916 receives commands directed to performing storage operations.

[0164] In at least one embodiment, when host interface 1906 receives a command buffer via I / O unit 1904, host interface 1906 may direct work operations to a front end 1908 to perform those commands. In at least one embodiment, front end 1908 couples to a scheduler 1910 configured to dispatch commands or other work items to a processing array 1912. In at least one embodiment, scheduler 1910 ensures that processing array 1912 is properly configured and in a valid state before dispatching tasks to processing array 1912. In at least one embodiment, scheduler 1910 is implemented via firmware logic executing on a microcontroller.In at least one embodiment, the microcontroller-implemented scheduler 1910 is configurable to perform complex scheduling and work distribution operations at coarse and fine granularity, enabling rapid preemption and context switching of threads executing on the processing array 1912. In at least one embodiment, the host software may present workloads for scheduling on the processing array 1912 via one of several graphics processing bells. In at least one embodiment, workloads may then be automatically distributed across the processing array 1912 by the logic of the scheduler 1910 within a microcontroller including the scheduler 1910.

[0165] In at least one embodiment, the processing array 1912 may include up to "N" processing clusters (e.g., cluster 1914A, cluster 1914B, through cluster 1914N). In at least one embodiment, each cluster 1914A-1914N of the processing array 1912 may execute a large number of concurrent threads. In at least one embodiment, the scheduler 1910 may assign work to the clusters 1914A-1914N of the processing array 1912 using various scheduling and / or work distribution algorithms, which may vary depending on the workload incurred for each type of program or computation. In at least one embodiment, scheduling may be handled dynamically by the scheduler 1910 or may be partially assisted by compiler logic during compilation of program logic configured for execution by the processing array 1912.In at least one embodiment, different clusters 1914A-1914N of the processing array 1912 may be assigned to process different types of programs or to perform different types of computations.

[0166] In at least one embodiment, processing array 1912 may be configured to perform various types of parallel processing operations. In at least one embodiment, processing array 1912 is configured to perform parallel, multi-purpose computing operations. For example, in at least one embodiment, processing array 1912 may include logic for performing processing tasks, including filtering video and / or audio data, performing modeling operations, including physical operations, and performing data transformations.

[0167] In at least one embodiment, processing array 1912 is configured to perform parallel graphics processing operations. In at least one embodiment, processing array 1912 may include additional logic to support the execution of such graphics processing operations, including, but not limited to, texture sampling logic for performing texture operations, as well as tiling logic and other vertex processing logic. In at least one embodiment, processing array 1912 may be configured to execute graphics processing-related shader programs, such as, but not limited to, vertex shaders, tile shaders, geometry shaders, and pixel shaders. In at least one embodiment, parallel processing unit 1902 may transfer data from system memory via I / O unit 1904 for processing.In at least one embodiment, data transferred during processing may be stored in on-chip memory (e.g., parallel processor memory 1922) during processing and then written back to system memory.

[0168] In at least one embodiment, when the parallel processing unit 1902 is used to perform graphics processing, the scheduler 1910 may be configured to divide a processing workload into approximately equal-sized tasks to better facilitate the distribution of graphics processing operations across multiple clusters 1914A-1914N of the processing array 1912. In at least one embodiment, portions of the processing array 1912 may be configured to perform different types of processing. For example, in at least one embodiment, a first portion may be configured to perform vertex shading and topology generation, a second portion may be configured to perform tiling and geometry shading, and a third portion may be configured to perform pixel shading or other screen-space operations to generate a rendered image for display.In at least one embodiment, intermediate data generated by one or more of clusters 1914A-1914N may be stored in buffers to enable intermediate data to be transferred between clusters 1914A-1914N for further processing.

[0169] In at least one embodiment, processing array 1912 may receive processing tasks to be executed via scheduler 1910, which receives commands defining processing tasks from frontend 1908. In at least one embodiment, processing tasks may include indices of data to be processed, e.g., surface (patch) data, primitive data, vertex data, and / or pixel data, as well as state parameters and commands that define how data should be processed (e.g., which program should be executed). In at least one embodiment, scheduler 1910 may be configured to retrieve indices corresponding to tasks or may receive indices from frontend 1908. In at least one embodiment, frontend 1908 may be configured to ensure that processing array 1912 is configured to a valid state before initiating a workload defined by incoming command buffers (e.g.,stack buffer, push buffer, etc.) is specified.

[0170] In at least one embodiment, each of one or more instances of parallel processing unit 1902 may couple to parallel processor memory 1922. In at least one embodiment, parallel processor memory 1922 may be accessed via memory crossbar 1916, which may receive memory requests from processing array 1912 as well as I / O unit 1904. In at least one embodiment, memory crossbar 1916 may access parallel processor memory 1922 via a memory interface 1918. In at least one embodiment, memory interface 1918 may include a plurality of partition units (e.g., partition unit 1920A, partition unit 1920B through partition unit 1920N), each of which may couple to a portion (e.g., memory unit) of parallel processor memory 1922.In at least one embodiment, a number of partition units 1920A-1920N is configured to equal a number of storage units, such that a first partition unit 1920A has a corresponding first storage unit 1924A, a second partition unit 1920B has a corresponding storage unit 1924B, and an Nth partition unit 1920N has a corresponding Nth storage unit 1924N. In at least one embodiment, a number of partition units 1920A-1920N may not equal a number of storage devices.

[0171] In at least one embodiment, the memory units 1924A-1924N may include various types of memory devices, including DRAM or graphics random access memory, such as SGRAM, including GDDR. In at least one embodiment, the memory units 1924A-1924N may also include stacked 3D memory, including but not limited to high-bandwidth memory ("HBM"). In at least one embodiment, render targets, such as frame buffers or texture maps, may be stored via the memory units 1924A-1924N, allowing the partition units 1920A-1920N to write portions of each render target in parallel to efficiently utilize the available bandwidth of the parallel processor memory 1922.In at least one embodiment, a local instance of parallel processor memory 1922 may be eliminated in favor of a unified memory design that uses system memory in conjunction with local cache memory.

[0172] In at least one embodiment, any of the clusters 1914A-1914N of the processing cluster array 1912 may process data written to any of the storage units 1924A-1924N within the parallel processor memory 1922. In at least one embodiment, the memory crossbar 1916 may be configured to transfer an output of each cluster 1914A-1914N to any of the partition units 1920A-1920N or to another cluster 1914A-1914N that may perform additional processing operations on an output. In at least one embodiment, each cluster 1914A-1914N may communicate with the memory interface 1918 via the memory crossbar 1916 to read from or write to various external storage devices.In at least one embodiment, the memory crossbar 1916 includes a connection to the memory interface 1918 to communicate with the I / O unit 1904, as well as a connection to a local instance of the parallel processor memory 1922, which enables processing units within different clusters 1914A-1914N to communicate with system memory or other memory that is not local to the parallel processing unit 1902. In at least one embodiment, the memory crossbar 1916 may use virtual channels to separate traffic flows between the clusters 1914A-1914N and the partition units 1920A-1920N.

[0173] In at least one embodiment, multiple instances of the parallel processing unit 1902 may be provided on a single add-in card, or multiple add-in cards may be interconnected. In at least one embodiment, different instances of the parallel processing unit 1902 may be configured to interoperate with each other, even if different instances have different numbers of processing cores, different amounts of local parallel processor memory, and / or other configuration differences. In at least one embodiment, the instances of the parallel processing unit 1902 may be configured to interoperate with each other. For example, in at least one embodiment, some instances of the parallel processing unit 1902 may include higher-precision floating-point units compared to other instances.In at least one embodiment, systems including one or more instances of the parallel processing unit 1902 or the parallel processor 1900 may be implemented in a variety of configurations and form factors, including, but not limited to, desktop, laptop, or handheld PCs, servers, workstations, game consoles, and / or embedded systems.

[0174] Fig. 19B illustrates a processing cluster 1994 according to at least one embodiment. In at least one embodiment, processing cluster 1994 is included in a parallel processing unit. In at least one embodiment, processing cluster 1994 is one of the processing clusters 1914A-1914N of Fig. 19. In at least one embodiment, the processing cluster 1994 may be configured to execute many threads in parallel, where the term "thread" refers to an instance of a particular program executing on a particular set of input data. In at least one embodiment, single instruction, multiple data ("SIMD") instruction issue techniques are used to support the parallel execution of a large number of threads without providing multiple independent instruction units. In at least one embodiment, single instruction, multithread ("SIMT") techniques are used to support the parallel execution of a large number of generally synchronized threads using a common instruction unit configured to issue instructions to a set of processing engines within each processing cluster 1994.

[0175] In at least one embodiment, the operation of the processing cluster 1994 may be controlled by a pipeline manager 1932 that distributes processing tasks to SIMT parallel processors. In at least one embodiment, the pipeline manager 1932 receives instructions from the scheduler 1910 of Fig. 19 and manages the execution of these instructions via a graphics multiprocessor 1934 and / or a texture unit 1936. In at least one embodiment, the graphics multiprocessor 1934 is an exemplary instance of a SIMT parallel processor. However, in at least one embodiment, various types of SIMT parallel processors of different architectures may be included in the processing cluster 1994. In at least one embodiment, one or more instances of the graphics multiprocessor 1934 may be included in a processing cluster 1994. In at least one embodiment, the graphics multiprocessor 1934 may process data, and a data crossbar 1940 may be used to distribute processed data to one of several possible destinations, including other shader units.In at least one embodiment, the pipeline manager 1932 may facilitate the distribution of processed data by specifying destinations for processed data to be distributed across the data crossbar 1940.

[0176] In at least one embodiment, each graphics multiprocessor 1934 in the processing cluster 1994 may include an identical set of functional execution logic (e.g., arithmetic logic units, load-store units ("LSUs"), etc.). In at least one embodiment, the functional execution logic may be configured in a pipelined manner, in which new instructions may be issued before previous instructions complete. In at least one embodiment, the functional execution logic supports a variety of operations, including integer and floating-point arithmetic, comparison operations, Boolean operations, bit shifting, and the calculation of various algebraic functions. In at least one embodiment, the same functional unit hardware may be used to perform different operations, and any combination of functional units may be present.

[0177] In at least one embodiment, instructions transferred to processing cluster 1994 constitute a thread. In at least one embodiment, a set of threads executing across a set of parallel processing engines is a thread group. In at least one embodiment, the thread group executes a program on different input data. In at least one embodiment, each thread within a thread group may be assigned to a different processing engine within a graphics multiprocessor 1934. In at least one embodiment, a thread group may include fewer threads than a number of processing engines within the graphics multiprocessor 1934.In at least one embodiment, if a thread group contains fewer threads than a number of processing engines, one or more of the processing engines may be idle during cycles in which that thread group is currently processing. In at least one embodiment, a thread group may also contain more threads than a number of processing engines within the graphics multiprocessor 1934. In at least one embodiment, if a thread group contains more threads than the number of processing engines within the graphics multiprocessor 1934, processing may be performed over consecutive clock cycles. In at least one embodiment, multiple thread groups may execute concurrently on a graphics multiprocessor 1934.

[0178] In at least one embodiment, the graphics multiprocessor 1934 includes an internal cache to perform load and store operations. In at least one embodiment, the graphics multiprocessor 1934 may forgo an internal cache and utilize a cache (e.g., the L1 cache 1948) within the processing cluster 1994. In at least one embodiment, each graphics multiprocessor 1934 also has access to Level 2 ("L2") caches within partition units (e.g., partition units 1920A-1920N of Fig. 19A) that are shared by all processing clusters 1994 and can be used to transfer data between threads. In at least one embodiment, graphics multiprocessor 1934 can also access off-chip global memory, which can include one or more of local parallel processor memory and / or system memory. In at least one embodiment, any memory external to parallel processing unit 1902 can be used as global memory. In at least one embodiment, processing cluster 1994 includes multiple instances of graphics multiprocessor 1934 that can share common instructions and data, which can be stored in L1 cache 1948.

[0179] In at least one embodiment, each processing cluster 1994 may include an MMU 1945 configured to map virtual addresses to physical addresses. In at least one embodiment, one or more instances of the MMU 1945 may reside within the memory interface 1918 of Fig. 19. In at least one embodiment, the MMU 1945 includes a set of page table entries ("PTEs") used to map a virtual address to a physical address of a tile and optionally a cache line index. In at least one embodiment, the MMU 1945 may include address translation buffers ("TLBs") or caches that may be located within the graphics multiprocessor 1934 or the L1 cache 1948 or the processing cluster 1994. In at least one embodiment, a physical address is processed to distribute surface data access locality to enable efficient request interleaving between partition units. In at least one embodiment, a cache line index may be used to determine whether a request for a cache line is a hit or miss.

[0180] In at least one embodiment, processing cluster 1994 may be configured such that each graphics multiprocessor 1934 is coupled to a texture unit 1936 for performing texture mapping operations, such as determining texture sample positions, reading texture data, and filtering texture data. In at least one embodiment, texture data is read from an internal texture L1 cache (not shown) or from an L1 cache within graphics multiprocessor 1934 and retrieved from an L2 cache, local parallel processor memory, or system memory as needed.In at least one embodiment, each graphics multiprocessor 1934 outputs a processed task to the data crossbar 1940 to provide the processed task to another processing cluster 1994 for further processing or to store the processed task in an L2 cache, local parallel processor memory, or system memory via the memory crossbar 1916. In at least one embodiment, a pre-raster operation unit ("preROP") 1942 is configured to receive data from the graphics multiprocessor 1934, pass data to the ROP units, which may be located with partition units as described herein (e.g., partition units 1920A-1920N of FIG. Fig. 19). In at least one embodiment, Pre-ROP 1942 may perform optimizations for color mixing, organize pixel color data, and perform address translations.

[0181] Fig. 19C illustrates a graphics multiprocessor 1996 according to at least one embodiment. In at least one embodiment, graphics multiprocessor 1996 is graphics multiprocessor 1934 of the Fig. 19B. In at least one embodiment, graphics multiprocessor 1996 is coupled to pipeline manager 1932 of processing cluster 1994. In at least one embodiment, graphics multiprocessor 1996 has an execution pipeline that includes, but is not limited to, an instruction cache 1952, an instruction unit 1954, an address mapping unit 1956, a register file 1958, one or more GPGPU cores 1962, and one or more LSUs 1966. GPGPU cores 1962 and LSUs 1966 are coupled to cache memory 1972 and shared memory 1970 via a memory and cache interconnect 1968.

[0182] In at least one embodiment, instruction cache 1952 receives a stream of instructions to be executed from pipeline manager 1932. In at least one embodiment, instructions are cached in instruction cache 1952 and dispatched for execution by instruction unit 1954. In at least one embodiment, instruction unit 1954 may dispatch instructions as thread groups (e.g., warps), where each thread of the thread group is assigned to a different execution unit within GPGPU core 1962. In at least one embodiment, an instruction may access any of a local, shared, or global address space by specifying an address within a unified address space.In at least one embodiment, the address mapping unit 1956 may be used to translate addresses in a unified address space into a unique memory address accessible by the LSUs 1966.

[0183] In at least one embodiment, register file 1958 provides a set of registers for functional units of graphics multiprocessor 1996. In at least one embodiment, register file 1958 provides temporary storage for operands associated with data paths of functional units (e.g., GPGPU cores 1962, LSUs 1966) of graphics multiprocessor 1996. In at least one embodiment, register file 1958 is partitioned between each of the functional units such that each functional unit is assigned a dedicated portion of register file 1958. In at least one embodiment, register file 1958 is partitioned between different thread groups executed by graphics multiprocessor 1996.

[0184] In at least one embodiment, the GPGPU cores 1962 may each include FPUs and / or ALUs used to execute instructions of the graphics multiprocessor 1996. The GPGPU cores 1962 may be similar in architecture or different in architecture. In at least one embodiment, a first portion of the GPGPU cores 1962 includes a single-precision FPU and an integer ALU, while a second portion of the GPGPU cores 1962 includes a double-precision FPU. In at least one embodiment, the FPUs may implement the IEEE 754-2008 standard for floating-point arithmetic or enable variable-precision floating-point arithmetic. In at least one embodiment, the graphics multiprocessor 1996 may additionally include one or more fixed-function or special-function units to perform specific functions, such as copy rectangle or pixel-shuffling operations.In at least one embodiment, one or more of the GPGPU cores 1962 may also include fixed or special function logic.

[0185] In at least one embodiment, GPGPU cores 1962 include SIMD logic capable of performing a single instruction on multiple data sets. In at least one embodiment, GPGPU cores 1962 may physically execute SIMD4, SIMD8, and SIMD16 instructions and logically execute SIMD1, SIMD2, and SIMD32 instructions. In at least one embodiment, SIMD instructions for GPGPU cores 1962 may be generated at compile time by a shader compiler or automatically generated when executing programs written and compiled for Single Program Multiple Data ("SPMD") or SIMT architectures. In at least one embodiment, multiple threads of a program configured for a SIMT execution model may execute from a single SIMD instruction.For example, in at least one embodiment, eight SIMT threads performing the same or similar operations may be executed in parallel via a single SIMD8 logic unit.

[0186] In at least one embodiment, the memory and cache interconnect 1968 is an interconnect network that connects each functional unit of the graphics multiprocessor 1996 to the register file 1958 and the shared memory 1970. In at least one embodiment, the memory and cache interconnect 1968 is a crossbar interconnect that enables the LSU 1966 to implement load and store operations between the shared memory 1970 and the register file 1958. In at least one embodiment, the register file 1958 may operate at a same frequency as the GPGPU cores 1962, such that data transfer between the GPGPU cores 1962 and the register file 1958 has very low latency.In at least one embodiment, shared memory 1970 may be used to enable communication between threads executing on functional units within graphics multiprocessor 1996. In at least one embodiment, cache 1972 may be used, for example, as a data cache to cache texture data communicated between functional units and texture unit 1936. In at least one embodiment, shared memory 1970 may also be used as a cached managed program. In at least one embodiment, threads executing on GPGPU cores 1962 may programmatically store data within shared memory in addition to automatically cached data stored within cache 1972.

[0187] In at least one embodiment, a parallel processor or GPGPU, as described herein, is communicatively coupled to host processor cores to accelerate graphics operations, machine learning operations, pattern analysis operations, and various general-purpose GPU (GPGPU) functions. In at least one embodiment, a GPU may be communicatively coupled to host processor cores via a bus or other interconnect (e.g., a high-speed interconnect such as PCIe or NVLink). In at least one embodiment, a GPU may be integrated on the same package or die as the cores and communicatively coupled to cores via an internal processor bus / interconnect located within the package or die.In at least one embodiment, regardless of how the GPU is connected, the processor cores can assign work to the GPU in the form of sequences of commands / instructions contained in a WD. In at least one embodiment, the GPU then uses dedicated circuitry / logic to efficiently process these commands / instructions.

[0188] In at least one embodiment, at least one in the Fig. 19A-19C is used to describe the components shown or described herein and at least in connection with the Fig. 1-7. In at least one embodiment, the parallel processor 1900 causes a compiler to allocate registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described, to assign live areas.

[0189] Fig. Figure 20 illustrates a graphics processor 2000 according to at least one embodiment. In at least one embodiment, the graphics processor 2000 includes a ring interconnect 2002, a pipeline front end 2004, a media engine 2037, and graphics cores 2080A-2080N. In at least one embodiment, the ring interconnect 2002 couples the graphics processor 2000 to other processing units, including other graphics processors or one or more general-purpose processor cores. In at least one embodiment, the graphics processor 2000 is one of many processors integrated within a multi-core processing system.

[0190] In at least one embodiment, graphics processor 2000 receives batches of commands via ring interconnect 2002. In at least one embodiment, incoming commands are interpreted by a command streamer 2003 in pipeline front end 2004. In at least one embodiment, graphics processor 2000 includes scalable execution logic for performing 3D geometry processing and media processing via graphics core(s) 2080A-2080N. In at least one embodiment, command streamer 2003 provides commands to geometry pipeline 2036 for 3D geometry processing commands. In at least one embodiment, command streamer 2003 provides commands to a video front end 2034 that couples to a media engine 2037 for at least some media processing commands.In at least one embodiment, media engine 2037 includes a Video Quality Engine ("VQE") 2030 for video and image post-processing and a Multi-Format Encoder / Decoder ("MFX") engine 2033 for providing hardware-accelerated media data encoding and decoding. In at least one embodiment, geometry pipeline 2036 and media engine 2037 each generate execution threads for threaded execution resources provided by at least one graphics core 2080A.

[0191] In at least one embodiment, graphics processor 2000 includes scalable threaded execution resources with modular graphics cores 2080A-2080N (sometimes referred to as core slices), each having a plurality of sub-cores 2050A-2080N, 2060A-2060N (sometimes referred to as core sub-slices). In at least one embodiment, graphics processor 2000 may include any number of graphics cores 2080A-2080N. In at least one embodiment, graphics processor 2000 includes a graphics core 2080A having at least a first sub-core 2050A and a second sub-core 2060A. In at least one embodiment, graphics processor 2000 is a low-power processor with a single sub-core (e.g., 2050A). In at least one embodiment, the graphics processor 2000 includes a plurality of graphics cores 2080A-2080N, each including a set of first sub-cores 2050A-2050N and a set of second sub-cores 2060A-2060N.In at least one embodiment, each subcore in the first subcores 2050A-2050N includes at least a first set of execution units ("EUs") 2052A-2052N and media / texture samplers 2054A-2054N. In at least one embodiment, each subcore in the second subcores 2060A-2060N includes at least a second set of execution units 2062A-2062N and samplers 2064A-2064N. In at least one embodiment, each subcore 2050A-2050N, 2060A-2060N utilizes a set of shared resources 2070A-2070N. In at least one embodiment, the shared resources 2070 include a shared cache and pixel operation logic.

[0192] In at least one embodiment, at least one in Fig. 20 is used to describe or describe the component used herein and at least in connection with Fig. 1-7. In at least one embodiment, the graphics processor 20 causes a compiler to calculate registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described to assign live areas.

[0193] Fig. 21 illustrates a processor 2100 according to at least one embodiment. In at least one embodiment, the processor 2100 may include, but is not limited to, logic circuitry to execute instructions. In at least one embodiment, the processor 2100 may execute instructions, including x86 instructions, ARM instructions, specialized instructions for ASICs, etc. In at least one embodiment, the processor 2110 may include registers to store packed data, such as 64-bit wide MMX™ registers in microprocessors enabled with MMX technology from Intel Corporation of Santa Clara, California. In at least one embodiment, MMX registers, which are available in both integer and floating-point forms, may operate on packed data elements accompanying "SIMD" and Streaming SIMD Extensions ("SSE") instructions.In at least one embodiment, 128-bit wide XMM registers related to SSE2, SSE3, SSE4, AVX, or beyond (commonly referred to as "SSEx") technology may hold such operands with packed data. In at least one embodiment, processors 2110 may execute instructions to accelerate CUDA programs.

[0194] In at least one embodiment, processor 2100 includes an in-order frontend ("frontend") 2101 to fetch instructions to be executed and prepare instructions to be used later in the processor pipeline. In at least one embodiment, frontend 2101 may include multiple units. In at least one embodiment, an instruction prefetcher 2126 fetches instructions from memory and supplies instructions to an instruction decoder 2128, which in turn decodes or interprets instructions. In at least one embodiment, instruction decoder 2128, for example, decodes a received instruction into one or more operations, referred to as "micro-instructions" or "micro-operations" (also referred to as "micro-ops" or "uops"), for execution.In at least one embodiment, instruction decoder 2128 parses instructions into an opcode and corresponding data and control fields that can be used by the microarchitecture to perform operations. In at least one embodiment, a trace cache 2130 may assemble decoded uops into program-ordered sequences or traces in a uop queue 2134 for execution. In at least one embodiment, when trace cache 2130 encounters a complex instruction, a microcode ROM 2132 provides uops needed to complete an operation.

[0195] In at least one embodiment, some instructions may be converted into a single micro-op, while others may require multiple micro-ops to complete the entire operation. In at least one embodiment, if more than four micro-ops are required to complete an instruction, instruction decoder 2128 may access microcode ROM 2132 to execute the instruction. In at least one embodiment, an instruction may be decoded into a small number of micro-ops for processing at instruction decoder 2128. In at least one embodiment, an instruction may be stored within microcode ROM 2132 if a number of micro-ops are required to complete the operation.In at least one embodiment, trace cache 2130 refers to a programmable logic array ("PLA") with an entry point to determine a correct microinstruction pointer for reading microcode sequences to complete one or more instructions from microcode ROM 2132. In at least one embodiment, machine front-end 2101 may continue fetching micro-ops from trace cache 2130 after microcode ROM 2132 completes sequencing micro-ops for an instruction.

[0196] In at least one embodiment, the out-of-order execution engine ("out-of-order engine") 2103 may prepare instructions for execution. In at least one embodiment, the out-of-order execution logic includes a series of buffers to smooth and reorder the flow of instructions to optimize performance as they traverse a pipeline and are scheduled for execution. The out-of-order execution engine 2103 includes, without limitation, an allocator / register renamer 2140, a memory uop queue 2142, an integer / floating-point uop queue 2144, a memory scheduler 2146, a fast scheduler 2102, a slow / general floating-point scheduler ("slow / general FP scheduler") 2104, and a simple floating-point scheduler ("simple FP scheduler") 2106.In at least one embodiment, the fast scheduler 2102, the slow / general floating-point scheduler 2104, and the simple floating-point scheduler 2106 are also collectively referred to herein as the "uop scheduler 2102, 2104, 2106." The allocator / register renamer 2140 allocates machine buffers and resources required by each uop to execute. In at least one embodiment, the allocator / register renamer 2140 renames logic registers into entries in a register file. In at least one embodiment, the allocator / register renamer 2140 also allocates an entry for each uop in one of two uop queues, the memory uop queue 2142 for memory operations and the integer / floating point uop queue 2144 for non-memory operations, prior to the memory scheduler 2146 and the uop schedulers 2102, 2104, 2106.In at least one embodiment, the uop schedulers 2102, 2104, 2106 determine when a uop is ready for execution based on the readiness of its dependent input register operand sources and the availability of execution resources required by the uop to complete its operation. In at least one embodiment, the fast scheduler 2102 of at least one embodiment may schedule on each half of the main clock cycle, while the slow / general floating-point scheduler 2104 and the simple floating-point scheduler 2106 may schedule once per main processor clock cycle. In at least one embodiment, the uop schedulers 2102, 2104, 2106 arbitrate for dispatch ports to schedule uops for execution.

[0197] In at least one embodiment, execution block 2111 includes, without limitation, an integer register file / bypass network 2108, a floating-point register file / bypass network ("FP register file / bypass network") 2110, address generation units ("AGUs") 2112 and 2114, fast ALUs 2116 and 2118, a slow ALU 2120, a floating-point ALU ("FP") 2122, and a floating-point move unit ("FP move") 2124. In at least one embodiment, the AGUs 2112 and 2114, the fast ALUs 2116 and 2118, the slow ALU 2120, the floating-point ALU 2122, and the floating-point move unit 2124 are also referred to herein as "execution units 2112, 2114, 2116, 2118, 2120, 2122, and 2124." In at least one embodiment, an execution block may include, without limitation, any number (including zero) and type of register files, bypass networks, address generation units, and execution units in any combination

[0198] In at least one embodiment, register files 2108, 2110 may be located between uop schedulers 2102, 2104, 2106 and execution units 2112, 2114, 2116, 2118, 2120, 2122, and 2124. In at least one embodiment, integer register file / bypass network 2108 performs integer operations. In at least one embodiment, floating-point register file / bypass network 2110 performs floating-point operations. In at least one embodiment, each of register files 2108, 2110 may include, without limitation, a bypass network that may bypass just-completed results that have not yet been written to the register file or forward them to new dependent uops. In at least one embodiment, register files 2108, 2110 may communicate data with each other.In at least one embodiment, the integer register file / bypass network 2108 may include, without limitation, two separate register files: one register file for 32 bits of low-order data and a second register file for 32 bits of high-order data. In at least one embodiment, the floating-point register file / bypass network 2110 may include, without limitation, 128-bit wide entries, since floating-point instructions typically have operands 64 to 128 bits wide.

[0199] In at least one embodiment, execution units 2112, 2114, 2116, 2118, 2120, 2122, 2124 may execute instructions. In at least one embodiment, register files 2108, 2110 store integer and floating-point data operand values ​​that microinstructions must execute. In at least one embodiment, processor 2100 may include, among other things, any number and combination of execution units 2112, 2114, 2116, 2118, 2120, 2122, 2124. In at least one embodiment, floating-point ALU 2122 and floating-point move unit 2124 may perform floating-point, MMX, SIMD, AVX, and SSE, or other operations. In at least one embodiment, floating-point ALU 2122 may include, among other things, a 64-bit by 64-bit floating-point divider to perform divide, square root, and remainder micro-ops. In at least one embodiment, instructions involving a floating-point value may be handled with floating-point hardware.In at least one embodiment, ALU operations may be passed to fast ALUs 2116, 2118. In at least one embodiment, the fast ALUs 2116, 2118 may perform fast operations with an effective latency of half a clock cycle. In at least one embodiment, most complex integer operations go to the slow ALU 2120, because the slow ALU 2120 may include, among other things, integer execution hardware for long-latency operations, such as a multiplier, shifts, flag logic, and branch processing. In at least one embodiment, memory load / store operations may be performed by the ALUs 2112, 2114. In at least one embodiment, the fast ALU 2116, the fast ALU 2118, and the slow ALU 2120 may perform integer operations on 64-bit data operands.In at least one embodiment, the fast ALU 2116, the fast ALU 2118, and the slow ALU 2120 may be implemented to support a variety of data bit sizes, including sixteen, thirty-two, 128, 256, etc. In at least one embodiment, the floating-point ALU 2122 and the floating-point movement unit 2124 may be implemented to support a range of operands with bits of different widths. In at least one embodiment, the floating-point ALU 2122 and the floating-point movement unit 2124 may operate on 128-bit wide operands with packed data in conjunction with SIMD and multimedia instructions.

[0200] In at least one embodiment, the uop schedulers 2102, 2104, 2106 dispatch dependent operations before the parent load has completed execution. In at least one embodiment, because uops may be speculatively scheduled and executed in the processor 2100, the processor 2100 may also include logic to handle memory misses. In at least one embodiment, when a data load fails in the data cache, there may be dependent operations in flight in the pipeline that have exited the scheduler with temporarily incorrect data. In at least one embodiment, a replay mechanism tracks instructions that use incorrect data and reexecutes them. In at least one embodiment, dependent operations may need to be replayed and independent operations may complete.In at least one embodiment, schedulers and replay mechanisms of at least one embodiment of a processor may also be designed to trap instruction sequences for text string comparison operations.

[0201] In at least one embodiment, the term "register" may refer to on-board processor memory locations that may be used as part of instructions to identify operands. In at least one embodiment, registers may be those that may be usable from outside the processor (from a programmer's perspective). In at least one embodiment, registers may not be limited to a particular type of circuit. Rather, in at least one embodiment, a register may store data, provide data, and perform functions described herein.In at least one embodiment, registers described herein may be implemented by circuitry within a processor using any number of different techniques, such as dedicated physical registers, dynamically allocated physical registers using register renaming, combinations of dedicated and dynamically allocated physical registers, etc. In at least one embodiment, integer registers store 32-bit integer data. A register file of at least one embodiment also includes eight multimedia SIMD registers for packed data.

[0202] Fig. 22 illustrates a processor 2200 according to at least one embodiment. In at least one embodiment, the processor 2200 includes, without limitation, one or more processor cores ("cores") 2202A-2202N, an integrated memory controller 2214, and an integrated graphics processor 2208. In at least one embodiment, the processor 2200 may include additional cores up to and including the additional core 2202N, represented by dashed-line boxes. In at least one embodiment, each of the processor cores 2202A-2202N includes one or more internal cache units 2204A-2204N. In at least one embodiment, each processor core also has access to one or more shared cache units 2206. In at least one embodiment, the one or more processor cores 2202A-2202N are referred to as one or more compute units or calculation units.

[0203] In at least one embodiment, the internal cache units 2204A-2204N and the shared cache units 2206 represent a cache hierarchy within the processor 2200. In at least one embodiment, the cache units 2204A-2204N may include at least one level of instruction and data cache within each processor core and one or more levels of shared middle-level cache, such as an L2, L3, Level 4 ("L4"), or other cache levels, with a highest cache level prior to external memory classified as an LLC. In at least one embodiment, the cache coherence logic maintains coherence between different cache units 2206 and 2204A-2204N.

[0204] In at least one embodiment, the processor 2200 may also include a set of one or more bus control units 2216 and a system agent core 2210. In at least one embodiment, one or more bus control units 2216 manage a set of peripheral buses, such as one or more PCI or PCI Express buses. In at least one embodiment, the system agent core 2210 provides management functionality for various processor components. In at least one embodiment, the system agent core 2210 includes one or more integrated memory controllers 2214 to manage access to various external storage devices (not shown).

[0205] In at least one embodiment, one or more of the processor cores 2202A-2202N include support for concurrent multi-threading. In at least one embodiment, the system agent core 2210 includes components for coordinating and operating the cores 2202A-2202N during multi-threaded processing. In at least one embodiment, the system agent core 2210 may additionally include a power control unit ("PCU") that includes logic and components for regulating one or more power states of the processor cores 2202A-2202N and the graphics processor 2208.

[0206] In at least one embodiment, processor 2200 additionally includes graphics processor 2208 to perform graphics processing operations. In at least one embodiment, graphics processor 2208 couples to shared cache units 2206 and system agent core 2210, including one or more integrated memory controllers 2214. In at least one embodiment, system agent core 2210 also includes a display controller 2211 to drive the graphics processor output to one or more coupled displays. In at least one embodiment, display controller 2211 may also be a separate module coupled to graphics processor 2208 via at least one connection, or may be integrated into graphics processor 2208.

[0207] In at least one embodiment, a ring-based interconnect 2212 is used to couple internal components of processor 2200. In at least one embodiment, an alternative interconnect may be used, such as a point-to-point connection, a switched connection, or other techniques. In at least one embodiment, graphics processor 2208 couples to ring interconnect 2212 via an I / O connection 2213.

[0208] In at least one embodiment, I / O interconnect 2213 represents at least one of several varieties of I / O interconnects, including an on-package I / O interconnect that facilitates communication between various processor components and an embedded high-performance memory module 2218, such as an eDRAM module. In at least one embodiment, each of the processor cores 2202A-2202N and the graphics processor 2208 utilize the embedded memory modules 2218 as a shared LLC.

[0209] In at least one embodiment, processor cores 2202A-2202N are homogeneous cores executing a common instruction set architecture. In at least one embodiment, processor cores 2202A-2202N are heterogeneous with respect to ISA, where one or more of processor cores 2202A-2202N execute a common instruction set, while one or more other cores of processor cores 2202A-2202N execute a subset of a common instruction set or a different instruction set. In at least one embodiment, processor cores 2202A-2202N are heterogeneous with respect to microarchitecture, where one or more relatively higher power cores couple with one or more lower power cores. In at least one embodiment, processor 2200 may be implemented on one or more chips or as an integrated circuit (SoC).

[0210] In at least one embodiment, at least one in Fig. 15 @ component shown or described herein and at least in connection with Fig. 1-7. In at least one embodiment, the processor 2200 causes a compiler to optimize registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described, to assign live areas.

[0211] Fig. 23 illustrates a graphics processor core 2300 according to at least one described embodiment. In at least one embodiment, the graphics processor core 2300 is included in a graphics core array. In at least one embodiment, the graphics processor core 2300, sometimes referred to as a core slice, may be one or more graphics cores within a modular graphics processor. In at least one embodiment, the graphics processor core 2300 is exemplary of a graphics core slice, and a graphics processor as described herein may include multiple graphics core slices based on target power and performance envelopes. In at least one embodiment, each graphics core 2300 may include a fixed functional block 2330 coupled to a plurality of sub-cores 2301A-2301F, also referred to as sub-slices, that include modular blocks of general-purpose and fixed-function logic.

[0212] In at least one embodiment, fixed function block 2330 includes a geometry / fixed function pipeline 2336 that may be shared by all sub-cores in graphics processor 2300, for example, in lower performance and / or lower power graphics processor implementations. In at least one embodiment, geometry / fixed function pipeline 2336 includes a 3D fixed function pipeline, a video front-end unit, a thread provider and thread dispatcher, and a unified return buffer manager that manages unified return buffers.

[0213] In at least one embodiment, fixed functional block 2330 also includes a graphics SoC interface 2337, a graphics microcontroller 2338, and a media pipeline 2339. Graphics SoC interface 2337 provides an interface between graphics core 2300 and other processor cores within a system-on-chip integrated circuit. In at least one embodiment, graphics microcontroller 2338 is a programmable subprocessor configurable to manage various functions of graphics processor 2300, including thread dispatch, scheduling, and preemption. In at least one embodiment, media pipeline 2339 includes logic for facilitating decoding, encoding, preprocessing, and / or postprocessing of multimedia data, including image and video data.In at least one embodiment, the media pipeline 2339 implements media operations via requests to compute or sensing logic within the subcores 2301-2301F.

[0214] In at least one embodiment, the SoC interface 2337 enables the graphics core 2300 to communicate with general-purpose application processor cores (e.g., CPUs) and / or other components within an SoC, including memory hierarchy elements such as shared LLC memory, system RAM, and / or embedded on-chip or on-package DRAM. In at least one embodiment, the SoC interface 2337 may also enable communication with fixed functional devices within an SoC, such as camera imaging pipelines, and enables the use of and / or implements global memory atoms that may be shared between the graphics core 2300 and CPUs within an SoC. In at least one embodiment, the SoC interface 2337 may also implement power management controls for the graphics core 2300 and enable an interface between a clock domain of the graphics core 2300 and other clock domains within an SoC.In at least one embodiment, SoC interface 2337 enables receipt of command buffers from a command streamer and a global thread dispatcher configured to provide commands and instructions to each of one or more graphics cores within a graphics processor. In at least one embodiment, commands and instructions may be sent to media pipeline 2339 when media operations are to be performed, or to a geometry and fixed function pipeline (e.g., geometry and fixed function pipeline 2336, geometry and fixed function pipeline 2314) when graphics processing operations are to be performed.

[0215] In at least one embodiment, graphics microcontroller 2338 may be configured to perform various scheduling and management tasks for graphics core 2300. In at least one embodiment, graphics microcontroller 2338 may perform graphics and / or compute workload scheduling on various graphics parallel engines within execution unit (EU) arrays 2302A-2302F, 2304A-2304F within subcores 2301A-2301F. In at least one embodiment, host software executing on a CPU core of an SoC including graphics core 2300 may submit workloads to one of several graphics processor ring blades, which invoke a scheduling operation on an appropriate graphics engine.In at least one embodiment, scheduling operations include determining which workload to execute next, submitting a workload to an instruction streamer, bypassing existing workloads running on an engine, monitoring the progress of a workload, and notifying host software when a workload completes. In at least one embodiment, graphics microcontroller 2338 may also enable low-power or idle states for graphics core 2300, thereby providing graphics core 2300 with the ability to save and restore registers within graphics core 2300 across low-power state transitions independent of an operating system and / or graphics driver software on a system.

[0216] In at least one embodiment, the graphics core 2300 may include more or fewer than illustrated sub-cores 2301A-2301F, up to N modular sub-cores. For each set of N sub-cores, the graphics core 2300 may also include, in at least one embodiment, common functional logic 2310, a shared and / or cache memory 2312, a geometry / fixed function pipeline 2314, and additional fixed function logic 2316 to accelerate various graphics and compute processing operations. In at least one embodiment, the common functional logic 2310 may include logic units (e.g., sampler, math, and / or inter-thread communication logic) that may be shared by each of the N sub-cores within the graphics core 2300. The shared and / or cache memory 2312 may be an LLC for N sub-cores 2301A-2301F within the graphics core 2300 and may also serve as shared memory accessible by multiple sub-cores.In at least one embodiment, the geometry / fixed function pipeline 2314 may be included within the fixed function block 2330 instead of the geometry / fixed function pipeline 2336 and may include the same or similar logic units.

[0217] In at least one embodiment, the graphics core 2300 includes additional fixed function logic 2316, which may include various fixed function acceleration logic for use by the graphics core 2300. In at least one embodiment, the additional fixed function logic 2316 includes an additional geometry pipeline for use with position-only shading. With position-only shading, at least two geometry pipelines exist, a full geometry pipeline within the geometry / fixed function pipeline 2316, 2336, and a cull pipeline, which is an additional geometry pipeline that may be included within the additional fixed function logic 2316. In at least one embodiment, the cull pipeline is a truncated version of a full geometry pipeline. In at least one embodiment, a full pipeline and a cull pipeline may execute different instances of an application, each instance having a separate context.In at least one embodiment, position-only shading may hide long cull runs of discarded triangles, allowing shading to complete sooner in some instances. For example, in at least one embodiment, the cull pipeline logic within the additional fixed function logic 2316 may run position shaders in parallel with a main application and generally produces critical results faster than a full pipeline because the cull pipeline retrieves and shades position attributes of vertices without performing rasterization and rendering pixels to a frame buffer. In at least one embodiment, a cull pipeline may use produced critical results to compute visibility information for all triangles, without considering whether those triangles are culled.In at least one embodiment, a full pipeline (which in this instance may be referred to as a rendering pipeline) may consume visibility information to skip rejected triangles in order to shade only visible triangles, which are eventually passed to a rasterization stage.

[0218] In at least one embodiment, the additional fixed function logic 2316 may also include general processing acceleration logic, such as fixed function logic for matrix multiplication, for accelerating CUDA programs.

[0219] In at least one embodiment, within each graphics sub-core 2301A-2301F includes a set of execution resources that can be used to perform graphics, media, and compute operations in response to requests from graphics pipeline, media pipeline, or shader programs. In at least one embodiment, the graphics sub-cores 2301A-2301F include a plurality of EU arrays 2302A-2302F, 2304A-2304F, thread dispatch and inter-thread communication ("TD / IC") logic 2303A-2303F, a 3D (e.g., texture) sampler 2305A-2305F, a media sampler 2306A-2306F, a shader processor 2307A-2307F, and a shared local memory ("SLM") 2308A-2308F.The EU arrays 2302A-2302F, 2304A-2304F each include a plurality of execution units, which are GPGPUs capable of performing floating-point and integer / fixed-point logic operations in service of a graphics, media, or compute operation, including graphics, media, or compute shader programs. In at least one embodiment, the TD / IC logic 2303A-2303F performs local thread dispatch and thread control operations for execution units within a subcore and facilitates communication between threads executing on execution units of a subcore. In at least one embodiment, the 3D sampler 2305A-2305F may read texture or other 3D graphics-related data into memory. In at least one embodiment, the 3D sampler may read texture data differently based on a configured sample state and texture format associated with a particular texture.In at least one embodiment, the media sampler 2306A-2306F may perform similar read operations based on a type and format associated with media data. In at least one embodiment, each graphics subcore 2301A-2301F may alternately include a unified 3D and media sampler. In at least one embodiment, threads executing on execution units within each of the subcores 2301A-2301F may use shared local memory 2308A-2308F within each subcore to enable threads executing within a thread group to execute using a common pool of on-chip memory.

[0220] In at least one embodiment, at least one in Fig. 23 is used to describe or describe the component used herein and at least in connection with Fig. 1-7. In at least one embodiment, the graphics core 2300 causes a compiler to allocate registers based on the estimated performance cost, as described herein at least in connection with the process 100 of Fig. 1 described to assign live areas.

[0221] Fig. 24 illustrates a parallel processing unit ("PPU") 2400 according to at least one embodiment. In at least one embodiment, the PPU 2400 is configured with machine-readable code that, when executed by the PPU 2400, causes the PPU 2400 to perform some or all of the processes and techniques described herein. In at least one embodiment, the PPU 2400 is a multi-threaded processor implemented on one or more integrated circuit devices and that uses multi-threading as a latency hiding technique designed to process computer-readable instructions (also referred to as machine-readable instructions or simply instructions) on multiple threads in parallel. In at least one embodiment, a thread refers to a thread of execution and is an instantiation of a set of instructions configured to be executed by the PPU 2400.In at least one embodiment, PPU 2400 is a 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 an LCD device. In at least one embodiment, PPU 2400 is used to perform computations, such as linear algebra operations and machine learning operations. Fig. 24 depicts an example parallel processor for illustrative purposes only and should be construed as a non-limiting example of processor architectures that may be implemented in at least one embodiment.

[0222] In at least one embodiment, one or more PPUs 2400 are configured to accelerate high performance computing ("HPC"), data center, and machine learning applications. In at least one embodiment, one or more PPUs 2400 are configured to accelerate CUDA programs. In at least one embodiment, the PPU 2400 includes, without limitation, an I / O unit 2406, a front-end unit 2410, a scheduler unit 2412, a work distribution unit 2414, a hub 2416, a crossbar (“Xbar”) 2420, one or more general processing clusters (“GPCs”) 2418, and one or more partition units (“memory partition units”) 2422. In at least one embodiment, the PPU 2400 is connected to a host processor or other PPUs 2400 via one or more high-speed GPU interconnects (“GPU interconnects”) 2408.In at least one embodiment, the PPU 2400 is connected to a host processor or other peripherals via an interconnect 2402. In at least one embodiment, the PPU 2400 is connected to local memory, including one or more memory devices ("memory") 2404. In at least one embodiment, the memory devices 2404 include, among other things, one or more dynamic random access memory ("DRAM") devices. In at least one embodiment, one or more DRAM devices are configured and / or configurable as high-bandwidth memory ("HBM") systems, with multiple DRAM dies stacked within each device.

[0223] In at least one embodiment, the high-speed GPU interconnect 2408 may refer to a wired, multi-lane communication connection used by systems to scale and include one or more PPUs 2400 combined with one or more CPUs, which supports cache coherence between PPUs 2400 and CPUs and CPU mastering. In at least one embodiment, data and / or instructions are transferred through the high-speed GPU interconnect 2408 via the hub 2416 to / from other units of the PPU 2400, such as one or more copy engines, video encoders, video decoders, power management units, and other components included in Fig. 24 may not be explicitly illustrated.

[0224] In at least one embodiment, the I / O unit 2406 is configured to receive communications (e.g., commands, data) from a host processor (in Fig. 24) over the system bus 2402. In at least one embodiment, the I / O unit 2406 communicates with the host processor directly over the system bus 2402 or through one or more intermediate devices, such as a memory bridge. In at least one embodiment, the I / O unit 2406 may communicate with one or more other processors, such as one or more of the PPUs 2400, over the system bus 2402. In at least one embodiment, the I / O unit 2406 implements a PCIe interface for communicating over a PCIe bus. In at least one embodiment, the I / O unit 2406 implements interfaces for communicating with external devices.

[0225] In at least one embodiment, the I / O unit 2406 decodes packets received over the system bus 2402. In at least one embodiment, at least some packets represent commands configured to cause the PPU 2400 to perform various operations. In at least one embodiment, the I / O unit 2406 transmits decoded commands to various other units of the PPU 2400 as specified by the commands. In at least one embodiment, commands are transmitted to the front-end unit 2410 and / or transmitted to the hub 2416 or other units of the PPU 2400, such as one or more copy engines, a video encoder, a video decoder, a power management unit, etc. (in Fig. 24). In at least one embodiment, the I / O unit 2406 is configured to direct communication between and among various logical units of the PPU 2400.

[0226] In at least one embodiment, a program executed by the host processor encodes an instruction stream in a buffer that provides workloads for the PPU 2400 to process. In at least one embodiment, a workload includes instructions and data to be processed by those instructions. In at least one embodiment, the buffer is an area in memory that is accessible (e.g., read / write) to both the host processor and the PPU 2400—a host interface device may be configured to access the buffer in system memory connected to the system bus 2402 via memory requests transmitted from the I / O device 2406 over the system bus 2402.In at least one embodiment, the host processor writes the instruction stream to the buffer and then transfers a pointer to the start of the instruction stream to the PPU 2400, so that the front-end unit 2410 receives pointers to one or more instruction streams and manages one or more instruction streams, reads instructions from instruction streams, and forwards instructions to various units of the PPU 2400.

[0227] In at least one embodiment, the front-end unit 2410 is coupled to the scheduler unit 2412, which configures various GPCs 2418 to process tasks defined by one or more instruction streams. In at least one embodiment, the scheduler unit 2412 is configured to track state information related to various tasks managed by the scheduler unit 2412, where the state information may indicate which of the GPCs 2418 a task is assigned to, whether the task is active or inactive, a priority level associated with the task, and so on. In at least one embodiment, the scheduler unit 2412 manages the execution of a plurality of tasks on one or more of the GPCs 2418.

[0228] In at least one embodiment, the scheduler unit 2412 is coupled to the work distribution unit 2414, which is configured to dispatch tasks for execution on the GPCs 2418. In at least one embodiment, the work distribution unit 2414 tracks a number of scheduled tasks received from the scheduler unit 2412, and the work distribution unit 2414 maintains a pending task pool and an active task pool for each of the GPCs 2418. In at least one embodiment, the pending task pool includes a number of slots (e.g., 32 slots) containing tasks to be processed by a particular GPC 2418; the active task pool may include a number of slots (e.g.,4 slots) for tasks that are actively being processed by the GPCs 2418, such that when one of the GPCs 2418 completes execution of a task, that task is evicted from the active task pool for the GPC 2418, and one of the other tasks is selected from the pending task pool and scheduled for execution on the GPC 2418. In at least one embodiment, when an active task on the GPC 2418 is idle, e.g., while waiting for a data dependency to be resolved, the active task is evicted from the GPC 2418 and returned to the pending task pool, while another task in the pending task pool is selected and scheduled for execution on the GPC 2418.

[0229] In at least one embodiment, the work distribution unit 2414 communicates with one or more GPCs 2418 via the Xbar 2420. In at least one embodiment, the Xbar 2420 is an interconnection network that couples many of the units of the PPU 2400 to other units of the PPU 2400 and may be configured to couple the work distribution unit 2414 to a particular GPC 2418. In at least one embodiment, one or more other units of the PPU 2400 may also be connected to the Xbar 2420 via the hub 2416.

[0230] In at least one embodiment, tasks are managed by the scheduler unit 2412 and dispatched by the work distribution unit 2414 to one of the GPCs 2418. The GPC 2418 is configured to process tasks and produce results. In at least one embodiment, results from other tasks may be consumed within the GPC 2418, passed to another GPC 2418 via the Xbar 2420, or stored in memory 2404. In at least one embodiment, results may be written to memory 2404 via partition units 2422, which implement a memory interface for reading and writing data to / from memory 2404. In at least one embodiment, results may be transferred to another PPU 2404 or CPU via the high-speed GPU interconnect 2408.In at least one embodiment, the PPU 2400 includes, among other things, a number U of partition units 2422 equal to the number of separate and unique storage devices 2404 coupled to the PPU 2400.

[0231] In at least one embodiment, a host processor executes a driver kernel that implements an application programming interface ("API") that enables one or more applications executing on the host processor to schedule operations for execution on the PPU 2400. In at least one embodiment, multiple computing applications are executed concurrently by the PPU 2400, and the PPU 2400 provides isolation, quality of service ("QoS"), and independent address spaces for multiple computing applications. In at least one embodiment, an application generates instructions (e.g., in the form of API calls) that cause a driver kernel to spawn one or more tasks for execution by the PPU 2400, and the driver kernel issues tasks to one or more streams that are processed by the PPU 2400. In at least one embodiment, each task comprises one or more groups of related threads, which may be referred to as a warp.In at least one embodiment, a warp comprises a plurality of related threads (e.g., 32 threads) that can execute in parallel. In at least one embodiment, cooperating threads may refer to a plurality of threads that contain instructions for performing a task and that exchange data via shared memory.

[0232] In at least one embodiment, at least one in Fig. 24 is used to describe or describe the component used herein and at least in connection with Fig. 1-7. In at least one embodiment, the PPU 2400 causes a compiler to allocate registers based on the estimated performance cost, as described herein at least in connection with the process 100 of Fig. 1 described to assign live areas.

[0233] Fig. 25 illustrates a GPC 2500 according to at least one embodiment. In at least one embodiment, the GPC 2500 is the GPC 2418 of Fig. 24. In at least one embodiment, each GPC 2500 includes, without limitation, a number of hardware units for processing tasks, and each GPC 2500 includes, without limitation, a pipeline manager 2502, a pre-raster operation unit (“PROP”) 2504, a raster engine 2508, a work distribution crossbar (“WDX”) 2516, an MMU 2518, one or more data processing clusters (“DPCs”) 2506, and any suitable combination of parts.

[0234] In at least one embodiment, the operation of the GPC 2500 is controlled by the pipeline manager 2502. In at least one embodiment, the pipeline manager 2502 manages the configuration of one or more DPCs 2506 for processing tasks assigned to the GPC 2500. In at least one embodiment, the pipeline manager 2502 configures at least one of one or more DPCs 2506 to implement at least a portion of a graphics rendering pipeline. In at least one embodiment, the DPC 2506 is configured to execute a vertex shader program on a programmable streaming multiprocessor ("SM") 2514.In at least one embodiment, pipeline manager 2502 is configured to route packets received from a work distribution unit to appropriate logical units within GPC 2500, and some packets may be routed to fixed-function hardware units in PROP 2504 and / or raster engine 2508, while other packets may be routed to DPCs 2506 for processing by a primitive engine 2512 or SM 2514. In at least one embodiment, pipeline manager 2502 configures at least one of DPCs 2506 to implement a compute pipeline. In at least one embodiment, pipeline manager 2502 configures at least one of DPCs 2506 to execute at least a portion of a CUDA program.

[0235] In at least one embodiment, the PROP unit 2504 is configured to direct data generated by the raster engine 2508 and the DPCs 2506 to a raster operation unit ("ROP") in a partition unit, such as the memory partition unit 2422 described above in connection with Fig. 24. In at least one embodiment, the PROP unit 2504 is configured to perform optimizations for color mixing, organize pixel data, perform address translations, and more. In at least one embodiment, the raster engine 2508 includes, without limitation, a number of fixed-function hardware units configured to perform various raster operations, and in at least one embodiment, the raster engine 2508 includes, among other things, a setup engine, a coarse raster engine, a culling engine, a clipping engine, a fine raster engine, a tile blending engine, and any suitable combination thereof.In at least one embodiment, the setup engine receives transformed vertices and generates plane equations associated with geometric primitives defined by vertices; plane equations are passed to the coarse raster engine to generate coverage information (e.g., an x, y coverage mask for a tile) for a primitive; the output of the coarse raster engine is passed to the culling engine, where fragments associated with primitives that fail a z-test are discarded, and to a clipping engine, where fragments that lie outside a viewing frustum are clipped. In at least one embodiment, fragments that survive clipping and culling are passed to a fine raster engine to generate attributes for pixel fragments based on plane equations generated by a setup engine.In at least one embodiment, the output of the raster engine 2508 includes fragments to be processed by any suitable entity, such as a fragment shader implemented within the DPC 2506.

[0236] In at least one embodiment, each DPC 2506 included in the GPC 2500 includes, among other things, an M-Pipe Controller ("MPC") 2510; a Primitive Engine 2512; one or more SMs 2514; and any suitable combination thereof. In at least one embodiment, the MPC 2510 controls the operation of the DPC 2506 and routes packets received from the Pipeline Manager 2502 to appropriate units within the DPC 2506. In at least one embodiment, packets associated with a vertex are passed to the Primitive Engine 2512, which is configured to retrieve vertex attributes associated with the vertex from memory; in contrast, packets associated with a shader program may be transferred to the SM 2514.

[0237] In at least one embodiment, the SM 2514 includes, among other things, a programmable streaming processor configured to process tasks represented by a number of threads. In at least one embodiment, the SM 2514 is multi-threaded and configured to concurrently execute a plurality of threads (e.g., 32 threads) from a given group of threads, and implements a SIMD architecture, where each thread in a group of threads (e.g., a warp) is configured to process a different set of data based on the same set of instructions. In at least one embodiment, all threads in the group of threads execute the same instructions.In at least one embodiment, the SM 2514 implements a SIMT architecture, where each thread in a group of threads is configured to process a different set of instructions based on the same set of instructions, but where individual threads within the group of threads are allowed to diverge during execution. In at least one embodiment, a program counter, call stack, and execution state are maintained for each warp, enabling concurrency between warps and serial execution within warps when threads diverge within the warp. In another embodiment, a program counter, call stack, and execution state are maintained for each individual thread, enabling equal concurrency among all threads within and between warps.In at least one embodiment, execution state is maintained for each individual thread, and threads executing the same instructions may be merged and executed in parallel for better efficiency. At least one embodiment of the SM 2514 is described herein in connection with. Fig. 26 described in more detail.

[0238] In at least one embodiment, the MMU 2518 provides an interface between the GPC 2500 and a memory partition unit (e.g., the partition unit 2422 of Fig. 24), and the MMU 2518 provides virtual address to physical address translation, memory protection, and arbitration of memory requests. In at least one embodiment, the NlNlU 2518 provides one or more translation buffers (TLBs) for performing virtual address to physical address translation in memory.

[0239] In at least one embodiment, at least one in Fig. 25 is used to describe or describe the component used herein and at least in connection with Fig. 1-7. In at least one embodiment, GPC 2500 causes a compiler to allocate registers based on the estimated performance cost, as described herein at least in connection with the method 100 of Fig. 1 described, to assign live areas.

[0240] Fig. 26 illustrates a streaming multiprocessor (“SM”) 2600 according to at least one embodiment. In at least one embodiment, SM 2600 is SM 2514 of Fig. 25. In at least one embodiment, the SM 2600 includes, among other things, an instruction cache 2602; one or more scheduler units 2604; a register file 2608; one or more processing cores ("cores") 2610; one or more special function units ("SFUs") 2612; one or more LSUs 2614; an interconnect network 2616; a shared memory / L1 cache 2618; and any suitable combination thereof. In at least one embodiment, a work dispatch unit dispatches tasks for execution on GPCs of parallel processing units (PPUs), and each task is assigned to a particular data processing cluster (DPC) within a GPC, and if a task is associated with a shader program, then the task is assigned to one of the SMs 2600.In at least one embodiment, a work distribution unit dispatches tasks for execution on compute clusters ("GPCs") of parallel processing units ("PPUs"), and each task is assigned to a particular compute cluster ("DPC") within a GPC, and if the task is associated with a shader program, the task is assigned to one of the In at least one embodiment, scheduler unit 2604 receives tasks from the work distribution unit and manages instruction scheduling for one or more thread blocks assigned to SM 2600. In at least one embodiment, scheduler unit 2604 schedules thread blocks for execution as warps of parallel threads, with each thread block assigned at least one warp. In at least one embodiment, each warp executes threads.In at least one embodiment, scheduler unit 2604 manages a plurality of different thread blocks, where warps are assigned to different thread blocks and then instructions are dispatched from a plurality of different cooperative groups to different functional units (e.g., processing cores 2610, SFUs 2612, and LSUs 2614) during each clock cycle. In at least one embodiment, SM 2600 includes one or more thread block clusters, where a thread block cluster may enable programmatic control of locality at a greater granularity than a single thread block of a single streaming multiprocessor (SM). In at least one embodiment, thread block clusters (also referred to as "clusters") enable multiple thread blocks running concurrently across streaming multiprocessors to synchronize and collectively retrieve, exchange, or otherwise utilize data.

[0241] In at least one embodiment, "cooperative groups" may refer to a programming model for organizing groups of communicating threads that allows developers to express the granularity at which threads communicate, enabling the expression of richer, more efficient parallel decompositions. In at least one embodiment, cooperative startup APIs support synchronization between thread blocks for executing parallel algorithms. In at least one embodiment, APIs of traditional programming models provide a single, simple construct for synchronizing cooperative threads: a barrier across all threads of a thread block (e.g., the syncthreads() function).However, in at least one embodiment, programmers can define groups of threads at granularities smaller than thread-block granularities and synchronize them within defined groups to enable greater performance, design flexibility, and software reuse in the form of collective group-wide functional interfaces. In at least one embodiment, cooperative groups allow programmers to explicitly define groups of threads at sub-block and multi-block granularities and perform collective operations such as synchronization on threads in a cooperative group. In at least one embodiment, a sub-block granularity is as small as a single thread.In at least one embodiment, the programming model supports clean composition across software boundaries, allowing libraries and utility functions to be safely synchronized within their local context without making assumptions about convergence. In at least one embodiment, the programming model can synchronize synchronization between threads in a cooperative group. In at least one embodiment, cooperative group primitives enable new patterns of cooperative parallelism, including, among others, producer-consumer parallelism, opportunistic parallelism, and global synchronization across an entire grid of thread blocks.

[0242] In at least one embodiment, a dispatch unit 2606 is configured to transfer instructions to one or more functional units, and the scheduler unit 2604 includes, among other things, two dispatch units 2606 that allow two different instructions to be dispatched from the same warp during each clock cycle. In at least one embodiment, each scheduler unit 2604 includes a single dispatch unit 2606 or additional dispatch units 2606.

[0243] In at least one embodiment, each SM 2600 includes, among other things, a register file 2608 that provides a set of registers for functional units of the SM 2600. In at least one embodiment, the register file 2608 is partitioned between each of the functional units such that each functional unit has a dedicated portion of the register file 2608 assigned to it. In at least one embodiment, the register file 2608 is partitioned between different warps executed by the SM 2600, and the register file 2608 provides temporary storage for operands associated with data paths of functional units. In at least one embodiment, each SM 2600 includes, among other things, a plurality of L processing cores 2610. In at least one embodiment, the SM 2600 includes, among other things, a large number (e.g., 128 or more) of unique processing cores 2610.In at least one embodiment, each processing core 2610 includes, among other things, a fully pipelined, single-precision, double-precision, and / or mixed-precision processing unit including, among other things, a floating-point arithmetic logic unit and an integer arithmetic logic unit. In at least one embodiment, floating-point arithmetic logic units implement the IEEE 754-2008 standard for floating-point arithmetic. In at least one embodiment, processing cores 2610 include, among other things, 64 single-precision (32-bit) floating-point cores, 64 integer cores, 26 double-precision (64-bit) floating-point cores, and 8 tensor cores.

[0244] In at least one embodiment, tensor cores are configured to perform matrix operations. In at least one embodiment, one or more tensor cores are included in processing cores 2610. In at least one embodiment, the tensor cores are configured to perform matrix arithmetic for deep learning, such as convolution operations for training and inference for neural networks. In at least one embodiment, each tensor core operates on a 4x4 matrix and performs a matrix multiplication and accumulation operation D = A × B + C, where A, B, C, and D are 4x4 matrices.

[0245] In at least one embodiment, the matrix multiplication inputs A and B are 16-bit floating-point matrices, and the accumulation matrices C and D are 16-bit or 32-bit floating-point matrices. In at least one embodiment, the tensor cores operate on 16-bit floating-point input data with 32-bit floating-point accumulation. In at least one embodiment, the 16-bit floating-point multiplication uses 64 operations and results in a full-precision product, which is then accumulated using 32-bit floating-point addition with other intermediate products for a 4x4x4 matrix multiplication. Tensor cores are used, in at least one embodiment, to perform much larger two-dimensional or higher-dimensional matrix operations built from these smaller elements. In at least one embodiment, an API, such asA CUDA C++ API exposes specialized matrix loading, matrix multiplication and accumulation, and matrix storage operations to efficiently use tensor cores from a CUDA C++ program. In at least one embodiment, a warp-level interface at the CUDA level accepts 16 x 16 matrices spanning all 32 threads of a warp.

[0246] In at least one embodiment, each SM 2600 includes, among other things, M SFUs 2612 that perform specialized functions (e.g., attribute evaluation, reciprocal square root, and the like). In at least one embodiment, the SFUs 2612 include, among other things, a tree traversal unit configured to traverse a hierarchical tree data structure. In at least one embodiment, the SFUs 2612 include, among other things, a texture unit configured to perform texture map filtering operations. In at least one embodiment, texture units are configured to load texture maps (e.g., a 2D array of texels) from memory and sample texture maps to generate sampled texture values ​​for use in shader programs executed by the SM 2600. In at least one embodiment, texture maps are stored in shared memory / L1 cache 2618.In at least one embodiment, texture units implement texture operations, such as filtering operations using mipmaps (e.g., texture maps with different levels of detail). In at least one embodiment, each SM 2600 includes, among other things, two texture units.

[0247] In at least one embodiment, each SM 2600 includes, among other things, N LSUs 2614 that, in at least one embodiment, implement load and store operations between the shared memory / L1 cache 2618 and the register file 2608. In at least one embodiment, each SM 2600 includes, among other things, an interconnect network 2616 that connects each of the functional units to the register file 2608 and LSU 2614 to the register file 2608 and the shared memory / L1 cache 2618. In at least one embodiment, the interconnect network 2616 is a crossbar that can be configured to connect any of the functional units to any of the registers in the register file 2608 and to connect LSUs 2614 to the register file 2608 and memory locations in the shared memory / L1 cache 2618.

[0248] In at least one embodiment, shared memory / L1 cache 2618 is an array of on-chip memory that enables data storage and communication between SM 2600 and the primitive engine, and between threads in SM 2600. In at least one embodiment, shared memory / L1 cache 2618 includes, among other things, 128 KB of memory capacity and is located on the path from SM 2600 to the partition unit. In at least one embodiment, shared memory / L1 cache 2618 is used to cache read and write operations. In at least one embodiment, one or more of shared memory / L1 cache 2618, the L2 cache, and the memory are backup memory.

[0249] In at least one embodiment, combining data cache and shared memory functionality into a single memory block provides improved performance for both types of memory accesses. In at least one embodiment, capacity is used by programs that do not use shared memory or is usable as a cache, such as when shared memory is configured to use half capacity, texture and load / store operations can use remaining capacity. In at least one embodiment, integration within shared memory / L1 cache 2618 enables shared memory / L1 cache 2618 to act as a high-throughput conduit for streaming data while providing high-bandwidth, low-latency access to frequently reused data.In at least one embodiment, when configured for general-purpose parallel computing, a simpler configuration may be used compared to graphics processing. In at least one embodiment, fixed-function GPUs are bypassed, creating a much simpler programming model. In at least one embodiment and in a general-purpose parallel computing configuration, the work distribution unit allocates and distributes blocks of threads directly to DPCs.In at least one embodiment, threads within a block execute the same program, using a unique thread ID in the computation to ensure that each thread produces unique results. The SM 2600 is used to execute programs and perform computations, the shared memory / L1 cache 2618 communicates between threads, and the LSU 2614 reads and writes global memory through the shared memory / L1 cache 2618 and the memory partition unit. In at least one embodiment, the SM 2600, when configured for general-purpose parallel computation, writes instructions that the scheduler unit 2604 can use to start new work on DPCs. In at least one embodiment, the SM 2600 includes one or more distributed shared memories (or distributed shared memory) that enable direct SM-to-SM operations, such asloading, saving, and executing atomics across multiple shared SM memory blocks.

[0250] In at least one embodiment, SM 2600 includes one or more asynchronous execution functions, including a tensor memory accelerator (TMA) capable of transferring data blocks between global memory and shared memory. In at least one embodiment, one or more processors use or access one or more TMAs to perform bidirectional copy operations, e.g., from global memory to shared memory and vice versa. In at least one embodiment, SM 2600 includes one or more TMAs for asynchronous copying between thread blocks in a cluster. In at least one embodiment, SM 2600 includes one or more asynchronous transaction barriers for performing atomic data movement and synchronization.In at least one embodiment, SM 2600 includes a Tensor Core Transformer engine, which includes software and one or more cores for accelerating the training and inference of Transformer models. In at least one embodiment, a Transformer manages one or more processor cores running one or more Tensor Core Transformer engines and dynamically selects between FP8 and 16-bit computations by recasting and scaling between FP8 and 16-bit in each layer of one or more neural networks.

[0251] In at least one embodiment, the PPU is included in or coupled to a desktop computer, a laptop computer, a tablet computer, servers, supercomputers, a smartphone (e.g., a wireless handheld device), a PDA, a digital camera, a vehicle, a head-mounted display, a handheld electronic device, and more. In at least one embodiment, the PPU is embodied on a single semiconductor substrate. In at least one embodiment, the PPU is included in an SoC along with one or more other devices, such as additional PPUs, memory, a RISC CPU, an MMU, a digital-to-analog converter ("DAC"), and the like.

[0252] In at least one embodiment, the PPU may be included on a graphics card that includes one or more memory devices. In at least one embodiment, a graphics card may be configured to interface with a PCIe slot on a motherboard of a desktop computer. In at least one embodiment, the PPU may be an integrated GPU ("iGPU") included in a chipset of the motherboard.

[0253] In at least one embodiment, at least one in Fig. 26 is used to describe or describe the component used herein and at least in connection with Fig. 1-7. In at least one embodiment, the streaming multiprocessor 2400 causes a compiler to allocate registers based on the estimated performance cost, as described herein at least in connection with the process 100 of Fig. 1 described to assign live areas. Software designs for general-purpose calculations

[0254] The following figures illustrate, without limitation, exemplary software constructions for implementing at least one embodiment.

[0255] Fig. 27 illustrates a software stack of a programming platform according to at least one embodiment. In at least one embodiment, a programming platform is a platform for utilizing hardware on a computing system to accelerate computational tasks. A programming platform may be accessible to software developers through libraries, compiler guidelines, and / or extensions to programming languages ​​in at least one embodiment. In at least one embodiment, a programming platform may be, but is not limited to, CUDA, Radeon Open Compute Platform ("ROCm"), OpenCL (OpenCL™ is developed by the Khronos group), SYCL, or Intel One API.

[0256] In at least one embodiment, a software stack 2700 of a programming platform provides an execution environment for an application 2701. In at least one embodiment, the application 2701 may include any computer software that can be launched on the software stack 2700. In at least one embodiment, the application 2701 may include, but is not limited to, an artificial intelligence ("AI") / machine learning ("ML") application, a high-performance computing ("HPC") application, a virtual desktop infrastructure ("VDI"), or a data center workload.

[0257] In at least one embodiment, application 2701 and software stack 2700 run on hardware 2707. Hardware 2707 may, in at least one embodiment, include one or more GPUs, CPUs, FPGAs, AI engines, and / or other types of computing devices that support a programming platform. In at least one embodiment, such as with CUDA, software stack 2700 may be vendor-specific and compatible only with devices from a specific vendor(s). In at least one embodiment, such as with OpenCL, software stack 2700 may be used with devices from different vendors. In at least one embodiment, hardware 2707 includes a host connected to one or more devices that can be accessed to perform computing tasks via calls to an application programming interface (“API”).A device within hardware 2707 may, in at least one embodiment, include, but is not limited to, a GPU, an FPGA, an AI engine, or other computing device (but may also include a CPU) and its memory, in contrast to a host within hardware 2707, which may, in at least one embodiment, include, but is not limited to, a CPU (but may also include a computing device) and its memory.

[0258] In at least one embodiment, the software stack 2700 of a programming platform includes, without limitation, a number of libraries 2703, a runtime 2705, and a device kernel driver 2706. Each of the libraries 2703, in at least one embodiment, may include data and programming code that can be used by computer programs and utilized during software development. In at least one embodiment, the libraries 2703 may include, but are not limited to, prescribed code and subroutines, classes, values, type specifications, configuration data, documentation, auxiliary data, and / or message templates. In at least one embodiment, the libraries 2703 include functions optimized for execution on one or more types of devices.In at least one embodiment, libraries 2703 may include, but are not limited to, functions for performing mathematical, deep learning, and / or other types of operations on devices. In at least one embodiment, libraries 2703 are associated with corresponding APIs 2702, which may include one or more APIs exposing functions implemented in libraries 2703. In at least one embodiment, a processor (e.g., CPU, GPU) executes, otherwise calls, or otherwise uses one or more APIs to prioritize kernels. For example, a first kernel (e.g., parent) may launch a second kernel (e.g., child kernel), and the second kernel may be used by a processor to launch additional kernels (e.g., grandchild kernels) independently of the first kernel.In at least one embodiment, a processor executes an API or calls an API from the memory to be executed to support dynamic stream priority (e.g., updating the priority while a stream is being used to perform operations). For example, when a processor executes the API, it allows a programmer to copy the stream priority from one stream to one or more other streams.

[0259] In at least one embodiment, the software stack 2700 includes an API for supporting dynamic stream priority (e.g., updating the priority while a stream is used to perform operations), which allows a programmer to set the priority of a stream at any time after creation. In at least one embodiment, the software stack 2700 includes an API for supporting dynamic stream priority (e.g., updating the priority while the stream is used to perform operations), which allows a programmer to obtain the current priority of a stream, where the priority is one of several attributes of a stream. In at least one embodiment, the software stack 2700 includes an API for supporting dynamic stream priority (e.g.,Updating the priority while the stream is being used to perform operations), which allows a programmer to obtain the current priority of a stream as a single attribute. In at least one embodiment, the software stack 2700 includes an API for supporting dynamic stream priority (e.g., updating the priority while the stream is being used to perform operations), which allows a programmer to launch a kernel to perform operations on a stream with a set priority that may be different from the stream priority. In at least one embodiment, the software stack 2700 includes an API for indicating whether an object (e.g.,A thread synchronization object (such as a barrier) tracks whether all data movement operations for a set of threads running on a GPU have completed, has a specified state after a specified period of time, where a specified state may be a state indicating that data has been moved and is ready for use, and is specified using an expected parity value as an input to the API.

[0260] In at least one embodiment, software stack 2700 includes one or more APIs for updated kernels. In at least one embodiment, a processor executes an API or calls an API from memory to update an existing API, and is intended to support context-free kernels, allowing a programmer to add a kernel node to a graph without a graphics context, so that a graphics context can be dynamically associated with a kernel at runtime. In at least one embodiment, software stack 2700 includes one or more APIs to allow a programmer to obtain a kernel identifier and a graphics context as separate parameters from a kernel node, so that parameters are to be obtained from kernels and context-free kernels.In at least one embodiment, the software stack 2700 includes one or more APIs to use parallel processor(s), such as one or more graphics processing units, to launch task graphs (e.g., task graphs) and execute one or more task graphs (e.g., including one or more programs).

[0261] In at least one embodiment, software stack 2700 includes one or more APIs for associating one or more instructions with one or more memory ordering operations, such as a fence or membar operation. In at least one embodiment, instructions are associated with one or more domains so that a memory ordering operation is executed in association with one or more specific domains without disturbing instructions from other domains. An API for indicating that a thread has arrived (e.g., at a thread synchronization barrier) or completed a stage of work related to asynchronous data movement operations on a GPU.In at least one embodiment, the software stack 2700 includes one or more to allow programmers to manually specify an expected transaction count when a thread has completed a stage of work, which is used to update an object that tracks whether all data movement operations for a set of threads have completed.

[0262] In at least one embodiment, the application 2701 is written as source code that is compiled into executable code, as described below in connection with the Fig. 32-34 are discussed in more detail. Executable code of application 2701 may, in at least one embodiment, run at least partially on an execution environment provided by software stack 2700. In at least one embodiment, during execution of application 2701, code may be accessed that must run on a device, as opposed to a host. In such a case, in at least one embodiment, runtime 2705 may be invoked to load and launch required code on the device. In at least one embodiment, runtime 2705 may include any technically feasible runtime system capable of supporting execution of application 2701.

[0263] In at least one embodiment, runtime 2705 is implemented as one or more runtime libraries associated with corresponding APIs shown as API(s) 2704. One or more such runtime libraries may, in at least one embodiment, include, but are not limited to, functions for memory management, execution control, device management, error handling, and / or synchronization, among others. In at least one embodiment, memory management functions may include, but are not limited to, functions for allocating, freeing, and copying device memory, as well as for transferring data between host memory and device memory.In at least one embodiment, execution control functions may include, but are not limited to, functions for starting a function (sometimes referred to as a "kernel" when a function is a global function that can be called from a host) on a device and for setting attribute values ​​in a buffer maintained by a runtime library for a given function to be executed on a device.

[0264] Runtime libraries and corresponding API(s) 2704 may, in at least one embodiment, be implemented in any technically feasible manner. In at least one embodiment, one (or any number of) APIs may expose a low-level set of functions for fine-grained control of a device, while another (or any number of) APIs may expose a higher-level set of such functions. In at least one embodiment, a high-level runtime API may be built upon a lower-level API. In at least one embodiment, one or more of the runtime APIs may be language-specific APIs layered upon a language-independent runtime API.

[0265] In at least one embodiment, one or more processors disclosed in “processing systems” may execute, access, or otherwise use the software stack 2700. For example, the APU 1400, the CPU 1500, the example graphics processors 17A-17B, the general-purpose graphics processing unit ("GPGPU") 1830, the parallel processor 1900, the processing cluster 1994, the graphics multiprocessor 1934, the graphics multiprocessor 1996, the graphics processor 2000, the processor 2100, the processor 2200, the parallel processing unit ("PPU") 2400, the GPC 2500, and / or the streaming multiprocessor ("SM") 2600 may perform, use, call, or otherwise implement (e.g., by accessing memory) one or more APIs included in the software stack 2700.

[0266] In at least one embodiment, a device kernel driver 2706 is configured to facilitate communication with an underlying device. In at least one embodiment, a device kernel driver 2706 may provide low-level functionality upon which APIs, such as API(s) 2704, and / or other software rely. In at least one embodiment, the device kernel driver 2706 may be configured to compile intermediate representation ("IR") code into binary code at runtime. For CUDA, in at least one embodiment, the device kernel driver 2706 may compile non-hardware-specific parallel threaded execution ("PTX") IR code at runtime into binary code for a specific target device (with caching of the compiled binary code), sometimes referred to as "completion code."This may, in at least one embodiment, allow completed code to be executed on a target device that may not have existed when the source code was originally compiled into PTX code. Alternatively, in at least one embodiment, the device source code may be compiled offline into binary code without requiring the device kernel driver 2706 to compile IR code at runtime.

[0267] In at least one embodiment, at least one component related to Fig. 27, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, execution of application 2701 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0268] Fig. 28 represents a CUDA implementation of the software stack 2700 of Fig. 27 according to at least one embodiment. In at least one embodiment, a CUDA software stack 2800 on which an application 2801 may be launched includes CUDA libraries 2803, a CUDA runtime 2805, a CUDA driver 2807, and a device kernel driver 2808. In at least one embodiment, the CUDA software stack 2800 executes on hardware 2809, which may include a GPU supporting CUDA and is developed by NVIDIA Corporation of Santa Clara, CA.

[0269] In at least one embodiment, the application 2801, the CUDA runtime 2805, and the device kernel driver 2808 may perform similar functionality to the application 2701, the runtime 2705, and the device kernel driver 2706, respectively, described above in connection with Fig. 27. In at least one embodiment, the CUDA driver 2807 includes a library (libcuda.so) that implements a CUDA driver API 2806. Similar to a CUDA runtime API 2804 implemented by a CUDA runtime library (cudart), the CUDA driver API 2806 may, in at least one embodiment, expose, without limitation, functions for memory management, execution control, device management, error handling, synchronization, and / or graphics interoperability, among others. In at least one embodiment, the CUDA driver API 2806 differs from the CUDA runtime API 2804 in that the CUDA runtime API 2804 simplifies device code management by providing implicit initialization, context management (analogous to a process), and module management (analogous to dynamically loaded libraries).In contrast to the high-level CUDA runtime API 2804, the CUDA driver API 2806, in at least one embodiment, is a low-level API that provides finer-grained control of the device, particularly with respect to contexts and module loading. In at least one embodiment, the CUDA driver API 2806 may expose context management functionality not exposed by the CUDA runtime API 2804. In at least one embodiment, the CUDA driver API 2806 is also language-independent, supporting, for example, OpenCL in addition to the CUDA runtime API 2804. Further, in at least one embodiment, development libraries, including the CUDA runtime 2805, may be considered separate from driver components, including the user-mode CUDA driver 2807 and the kernel-mode device driver 2808 (sometimes referred to as a "display" driver).

[0270] In at least one embodiment, CUDA libraries 2803 may include, but are not limited to, mathematical libraries, deep learning libraries, parallel algorithm libraries, and / or signal / image / video processing libraries that may be used by parallel computing applications, such as application 2801. In at least one embodiment, CUDA libraries 2803 may include mathematical libraries such as a cuBLAS library, which is an implementation of Basic Linear Algebra Subprograms ("BLAS") for performing linear algebra operations, a cuFFT library for computing Fast Fourier Transforms ("FFTs"), and a cuRAND library for generating random numbers, among others.In at least one embodiment, CUDA libraries 2803 may include deep learning libraries, such as a cuDNN library of primitives for deep neural networks and a TensorRT platform for high-performance deep learning inference, among others.

[0271] In at least one embodiment, at least one component related to Fig. 28, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, execution of application 2801 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0272] Fig. 29 illustrates an ROCm implementation of the software stack 2700 of Fig. 27 according to at least one embodiment. In at least one embodiment, an ROCm software stack 2900 on which an application 2901 may be launched includes a language runtime 2903, a system runtime 2905, a thunk 2907, and an ROCm kernel driver 2908. In at least one embodiment, the ROCm software stack 2900 executes on hardware 2909, which may include a GPU supporting ROCm and is developed by AMD Corporation of Santa Clara, CA.

[0273] In at least one embodiment, the application 2901 may provide similar functionality as described above in connection with Fig. 27. In addition, the language runtime 2903 and the system runtime 2905 may perform similar functionalities as those described above in connection with Fig. 27, in at least one embodiment. In at least one embodiment, the language runtime 2903 and the system runtime 2905 differ in that the system runtime 2905 is a language-independent runtime that implements a ROCr system runtime API 2904 and uses a Heterogeneous System Architecture ("HSA") runtime API. The HSA runtime API is a thin user-mode API that, in at least one embodiment, exposes, among other things, interfaces for accessing and interacting with an AMD GPU, including functions for memory management, execution control via an architectural distribution of kernels, error handling, system and agent information, and runtime initialization and shutdown.In contrast to the system runtime 2905, the language runtime 2903, in at least one embodiment, is an implementation of a language-specific runtime API 2902 layered on top of the ROCr system runtime API 2904. In at least one embodiment, the language runtime API may include, but is not limited to, a Heterogeneous Computing Interface for Portability ("HIP") language runtime API, a Heterogeneous Computing Compiler ("HCC") language runtime API, or an OpenCL API, among others. In particular, the HIP language is an extension of the C++ programming language with functionally similar versions of CUDA mechanisms, and in at least one embodiment, a HIP language runtime API includes functionality similar to that described above in connection with . Fig. 28 are similar to the CUDA Runtime API 2804 discussed in section 28, including functions for memory management, execution control, device management, error handling, and synchronization.

[0274] In at least one embodiment, the thunk (ROCt) 2907 is an interface 2906 that can be used to interact with the underlying ROCm driver 2908. In at least one embodiment, the ROCm driver 2908 is a ROCk driver that is a combination of an AMDGPU driver and an HSA kernel driver (AMDKFD). In at least one embodiment, the AMDGPU driver is a device kernel driver for AMD-developed GPUs that provides similar functionality to the one described above in connection with Fig. 27. In at least one embodiment, the HSA kernel driver is a driver that enables different types of processors to more effectively share system resources via hardware features.

[0275] In at least one embodiment, various libraries (not shown) may be included in the ROCm software stack 2900 above the language runtime 2903 and may provide functionality similarity to those described above in connection with Fig. 28. In at least one embodiment, various libraries may include, but are not limited to, mathematical, deep learning, and / or other libraries, such as a hipBLAS library implementing functions similar to CUDA cuBLAS, a rocFFT library for computing FFTs similar to CUDA cuFFT, among others.

[0276] In at least one embodiment, at least one component related to Fig. 29, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, execution of application 2901 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0277] Fig. 30 represents an OpenCL implementation of the software stack 2700 of Fig. 27 according to at least one embodiment. In at least one embodiment, an OpenCL software stack 3000 on which an application 3001 may be launched includes an OpenCL framework 3010, an OpenCL runtime 3006, and a driver 3007. In at least one embodiment, the OpenCL software stack 3000 executes on hardware 2809 that is not vendor-specific. Because OpenCL is supported by devices developed by various vendors, specific OpenCL drivers may be required to interoperate with hardware from such vendors in at least one embodiment.

[0278] In at least one embodiment, the application 3001, the OpenCL runtime 3006, the device kernel driver 3007, and the hardware 3008 may perform similar functionality to the application 2701, the runtime 2705, the device kernel driver 2706, and the hardware 2707, respectively, described above in connection with Fig. 27. In at least one embodiment, application 3001 further includes an OpenCL kernel 3002 having code to be executed on a device.

[0279] In at least one embodiment, OpenCL defines a "platform" that enables a host to control devices connected to the host. In at least one embodiment, an OpenCL framework provides a platform layer API and a runtime API, shown as platform API 3003 and runtime API 3005. In at least one embodiment, runtime API 3005 uses contexts to manage the execution of kernels on devices. In at least one embodiment, each identified device may be associated with a respective context, which runtime API 3005 may use to manage instruction queues, program objects, and kernel objects, including sharing memory objects for that device.In at least one embodiment, the platform API 3003 exposes functions that enable device contexts to be used to select and initialize devices, submit work to devices via command queues, and enable data transfer to and from devices, among other things. Additionally, the OpenCL framework provides various built-in functions (not shown), including mathematical functions, relational functions, and image processing functions, among others, in at least one embodiment.

[0280] In at least one embodiment, a compiler 3004 is also included in the OpenCL framework 3010. Source code may, in at least one embodiment, be compiled offline before an application is executed, or online during the execution of an application. Unlike CUDA and ROCm, in at least one embodiment, OpenCL applications may be compiled online by compiler 3004, which is included to be representative of any number of compilers that may be used to compile source code and / or IR code, such as Standard Portable Intermediate Representation ("SPIR-V") code, into binary code. Alternatively, in at least one embodiment, OpenCL applications may be compiled offline before such applications are executed.

[0281] In at least one embodiment, at least one component related to Fig. 30 is used to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, execution of application 3001 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0282] Fig. 31 illustrates software supported by a programming platform, according to at least one embodiment. In at least one embodiment, a programming platform 3104 is configured to support various programming models 3103, middlewares and / or libraries 3102, and frameworks 3101 that an application 3100 may rely on. In at least one embodiment, the application 3100 may be an AI / ML application implemented, for example, using a deep learning framework such as MXNet, PyTorch, or TensorFlow, which may rely on libraries such as cuDNN, NVIDIA Collective Communications Library ("NCCL"), and / or NVIDIA Developer Data Loading Library ("DALI") CUDA libraries to provide accelerated computation on underlying hardware.

[0283] In at least one embodiment, the programming platform 3104 may be one of a CUDA, ROCm, or OpenCL platform described above in connection with Fig. 28, Fig. 29 respectively Fig. 30. In at least one embodiment, the programming platform 3104 supports multiple programming models 3103, which are abstractions of an underlying computing system that enable expressions of algorithms and data structures. The programming models 3103 may expose features of underlying hardware, in at least one embodiment, to improve performance. In at least one embodiment, the programming models 3103 may include, but are not limited to, CUDA, HIP, OpenCL, C++ Accelerated Massive Parallelism ("C++AMP"), Open Multi-Processing ("OpenMP"), Open Accelerators ("OpenACC"), and / or Vulcan Compute.

[0284] In at least one embodiment, libraries and / or middleware 3102 provide implementations of abstractions of programming models 3104. In at least one embodiment, such libraries include data and programming code that can be used by computer programs and utilized during software development. In at least one embodiment, such middleware includes software that provides services to applications beyond those available from programming platform 3104. In at least one embodiment, libraries and / or middleware 3102 may include, but are not limited to, cuBLAS, cuFFT, cuRAND, and other CUDA libraries, or rocBLAS, rocFFT, rocRAND, and other ROCm libraries.Additionally, in at least one embodiment, libraries and / or middleware 3102 may include NCCL and ROCm Communication Collective Library (“RCCL”) libraries that provide communication routines for GPUs, an MIOpen library for deep learning acceleration, and / or an Eigen library for linear algebra, matrix and vector operations, geometric transformations, numerical solvers, and related algorithms.

[0285] In at least one embodiment, application frameworks 3101 depend on libraries and / or middleware 3102. In at least one embodiment, each of the application frameworks 3101 is a software framework used to implement a standard application software structure. Referring again to the AI / ML example discussed above, in at least one embodiment, an AI / ML application may be implemented using a framework such as Caffe, Caffe2, TensorFlow, Keras, PyTorch, or MxNet deep learning frameworks.

[0286] In at least one embodiment, at least one component related to Fig. 31, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, execution of application 3100 causes a compiler to allocate registers to live regions based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0287] Fig. 32 illustrates compilation code running on one of the programming platforms of Fig. 27-30, according to at least one embodiment. In at least one embodiment, a compiler 3201 receives source code 3200 that includes both host code and device code. In at least one embodiment, the compiler 3201 is configured to convert source code 3200 into host-executable code 3202 for execution on a host and device-executable code 3203 for execution on a device. In at least one embodiment, the source code 3200 can be compiled either offline before an application is executed or online during execution of an application. In at least one embodiment, the compiler 3201 includes or has access to one or more libraries to recognize a sequence of API calls to perform a single fused API, where a single fused API is a combined API for two or more APIs.

[0288] In at least one embodiment, source code 3200 may include code in any programming language supported by compiler 3201, such as C++, C, Fortran, etc. In at least one embodiment, source code 3200 may be included in a single source file that includes a mixture of host code and device code, with locations of device code indicated therein. In at least one embodiment, a single source file may be a .cu file that includes CUDA code or a .hip.cpp file that includes HIP code. Alternatively, in at least one embodiment, source code 3200 may include multiple source code files instead of a single source file into which host code and device code are separated.

[0289] In at least one embodiment, compiler 3201 is configured to compile source code 3200 into host-executable code 3202 for execution on a host and device-executable code 3203 for execution on a device. In at least one embodiment, compiler 3201 performs operations including parsing source code 3200 into an abstract system tree (AST), performing optimizations, and generating executable code. In at least one embodiment where source code 3200 comprises a single source file, compiler 3201 may separate device code from host code in such a single source file, compile device code and host code into device-executable code 3203 and host-executable code 3202, respectively, and link device-executable code 3203 and host-executable code 3202 into a single file, as described below with respect to Fig. 33 discussed in more detail.

[0290] In at least one embodiment, host-executable code 3202 and device-executable code 3203 may be in any suitable format, such as binary code and / or IR code. In the case of CUDA, in at least one embodiment, host-executable code 3202 may include native object code, and device-executable code 3203 may include code in a PTX intermediate representation. In the case of ROCm, both host-executable code 3202 and device-executable code 3203 may include binary target code in at least one embodiment.

[0291] In at least one embodiment, at least one component related to Fig. 32, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, compiler 3201 allocates registers to live areas based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail.

[0292] Fig. 33 is a more detailed illustration of compiling code written on one of the programming platforms of Fig. 27-30, according to at least one embodiment. In at least one embodiment, a compiler 3301 is configured to receive source code 3300, compile source code 3300, and output an executable file 3310. In at least one embodiment, source code 3300 is a single source file, such as a .cu file, a .hip.cpp file, or a file in another format that includes both host and device code. In at least one embodiment, compiler 3301 may be, but is not limited to, an NVIDIA CUDA compiler ("NVCC") for compiling CUDA code into .cu files or an HCC compiler for compiling HIP code into .hip.cpp files.

[0293] In at least one embodiment, compiler 3301 includes a compiler front-end 3302, a host compiler 3305, a device compiler 3306, and a linker 3309. In at least one embodiment, compiler front-end 3302 is configured to separate device code 3304 from host code 3303 into source code 3300. Device code 3304 is compiled by device compiler 3306, in at least one embodiment, into device-executable code 3308, which may include binary code or IR code, as described. Separately, host code 3303 is compiled by host compiler 3305, in at least one embodiment, into host-executable code 3307.For NVCC, the host compiler 3305 may be, but is not limited to, a general-purpose C / C++ compiler that outputs native object code, while the device compiler 3306, in at least one embodiment, may be, but is not limited to, a Low-Level Virtual Machine ("LLVM")-based compiler that forks an LLVM compiler infrastructure and outputs PTX code or binary code. For HCC, both the host compiler 3305 and the device compiler 3306, in at least one embodiment, may be, but is not limited to, LLVM-based compilers that output binary target code.

[0294] After compiling source code 3300 into host-executable code 3307 and device-executable code 3308, in at least one embodiment, linker 3309 links host and device-executable code 3307 and 3308 together in an executable file 3310. In at least one embodiment, native object code for a host and PTX or binary code for a device may be linked together in an executable and linkable format (“ELF”) file, which is a container format used to store object code.

[0295] In at least one embodiment, at least one component related to Fig. 33, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, the host compiler 3305 allocates registers to live areas based on estimated performance costs, as described herein at least in connection with the process 100 of Fig. 1 described in more detail.

[0296] Fig. 34 illustrates translating source code prior to compiling source code, according to at least one embodiment. In at least one embodiment, source code 3400 is passed through a translation tool 3401 that translates source code 3400 into translated source code 3402. In at least one embodiment, a compiler 3403 is used to compile translated source code 3402 into executable host code 3404 and executable device code 3405 in a process similar to the compilation of source code 3200 by compiler 3201 into executable host code 3202 and executable device code 3203, as described above in connection with Fig. 32 discussed.

[0297] In at least one embodiment, a translation performed by translation tool 3401 is used to port source 3400 for execution in a different environment than the one in which it was originally intended to be executed. In at least one embodiment, translation tool 3401 may include, but is not limited to, a HIP translator used to "hipify" CUDA code intended for a CUDA platform into HIP code that can be compiled and executed on a ROCm platform. In at least one embodiment, translation of source code 3400 may include parsing source code 3400 and converting calls to API(s) provided by one programming model (e.g., CUDA) into corresponding calls to API(s) provided by another programming model (e.g., HIP), as described below in connection with the Fig. 35A- Fig. 36. Referring again to the example of Hipifying CUDA code, calls to the CUDA runtime API, CUDA driver API, and / or CUDA libraries may, in at least one embodiment, be converted into corresponding HIP API calls. In at least one embodiment, automated translations performed by translation tool 3401 may sometimes be incomplete, requiring additional manual effort to fully port source code 3400.

[0298] In at least one embodiment, at least one component related to Fig. 34, to implement techniques and / or functions described herein and at least in connection with Fig. 1-7. In at least one embodiment, compiler 3403 allocates registers to live areas based on estimated performance costs, as described herein at least in connection with process 100 of Fig. 1 described in more detail. Configuring GPUs for general-purpose computing

[0299] The following figures illustrate, without limitation, example architectures for compiling and executing computation source code in accordance with at least one embodiment.

[0300] Fig. 35A illustrates a system 3500 configured to compile and execute CUDA source code 3510 using various types of processing units, according to at least one embodiment. In at least one embodiment, the system 3500 ...

Claims

[1] Processor comprising: one or more circuits for executing a compiler to assign one or more memory locations to one or more variables corresponding to a first portion of a computer program independently of one or more assignments of one or more memory locations to the one or more variables corresponding to a second portion of the computer program. [2] The processor of claim 1, wherein the first and second portions of a computer program correspond to two or more segments of one or more live regions of the one or more variables. [3] The processor of claim 1, wherein the one or more circuits are to execute the compiler to assign the one or more memory locations to the one or more variables based at least in part on estimated performance metrics of the one or more memory locations. [4] The processor of claim 1, wherein the one or more circuits are to execute the compiler to assign the one or more memory locations to the one or more variables based at least in part on one or more indications of a register preference corresponding to the one or more variables. [5] The processor of claim 1, wherein the one or more circuits are to execute the compiler to assign the one or more memory locations to the one or more variables based at least in part on two or more types of modifications to the computer program. [6] The processor of claim 1, wherein the one or more circuits are to execute the compiler to assign the one or more memory locations to the one or more variables based at least in part on reassigning one or more of the memory locations from another variable to the one or more variables. [7] The processor of claim 1, wherein the one or more circuits are to execute the compiler to assign the one or more memory locations to the one or more variables based at least in part on one or more sets of two or more types of modifications to the computer program. [8] System comprising: one or more circuits for executing a compiler to assign one or more memory locations to one or more variables corresponding to a first portion of a computer program independently of one or more assignments of one or more memory locations to the one or more variables corresponding to a second portion of the computer program. [9] The system of claim 8, wherein the assignment of the one or more storage locations is based at least in part on one or more indications of a storage location preference corresponding to the one or more variables. [10] The system of claim 8, wherein the one or more circuits are to execute a compiler to assign the one or more memory locations to the one or more variables corresponding to the first portion of a computer program based at least in part on observed performance metrics of the one or more memory locations. [11] The system of claim 8, wherein the first and second portions of a computer program correspond to two or more segments of one or more live areas of the one or more variables. [12] The system of claim 8, wherein the assignment of the one or more memory locations is based at least in part on two or more types of modifications to instructions of the computer program. [13] The system of claim 8, wherein the assignment of the one or more memory locations is based at least in part on two or more modifications to software to reassign a memory location from another variable to the one or more variables. [14] The system of claim 8, wherein the assignment of the one or more storage locations is based at least in part on one or more sets of two or more types of modifications to the computer program. [15] Method comprising: Executing a compiler to assign one or more memory locations to one or more variables corresponding to a first section of a computer program, independently of one or more assignments of one or more memory locations to the one or more variables corresponding to a second section of the computer program. [16] The method of claim 15, wherein the assignment of the one or more memory locations is based at least in part on one or more indications of whether a memory location is required by the one or more variables. [17] The method of claim 15, wherein the allocation of the one or more storage locations is based at least in part on one or more estimated performance metrics. [18] The method of claim 15, wherein the allocation of the one or more memory locations is based at least in part on a physical memory to virtual memory mapping. [19] The method of claim 15, wherein the one or more circuits are to execute a compiler to identify an intersection of memory locations between two or more sets of the one or more memory locations that can be used by two or more portions of the computer program. [20] The method of claim 15, wherein the assignment of the one or more memory locations is based at least in part on two or more modifications to the computer program to reassign the one or more memory locations from the second portion of the computer program to a first portion of the computer program.