96属什么生肖| 地势是什么意思| 什么是嗳气有何症状| 做梦梦到捡钱是什么征兆| 阿莫西林有什么副作用| 户口所在地是什么意思| 牛三合生肖是什么| 胃热是什么原因| 凉烟都有什么牌子| 腿抽筋是什么问题| 眩晕是怎么回事是什么原因引起| 君子兰叶子发黄是什么原因| 直言不讳是什么意思| 五行缺木是什么意思| 阿耨多罗三藐三菩提是什么意思| evisu是什么牌子中文| 蜈蚣咬了擦什么药最好| 什么是同性恋| 扁桃体肿大有什么症状| 感恩节为什么要吃火鸡| 梦笔生花的意思是什么| 沙悟净是什么生肖| 米诺地尔有什么副作用| 胸闷气短吃什么特效药| 四维什么时候做最佳| gm是什么牌子| 血小板高是什么病| 午饭吃什么| earth是什么意思| 是非是什么意思| 乙肝五项45阳性是什么意思| 活塞是什么意思| 什么是道| 什么叫做绝对值| 吃什么能养肝护肝| 无异于是什么意思| 什么是磁共振| 督邮相当于现在什么官| 宫闱是什么意思| hiit是什么意思| 口腔溃疡缺什么维生素| 无力感是什么意思| 前三个月怀孕注意什么| 争是什么生肖| 味精是什么提炼出来的| 只是女人容易一往情深是什么歌| 母螳螂为什么要吃公螳螂| 大象鼻子为什么那么长| 复杂性囊肿是什么意思| 孕晚期脚肿是什么原因| 蒙古族的那达慕大会是在什么时候| 威海有什么特产| 冰粉为什么要加石灰水| 除湿气吃什么| rst是什么意思| 什么瓜| 勇敢地什么| 额是什么意思| 攻坚是什么意思| 骨刺吃什么药| 梅州有什么大学| 白马怕青牛是什么意思| 猴年马月是什么时候| 蓝风铃香水什么味道| 第一次要注意什么| 手指倒刺是什么原因| 穆斯林为什么不吃猪肉| 好不热闹是什么意思| 1.7号是什么星座| 三百年前是什么朝代| 梅核气有什么症状| 5月12号是什么星座| 五十坐地能吸土是什么意思| 兔对冲生肖是什么| 脑梗可以吃什么水果| 贝母是什么| 血糖高吃什么水果好能降糖| 女子与小人难养也什么意思| 眉毛中间长痘痘是什么原因| 声带小结是什么意思| 5月3日什么星座| 什么样的细雨| 介入室是干什么的| plv是什么意思| 肝炎有什么症状| 凤字五行属什么| 左侧脖子疼是什么原因| 大便带血丝是什么原因| 黄龙玉产地在什么地方| 什么叫矫正视力| 高铁动力来源是什么| 火腿是什么肉| 心绪是什么意思| tf口红是什么牌子| 四个鱼念什么| 蜜饯是什么意思| 不孕不育都检查什么项目| 吃完泡面吃什么解毒| 免冠照片是什么意思| 万能血型是什么血型| 荠菜长什么样| 胎儿头围偏大什么原因| 痛风用什么药治疗最好| 生气过度会气出什么病| 平板支撑练什么| 孕酮低吃什么药| 湿寒吃什么中成药| 雅漾喷雾有什么功效| 每天都做梦是什么原因| 乳腺增生是什么| 菲妮迪女装是什么档次| 3.21什么星座| 三鹿奶粉现在叫什么| 茶苯海明片是什么药| 什么是碳水化合物食物| 肝阳虚吃什么中成药| aivei是什么品牌| 眼角膜是什么| 绣眼鸟吃什么| 梦见老宅是什么意思| 娃娃流鼻血是什么原因| 肚脐眼上面痛是什么原因引起的| 膝盖后面的窝叫什么| 三观是指什么| 更年期是什么时候| 肾病吃什么水果好| ems是什么意思| 血压太低有什么危害| 苹果枸杞红枣煮水喝有什么功效| 女人内心强大说明什么| 银镯子变黑是什么原因| 11月有什么节日| 天天喝啤酒对身体有什么危害| 1921年是什么年| 直采是什么意思| 柠檬水苦是什么原因| 命门是什么意思| 750是什么金| 钟字五行属什么| 涤棉是什么材质| 心脏不舒服挂什么科室| 什么是孤独| 脚突然肿了是什么原因| 阅字五行属什么| 汗味重是什么原因| 天公作美是什么生肖| 骨折吃什么好的快| 胀气吃什么药| 无春年是什么意思| 精神障碍是什么病| 柠檬水苦是什么原因| 木薯粉在超市里叫什么| 6月22日什么星座| 肾阳虚是什么意思| 女孩名字带什么字好听| 海带排骨汤海带什么时候放| 口爆什么意思| 磁共振和核磁共振有什么区别| 双角子宫是什么意思| 苏轼是什么之一| 6月29号是什么星座| 万马奔腾是什么生肖| 风向标是什么意思| 什么是阴历什么是阳历| 吃什么水果降血压| 吃什么能快速降血压| nbcs是什么意思| 各位同仁用在什么场合| 榴莲为什么是水果之王| 女性体寒 吃什么好| 温州冬至吃什么| 慢性胃炎吃什么药| 屙是什么意思| 十月七号什么星座| 为什么得带状疱疹| cc代表什么意思| 打压什么意思| 什么降血糖| 属猪的守护神是什么菩萨| 脚背发麻是什么原因引起的| 为什么喜欢一个人| 了什么意思| ir是什么意思| 婴儿肥是什么意思| 末梢神经炎吃什么药| 心电图诊断窦性心律什么意思| 早上起来不晨勃是什么原因| 脚底痛是什么原因| 率的部首是什么| 喝什么最解渴| 胃酸吃什么药效果最好| 上热下寒吃什么食物好| 社保缴费基数什么意思| 小腿肚疼是什么原因| 经常腿麻是什么原因| 减肥可以吃什么肉| 什么水果含叶酸最多| 肠胃不好吃什么| 肠胃挂什么科| pku什么意思| 普门品是什么意思| 药流有什么危害| 亚型是什么意思| 肝郁气滞吃什么中成药| 玻尿酸是干什么用的| 硬膜囊前缘受压是什么意思| 脚筋膜炎什么办法恢复的最快| 夏天煲鸡汤放什么材料| 钻石王老五是什么意思| 运是什么结构| 口什么心什么| 羊可以加什么偏旁| 乙肝是什么病严重吗| 工口是什么意思| 中国的国宝是什么| 什么样的女人招人嫉妒| 尿毒症能吃什么水果| 海藻是什么植物| 氢什么意思| 气阴两虚吃什么中成药| 血糖高的人可以吃什么水果| 牙周炎吃什么消炎药| 绿茶不能和什么一起吃| 过期橄榄油有什么用途| 澳门有什么特产| 领衔是什么意思| 博五行属性是什么| 为什么月经期有性冲动| 鼻尖疼是什么原因| 湿疹用什么药膏最有效| 突然头晕是什么原因| 1967年出生属什么| 宫颈肥大有什么症状| 豆角没熟中毒什么症状| 毕婚族是什么意思| 什么的城堡| 做梦怀孕了是什么意思| 核磁和ct有什么区别| 吝啬鬼是什么生肖| 428是什么意思| 吃什么去肝火| 诸葛亮属相是什么生肖| 什么叫法西斯| 绊倒是什么意思| 好嘛是什么意思| 消症是什么意思| 放屁多是什么原因呢| 梦见被追杀预示什么| 精神恍惚是什么症状| 战五渣是什么意思| 红和绿混合是什么颜色| 喜欢紫色的人是什么性格| 什么胆什么心| 梦到发洪水是什么征兆| 这是什么地方| 6月18什么星座| 什么名字好听女生| 头不舒服去医院挂什么科| 恍然大悟什么意思| 群青色是什么颜色| 六个月宝宝可以吃什么水果| 月子里头疼是什么原因| 新疆什么时候天黑| 眼睛痒吃什么药| 百度
Skip to content

