Harness the Potential of AI Tools with ChatGPT. Our blog offers comprehensive insights into the world of AI technology, showcasing the latest advancements and practical applications facilitated by ChatGPT’s intelligent capabilities.
Optimizing machine learning models with dynamic shapes can be crucial for achieving better performance and flexibility. Dynamic shapes refer to the ability of a model to handle input data with varying dimensions during runtime. Users utilize frameworks that support dynamic computation graphs, such as TensorFlow’s eager execution or PyTorch. These frameworks allow building models that can adapt to variable input sizes during runtime.
There are many challenges in optimizing machine learning models with dynamic shapes, as many traditional optimizations depend on static shape analysis. The missing information from dynamic dimensions can significantly affect the optimizations one can perform across operators and functions. Models with dynamic shapes need to handle varying batch sizes. Optimizing for different batch sizes can be more challenging than optimizing for a fixed batch size, particularly in production settings.
Current machine learning (ML) compilers usually lower programs to hardware in a traditional single-shot lowering flow, applying one optimization after the other, typically rewriting the program into a lower-level representation. This approach often results in losing shape and additional information between abstraction layers, making it harder to perform incremental optimizations across boundaries.
Researchers present Relax. It is a compiler abstraction for optimizing end-to-end dynamic machine learning workloads. It has first-class symbolic shape annotations to track dynamic shape computations globally across the program. It also has a cross-level abstraction that encapsulates computational graphs, loop-level tensor programs, and library calls in a single representation to enable cross-level optimizations. It is an end-to-end compilation framework to optimize dynamic shape models.
Researchers adopt a forward deduction method that deduces the annotation of an expression based on its input components. Forward deduction is simple and local, and one can obtain annotations for temporary variables during compiler passes. Additionally, when shapes cannot be inferred automatically, the forward deduction can use the results of a user-inserted match cast to continue inferring later annotations.
Researchers say all optimizations in Relax are performed as composable dynamic shape–aware transformations. This incrementally optimizes or partially lowers portions of the computation using different approaches. It considers analysis from other levels and incorporates further optimizations that assume dynamic shape relations.
Experimental results show that Relax compiles and optimizes emerging LLMs onto diverse hardware backends, delivering competitive performance to heavily optimized platform-specific solutions. Additionally, Relax supports LLMs on a broad set of devices and environments, including mobile phones, embedded devices, and web browsers through WebAssembly and WebGPU.
Check out the. All credit for this research goes to the researchers of this project. Also, don’t forget to join and , where we share the latest AI research news, cool AI projects, and more.
We are also onand .
Arshad is an intern at MarktechPost. He is currently pursuing his Int. MSc Physics from the Indian Institute of Technology Kharagpur. Understanding things to the fundamental level leads to new discoveries which lead to advancement in technology. He is passionate about understanding the nature fundamentally with the help of tools like mathematical models, ML models and AI.
Discover the vast possibilities of AI tools by visiting our website at
https://chatgptoai.com/ to delve deeper into this transformative technology.