IP Library Granted Patent US 12,474,903
Granted Patent B1
US 12,474,903 · App. 18/386,178 · Granted Nov 18, 2025

Systems and methods for automatically generating computer programming code and schedules and comparing their performance

Inventors: Ivan Garcia Alsina (Framingham, MA); Partha Biswas (Wayland, MA); Jianyi Li (Framingham, MA)
Assignee: The Math Works, Inc.
G06F8/41G06F8/10G06F8/31G06F8/315G06F8/35G06F8/36G06F8/42G06F8/443G06F8/447G06F8/451G06F8/51G06F8/52G06F8/75G06F9/3005G06F9/30174G06F9/38873G06F9/45558G06F9/4881
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 12,474,903
App. No.
18/386,178
Granted
Nov 18, 2025
Kind
B1
Abstract

Systems and methods utilize an auto-scheduler of a Domain Specific Language (DSL) to schedule one or more portions of a computer program written in a programming language other than the DSL. Portions of the computer program compatible with the DSL may be identified. The portions may be translated to a form compatible with the DSL. The DSL may generate schedules for the portions. Code may be generated for the computer program and the code may be executed. The schedules generated by the DSL may be utilized during execution of the code generated for the computer program.

Claims (53)

1 . A computer-implemented method comprising:

accessing a computer program written in a first programming language, the computer program including tensor-based operations that are implemented as programming idioms or vectorized statements of the first programming language;

receiving information on resources of a target hardware system;

receiving an identification of a scheduler of a second programming language different from the first programming language;

generating, by one or more processors, a first Intermediate Representation (IR) of the computer program;

partitioning the first IR of the computer program into a plurality of partitions wherein the plurality of partitions include the tensor-based operations, the partitioning including searching the first IR for the programming idioms or the vectorized statements;

generating, by the one or more processors, an IR for the plurality of partitions, the Intermediate Representation for the plurality of partitions compatible with the second programming language;

generating, by the scheduler of the second programming language, a schedule for the plurality of partitions, wherein the generating the schedule includes analyzing the IR for the plurality of partitions, further wherein the scheduler considers the information on the resources of the target hardware system;

generating, by the one or more processors, a second IR for the computer program, wherein the second IR for the computer program includes the schedule for the plurality of partitions as generated by the scheduler of the second programming language; and

generating code based on the second IR for the computer program, wherein the code implements the schedule for the plurality of partitions as generated by the scheduler of the second programming language.

2 . The computer-implemented method of claim 1 further comprising:

receiving identification of a scheduler of a third programming language; and

repeating

the generating the IR for the plurality of partitions,

the analyzing,

the generating the second IR for the computer program, and

the generating code,

with the scheduler of the third programming language.

3 . The computer-implemented method of claim 1 wherein the first programming language is a functional language or an imperative language, the second programming language is a Domain Specific Language (DSL), and the DSL is Halide, Tiramisu, Tensor Algebra Compiler (TACO), Seq, Tensor Comprehensions (TC), Fireiron, or TVM.

4 . The computer-implemented method of claim 1 wherein the first programming language is graphical programming language, Modelica, Octave, Julia, or Python.

5 . The computer-implemented method of claim 1 wherein the second IR for the computer program is a tensor directed acyclic graph (DAG).

6 . The computer-implemented method of claim 1 wherein the resources of the target hardware system include one or more of:

number of cores;

vectorization option;

instruction set extensions;

application-specific instruction set (ASIP);

single instruction multiple data (SIMD) register size;

memory hierarchy;

cache attributes; or

graphics processor unit (GPU).

7 . The computer-implemented method of claim 6 wherein the scheduler considers the information on the resources of the target hardware system to improve execution performance of the plurality of partitions at the target hardware system.

8 . The computer-implemented method of claim 1 wherein the tensor-based operations include one or more of:

neighborhood operations;

stencil operations;

element-wise mathematical operations;

convolution operations;

batch normalization operations;

operations applying a specified function to each element of an array operations applying a given function to each page of an array; or

matrix multiplication operations.

9 . The computer-implemented method of claim 1 wherein the code generated from the second IR for the computer program is:

C code;

C++ code;

CUDA code;

OpenCL code,

Mojo code,

LLVM assembly code, or

MLIR code.

10 . The computer-implemented method of claim 1 wherein the second programming language supports separating an algorithm from an execution schedule for the algorithm.

11 . The computer-implemented method of claim 1 further comprising:

