Skip to Content
在企业中实施 MLOps
book

在企业中实施 MLOps

by Yaron Haviv, Noah Gift
May 2025
Intermediate to advanced
380 pages
4h 56m
Chinese
O'Reilly Media, Inc.
Content preview from 在企业中实施 MLOps

第 10 章 使用 Rust 实现 MLOps 使用 Rust 实现 MLOps

本作品已使用人工智能进行翻译。欢迎您提供反馈和意见:translation-feedback@oreilly.com

任何技术系统都必须以运营效率为核心。MLOps 建立在 DevOps 的基础之上,而 DevOps 建立在日语中持续改进(kaizen)的概念之上。没有持续改进,就不会有 DevOps,进而也就不会有 MLOps。

持续改进运营的核心是一个简单的问题:"我们能否将运营绩效(从培训和推理到包装和交付)提高十倍或更多?如果答案是肯定的,就像许多使用 Python 进行数据科学分析的组织一样,那么下一个问题就应该是:"我们为什么不这样做?"我们为什么不这样做?

几十年来,在机器学习解决方案方面,除了纯 C、C++ 或 C# 和 Python 之外,企业几乎没有其他选择。C++ 在性能方面可能提供更高的效率,但 Python 通常更容易学习、实现和维护,这也是 Python 在数据科学领域风生水起的原因。在性能优异但复杂的 C++ 和易学但相对缓慢的 Python 之间艰难抉择,最终导致许多公司选择了 Python。

但还有另一种方法。Rust 一直是性能和能效最高的语言之一。在Stack Overflow 的年度开发者调查中,它也是最受喜爱的语言之一。虽然数据科学中广泛使用的一些 Python 库是用 C 语言编写的,可以提供运行编译语言的一些性能优势,但 Rust 在使用单一语言的同时提供了更直接的裸机路径。

Rust 的学习和使用也远比 C 或 C++ 容易,这让它成为那些希望获得编译语言性能的人的现实解决方案。使用GitHub Copilot 时尤其如此。这个由人工智能驱动的结对编程助手使用 OpenAI Codex,在开发人员编码时实时向他们推荐代码和整个函数。接下来让我们讨论一下这一策略。

备注

人工智能驱动的结对编程助手指的是对传统结对编程方式的改进,即你坐在另一位开发人员旁边,一起编写代码。借助GitHub Copilot X 等新兴开发人员工具,您可以与编码助手聊天,了解编码项目的想法,并在输入时获得编码建议。

为 MLOps 引入 Rust 的理由

GitHub Copilot是开发人员工作方式的革命性新变革。GitHub Copilot 和类似工具改变了游戏规则,因为它们最大程度地减少了语法对工作效率的影响。使用 Rust,你可以花更多时间编译代码,这是对未来回报的投资,就像在退休账户中为未来储蓄一样。Rust 具有出色的性能和安全性,但语法可能具有挑战性。有了 GitHub Copilot,语法就不再是问题,因为它的建议消除了编程中的许多困难。此外,由于 Rust 工具链在着色、格式化和编译方面的强大功能,GitHub Copilot 的任何错误或错误启动都会被这些工具捕捉到,从而使 Rust 和 GitHub Copilot 的组合成为人工智能辅助编码的新兴领跑者。

备注

除了性能之外,还有几个原因需要考虑 Rust。Rust 是一种现代语言,于 2010 年首次出现。它没有老式语言的包袱,但已经足够成熟,不会很快消失。此外,其他趋势也支持对 Rust 进行认真研究。

Rust 从设计之初就支持多核线程等现代计算功能,而这些功能通常是 "附加 "在 Python 等老式语言上的。通过从一开始就设计支持这些功能的语言,Rust 可以避免许多其他语言的尴尬。Rustrayon 库中的以下代码片段就是一个很好的例子,它说明了多核线程在

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

实用 MLOps

实用 MLOps

Noah Gift, Alfredo Deza
MLOps 权威指南

MLOps 权威指南

Noah Gift, Alfredo Deza
软件架构指标

软件架构指标

Christian Ciceri, Dave Farley, Neal Ford, Andrew Harmel-Law, Michael Keeling, Carola Lilienthal, João Rosa, Alexander von Zitzewitz, Rene Weiss, Eoin Woods

Publisher Resources

ISBN: 9798341657106