IP Library Granted Patent US 12694294
Granted Patent B2
US 12694294 · App. 17/350,585 · Granted Jul 28, 2026

Concatenating input and output tensors for use in recurrent neural networks

Inventors: Cedric Lichtenau (Stuttgart, DE); Jonathan D. Bradbury (Poughkeepsie, NY); Laith M. AlBarakat (Wappingers Falls, NY); Simon Weishaupt (Stuttgart, DE)
Assignee: INTERNATIONAL BUSINESS MACHINES CORPORATION
G06N3/082G06N3/0442G06N3/048
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 12694294
App. No.
17/350,585
Granted
Jul 28, 2026
Kind
B2
Abstract

A plurality of tensors is obtained, and the plurality of tensors is reformatted to provide a plurality of reformatted tensors of a select dimension. The reformatting includes adding padding to at least one reformatted tensor of the plurality of reformatted tensors. The plurality of reformatted tensors is concatenated to provide a concatenated tensor. The concatenated tensor is to be used in recurrent neural network processing.

Claims (52)

1 . A computer program product for facilitating processing within a computing environment, the computer program product comprising:

at least one computer readable storage medium and program instructions collectively stored on the at least one computer readable storage medium to perform a method comprising:

generating, by a processor, a concatenated tensor of a selected data layout format to be used in recurrent neural network processing on an accelerator coupled to the processor, the generating the concatenated tensor of the selected data layout format comprising:

obtaining a plurality of tensors;

reformatting the plurality of tensors to provide a plurality of reformatted tensors of a select dimension, wherein the reformatting includes automatically adding padding to at least one reformatted tensor of the plurality of reformatted tensors to create the at least one reformatted tensor such that it is aligned on a boundary of a memory unit of memory of the computing environment; and

concatenating the plurality of reformatted tensors to provide a concatenated tensor, the concatenated tensor to be used in the recurrent neural network processing; and

transmitting from the processor to the accelerator coupled to the processor at least an indication of the concatenated tensor, the concatenated tensor to be directly used by a neural network processing instruction to be executed on the accelerator to perform cell activation, the neural network processing instruction having an operation code that identifies the neural network processing instruction and the neural network processing instruction receiving as input a function code that specifies the cell activation to be performed by the neural network processing instruction, wherein based on execution of the neural network processing instruction by the accelerator, the concatenated tensor is used by a plurality of operations of the cell activation during a single invocation of the neural network processing instruction, the single invocation of the neural network processing instruction performing the plurality of operations and a number of activations of the cell activation, wherein the plurality of operations of the cell activation performed during the single invocation of the neural network processing instruction includes at least one arithmetic operation and the number of activations of the cell activation performed during the single invocation of the neural network processing instruction includes at least one non-linear activation function.

2 . The computer program product of claim 1 , wherein the plurality of reformatted tensors comprises a plurality of reformatted weight tensors to be used in the recurrent neural network processing.

3 . The computer program product of claim 2 , wherein the method further comprises:

multiplying a feature input by the plurality of reformatted weight tensors to provide an intermediate result; and

adding a bias tensor to the intermediate result to provide a result tensor.

4 . The computer program product of claim 3 , wherein the method further comprises providing identifying information of the result tensor to the accelerator, the result tensor being the concatenated tensor to be used in the cell activation of a recurrent neural network performed by the accelerator.

5 . The computer program product of claim 1 , wherein the cell activation is a long short-term memory cell activation and the at least one non-linear activation function includes a sigmoid function.

6 . The computer program product of claim 1 , wherein the cell activation is a gated recurrent unit cell activation and the at least one non-linear activation function includes a sigmoid function.

7 . The computer program product of claim 1 , wherein the automatically adding padding to the at least one reformatted tensor includes adding padding to a reformatted tensor of the at least one reformatted tensor to provide a complete reformatted tensor of a selected size.

8 . The computer program product of claim 7 , wherein the automatically adding padding includes padding one or more rows of the reformatted tensor, based on the one or more rows having less data than accommodated by the selected size of the reformatted tensor.

9 . The computer program product of claim 7 , wherein the automatically adding padding includes padding the reformatted tensor with one or more additional padded rows, based on the reformatted tensor having less rows than accommodated by the selected size of the reformatted tensor.

10 . A computer system for facilitating processing within a computing environment, the computer system comprising:

a memory; and

at least one processor in communication with the memory, wherein the computer system is configured to perform a method, said method comprising:

generating, by a processor, a concatenated tensor of a selected data layout format to be used in recurrent neural network processing on an accelerator coupled to the processor, the generating the concatenated tensor of the selected data layout format comprising:

obtaining a plurality of tensors;

reformatting the plurality of tensors to provide a plurality of reformatted tensors of a select dimension, wherein the reformatting includes automatically adding padding to at least one reformatted tensor of the plurality of reformatted tensors to create the at least one reformatted tensor such that it is aligned on a boundary of a memory unit of memory of the computing environment; and

concatenating the plurality of reformatted tensors to provide a concatenated tensor, the concatenated tensor to be used in the recurrent neural network processing; and

transmitting from the processor to the accelerator coupled to the processor at least an indication of the concatenated tensor, the concatenated tensor to be directly used by a neural network processing instruction to be executed on the accelerator to perform cell activation, the neural network processing instruction having an operation code that identifies the neural network processing instruction and the neural network processing instruction receiving as input a function code that specifies the cell activation to be performed by the neural network processing instruction, wherein based on execution of the neural network processing instruction by the accelerator, the concatenated tensor is used by a plurality of operations of the cell activation during a single invocation of the neural network processing instruction, the single invocation of the neural network processing instruction performing the plurality of operations and a number of activations of the cell activation, wherein the plurality of operations of the cell activation performed during the single invocation of the neural network processing instruction includes at least one arithmetic operation and the number of activations of the cell activation performed during the single invocation of the neural network processing instruction includes at least one non-linear activation function.

