IP Library Granted Patent US 9,658,823
Granted Patent B2
US 9,658,823 · App. 14/631,255 · Granted May 23, 2017

Source-to-source compiler and run-time library to transparently accelerate stack or queue-based irregular applications on many-core architectures

Inventors: Yi Yang (Plainsboro, NJ); Min Feng (Princeton, NJ); Srimat Chakradhar (Manalapan, NJ)
Assignee: NEC Corporation
G06F5/14G06F8/4434G06F8/30
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 9,658,823
App. No.
14/631,255
Granted
May 23, 2017
Kind
B2
Abstract

Systems and methods for system for source-to-source transformation for optimizing stacks and/or queues in an application, including identifying usage of stacks and queues in the application and collecting the resource usage and thread block configurations for the application. If the usage of stacks is identified, optimized code is generated by determining appropriate storage, partitioning stacks based on determined storage, and caching tops of the stacks in a register. If the identifier identifies usage of queues, optimized code is generated by combining queue operations in all threads in a warp/thread block into one batch queue operation, converting control divergence of the application to data divergence to enable warp-level queue operations, determining whether at least one of the threads includes a queue operation, and combining queue operations into threads in a warp.

Claims (50)

1. A method for source-to-source transformation for optimizing, using a processor, one or more stacks in an application, comprising:

identifying the usage of the one or more stacks in the application and the one or more queues in the application, and identifying and caching items to be pushed into the queue in a local buffer;

wherein if an enqueue operation is in a loop, the items to be pushed into the queue in a local buffer are identified and pushed, wherein all items in the local buffer are pushed to the queue if the local buffer is full to determine whether at least one thread includes a queue operation, and

wherein if the enqueue operation is not in a loop, a pre-check for queue operations is performed to determine whether at least one thread includes a queue operation;

collecting resource usage and thread block configurations for the applications; and

generating optimized code, wherein the optimized code is generated by:

combining queue operations in all threads in a warp/thread block into one batch queue operation;

converting control divergence of the application to data divergence to enable warp-level queue operations;

determining whether at least one of the threads includes a queue operation; and

determining appropriate storage, and allocating one or more stacks to the appropriate storage, the determining appropriate storage further comprising:

determining whether a resource is satisfied if each item in the one or more stacks is partitioned into shared memory and local memory,

wherein if the resource is determined to not be satisfied, partitioning one or more threads of each of one or more thread blocks into the shared memory and local memory for one or more stacks to identify whether the resource is satisfied;

wherein if the resource is identified as not being satisfied, partitioning one or more stacks of each of one or more threads into the shared memory and local memory to determine if the resource is satisfied, and

wherein if the resource is satisfied, caching one or more tops of the one or more stacks in one or more registers; and

outputting final optimized code based on the determined appropriate storage, wherein generation of the optimized code includes combining queue operations into threads in a warp, wherein control divergence is converted to data divergence before combining queue operations.

2. The method as recited in claim 1 , wherein the collecting resource usages includes collecting shared memory and local memory for the application.

3. The method as recited in claim 1 , wherein the appropriate storage includes shared memory, local memory, and/or a hybrid of shared memory and local memory.

4. A method for source-to-source transformation for optimizing, using a processor, one or more queues in an application, comprising:

identifying the usage of the one or more queues in the application, and identifying and caching items to be pushed into the queue in a local buffer,

wherein if an enqueue operation is in a loop, the items to be pushed into the queue in the local buffer are identified and pushed, wherein all items in the local buffer are pushed to the queue if the local buffer is full to determine whether at least one thread includes a queue operation, and

wherein if the enqueue operation is not in a loop, a pre-check for queue operations is performed to determine whether at least one thread includes a queue operation;

collecting resource usage and thread block configurations for the application; and

generating optimized code, wherein the optimized code is generated by:

combining queue operations in all threads in a warp/thread block into one batch queue operation;

converting control divergence of the application to data divergence to enable warp-level queue operations;

determining whether at least one of the threads includes a queue operation; and

combining queue operations into threads in a warp, wherein the control divergence is converted to the data divergence before the combining queue operations.

5. The method as recited in claim 4 , wherein the determining whether at least one thread includes a queue operation is performed before combining queue operations in threads in a warp if an enqueue is not in a loop.

6. The method as recited in claim 4 , wherein the control divergence is converted to data divergence if the application including control divergence cannot be combined for threads in a warp.

7. A system for source-to-source transformation for optimizing, one or more stacks and/or one or more queues in an application, comprising:

a processor;

an identifier configured to identify usage of the one or more stacks and the one or more queues in the application and identifying and caching items to be pushed into the queue in a local buffer;

wherein if an enqueue operation is in a loop, the items to be pushed into the queue in a local buffer are identified and pushed, wherein all items in the local buffer are pushed to the queue if the local buffer is full to determine whether at least one thread includes a queue operation, and

wherein if the enqueue operation is not in a loop, a pre-check for queue operations is performed to determine whether at least one thread includes a queue operation;

a collector configured to collect the resource usage and thread block configurations for the application;

wherein if the identifier identifies the usage of one or more stacks, a code generation module generates optimized code using:

a storage determination module configured to determine appropriate storage, the determining appropriate storage further comprising:

determining whether a resource is satisfied if each item in the one or more stacks is partitioned into shared memory and local memory,

wherein if the resource is determined to not be satisfied, partitioning one or more threads of each of one or more thread blocks into the shared memory and local memory for one or more stacks to identify whether the resource is satisfied;

wherein if the resource is identified as not being satisfied, partitioning one or more stacks of each of one or more threads into the shared memory and local memory to determine if the resource is satisfied, and

wherein if the resource is satisfied, caching one or more tops of the one or more stacks in one or more registers; and

wherein if the identifier identifies the usage of one or more queues, a code generation module generates optimized code using:

a combining module configured to combine queue operations in all threads in a warp/thread block into one batch queue operation,

a converting module configured to convert control divergence of the application to data divergence to enable warp-level queue operations, and

a queue determining module configured to determine whether at least one of the threads includes a queue operation, and combines any queue operations into threads in a warp, wherein the control divergence is converted to the data divergence before the combining queue operations.

8. The system as recited in claim 7 , wherein the collecting resource usages includes collecting shared memory and local memory for the application.

9. The system as recited in claim 7 , wherein the appropriate storage includes shared memory, local memory, and/or a hybrid of shared memory and local memory.

10. The system as recited in claim 7 , wherein the determining whether at least one thread includes a queue operation is performed before combining queue operations in threads in a warp if an enqueue is not in a loop.

11. The system as recited in claim 7 , wherein the identifier is further configured to identify and cache items to be pushed into the one or more queues in a local buffer, wherein the items to be pushed into the queue in the local buffer are identified and pushed if an enqueue operation is in a loop.

12. The system as recited in claim 7 , wherein the control divergence is converted to data divergence if the application including control divergence cannot be combined for threads in a warp.

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 29, 2017
From: NEC LABORATORIES AMERICA, INC.
To: NEC CORPORATION
Reel/Frame 041779/0828 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Feb 25, 2015
From: YANG, YI; FENG, MIN; CHAKRADHAR, SRIMAT
To: NEC LABORATORIES AMERICA, INC.
Reel/Frame 035029/0049 →
Continuity (2)
Provisional Application 61944289 · Feb 25, 2014
Related Publication 20150242323A1 · Aug 27, 2015