Skip to Content
Ray 分布式机器学习:利用Ray 进行大模型的数据处理、训练、推理和部署
book

Ray 分布式机器学习:利用Ray 进行大模型的数据处理、训练、推理和部署

by Max Pumperla, Edward Oakes, Richard Liaw
May 2024
Intermediate
252 pages
5h 31m
Chinese
China Machine Press
Content preview from Ray 分布式机器学习:利用Ray 进行大模型的数据处理、训练、推理和部署
Ray
生态及其他
|
221
11.1
蓬勃的生态
1
为了通过具体示例一窥
Ray
的生态
1
,我们将展示如何使用
Ray AIR
结合
PyTorch
生态中的数据和模型、如何使用
MLflow
记录超参数调优,以及如何使
Ray
Gradio
集成部署训练好的模型。在此过程中,还将讨论每个阶段其他
值得注意的集成的使用。
要跟随本章的代码示例,请确保在
Python
环境中安装以下依赖项:
pip install "ray[air, serve]==2.2.0" "gradio==3.5.0" "requests==2.28.1"
pip install "mlflow==1.30.0" "torch==1.12.1" "torchvision==0.13.1"
我们将使用
PyTorch
框架的功能加载和转换数据集,然后将这些数据转换为
Ray
数据集,以便在
Ray AIR
中处理。然后,我们定义一个标准的
PyTorch
型和简单的训练循环,在
Ray Train
中加以训练。接下来,我们在
Tuner
中包装
这个
TorchTrainer
,并使用
Ray Tune
附带的
MLflowLogger
将试验结果记录到
MLflow
中。最后,我们使用运行在
Ray Serve
上的
Gradio
服务训练好的模型。
换句话说,下面介绍的示例使用了常见的
Python
数据科学库,并借助
Ray
的生
态集成将它们包装在
AIR
工作流中。示例的重点是使用的集成,以及它们如何
AIR
通过接口结合使用。
11.1.1
数据加载和处理
6
章介绍了
Ray
数据集的基础知识 ...
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

通过可观测性确保数据与AI的可靠性

通过可观测性确保数据与AI的可靠性

Barr Moses, Michael Segner

Publisher Resources

ISBN: 9787111753384