The case for using Rust in MLOps

Level up your Rust skills and push MLOps forward with GitHub Copilot.

Artwork: Susan Haejin Lee

Photo of Noah Gift
Pragmatic AI Labs logo

Noah Gift // Executive in Residence, Duke University and Founder, Pragmatic AI Labs

The ReadME Project amplifies the voices of the open source community: the maintainers, developers, and teams whose contributions move the world forward every day.

Operational efficiency must be at the core of any technology system. MLOps builds upon DevOps, which in turn builds on the concept of kaizen, the Japanese word for continuous improvement. Without continuous improvement, you wouldn’t have DevOps or, by extension, MLOps.


In this Guide, you will learn how to:

  1. Apply best practices for sustainability and energy efficiency by using the Rust language.

  2. Level up to using a more robust language, Rust, with GitHub Copilot.

  3. Think differently about the false appearance of progress in data science and MLOps projects.


At the heart of continuously improving operations is a simple question: “Can we improve operational performance—from training and inference to packaging and delivery—by ten times or more?” If the answer is yes, as it will be with many organizations using Python for data science, the next question should be: "Why are we not doing it?"?

For decades, organizations had few options besides pure C/C++ and Python for machine learning solutions. C++ may provide more efficiency in terms of performance, but Python is generally easier to learn, implement, and maintain, which is why Python has taken off in data science. The hard choice between the performant but complex C++ and the easy-to-learn but comparatively slow Python ultimately results in many companies choosing Python.

