# US 2023/0065994 A1 · Offload server, offload control method, and offload program

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2023/0065994 A1
- Document ID: US20230065994A1
- Status: Published application
- Kind: A1
- Application number: 17/797,188
- Filed: 2020-02-04
- Published: 2023-03-02
- Earliest claimed: 2020-02-04
- Assignees: Nippon Telegraph and Telephone Corporation
- Applicants: Nippon Telegraph and Telephone Corporation
- Inventors: Yoji YAMATO
- Web page: https://patentgrep.com/patent/US20230065994A1

## CPC

- G06F 8/41: Compilation
- G06F 8/452: {Loops}
- G06F 8/30: Creation or generation of source code
- G06F 8/4441: {Reducing the execution time required by the program code}
- G06F 8/457: {Communication (intertask communication G06F9/54)}
- G06F 11/3466: {Performance evaluation by tracing or monitoring}
- Y02D 10/00: Energy efficient computing, e.g. low power processors, power management or thermal management
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)
- Y02D: CLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE

## Abstract

An offload server (1) includes: an application code analysis section (112) configured to analyze source code of an application; a data transfer designation section (113) configured to, on the basis of a result of the code analysis, designate a data transfer to be collectively performed on, before starting GPU processing and after finishing the GPU processing, of variables that need to be transferred between a CPU and a GPU, those which are not mutually referenced nor mutually updated between CPU processing and the GPU processing and which are only to be returned to the CPU as a result of the GPU processing; a parallel processing designation section (114) configured to identify loop statements in the application, and, for each of the identified loop statements, specify a statement specifying application of parallel processing by the GPU and perform compilation.

## Claims

### Claim 1

An offload server that offloads specific processing of an application to a GPU (Graphics Processing Unit), the offload server comprising:
one or more hardware processors;
an application code analysis section, implemented using one or more of the one or more hardware processors, configured to analyze source code of an application;
a data transfer designation section, implemented using one or more of the one or more hardware processors, configured to, on the basis of a result of the code analysis, designate a data transfer to be collectively performed on, before starting GPU processing and after finishing the GPU processing, of variables that need to be transferred between a CPU (Central Processing Unit) and the GPU, those which are not mutually referenced nor mutually updated between CPU processing and the GPU processing and which are only to be returned to the CPU as a result of the GPU processing;
a parallel processing designation section, implemented using one or more of the one or more hardware processors, configured to identify loop statements in the application, and, for each of the identified loop statements, specify a statement specifying application of parallel processing by the GPU and perform compilation;
a parallel processing pattern generation section, implemented using one or more of the one or more hardware processors, configured to exclude, from loop statements to be offloaded, any loop statement at which a compilation error occurs and to generate a plurality of parallel processing patterns each of which specifies whether to perform parallel processing for each of the loop statements at which no compilation error occurs;
a performance measurement section, implemented using one or more of the one or more hardware processors, configured to, for each of the plurality of parallel processing patterns, compile the application according to the parallel processing pattern, deploy the compiled application to an accelerator verification device, and perform processing for a measurement of a performance obtained when offloading the compiled application to the GPU according to the parallel processing pattern; and
an execution file generation section, implemented using one or more of the one or more hardware processors, configured to select a parallel processing pattern with a highest processing performance as a solution from the plurality of parallel processing patterns on the basis of a result of the measurement of the performance, and compile the application according to the parallel processing pattern with the highest processing performance to generate an execution file.

### Claim 2 (depends on 1)

The offload server according to claim 1,
wherein the data transfer designation section is configured to designate the data transfer to be collectively performed before starting the GPU processing and after finishing the GPU processing, by means of ‘data copy’ of OpenACC (Open Accelerator).

### Claim 3 (depends on 1)

The offload server according to claim 1,
wherein when a variable to be processed on the GPU has been already collectively transferred to the GPU, the data transfer designation section is configured to add a directive clause indicating that the variable need not be transferred.

### Claim 4 (depends on 1)

The offload server according to claim 1,
wherein the data transfer designation section is configured to explicitly indicate that transfer is not necessary for variables that are collectively transferred before start of the GPU processing and need not be transferred at timing of loop statement processing, using ‘data present’ of OpenACC.

### Claim 5 (depends on 1)

