Method and system for managing intermediate representation from program
A method for managing an intermediate representation from a program is executed by one or more processors, and includes extracting, from the program, information on data for input and output and information on operation, generating an intermediate representation from the program using the extracted information on data and the extracted information on operation, storing, in a database, a corresponding relationship between the program and the intermediate representation, storing execution information on operation of the intermediate representation, and deleting at least a part of the intermediate representation based on the execution information.
1 . A method executed by one or more processors, the method comprising:
determining, information associated with a deep learning program executable by one or more computing devices, wherein the information associated with the deep learning program comprises:
information associated with one or more data elements of the deep learning program, wherein at least one data element of the one or more data elements provides tensor information, and
wherein at least one second data element of the one or more data elements indicates data of the deep learning program; and
information associated with one or more operations of the deep learning program;
generating, based on the information associated with the deep learning program, an intermediate representation of at least a portion of the deep learning program by:
generating a plurality of data nodes corresponding to the data elements of the deep learning program, wherein the plurality of data nodes comprises at least one input data node and at least one output data node;
generating an operation node corresponding to the one or more operations of the deep learning program;
generating a first edge that links an input data node corresponding to input data associated with at least one of the one or more operations to the operation node; and
generating a second edge that links the operation node to an output data node corresponding to output data associated with the at least one of the one or more operations;
storing, in a database, a corresponding relationship between the at least a portion of the deep learning program and the intermediate representation by storing, in the database, a relationship between the data elements and the plurality of data nodes;
executing an optimized form of the deep learning program by executing, based on the intermediate representation, the deep learning program;
storing information indicating an execution status of one or more operations of the deep learning program by:
storing information indicating whether an execution has been performed for at least one of the one or more operations of the intermediate representation;
selecting a first operation to be executed by selecting, from among operations of the intermediate representation, at least a part of unexecuted operation;
executing the first operation; and
updating information indicating that the first operation has been executed; and
deleting, from memory and based on the execution status, at least a part of the intermediate representation.
2 . The method according to claim 1 , further comprising:
adding, based on determining that a new tensor was generated by the deep learning program, a new data node to the intermediate representation.
3 . The method according to claim 1 , further comprising:
updating, based on determining that an existing tensor was generated by the deep learning program, an existing data node of the plurality of data nodes.
4 . The method according to claim 1 , further comprising:
extracting input tensor information from the deep learning program; and
adding, based on the input tensor information, a new operation node to the intermediate representation.
5 . The method according to claim 1 , wherein the deleting the at least the part of the intermediate representation comprises:
selecting a first data node, from among the plurality of data nodes and the operation node, as a node not to be used in a future execution, wherein the selecting the first data node is based on:
the information indicating the execution status
a determination that data corresponding to the first data node is not stored in the database,
one or both of:
a determination that no operation node associated with the first data node exists, or
a condition that operations of all operation nodes associated with the first data node have been executed; and
a determination that the operation node is an executed node;
deleting, from the memory, the first data node; and
deleting, from the memory, an edge associated with the first data node.
6 . The method according to claim 1 , wherein the operation node corresponds to an operation performed on at least two tensors.
7 . An information processing system comprising:
Memory; and
One or more processors coupled to the memory and configured to execute one or more computer-readable programs stored in memory,
determine, information associated with a deep learning program executable by one or more computing devices, wherein the information associated with the deep learning program comprises:
information associated with one or more data elements of the deep learning program, wherein at least one data element of the one or more data elements provides tensor information, and
wherein at least one second data element of the one or more data elements indicates data of the deep learning program; and
information associated with one or more operations of the deep learning program;
generate, based on the information associated with the deep learning program, an intermediate representation of at least a portion of the deep learning program by:
generating a plurality of data nodes corresponding to the data elements of the deep learning program, wherein the plurality of data nodes comprises at least one input data node and at least one output data node;
generating an operation node corresponding to the one or more operations of the deep learning program;
generating a first edge that links an input data node corresponding to input data associated with at least one of the one or more operations to the operation node; and
generating a second edge that links the operation node to an output data node corresponding to output data associated with the at least one of the one or more operations;
store, in a database, a corresponding relationship between the at least a portion of the deep learning program and the intermediate representation by storing, in the database, a relationship between the data elements and the plurality of data nodes;
execute an optimized form of the deep learning program by executing, based on the intermediate representation, the deep learning program;
storing information indicating an execution status of one or more operations of the deep learning program by:
storing information indicating whether an execution has been performed for at least one of the one or more operations of the intermediate representation;
selecting a first operation to be executed by selecting, from among operations of the intermediate representation, at least a part of unexecuted operation;
executing the first operation; and
updating information indicating that the first operation has been executed; and
delete, from memory and based on the execution status, at least a part of the intermediate representation.
8 . The information processing system according to claim 7 , wherein the instructions, when executed by the one or more processors, further cause the information processing system to:
add, based on determining that a new tensor was generated by the deep learning program, a new data node to the intermediate representation.
9 . The information processing system according to claim 7 , wherein the instructions, when executed by the one or more processors, further cause the information processing system to:
update, based on determining that an existing tensor was generated by the deep learning program, an existing data node of the plurality of data nodes.
10 . The information processing system according to claim 7 , wherein the instructions, when executed by the one or more processors, further cause the information processing system to:
extract input tensor information from the deep learning program; and
add, based on the input tensor information, a new operation node to the intermediate representation.
11 . The information processing system according to claim 7 , wherein the instructions, when executed by the one or more processors, cause the information processing system to delete the at least the part of the intermediate representation by causing the information processing system to:
select a first data node, from among the plurality of data nodes and the operation node, as a node not to be used in a future execution, wherein the selecting the first data node is based on:
the information indicating the execution status
a determination that data corresponding to the first data node is not stored in the database,
one or both of:
a determination that no operation node associated with the first data node exists, or
a condition that operations of all operation nodes associated with the first data node have been executed; and
a determination that the operation node is an executed node;
delete, from the memory, the first data node; and
delete, from the memory, an edge associated with the first data node.
12 . The information processing system according to claim 7 , wherein the operation node corresponds to an operation performed on at least two tensors.
13 . One or more non-transitory computer-readable media storing instruction that when execute by one or more processors of an information processing system cause the information processing system to:
determine, information associated with a deep learning program executable by one or more computing devices, wherein the information associated with the deep learning program comprises:
information associated with one or more data elements of the deep learning program, wherein at least one data element of the one or more data elements provides tensor information, and
wherein at least one second data element of the one or more data elements indicates data of the deep learning program; and
information associated with one or more operations of the deep learning program;
generating, based on the information associated with the deep learning program, an intermediate representation of at least a portion of the deep learning program by:
generating a plurality of data nodes corresponding to the data elements of the deep learning program, wherein the plurality of data nodes comprises at least one input data node and at least one output data node;
generating an operation node corresponding to the one or more operations of the deep learning program;
generating a first edge that links an input data node corresponding to input data associated with at least one of the one or more operations to the operation node; and
generating a second edge that links the operation node to an output data node corresponding to output data associated with the at least one of the one or more operations;
storing, in a database, a corresponding relationship between the at least a portion of the deep learning program and the intermediate representation by storing, in the database, a relationship between the data elements and the plurality of data nodes;
execute an optimized form of the deep learning program by executing, based on the intermediate representation, the deep learning program;
store information indicating an execution status of one or more operations of the deep learning program by:
storing information indicating whether an execution has been performed for at least one of the one or more operations of the intermediate representation;
selecting a first operation to be executed by selecting, from among operations of the intermediate representation, at least a part of unexecuted operation;
executing the first operation; and
updating information indicating that the first operation has been executed; and
delete, from memory and based on the execution status, at least a part of the intermediate representation by:
selecting a first data node from among the plurality of data nodes and the operation node, as a node not to be used in a future execution, wherein the selecting the first data node is based on:
the information indicating the execution status,
a determination that data corresponding to the data node is not stored in the database,
one or both of:
a determination that no operation node associated with first data node exists, or
a condition that operations of all operation nodes associated with the first data node have been executed; and
a determination that the operation node is an executed node;
deleting from the memory, the first data node; and
deleting form the memory, an edge associated with the first data node.
14 . The one or more non-transitory computer-readable media according to claim 13 , wherein the instructions, when executed by the one or more processors, further cause the information processing system to:
add, based on determining that a new tensor was generated by the deep learning program, a new data node to the intermediate representation.
15 . The one or more non-transitory computer-readable media according to claim 13 , wherein the instructions, when executed by the one or more processors, further cause the information processing system to:
update, based on determining that an existing tensor was generated by the deep learning program, an existing data node of the plurality of data nodes.
16 . The one or more non-transitory computer-readable media according to claim 13 , wherein the instructions, when executed by the one or more processors, further cause the information processing system to:
extract input tensor information from the deep learning program; and
add, based on the input tensor information, a new operation node to the intermediate representation.
17 . The one or more non-transitory computer-readable media according to claim 13 , wherein the instructions, when executed by the one or more processors, cause the information processing system to delete the at least the part of the intermediate representation by causing the information processing system to:
select a first data node, from among the plurality of data nodes and the operation node, as a node not to be used in a future execution, wherein the selecting the first data node is based on:
the information indicating the execution status
a determination that data corresponding to the first data node is not stored in the database,
one or both of:
a determination that no operation node associated with the first data node exists, or
a condition that operations of all operation nodes associated with the first data node have been executed; and
a determination that the operation node is an executed node;
delete, from the memory, the first data node; and
delete, from the memory, an edge associated with the first data node.