But there is another way. Rust consistently ranks among the most performant and energy-efficient languages. It also happens to be among the most loved languages in StackOverflow’s annual developer survey. Though some Python libraries widely used in data science are written in C and can provide some of the performance benefits of running a compiled language, Rust provides a more direct route to bare metal while using a single language.?

Rust is also far easier to learn and use than C or C++, which makes it a realistic solution for those who want the performance of a compiled language. That’s especially the case when using GitHub Copilot, an AI-powered pair programmer that uses the OpenAI Codex to suggest code and entire functions in real time to developers while they code. Let's discuss this strategy next.

We want to hear from you! Join us on GitHub Discussions.

The case for Rust for MLOps

GitHub Copilot is a revolutionary new change in the way developers work. GitHub Copilot and tools like it are a game changer since they minimize the impact of syntax on productivity. With Rust, you spend more time working on compiling code, which is an investment in future returns, much like saving for the future in a retirement account. Rust has great performance and safety, but the syntax can be challenging. With GitHub Copilot, the syntax becomes less of an issue since the suggestions eliminate many of the difficulties in programming. Additionally, because of the robustness of the Rust toolchain for linting, formatting, and compiling, any errors or false starts from GitHub Copilot are caught by the these tools, making the combination of Rust and GitHub Copilot an emergent front-runner in AI-assisted coding.

There are several reasons to consider Rust other than performance. Rust is a modern language that first appeared in 2010. It lacks the baggage that older languages carry, but it’s established enough that we can rest assured it isn’t going anywhere anytime soon. Further, other trends are supporting a hard look at Rust.

Rust was designed from the ground up to support modern computing capabilities, like multi-core threads, that are often “bolted on” to older languages like Python. By designing the language to support these features from the start, Rust can avoid the awkwardness found in many other languages. A great example of how simple multi-core threads are in Rust is the following snippet from the Rust rayon library:

1
2
3
4
5
6
use rayon::prelude::*;
fn sum_of_squares(input: &[i32]) -> i32 {
    input.par_iter()
         .map(|i| i * i)
         .sum()
}

There are no gimmicks or hacks to the code; the threads “just work” across all the machine cores, and the code is just as readable as Python.?

Likewise, Rust was built to support typing, so the entire toolchain from the linter to the editor to the compiler can leverage this capability. Rust also makes packaging a breeze. Cargo provides a Python-esque “one obvious way” to install packages.