The offload server according to claim 1,
wherein the data transfer designation section is configured to designate, in the event of transferring data between the CPU and the GPU, a transfer of a variable by creating a temporary area on a GPU side, storing data of the variable in the temporary area, and then synchronizing the temporary area.

### Claim 6 (depends on 1)

The offload server according to claim 1,
wherein the parallel processing designation section is further configured to set a gene length to the number of the loop statements at which no compilation error occurs, according to a genetic algorithm,
wherein the parallel processing pattern generation section is further configured to prepare gene patterns as many as a specified number of current-generation individuals, wherein each of the gene patterns has elements whose gene values are each randomly assigned a value of 1 or 0 and GPU processing availability is mapped to the value in such a manner that performing GPU processing is assigned either 1 or 0 and not performing GPU processing is assigned either the opposite 0 or 1,
wherein the performance measurement section is further configured to: for each of the current-generation individuals, compile an application code in which statements specifying application of parallel processing by the GPU are specified, deploy the compiled code to the accelerator verification device, and perform processing for a measurement of a performance of the individual on the accelerator verification device, and
wherein the execution file generation section is further configured to perform performance measurement for each individual, evaluate the individual in such a manner that an individual that requires less processing time period is regarded as having a higher degree of fitness, select individuals having degrees of fitness higher than a predetermined value from all the individuals as individuals with high performances, generate next-generation individuals by performing crossover and mutation processes on the selected individuals, and after completing processing for a specified number of generations, select a parallel processing pattern with a highest performance as the solution.

### Claim 7

An offload control method for an offload server that offloads specific processing of an application to a GPU (Graphics Processing Unit), the offload server comprising one or more hardware processors, wherein the offload control method causing the offload server to perform steps of:
analyzing source code of an application;
on the basis of a result of the code analysis, designating a data transfer to be collectively performed on, before starting GPU processing and after finishing the GPU processing, of the variables that need to be transferred between a CPU (Central Processing Unit) and the GPU, those which are not mutually referenced nor mutually updated between CPU processing and the GPU processing and which are only to be returned to the CPU as the result of the GPU processing;
identifying loop statements in the application, and, for each of the identified loop statements, specifying a statement specifying application of parallel processing by the GPU and performing compilation;
excluding, from loop statements to be offloaded, any loop statement at which a compilation error occurs and generating a plurality of parallel processing patterns each of which specify specifies whether to perform parallel processing for each of the loop statements at which no compilation error occurs;
for each of the plurality of parallel processing patterns, compiling the application according to the parallel processing pattern, deploying the compiled application to an accelerator verification device, and performing processing for a measurement of a performance obtained when offloading the compiled application to the GPU according to the parallel processing pattern; and
selecting a parallel processing pattern with a highest processing performance as a solution from the plurality of parallel processing patterns on the basis of a result of the measurement of the performance, and compiling the application according to the parallel processing pattern with the highest processing performance to generate an execution file.

### Claim 8

A non-transitory computer-readable medium storing a computer program configured to cause an offload server to perform operations to offload specific processing of an application to a GPU (Graphics Processing Unit), the operations comprising:
analyzing source code of an application;
on the basis of a result of the code analysis, designating a data transfer to be collectively performed on, before starting GPU processing and after finishing the GPU processing, of variables that need to be transferred between a CPU (Central Processing Unit) and the GPU, those which are not mutually referenced nor mutually updated between CPU processing and the GPU processing and which are only to be returned to the CPU as a result of the GPU processing;
identifying loop statements in the application, and, for each of the identified loop statements, specifying a statement specifying application of parallel processing by the GPU and perform compilation;
excluding, from loop statements to be offloaded, any loop statement at which a compilation error occurs and to generate a plurality of parallel processing patterns each of which specifies whether to perform parallel processing for each of the loop statements at which no compilation error occurs;
for each of the plurality of parallel processing patterns, compiling the application according to the parallel processing pattern, deploy the compiled application to an accelerator verification device, and performing processing for a measurement of a performance obtained when offloading the compiled application to the GPU according to the parallel processing pattern; and
selecting a parallel processing pattern with a highest processing performance as a solution from the plurality of parallel processing patterns on the basis of a result of the measurement of the performance, and compiling the application according to the parallel processing pattern with the highest processing performance to generate an execution file.

### Claim 9 (depends on 7)

