惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

AI
AI
博客园 - 叶小钗
Blog — PlanetScale
Blog — PlanetScale
Microsoft Azure Blog
Microsoft Azure Blog
Vercel News
Vercel News
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
MyScale Blog
MyScale Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
量子位
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
阮一峰的网络日志
阮一峰的网络日志
D
Docker
Jina AI
Jina AI
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
The Register - Security
The Register - Security
J
Java Code Geeks
S
SegmentFault 最新的问题
月光博客
月光博客
G
Google Developers Blog
美团技术团队
Last Week in AI
Last Week in AI
L
LangChain Blog
Apple Machine Learning Research
Apple Machine Learning Research
T
The Blog of Author Tim Ferriss
腾讯CDC
Recent Announcements
Recent Announcements
Recorded Future
Recorded Future
The Cloudflare Blog
有赞技术团队
有赞技术团队
博客园_首页
博客园 - 聂微东
人人都是产品经理
人人都是产品经理
B
Blog
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
F
Fortinet All Blogs
B
Blog RSS Feed
Engineering at Meta
Engineering at Meta
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
Microsoft Security Blog
Microsoft Security Blog
MongoDB | Blog
MongoDB | Blog
爱范儿
爱范儿
D
DataBreaches.Net
F
Full Disclosure
M
MIT News - Artificial intelligence
博客园 - 司徒正美
H
Help Net Security

Synthesist in the Shell — A blog by Linghao Zhang

A Taxonomy Is a Theory of What Differences Matter Evolving Memory Systems: An Eval-First Approach Memory Systems Are Evolved, Not Designed Code as Config: The Start of Software Speciation The Bespoke Flywheel The Negative Space of AI Memory My 2025 Games of the Year My 2025 Games of the Year Why You Should Probably Work on AI Engineering AI Assisted System Design Interview Prep Hotel California Hotel California How To Be Great 101 Lessons Learned Building LLM Applications Naming Matters: DRI vs. Owner in Software Projects Becoming a Staff Engineer Demystifying TLMs Learnings as a Tech Lead Notes: Staff Engineer Self Awareness with Tools Editing Technical Direction Rethinking Pessimism Superficial Similarity Grow @ Google 03: 文档意识与培养新人 我的时间管理系统 Notes: A Philosophy of Software Design 「程序员」和「软件工程师」是一回事吗? Grow @ Google 02: 「能用就行」还远远不够 Excerpts from Permanent Records David Perell 关于在线写作的建议 Grow @ Google 01: Noogler 成长的必经之痛 Excerpts from Blindsight 过去这五年,我学到了什么 利器访谈:创造者和他们的工具 Notes: The Effective Engineer 过去这五年 Notes: Steven Pinker on Linguistics, Style and Writing Notes: Programming Beyond Practices 如何提高英语水平 DIY 留学申请全攻略 Notes: Alistair Croll on Lean Analytics and Growth Hacking 初心 Notes: How Technology is Hijacking Your Mind 如何备考 TOEFL/GRE Learning How to Learn 课程笔记
Why is ML Runtime Infra So Hard
2024-11-09 · via Synthesist in the Shell — A blog by Linghao Zhang

This post is my rough thoughts on the topic while I onboard to the problem space. I wrote this mainly for myself and it's bound to contain problematic statements and reasoning. Take it with a grain of salt. I'd appreciate any discussions on the topic.


Let's loosely define an ML Runtime System as a software stack that bridges ML frameworks (think PyTorch, Tensorflow, Jax) and hardware accelerators (think NVIDIA H100s, TPUs), enabling ML developers to (primarily) train and serve ML models. For simplicity, let's also largely disregard the fact that hardware is being constantly iterated on. Instead we focus on engineering software systems based on the currently available set of hardware.

Building such systems seems to be widely considered challenging. Why is that?

Computing on a specific software-hardware stack is already no small feat. Some common requirements to solve for are:

  • Efficiency: To maximize performance goals such as throughput / latency and hardware utilization.
  • Ease of use: To make it easy for different user personas to do their work.
  • Scalability: Bigger problems often simply require more resources. But adding more resources doesn't automatically solve the problem -- think distributed system challenges.

On "traditional" stacks, however, this is relatively speaking a solved problem. The domain has been around for longer and the number of variables at play is limited. For instance, developers of distributed query processing systems are mostly only dealing with machines that can be abstracted away as compute resources with CPUs and RAMs. Things like different CPU ISAs, for example, are implementation details. There are also decades worth of frameworks, abstractions, design patterns, and best practices that have been well validated.

An ML program, on the other hand, typically has more diverse computing requirements, which in turn necessitates, among other things, a range of hardware accelerators. Each accelerator typically comes with its own software stack. Therefore we end up with multiple interweaving "stacks" of software-hardware paths.

Why? A ML program might need to do:

  • Computation-intensive numerical programs - best on GPUs / TPUs
  • More general-purpose logic for e.g. pre- and post-processing - best on CPUs
  • Memory-bound operations such as embedding lookups
  • To make things more complicated, any of the above can be further optimized with bespoke architectural changes, e.g. with disaggregated serving.

In essence, an ML program can be viewed as a computational graph that describes any number of computation units that run in arbitrary orders and on heterogeneous hardware. It's not hard to see how this creates magnitudes more complexities than, say, a system that only runs general-purpose logic purely on CPUs. It's a challenging but highly interesting and rewarding problem space.

As a result, an ML Runtime Infra, which typically consists of more than one runtime system, often struggles to balance a number of requirement dimensions:

  • CUJs: Model training and serving have very different computational characteristics.
  • User personas: Research and production users have very different priorities. One demands iteration speed and flexibility while the other pursues SLOs and robustness.
  • Software/hardware optionality: Users want to leverage whatever languages/frameworks that are best for the job; Similarly, a company might have a diverse pool of hardware that all need to be well supported to achieve good utilization.

To mitigate the complexity, a lot of intermeidate layers were introduced (e.g. see Why are ML Compilers so Hard? ), resulting in a deep stack where end-to-end expertise is hard to build and maintain. At the same time, the overall landscape in this space is usually fragmented. There are often multiple ways to do one thing and the best we can do is to create "well-lit paths" for major CUJs. And that needs to be constantly adapted to catch up with research advancements and hardware iterations and availability. Creating a small number (ideally 1) of general-purpose, catch-all solution for each sufficiently disjoint CUJ is aspiring but often not achievable due to various constraints (e.g. opportunity cost from diverting resources to perfect infrastructure instead of building applications, prohibitive migration costs for existing models, etc).

In summary, I see ML Runtime Infra as a natural evolution from the previous generations of computing software. The challenges ultimately stem from the inherent complexity of the problem space. The fragmented landspace we see today is not inevitable IMO. Eventually, this space should mature just like its "predecessors" and the challenge then might be on some new computing paradigm not yet imaginable. Do you agree?