Of course there are still areas where Python excels. It’s fantastic for API documentation and readability in general. If you need to try out an idea, it is hard to beat using Python in an interactive prompt, like IPython, to explore a concept. But MLOPs is more sensitive to performance requirements than other data science fields, and is heavily dependent on software engineering best practices that are better implemented with Rust. A new superset of Python called Mojo might solve many performance and deployment issues in the near future, but it's still in development while Rust is available in the here and now.

?One common objection to the use of Rust is that it doesn’t have as large and established an ecosystem as Python does for working with data. But keep in mind that this ecosystem isn’t necessarily tuned to the needs of MLOps. In particular, the stack I call #jcpennys (Jupyter, Conda, Pandas, Numpy, Sklearn) is straight from academia, heavyweight, and optimized for use with small data. In academics, there is much to be said for a "God environment" with everything in one spot. But in real-world production MLOps, you don't want extra packages or brittle tools that are difficult to test, like notebooks. Meanwhile, the Rust ecosystem is growing. For example, Polars is a performant data frame library.

Leveling up with Rust, GitHub Copilot, and Codespaces

Let's look at how you can use the GitHub ecosystem to level up to a more robust language in Rust.

All Rust projects can follow this pattern:

  1. Create a new repo using Rust New Project Template.

  2. Create a new Codespace and use it.

  3. Use main.rs to call the handle CLI and lib.rs to handle logic and import clap in Cargo.toml as shown in this project.

  4. Use cargo init --name 'hello' or whatever you want to call your project.

  5. Put your "ideas" in as comments in Rust to seed GitHub Copilot, i.e //build anadd function

  6. Run make format i.e. cargo format

  7. Run make lint i.e. cargo clippy --quiet

  8. Run project: cargo run -- --help

  9. Push your changes to allow GitHub Actions to format check, lint check, and other actions like binary deploy.

This is a new emerging pattern ideal for systems programming in Rust, as certain combinations lead to new advances. For example, steel is a composite of iron and carbon, making a new substance stronger and harder than iron. Similarly, GitHub Copilot’s suggestions combined with a next generation compiled language like Rust and its ecosystem of formatting, linting, and packaging tools leads to the computer science equivalent of an alloy: a new, stronger solution to computational problems.

Flow chart depicting modern programming with prompt engineering for Rust MLOps and cloud computing

Here’s an example repository.

A good starting point for a new Rust project is the following pattern:

To run: cargo run -- marco --name "Marco"

Be careful to use the NAME of the project in the Cargo.toml to call lib.rs as in:

1
2
[package]
name = "hello"

For example, see the name `hello` invoked alongside marco_polo, which is in lib.rs

lib.rs code:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
rust
/* A Marco Polo game. */
/* Accepts a string with a name.
If the name is "Marco", returns "Polo".
If the name is "any other value", it returns "Marco".
*/
pub fn marco_polo(name: &str) -> String {
    if name == "Marco" {
        "Polo".to_string()
    } else {
        "Marco".to_string()
    }
}

main.rs code:

1
2
3
4
5
6
7
8
9
10
Rust
fn main() {
    let args = Cli::parse();
    match args.command {
        Some(Commands::Marco { name }) => {
            println!("{}", hello::marco_polo(&name));
        }
        None => println!("No command was used"),
    }
}

Retrofitting a VW bug from the 1970s with modern EV technology is a suboptimal financial strategy. Similarly, bolting more and more non-native components onto Python is a suboptimal strategy when, instead, you could choose a new language when appropriate. Additionally, the old paradigm of mixing C with Python needs to be clarified if a developer can use one language and replace both with Rust.

In distributed computing, performance does matter, as does cybersecurity, energy usage, and binary distribution of software. Rust has a lot of compelling use cases for MLOps, and additional examples are in the Rust MLOps repo as well as a tutorial including notes from the Duke cloud computing course teaching Rust with GitHub Copilot.

