IP Library Granted Patent US 11,928,446
Granted Patent B2
US 11,928,446 · App. 17/524,619 · Granted Mar 12, 2024

Multi-level intermediate representation decoder for heterogeneous platforms

Inventors: Zhen Peng (Palo Alto, CA); Yang Liu (San Jose, CA); Hanxian Huang (Palo Alto, CA); Yongxiong Ren (San Jose, CA); Jishen Yang (Palo Alto, CA); Lingzhi Liu (San Jose, CA); Xin Chen (Palo Alto, CA)
Assignee: KWAI INC.
G06F8/443G06N3/04G06N3/063G06N3/08G06N3/105
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,928,446
App. No.
17/524,619
Granted
Mar 12, 2024
Kind
B2
Abstract

A method, apparatus, and a non-transitory computer-readable storage medium for generating heterogenous platform code. The method may obtain a neural network model. The neural network model may be programed to run on at least one platform. The method may also obtain an initial intermediate representation (IR) code by encoding the neural network model, and obtain a target IR code by adding decorations to the initial IR code based on a target platform. The method may also output an executable code optimized to run on the target platform by decoding the target IR code.

Claims (70)

1. A method for generating heterogenous platform code comprising:

obtaining a neural network model, wherein the neural network model is programed to run on at least one platform;

obtaining an initial intermediate representation (IR) code by encoding the neural network model, and obtaining a target IR code by adding decorations to the initial IR code based on a target platform; and

outputting an executable code optimized to run on the target platform by decoding the target IR code, wherein outputting the executable code optimized to run on the target platform by decoding the target IR code comprises:

obtaining multiple graph objects based on a scan of the target IR code, and

outputting the executable code based on a traverse of the multiple graph objects.

2. The method of claim 1 , wherein the decorations are associated with target platforms that comprise graphics processing unit (GPU), central processing unit (CPU), and field-programmable gate array (FPGA) hardware.

3. The method of claim 2 , wherein obtaining the multiple graph objects based on the scan of the target IR code comprises:

obtaining a general graph object based on the scan of the target IR code; and obtaining the multiple graph objects based on the general graph object, wherein the multiple graph objects are optimized to run on different target platforms.

4. The method of claim 3 , wherein obtaining the multiple graph objects based on the general graph object comprises:

obtaining the multiple graph objects based on the general graph object; and

optimizing the multiple graph objects to run on the different target platforms based on vertices in the at least one graph object being fused into a vertex that combines operations together.

5. The method of claim 2 , wherein outputting the executable code based on the traverse of the multiple graph objects comprise:

obtaining at least one input vertex of the multiple graph objects;

obtaining at least one neighboring vertex based on a neighbor list of the at least one input vertex; and

outputting the executable code generated based on the at least one input vertex and the at least one neighboring vertex.

6. The method of claim 2 , wherein outputting the executable code based on the traverse of the multiple graph objects comprise:

obtaining at least one input vertex of the multiple graph objects;

obtaining at least one neighboring vertex based on a neighbor list of the at least one input vertex;

mapping at least one operation of the at least one input vertex based on at least one target platform;

mapping at least one operation of the at least one neighboring vertex based on at least one target platform; and

outputting the executable code generated based on the mapped operation of the input vertex and the mapped operation of the at least one neighboring vertex.

7. A computing device comprising:

one or more processors; and

a non-transitory computer-readable memory storing instructions executable by the one or more processors, wherein the one or more processors are configured to:

obtain a neural network model, wherein the neural network model is programed to run on at least one platform;

obtain an initial intermediate representation (IR) code by encoding the neural network model, and obtaining a target IR code by adding decorations to the initial IR code based on a target platform; and

output an executable code optimized to run on the target platform by decoding the target IR code, wherein the one or more processors configured to output the executable code optimized to run on the target platform by decoding the target IR code are further configured to:

obtain multiple graph objects based on a scan of the target IR code; and

output the executable code based on a traverse of the multiple graph objects.

8. The computing device of claim 7 , wherein the decorations are associated with target platforms that comprise graphics processing unit (GPU), central processing unit (CPU), and field-programmable gate array (FPGA) hardware.

9. The computing device of claim 7 , wherein the one or more processors configured to obtain the multiple graph objects based on the scan of the target IR code are further configured to:

obtain a general graph object based on the scan of the target IR code; and

obtain the multiple graph objects based on the general graph object, wherein the multiple graph objects are optimized to run on different target platforms.

10. The computing device of claim 9 , the one or more processors configured to obtain the multiple graph objects based on the general graph object are further configured to:

