IP Library Granted Patent US 11,604,774
Granted Patent B2
US 11,604,774 · App. 17/480,294 · Granted Mar 14, 2023

Method and apparatus of converting schema in deep learning framework, and computer storage medium

Inventors: Liujie Zhang (Beijing, CN); Yamei Li (Beijing, CN); Huihuang Zheng (Beijing, CN); Hongyu Liu (Beijing, CN); Xiang Lan (Beijing, CN); Dianhai Yu (Beijing, CN); Yanjun Ma (Beijing, CN); Tian Wu (Beijing, CN); Haifeng Wang (Beijing, CN)
Assignee: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
G06F16/211G06F16/2246
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 11,604,774
App. No.
17/480,294
Granted
Mar 14, 2023
Kind
B2
Abstract

A method and apparatus of converting a schema in a deep learning framework, an electronic device, and a computer storage medium are provided. The method of converting the schema in the deep learning framework includes: updating a first schema, based on first syntax elements in the first schema and a context relationship between the first syntax elements in the first schema, so as to obtain an updated first schema; generating second syntax elements corresponding to updated first syntax elements in the updated first schema, based on a mapping relationship between the updated first syntax elements in the updated first schema and second syntax elements in a second schema system; and combining the second syntax elements according to a context relationship between the updated first syntax elements, so as to generate a second schema.

Claims (33)

1. A method of converting a schema in a deep learning framework, comprising:

updating a first schema, based on first syntax elements in the first schema and a context relationship between the first syntax elements in the first schema, so as to obtain an updated first schema;

generating second syntax elements corresponding to updated first syntax elements, the updated first schema comprising the updated first syntax elements;

combining the second syntax elements according to a context relationship between the updated first syntax elements, so as to generate a second schema; and

executing the second schema, wherein a machine overhead cost required for an execution of the first schema is greater than that required for an execution of the second schema, wherein

generating the second syntax elements corresponding to the updated first syntax elements comprises inputting abstract syntax trees of the updated first syntax elements to converters corresponding to the updated first syntax elements, so that the converters convert and output abstract syntax trees corresponding to the abstract syntax trees of the updated first syntax elements as the second syntax elements.

2. The method of claim 1 , wherein a number of the updated first syntax elements is less than that of the first syntax elements.

3. The method of claim 1 , wherein the first syntax elements comprise a first operator, and the second syntax elements comprise a second operator, and wherein the method further comprises:

allowing the second schema to be executed by the first operator corresponding to the second operator.

4. The method of claim 1 , wherein a first identifier of the first schema is stored in a high-speed storage device, and wherein the method further comprises:

acquiring the first identifier of the first schema;

determining a second identifier of an another first schema; and

determining the second schema as a schema corresponding to the further first schema in response to determining that the first identifier matches the second identifier.

5. The method of claim 1 , wherein the first syntax elements comprise a loop operator and a conditional operator; and

wherein the updating a first schema based on first syntax elements in the first schema and a context relationship between the first syntax elements in the first schema comprises:

updating the conditional operator and the loop operator as an another loop operator, in response to determining that a context relationship between the conditional operator and the loop operator is to be adjacent in the first schema.

6. The method of claim 1 , wherein the first syntax elements comprise constants, and wherein the updating a first schema based on first syntax elements in the first schema and a context relationship between the first syntax elements in the first schema comprises:

removing repetitive constants in the first schema.

7. The method of claim 1 , wherein the first schema is implemented by imperative programming, and the second schema is implemented by declarative programming.

8. An electronic device, comprising:

one or more processors; and

a storage device for storing one or more programs, wherein the one or more programs, when executed by the one or more processors, cause the one or more processors to implement operations of converting a schema in a deep learning framework, comprising:

updating a first schema, based on first syntax elements in the first schema and a context relationship between the first syntax elements in the first schema, so as to obtain an updated first schema;

generating second syntax elements corresponding to updated first syntax elements, the updated first schema comprising the updated first syntax elements;

combining the second syntax elements according to a context relationship between the updated first syntax elements, so as to generate a second schema; and

executing the second schema, wherein a machine overhead cost required for an execution of the first schema is greater than that required for an execution of the second schema, wherein

generating the second syntax elements corresponding to the updated first syntax elements comprises inputting abstract syntax trees of the updated first syntax elements to converters corresponding to the updated first syntax elements, so that the converters convert and output abstract syntax trees corresponding to the abstract syntax trees of the updated first syntax elements as the second syntax elements.

9. A non-transitory computer-readable storage medium having computer programs stored thereon, wherein the computer programs, when executed by a processor, cause the processor to implement operations of converting a schema in a deep learning framework, comprising:

updating a first schema, based on first syntax elements in the first schema and a context relationship between the first syntax elements in the first schema, so as to obtain an updated first schema;

generating second syntax elements corresponding to updated first syntax elements, the updated first schema comprising the updated first syntax elements;

combining the second syntax elements according to a context relationship between the updated first syntax elements, so as to generate a second schema; and

executing the second schema, wherein a machine overhead cost required for an execution of the first schema is greater than that required for an execution of the second schema, wherein

generating the second syntax elements corresponding to the updated first syntax elements comprises inputting abstract syntax trees of the updated first syntax elements to converters corresponding to the updated first syntax elements, so that the converters convert and output abstract syntax trees corresponding to the abstract syntax trees of the updated first syntax elements as the second syntax elements.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 21, 2021
From: ZHANG, LIUJIE; LI, YAMEI; ZHENG, HUIHUANG; LIU, HONGYU; LAN, XIANG; YU, DIANHAI; MA, YANJUN; WU, TIAN; WANG, HAIFENG
To: BEIJING BAIDU NETCOM SCIENCE TECHNOLOGY CO., LTD.
Reel/Frame 057545/0089 →
Priority Claims (1)
CN 202011242902.8 · Nov 9, 2020 · national
Continuity (1)
Related Publication 20220004526A1 · Jan 6, 2022