annotating, by the one or more processors, the computer program with scheduler directives or configuration settings that represent the schedule for the tensor-based operations as determined by the scheduler.

12 . The computer-implemented method of claim 1 further comprising:

running the code on the target hardware system; and

evaluating the code as run on the target hardware system.

Assignments (1)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Nov 1, 2023
From: GARCIA ALSINA, IVAN; BISWAS, PARTHA; LI, JIANYI
To: THE MATHWORKS, INC.
Reel/Frame 065425/0710 →
Continuity (1)
Provisional Application 63506988 · Jun 8, 2023
References Cited (21)
US 8566804B1 · Carrick et al. · 2013 [cited by applicant]
US 8990783B1 · Yu et al. · 2015 [cited by applicant]
US 10025566B1 · Ahmed et al. · 2018 [cited by applicant]
US 11036477B2 · Herr · 2021 [cited by examiner]
US 11216752B1 · Welsh et al. · 2022 [cited by applicant]
US 11269639B2 · Herr · 2022 [cited by examiner]
US 11556357B1 · Ghosh et al. · 2023 [cited by applicant]
US 12293299B1 · Sharma · 2025 [cited by examiner]
US 20210174214A1 · Venkatesan · 2021 [cited by examiner]
Navdeep Katel et al., MLIR-Based Code Generation for GPU Tensor Cores, 2022, [Retrieved on Jul. 3, 2025]. Retrieved from the internet: <URL: https://dl.acm.org/doi/pdf/10.1145/3497776.3517770> 12 Pages (117-128) (Year: … [cited by examiner]
Ziheng Wang, Automatic Optimization of Sparse Tensor Algebra Programs, 2020, [Retrieved on Jul. 3, 2025]. Retrieved from the internet: <URL: https://dspace.mit.edu/bitstream/handle/1721.1/127536/1193031233-MIT.pdf?seque… [cited by examiner]
Adams, Andrew, et al., “Learning to Optimize Halide with Tree Search and Random Programs,” ACM, ACM Transactions Graph, vol. 38, No. 4, Article 121, Jul. 2019, pp. 1-12. [cited by applicant]
Chen, Tianqi, et al., “TVM: An Automated End-to-End Optimizing Compiler for Deep Learning,” ACM, Inc., ACM Digital Library, OSDI'18: Proceedings of the 13th USENIX conference on Operating Systems Design and Implementati… [cited by applicant]
Ragan-Kelley, Jonathan, et al., “Decoupling Algorithms from Schedules for Easy Optimization of Image Processing Pipelines,” ACM, ACM Journals, ACM Transactions on Graphics, vol. 31, Issue 4, Article No. 32, Jul. 1, 2012… [cited by applicant]
Ullah, Ubaid, et al., “Towards Optimal Placement and Scheduling of DNN Operations with Pesto,” Association for Computing Machinery, ACM, In 22 [cited by applicant]
Wang, Ziheng, “Automatic Optimization of Sparse Tensor Algebra Programs,” Massachusetts Institute of Technology, Submitted to the Department of Electrical Engineering and Computer Science in partial fulfillment of the r… [cited by applicant]
Wu, Song-Lin, et al., “Accelerating OpenVX Through Halide and MLIR,” Springer, Springer Science+Business Media, LLC, Singer Nature 2023, Journal of Signal Processing Systems, vol. 95, Feb. 1, 2023, pp. 571-584. [cited by applicant]
Zheng, Lianmin, et al., “Ansor: Generating High-Performance Tensor Programs for Deep Learning,” arXiv, arXiv:2006.06762v4 [cs.LG], Nov. 4, 2020, pp. 1-19. [cited by applicant]
Zheng, Lianmin, et al., “Introducing TVM Auto-Scheduler (a.k.a. Ansor),” The Apache Software Foundation, TVM, Mar. 3, 2021, pp. 1-3. [cited by applicant]
Zheng, Lianmin, et al., “Optimizing Operators with Auto-Scheduling,” The Apache Software Foundation, TVM, Retrieved from the Internet: < https://tvm.apache.org/docs/tutorial/auto_scheduler_matmul_x86.html>, Retrieved fr… [cited by applicant]
Zheng, Size, et al., “FlexTensor: An Automatic Schedule Exploration and Optimization Framework for Tensor Computation on Heterogeneous System,” ACM, ASPLOS'20, Session 10A, Lausanne, Switzerland, Mar. 16-20, 2020, pp. 8… [cited by applicant]