示例和快速入门

本主题包含几个示例和 Quickstarts,用于介绍在 Snowflake ML 中进行模型记录和模型推理的常见用例。您可以将这些示例用作自己用例的起点。

初学者 Quickstart

开始使用 Snowflake ML:训练 xgboost 回归模型,记录到模型注册表,并在仓库中运行推理。

Quickstart (https://quickstarts.snowflake.com/guide/intro_to_machine_learning_with_snowpark_ml_for_python/#0)

xgboost 模型,Snowpark Container Services 中的 CPU 推理

这段代码说明了在 Snowpark Container Services (SPCS) 中部署 XGBoost 模型,然后使用部署的模型进行推理的关键步骤。

示例

记录具有自定义预处理和模型训练的管道

此示例说明如何:

  • 执行功能工程

  • 使用自定义预处理步骤和 xgboost 预测模型训练管道

  • 运行超参数优化

  • 记录最佳管道

  • 在仓库或 Snowpark Container Services (SPCS) 中运行推理

示例 Notebook (https://github.com/rajshah4/snowflake-notebooks/blob/main/Forecasting_ChicagoBus/Snowpark_Forecasting_Bus_FeatureStore.ipynb)

大规模开源嵌入模型,GPU 推理

本示例使用容器运行时上的 Snowflake Notebooks 从 Hugging Face sentence_transformer 库中训练大规模嵌入模型,并在 Snowpark Container Services (SPCS) 上使用 GPUs 运行大规模预测。

Quickstart (https://quickstarts.snowflake.com/guide/scale-embeddings-with-snowflake-notebooks-on-container-runtime/index.html?index=..%2F..index#0)

具有分布式 PyTorch 推荐模型、GPU 推理的完整管道

本示例展示了如何使用 GPUs 构建端到端分布式 Pytorch 推荐模型,在 Snowpark Container Services (SPCS) 上为 GPU 推理部署模型。

Quickstart (https://quickstarts.snowflake.com/guide/getting-started-with-running-distributed-pytorch-models-on-snowflake/index.html?index=..%2F..index#0)

将外部训练的现有模型(例如 AWS Sagemaker/AzureML/GCP VertexAI)引入 Snowflake

这些示例展示了如何将 AWS Sagemaker、Azure ML 或 GCP Vertex AI 中的现有模型引入 Snowflake(请参阅 博客文章 (link removed) 了解更多详细信息)。

  • AWS 和 Azure ML Quickstart (https://quickstarts.snowflake.com/guide/deploying_models_from_azureml_and_sagemaker_to_snowparkml/index.html?index=..%2F..index#0)

  • GCP Vertex AI Quickstart (https://quickstarts.snowflake.com/guide/getting_started_with_snowpark_for_machine_learning_on_vertexai/index.html?index=..%2F..index#0)

将 MLFlow PyFunc 模型引入 Snowflake

本示例展示了如何在 Snowflake 模型注册表中记录 MLFlow PyFunc 模型并运行推理。

示例

记录用于训练和推理的分区预测模型

本示例展示了如何记录预测模型,以便在 Snowflake 中运行分区训练和推理。

Quickstart (https://quickstarts.snowflake.com/guide/partitioned-ml-model/index.html?index=..%2F..index#0)

将多模型记录为集合,以大规模运行分区推理

本示例展示了如何将数千个模型记录为自定义分区模型,以运行分布式分区推理。

Quickstart (https://quickstarts.snowflake.com/guide/many-model-inference-in-snowflake/#0)

语言: 中文