We want to hear from you! Join us on GitHub Discussions.

We shouldn't treat software languages like sports teams we “root for.” The pragmatic practitioner looks for tools that efficiently solve problems. Languages like Go and Rust have emerged as solutions for high-performance computing, and Rust, in particular, shines at cybersecurity safety, a weakness of most languages like C and Python. The slight increase in complexity will pay off for organizations in the form of fewer bugs, more secure code, less toil for developers when managing packages and dependency, and lower compute costs.??

As you look around your organization, you’re bound to find numerous areas that can benefit from Rust’s improved cost profiles. Embedding ML models inside of command line tools is a great place to start. This could open up a new world of possibilities for sophisticated, binary-distributed tools. Microsoft has also adopted Rust bindings for the ONNX Runtime, which should increase the likelihood of new emerging embedded solutions in binary command line tools. Likewise, edge and embedded ML are ideal targets for Rust, since it is an excellent solution for low-memory and lower-energy workloads. Even if you start small, you’re bound to find some big wins.

Noah Gift is a distinguished technologist, entrepreneur, educator, and author with expertise in cloud computing, machine learning, and artificial intelligence. Renowned for developing innovative software solutions, Noah has founded multiple technology startups and taught at prestigious institutions, including Duke University, Northwestern University, and the University of California, Berkeley. A prolific author, Noah has written and co-authored books on topics such as cloud-native applications and machine learning workflows, empowering readers with the skills to excel in the evolving tech landscape. His contributions to the field have earned him recognition and respect within the technology community.

About The
ReadME Project

Coding is usually seen as a solitary activity, but it’s actually the world’s largest community effort led by open source maintainers, contributors, and teams. These unsung heroes put in long hours to build software, fix issues, field questions, and manage communities.

The ReadME Project is part of GitHub’s ongoing effort to amplify the voices of the developer community. It’s an evolving space to engage with the community and explore the stories, challenges, technology, and culture that surround the world of open source.

Follow us:

Nominate a developer

Nominate inspiring developers and projects you think we should feature in The ReadME Project.

Support the community

Recognize developers working behind the scenes and help open source projects get the resources they need.

Sign up for the newsletter

Sharpen your open source skills with tips, tools, and insights. Delivered monthly.

三亚在海南的什么位置 血小板低是什么原因 维生素E什么牌子的效果最好 腿肿吃什么药消肿最快最有效 梦到拉粑粑是什么意思
气管炎的症状吃什么药好得快 心里难受是什么原因 笨拙是什么意思 检查腰部挂什么科 逼宫什么意思
上元节是什么节日 生育登记有什么用 口臭去医院挂什么科室看病 大理有什么好玩的 鸡爪烧什么好吃
guess什么牌子 昱这个字念什么 珍珠婚是什么意思 鹰嘴桃什么时候成熟 暖五行属什么
胰腺炎是什么病严重吗hcv8jop1ns9r.cn 什么是有意义的东西hcv8jop2ns1r.cn 阴道息肉长什么样hcv9jop0ns7r.cn 身上痒是什么原因引起的shenchushe.com lalpina是什么牌子hcv9jop1ns5r.cn
全科医学科看什么病hcv7jop4ns8r.cn 阴湿是什么病kuyehao.com 男性霉菌感染用什么药hcv8jop4ns2r.cn 吃什么推迟月经hcv9jop1ns4r.cn k9什么意思naasee.com
lsd是什么hcv9jop3ns3r.cn 235是什么意思hcv7jop9ns0r.cn 卡罗莱手表是什么档次hcv8jop6ns6r.cn 产检挂什么科室inbungee.com 百雀羚属于什么档次hcv7jop6ns9r.cn
肛门湿疹用什么药膏最有效hcv7jop7ns4r.cn 吃什么长头发快hcv9jop1ns0r.cn 打鸡血是什么意思hcv8jop3ns0r.cn 14年属什么生肖hcv9jop0ns2r.cn 一朝一夕是什么意思hcv8jop3ns4r.cn
百度