ML Compiler IR for GPU Inference Task Mapping and Layouts
Find Innovative SolutionsGenerate Solutions
Solution Overview
Problem
Existing machine learning inference systems face challenges in optimizing GPU programs due to complex architectures and memory hierarchies, particularly in expressing fine-grained optimizations for mixed-type tensor operations and low-precision computations, with current compilers lacking expressiveness and requiring manual, error-prone specifications for task mappings and layouts.
Innovation Solution
A tile-based programming language, Hexcute, automates the generation of task and layouts, particularly in the field of machine learning inference systems, by exposing shared memory and register abstractions, and using a type-inference-based algorithm to synthesize task mappings and layouts, reducing programming efforts and improving performance.
Engineering Contradictions & Design Principles
Engineering Contradiction Analysis
1Ease of manufacture
If manual task mapping specifications are used for GPU optimization, then fine-grained control over memory layouts and task mappings is achieved, but programming complexity and error-proneness increase significantly
Solution Approach 1:
The patent introduces a new intermediate representation (IR) that serves as a mediator between high-level Python code and low-level GPU instructions. This IR incorporates tile-based abstractions that automatically handle task mappings and memory layouts, eliminating the need for manual specifications while maintaining fine-grained control. The IR acts as an intermediary layer that translates intuitive high-level operations into optimized low-level code without requiring programmers to directly manage complex GPU architecture details.
2Adaptability or versatility
If existing compiler optimization passes are used, then general GPU program compilation is supported, but fine-grained optimizations for mixed-type tensor operations and low-precision computations cannot be expressed
Solution Approach 1:
The patent segments the compilation process into distinct optimization passes that operate at different levels of abstraction. The new IR introduces tile-based primitives that represent fine-grained computational units, allowing separate optimization passes to target specific aspects of mixed-type tensor operations and low-precision computations. This segmentation enables precise optimizations for specific operation types while maintaining general compiler functionality through the unified IR framework.
3Productivity
If weight-only quantization is applied for LLM compression, then computational efficiency is improved, but the complexity of tensor programming increases due to mixed input types
Solution Approach 1:
The patent changes the parameter representation by introducing a new IR that natively supports mixed-precision data types through tile-based abstractions. Instead of requiring separate handling for different precision types, the IR uses parameter transformations to automatically manage type conversions and optimizations. The tile-based primitives allow the compiler to apply parameter changes at the optimization level, handling mixed input types from weight-only quantization without increasing programming complexity for users.
Data Source
AI summary
A computer system is provided for compiling computer programs using machine learning compilers. The method includes obtaining a first computer program written in a script with a defined programming language dialect for a particular machine learning compiler, defining a higher level intermediate representation (IR) that represents the first computer program written with the defined programming language dialect; generating a second computer program represented in the higher level IR; deriving a plurality of new optimization passes based on the higher level IR; converting the second computer program represented in the higher level IR into a third computer program represented in one or more lower-level IRs that exist in the machine learning compiler; applying a plurality of existing optimization passes to generate an optimized fourth computer program represented in the existing lower-level IR; and converting the optimized fourth computer program represented in the existing lower-level IR-to-machine instructions.