11 . The computer system of claim 10 , wherein the plurality of reformatted tensors comprises a plurality of reformatted weight tensors to be used in the recurrent neural network processing.

12 . The computer system of claim 10 , wherein the automatically adding padding to the at least one reformatted tensor includes adding padding to a reformatted tensor of the at least one reformatted tensor to provide a complete reformatted tensor of a selected size.

13 . The computer system of claim 12 , wherein the automatically adding padding includes padding one or more rows of the reformatted tensor, based on the one or more rows having less data than accommodated by the selected size of the reformatted tensor.

14 . The computer system of claim 12 , wherein the automatically adding padding includes padding the reformatted tensor with one or more additional padded rows, based on the reformatted tensor having less rows than accommodated by the selected size of the reformatted tensor.

15 . A computer-implemented method of facilitating processing within a computing environment, the computer-implemented method comprising:

generating, by a processor, a concatenated tensor of a selected data layout format to be used in recurrent neural network processing on an accelerator coupled to the processor, the generating the concatenated tensor of the selected data layout format comprising:

obtaining a plurality of tensors;

reformatting the plurality of tensors to provide a plurality of reformatted tensors of a select dimension, wherein the reformatting includes automatically adding padding to at least one reformatted tensor of the plurality of reformatted tensors to create the at least one reformatted tensor such that it is aligned on a boundary of a memory unit of memory of the computing environment; and

concatenating the plurality of reformatted tensors to provide a concatenated tensor, the concatenated tensor to be used in the recurrent neural network processing; and

transmitting from the processor to the accelerator coupled to the processor at least an indication of the concatenated tensor, the concatenated tensor to be directly used by a neural network processing instruction to be executed on the accelerator to perform cell activation, the neural network processing instruction having an operation code that identifies the neural network processing instruction and the neural network processing instruction receiving as input a function code that specifies the cell activation to be performed by the neural network processing instruction, wherein based on execution of the neural network processing instruction by the accelerator, the concatenated tensor is used by a plurality of operations of the cell activation during a single invocation of the neural network processing instruction, the single invocation of the neural network processing instruction performing the plurality of operations and a number of activations of the cell activation, wherein the plurality of operations of the cell activation performed during the single invocation of the neural network processing instruction includes at least one arithmetic operation and the number of activations of the cell activation performed during the single invocation of the neural network processing instruction includes at least one non-linear activation function.

16 . The computer-implemented method of claim 15 , wherein the plurality of reformatted tensors comprises a plurality of reformatted weight tensors to be used in the recurrent neural network processing.

17 . The computer-implemented method of claim 15 , wherein the automatically adding padding to the at least one reformatted tensor includes adding padding to a reformatted tensor of the at least one reformatted tensor to provide a complete reformatted tensor of a selected size.

18 . The computer-implemented method of claim 17 , wherein the automatically adding padding includes padding one or more rows of the reformatted tensor, based on the one or more rows having less data than accommodated by the selected size of the reformatted tensor.

19 . The computer-implemented method of claim 17 , wherein the automatically adding padding includes padding the reformatted tensor with one or more additional padded rows, based on the reformatted tensor having less rows than accommodated by the selected size of the reformatted tensor.

20 . A computer program product for facilitating processing within a computing environment, the computer program product comprising:

at least one computer readable storage medium and program instructions collectively stored on the at least one computer readable storage medium to perform a method comprising:

executing, on a processor of the computing environment, a function of a neural network processing instruction, the function using at least one input concatenated tensor, wherein an input concatenated tensor of the at least one input concatenated tensor is a concatenation of a plurality of reformatted tensors of a select dimension, and wherein at least one reformatted tensor of the plurality of reformatted tensors is aligned on a boundary of a memory unit of memory of the computing environment;

performing a plurality of activations and operations of the function in a single invocation of the neural network processing instruction, the neural network processing instruction specifying the function, and wherein the performing the plurality of activations and operations of the function uses the at least one input concatenated tensor, the plurality of activations and operations of the function performed during the single invocation of the neural network processing instruction including at least one arithmetic operation and at least one activation, the at least one activation including at least one sigmoid function; and

outputting, based on the executing the function, an output concatenated tensor, wherein the output concatenated tensor is accessible as a memory contiguous sub-tensor.

21 . The computer program product of claim 20 , wherein the function is specified by a function code included in a hardware register used as an input to the neural network processing instruction.

22 . The computer program product of claim 20 , wherein the function is a long short-term memory cell activation.

23 . The computer program product of claim 20 , wherein the function is a gated recurrent unit cell activation.

24 . A computer-implemented method comprising:

executing, on a processor of a computing environment, a function of a neural network processing instruction, the function using at least one input concatenated tensor, wherein an input concatenated tensor of the at least one input concatenated tensor is a concatenation of a plurality of reformatted tensors of a select dimension, and wherein at least one reformatted tensor of the plurality of reformatted tensors is aligned on a boundary of a memory unit of memory of the computing environment;

performing a plurality of activations and operations of the function in a single invocation of the neural network processing instruction, the neural network processing instruction specifying the function, and wherein the performing the plurality of activations and operations of the function uses the at least one input concatenated tensor, the plurality of activations and operations of the function performed during the single invocation of the neural network processing instruction including at least one arithmetic operation and at least one activation, the at least one activation including at least one sigmoid function; and

outputting, based on the executing the function, an output concatenated tensor, wherein the output concatenated tensor is accessible as a memory contiguous sub-tensor.

25 . The computer-implemented method of claim 24 , wherein the function is specified by a function code included in a hardware register used as an input to the neural network processing instruction.