obtain the multiple graph objects based on the general graph object; and

optimize the multiple graph objects to run on the different target platforms based on vertices in the at least one graph object being fused into a vertex that combines operations together.

11. The computing device of claim 7 , wherein the one or more processors configured to output the executable code based on the traverse of the multiple graph objects are further configured to:

obtain at least one input vertex of the multiple graph objects;

obtain at least one neighboring vertex based on a neighbor list of the at least one input vertex; and

output the executable code generated based on the at least one input vertex and the at least one neighboring vertex.

12. The computing device of claim 7 , wherein the one or more processors configured to output the executable code based on the traverse of the multiple graph objects are further configured to:

obtain at least one input vertex of the multiple graph objects;

obtain at least one neighboring vertex based on a neighbor list of the at least one input vertex;

map at least one operation of the at least one input vertex based on at least one target platform;

map at least one operation of the at least one neighboring vertex based on at least one target platform; and

output the executable code generated based on the mapped operation of the input vertex and the mapped operation of the at least one neighboring vertex.

13. A non-transitory computer-readable storage medium storing a plurality of programs for execution by a computing device having one or more processors, wherein the plurality of programs, when executed by the one or more processors, cause the computing device to perform acts comprising:

obtaining a neural network model, wherein the neural network model is programed to run on at least one platform;

obtaining an initial intermediate representation (IR) code by encoding the neural network model, and obtaining a target IR code by adding decorations to the initial IR code based on a target platform; and

outputting an executable code optimized to run on the target platform by decoding the target IR code, wherein the plurality of programs further cause the computing device to perform:

obtaining multiple graph objects based on a scan of the target IR code; and

outputting the executable code based on a traverse of the multiple graph objects.

14. The non-transitory computer-readable storage medium of claim 13 , wherein the decorations are associated with target platforms that comprise graphics processing unit (GPU), central processing unit (CPU), and field-programmable gate array (FPGA) hardware.

15. The non-transitory computer-readable storage medium of claim 13 , wherein the plurality of programs further cause the computing device to perform:

obtaining a general graph object based on the scan of the target IR code; and

obtaining the multiple graph objects based on the general graph object, wherein the multiple graph objects are optimized to run on different target platforms.

16. The non-transitory computer-readable storage medium of claim 15 , wherein the plurality of programs further cause the computing device to perform:

obtaining the multiple graph objects based on the general graph object; and

optimizing the multiple graph objects to run on the different target platforms based on vertices in the at least one graph object being fused into a vertex that combines operations together.

17. The non-transitory computer-readable storage medium of claim 13 , wherein the plurality of programs further cause the computing device to perform:

obtaining at least one input vertex of the multiple graph objects;

obtaining at least one neighboring vertex based on a neighbor list of the at least one input vertex; and

outputting the executable code generated based on the at least one input vertex and the at least one neighboring vertex.

18. The non-transitory computer-readable storage medium of claim 13 , wherein the plurality of programs further cause the computing device to perform:

obtaining at least one input vertex of the multiple graph objects;

obtaining at least one neighboring vertex based on a neighbor list of the at least one input vertex;

mapping at least one operation of the at least one input vertex based on at least one target platform;

mapping at least one operation of the at least one neighboring vertex based on at least one target platform; and

outputting the executable code generated based on the mapped operation of the input vertex and the mapped operation of the at least one neighboring vertex.

Assignments (4)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 28, 2024
From: BEIJING DAJIA INTERNET INFORMATION TECHNOLOGY CO. LTD.,
To: BEIJING TRANSTREAMS TECHNOLOGY CO. LTD.
Reel/Frame 066941/0319 →
CORRECTIVE ASSIGNMENT TO CORRECT THE APPLICATION 11830480 TO PATENT NUMBER PREVIOUSLY RECORDED AT REEL: 66622 FRAME: 672. ASSIGNOR(S) HEREBY CONFIRMS THE ASSIGNMENT . Recorded Mar 12, 2024
From: KWAI INC.
To: BEIJING DAJIA INTERNET INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 066795/0775 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Mar 1, 2024
From: KWAI INC.
To: BEIJING DAJIA INTERNET INFORMATION TECHNOLOGY CO., LTD.
Reel/Frame 066622/0672 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 11, 2021
From: PENG, ZHEN; LIU, YANG; HUANG, HANXIAN; REN, YONGXIONG; YANG, JISHEN; LIU, LINGZHI; CHEN, XIN
To: KWAI INC.
Reel/Frame 058092/0191 →
Continuity (1)
Related Publication 20230143291A1 · May 11, 2023