The offload control method according to claim 7, further comprising:
designating the data transfer to be collectively performed before starting the GPU processing and after finishing the GPU processing, by means of ‘data copy’ of OpenACC (Open Accelerator).

### Claim 10 (depends on 7)

The offload control method according to claim 7, further comprising:
when a variable to be processed on the GPU has been already collectively transferred to the GPU, adding a directive clause indicating that the variable need not be transferred.

### Claim 11 (depends on 7)

The offload control method according to claim 7, further comprising:
explicitly indicating that transfer is not necessary for variables that are collectively transferred before start of the GPU processing and need not be transferred at timing of loop statement processing, using ‘data present’ of OpenACC.

### Claim 12 (depends on 7)

The offload control method according to claim 7, further comprising:
designating, in the event of transferring data between the CPU and the GPU, a transfer of a variable by creating a temporary area on a GPU side, storing data of the variable in the temporary area, and then synchronizing the temporary area.

### Claim 13 (depends on 7)

The offload control method according to claim 7, further comprising:
setting a gene length to the number of the loop statements at which no compilation error occurs, according to a genetic algorithm,
preparing gene patterns as many as a specified number of current-generation individuals, wherein each of the gene patterns has elements whose gene values are each randomly assigned a value of 1 or 0 and GPU processing availability is mapped to the value in such a manner that performing GPU processing is assigned either 1 or 0 and not performing GPU processing is assigned either the opposite 0 or 1,
for each of the current-generation individuals, compiling an application code in which statements specifying application of parallel processing by the GPU are specified, deploying the compiled code to the accelerator verification device, and performing processing for a measurement of a performance of the individual on the accelerator verification device, and
performing performance measurement for each individual, evaluating the individual in such a manner that an individual that requires less processing time period is regarded as having a higher degree of fitness, selecting individuals having degrees of fitness higher than a predetermined value from all the individuals as individuals with high performances, generating next-generation individuals by performing crossover and mutation processes on the selected individuals, and after completing processing for a specified number of generations, selecting a parallel processing pattern with a highest performance as the solution.

### Claim 14 (depends on 8)

The non-transitory computer-readable medium according to claim 8, wherein the operations further comprises:
designating the data transfer to be collectively performed before starting the GPU processing and after finishing the GPU processing, by means of ‘data copy’ of OpenACC (Open Accelerator).

### Claim 15 (depends on 8)

The non-transitory computer-readable medium according to claim 8, wherein the operations further comprises:
when a variable to be processed on the GPU has been already collectively transferred to the GPU, adding a directive clause indicating that the variable need not be transferred.

### Claim 16 (depends on 8)

The non-transitory computer-readable medium according to claim 8, wherein the operations further comprises:
explicitly indicating that transfer is not necessary for variables that are collectively transferred before start of the GPU processing and need not be transferred at timing of loop statement processing, using ‘data present’ of OpenACC.

### Claim 17 (depends on 8)

The non-transitory computer-readable medium according to claim 8, wherein the operations further comprises:
designating, in the event of transferring data between the CPU and the GPU, a transfer of a variable by creating a temporary area on a GPU side, storing data of the variable in the temporary area, and then synchronizing the temporary area.

### Claim 18 (depends on 8)

The non-transitory computer-readable medium according to claim 8, wherein the operations further comprises:
setting a gene length to the number of the loop statements at which no compilation error occurs, according to a genetic algorithm,
preparing gene patterns as many as a specified number of current-generation individuals, wherein each of the gene patterns has elements whose gene values are each randomly assigned a value of 1 or 0 and GPU processing availability is mapped to the value in such a manner that performing GPU processing is assigned either 1 or 0 and not performing GPU processing is assigned either the opposite 0 or 1,
for each of the current-generation individuals, compiling an application code in which statements specifying application of parallel processing by the GPU are specified, deploying the compiled code to the accelerator verification device, and performing processing for a measurement of a performance of the individual on the accelerator verification device, and
performing performance measurement for each individual, evaluating the individual in such a manner that an individual that requires less processing time period is regarded as having a higher degree of fitness, selecting individuals having degrees of fitness higher than a predetermined value from all the individuals as individuals with high performances, generating next-generation individuals by performing crossover and mutation processes on the selected individuals, and after completing processing for a specified number of generations, selecting a parallel processing pattern with a highest performance as the solution.
