Snowflake ML 版本说明¶
本文包含 Snowflake ML 的版本说明,包括以下内容(如果适用):
行为变更
新功能
面向客户的错误修复
备注
这些说明未包含尚未公开宣布的功能的变更。此类功能可能会显示在 Snowflake ML 源代码中,但不会显示在公开的文档中。
有关文档,请参阅 Snowflake ML:端到端机器学习。
验证 snowflake-ml-python 包¶
所有 Snowflake 包都带有签名,允许您验证其来源。要验证 snowflake.ml.python 包,请按照以下步骤操作:
安装
cosign。此示例使用 Go 安装:使用 Go 安装 cosign (https://edu.chainguard.dev/open-source/sigstore/cosign/how-to-install-cosign/#installing-cosign-with-go)。从 PyPi (https://pypi.org/project/snowflake-ml-python/#files) 等存储库下载文件。
从 GitHub 版本页面 (https://github.com/snowflakedb/snowflake-ml-python/releases/) 下载该版本的
.sig文件。使用
cosign验证签名。例如:
cosign verify-blob snowflake_ml_python-1.7.0.tar.gz --key snowflake-ml-python-1.7.0.pub --signature resources.linux.snowflake_ml_python-1.7.0.tar.gz.sig
cosign verify-blob snowflake_ml_python-1.7.0.tar.gz --key snowflake-ml-python-1.7.0.pub --signature resources.linux.snowflake_ml_python-1.7.0
备注
此示例使用包版本 1.7.0 的库和签名。使用您正在验证的版本的文件名。
弃用声明¶
snowflake.ml.fileset.FileSet已弃用,并将在未来版本中移除。改为使用 snowflake.ml.dataset.Dataset 和 snowflake.ml.data.DataConnector。snowflake.ml.cortex中的“CamelCase”函数名称已弃用,将在未来版本中移除。改为使用这些函数的“snake_case”名称。例如,使用classify_text代替ClassifyText。partitioned_inference_api装饰器已弃用,并将在未来版本中移除。请改用custom_model.partitioned_api。The
additional_payloadsargument of theMLJob.submit_*methods has been deprecated and will be removed in a future release. Use theimportsargument instead.
Version 1.16.0 (2025-10-06)¶
错误修复¶
模型注册表错误修复:
Remove redundant pip dependency warnings when
artifact_repository_mapis provided for warehouse model deployments.
新功能¶
New modeling features:
Support for
scikit-learnversions earlier than 1.8.
新的 ML 作业功能:
Support for configuring the runtime image via the
runtime_environmentparameter at submission time. You may specify an image tag or a full image URL.Examples for
@remotedecorator andsubmit_filefunction:@remote(compute_pool, stage_name = 'payload_stage', runtime_environment = '1.8.0') submit_file('/path/to/repo/test.py', compute_pool, stage_name = 'payload_stage', runtime_environment = '/mydb/myschema/myrepo/myimage:latest')
新的模型注册表功能:
Ability to mark model methods as volatile or immutable. Volatile methods may return different results when called multiple times with the same input, while immutable methods always return the same result for the same input. Methods in supported model types are immutable by default, while methods in custom models are volatile by default. Use the
Volatilityenum to specify the volatility of model methods when logging a model as follows:from snowflake.ml.model.volatility import Volatility options = { "embed_local_ml_library": True, "relax_version": True, "save_location": "/path/to/my/directory", "function_type": "TABLE_FUNCTION", "volatility": Volatility.IMMUTABLE, "method_options": { "predict": { "case_sensitive": False, "max_batch_size": 100, "function_type": "TABLE_FUNCTION", "volatility": Volatility.VOLATILE, }, }
Version 1.15.0 (2025-09-29)¶
行为变更¶
模型注册表行为变更:
Drop support for deprecated
conversationaltask type for Hugging Face models. This task type has been deprecated by Hugging Face for some time and is due for removal from their API imminently.
Version 1.14.0 (2025-09-18)¶
新功能¶
新的 ML 作业功能:
The
additional_payloadsargument of theMLJob.submit_*methods has been renamedimportsto better reflect its purpose.additional_payloadshas been deprecated and will be removed in a future release.
Version 1.13.0 (2025-09-11)¶
新功能¶
新的模型注册表功能:
You can now log a HuggingFace model without having to load the model in memory using
huggingface_pipeline.HuggingFacePipelineModel. Requires thehuggingface_hubpackage. To disable downloading from the HuggingFace repository, palldownload_snapshot=Falsewhen instantiatinghuggingface_pipeline.HuggingFacePipelineModel.You can now use XGBoost's
enable_categorical=Truemodels to with pandas DataFramesWhen listing services, the PrivateLink inference endpoint in shown in the
ModelVersionlist.
Version 1.12.0 (2025-09-04)¶
错误修复¶
模型注册表错误修复:
Fixed an issue where the string representation of dictionary-type output columns was being incorrectly created during structured output deserialization, losing the original data type.
Fixed an inference server performance issue for wide (500+ features) and JSON inputs.
新功能¶
新的模型注册表功能:
You can now log text-generation models with signatures compatible with OpenAI chat completion compatible signature, as shown in the following example:
from snowflake.ml.model import openai_signatures import pandas as pd mv = snowflake_registry.log_model( model=generator, model_name=..., ..., signatures=openai_signatures.OPENAI_CHAT_SIGNATURE, ) # create a pd.DataFrame with openai.client.chat.completions arguments like below: x_df = pd.DataFrame.from_records( [ { "messages": [ {"role": "system", "content": "Complete the sentence."}, { "role": "user", "content": "A descendant of the Lost City of Atlantis, who swam to Earth while saying, ", }, ], "max_completion_tokens": 250, "temperature": 0.9, "stop": None, "n": 3, "stream": False, "top_p": 1.0, "frequency_penalty": 0.1, "presence_penalty": 0.2, } ], )
New Model Monitoring features:
Model monitors now support segment columns to enable filtered analysis, specified in the
segment_columnsfield in the model monitor source options. Segment columns must exist in the source table and be of string type.add_segment_columnanddrop_segment_columnmethods are provided to add or remove segment columns in existing model monitors.
Version 1.11.0 (2025-08-12)¶
新功能¶
新的模型注册表功能:
Made
image_repoargument optional inModelVersion.create_service. If not specified, a default image repository is used.
错误修复¶
ML Jobs bug fixes:
Fixed
TypeError: SnowflakeCursor.execute() got an unexpected keyword argument '_force_qmark_paramstyle'inside stored procedure.Fixed
Error: Unable to retrieve head IP addresswhen not all instances start within the timeout period.
版本 1.10.0(2025 年 8 月 1 日)¶
新功能¶
新的模型注册表功能:
为
ModelVersion.create_service和ModelVersion.log_model添加了进度条。来自
ModelVersion.create_service的日志现已写入到文件。日志文件的位置在控制台内显示。
版本 1.9.2(2025 年 7 月 28 日)¶
错误修复¶
DataConnector 错误修复:
修复了导致提及
self._session错误的问题。
模型注册表错误修复:
修复了在模型签名和 Pandas 数据处理程序中,向数组 (
pd.dtype('O')) 传递 None 时的错误。
版本 1.9.1(2025 年 7 月 18 日)¶
错误修复¶
模型注册表错误修复:
修复了 HuggingFace 文本生成模型有多个 EOS 词元时设置 PAD 词元的错误。处理程序现在会选择第一个 EOS 词元作为 PAD 词元。
新功能¶
新 DataConnector 功能:
现在,可以对 DataConnector 对象执行 pickle 操作。
新数据集功能:
现在,可以对数据集对象执行 pickle 操作。
新的模型注册表功能:
Snowpark Container Services 上托管的模型现在支持广泛的输入(500 多项功能)。
版本 1.9.0(2025 年 6 月 25 日)¶
行为变更¶
ML 作业行为变更:
从
list_jobs方法中移除了scope参数。向
list_jobs方法添加了可选的database和schema参数。list_jobs方法现在返回的是 Pandas DataFrame,而非 Snowpark DataFrame。list_jobs方法现在会返回以下列:name、status、message、database_name、schema_name、owner````compute_pool、target_instances、created_time和completed_time。
模型注册表行为变更:
在
log_model调用中指定pip_requirements时将relax_version设置为 false。仅在指定的
target_platforms上触发UserWarning,以处理无关警告
错误修复¶
模型注册表错误修复:
修复了启用 QUOTED_IDENTIFIERS_IGNORE_CASE 参数后,将 Snowpark DataFrame 转换为 Pandas DataFrame 时失败的问题
修复了模型打包期间重复的
UserWarning日志条目
新功能¶
新的模型注册表功能:
用于表示目标平台 (
snowflake.ml.model.target_platform.TargetPlatform)、目标平台常量和任务 (snowflake.ml.model.task.Task) 的新 APIs。log_model方法中的target_platform实参现在会接受一个TargetPlatformMode常量,该常量可以是 WAREHOUSE_ONLYSNOWPARK_CONTAINER_SERVICES_ONLY 或 BOTH_WAREHOUSE_AND_SNOWPARK_CONTAINER_SERVICES。
新的 ML 作业功能:
不太常用的作业提交实参已移至
**kwargs。平台指标默认处于启用状态。
在此版本中,单节点 ML 作业 APIs 现在处于稳定状态,并已被标示为正式发布。
版本 1.8.6(2025 年 6 月 18 日)¶
新功能¶
新的模型注册表功能:
向日志添加了服务容器信息
版本 1.8.5(2025 年 5 月 27 日)¶
行为变更¶
ML 作业行为变更:
在作业提交 APIs 中,实参
num_instances已重命名为target_instances,现在为必填项。
错误修复¶
模型注册表错误修复:
修复了列出和删除容器服务时的一个错误。
修复了记录未创建
explain函数的 scikit-learn 管道时的错误。记录纯容器模型不会再检查所需
snowflake-ml-python版本在 Snowflake conda 通道中是否可用。
可解释性错误修复:
为了提高兼容性,最低
streamlit版本已降至 1.30。
建模错误修复:
xgboost再次成为必要依赖项(在 v1.8.4 中是可选的)。
新功能¶
ML 作业新功能:
作业装饰器现在具有
min_instances实参,可以让作业等待指定数量的工作器准备就绪后再开始。
版本 1.8.5(2025 年 5 月 12 日)¶
行为变更¶
ML 作业行为变更:
id属性现在是任务的完全限定名称。引入了一个新属性name来表示 ML 作业名称。list_jobs方法现在返回 ML 作业名称,而非作业 ID。
模型注册表行为变更:
在
log_model中,当模型仅部署到 Snowpark Container Services 时启用可解释性现在属于错误而非警告,并且会阻止日志操作完成。
错误修复¶
模型注册表错误修复:
修复了日志记录 PyTorch 和 TensorFlow 模型导致
UnboundLocalError: local variable 'multiple_inputs' referenced before assignment.的一个错误
新功能¶
新的模型注册表功能:
自动为可部署到仓库的模型启用可解释性。
全新可解释性功能:
笔记本的
snowflake.ml.monitoring绘图解释中的全新可视化功能。支持 scikit-learn 管道中的分类转换。
新的建模功能:
支持 XGBoost 模型中
xgboost.DMatrix输入的分类类型。
版本 1.8.3(2025 年 4 月 28 日)¶
新功能¶
新的模型注册表功能:
将支持 GPU 的模型记录到 Container Runtime for ML 以进行部署时,将默认使用 CUDA 容器镜像(如可用)。
模型版本拥有一个
run_job方法,该方法可以将推理方法作为单节点 Snowpark Container Services 作业运行。此方法适用于所有模型,包括那些未部署到 Container Runtime for ML 的模型。在记录分区模型时,目标平台默认为 Snowflake 仓库。
版本 1.8.2(2025 年 4 月 15 日)¶
新功能¶
允许您在本地工作站运行 Container Runtime for ML 上的代码的 ML Jobs API 现已提供预览版。此 API 的文档可在 Snowflake ML API 参考资料中找到,对此 API 的更改也会反映在这些版本说明中。ML Jobs API 中的新功能在正式发布前可能不会显示在此处,但会首先在 API 参考资料中提供。
新的模型注册表功能:
您可以使用
log_model方法中的save_location选项,来指定存储在模型 Snowflake 暂存区中的模型版本文件的写入路径。现在,在 Container Runtime for ML 中记录模型日志时,模型依赖项默认会包含在
pip_requirements中。
版本 1.8.1(2025 年 3 月 20 日)¶
错误修复¶
模型注册表错误修复:
修复了使用
score_samples推理方法记录 scikit-learn 模型日志时的unsupported model type错误。修复了在现有挂起服务上创建推理服务失败的问题。
新功能¶
新的模型注册表功能:
创建使用
log_model的模型版本副本时,如果实参不受支持,现会引发异常。
版本 1.80(2025 年 3 月 20 日)¶
行为变更¶
模型注册表行为变更:
transformers.Pipeline中的自动推理签名已更改为使用FeatureGroupSpec任务类,包括:Fill-mask 任务的签名:
ModelSignature( inputs=[ FeatureSpec(name="inputs", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="outputs", dtype=DataType.STRING), ], )
ModelSignature( inputs=[ FeatureSpec(name="inputs", dtype=DataType.STRING), ], outputs=[ FeatureGroupSpec( name="outputs", specs=[ FeatureSpec(name="sequence", dtype=DataType.STRING), FeatureSpec(name="score", dtype=DataType.DOUBLE), FeatureSpec(name="token", dtype=DataType.INT64), FeatureSpec(name="token_str", dtype=DataType.STRING), ], shape=(-1,), ), ], )
词元分类任务的签名:
ModelSignature( inputs=[ FeatureSpec(name="inputs", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="outputs", dtype=DataType.STRING), ], )
ModelSignature( inputs=[FeatureSpec(name="inputs", dtype=DataType.STRING)], outputs=[ FeatureGroupSpec( name="outputs", specs=[ FeatureSpec(name="word", dtype=DataType.STRING), FeatureSpec(name="score", dtype=DataType.DOUBLE), FeatureSpec(name="entity", dtype=DataType.STRING), FeatureSpec(name="index", dtype=DataType.INT64), FeatureSpec(name="start", dtype=DataType.INT64), FeatureSpec(name="end", dtype=DataType.INT64), ], shape=(-1,), ), ], )
问答任务的签名:
ModelSignature( inputs=[ FeatureSpec(name="question", dtype=DataType.STRING), FeatureSpec(name="context", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="outputs", dtype=DataType.STRING), ], )
ModelSignature( inputs=[ FeatureSpec(name="question", dtype=DataType.STRING), FeatureSpec(name="context", dtype=DataType.STRING), ], outputs=[ FeatureGroupSpec( name="answers", specs=[ FeatureSpec(name="score", dtype=DataType.DOUBLE), FeatureSpec(name="start", dtype=DataType.INT64), FeatureSpec(name="end", dtype=DataType.INT64), FeatureSpec(name="answer", dtype=DataType.STRING), ], shape=(-1,), ), ], )
当
top_k大于 1 时,用于问答任务的签名:ModelSignature( inputs=[ FeatureSpec(name="question", dtype=DataType.STRING), FeatureSpec(name="context", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="outputs", dtype=DataType.STRING), ], )
ModelSignature( inputs=[ FeatureSpec(name="question", dtype=DataType.STRING), FeatureSpec(name="context", dtype=DataType.STRING), ], outputs=[ FeatureGroupSpec( name="answers", specs=[ FeatureSpec(name="score", dtype=DataType.DOUBLE), FeatureSpec(name="start", dtype=DataType.INT64), FeatureSpec(name="end", dtype=DataType.INT64), FeatureSpec(name="answer", dtype=DataType.STRING), ], shape=(-1,), ), ], )
当
top_k为None时,文本分类任务的签名:ModelSignature( inputs=[ FeatureSpec(name="text", dtype=DataType.STRING), FeatureSpec(name="text_pair", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="label", dtype=DataType.STRING), FeatureSpec(name="score", dtype=DataType.DOUBLE), ], )
ModelSignature( inputs=[ FeatureSpec(name="text", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="label", dtype=DataType.STRING), FeatureSpec(name="score", dtype=DataType.DOUBLE), ], )
当
top_k不是None时,文本分类任务的签名:ModelSignature( inputs=[ FeatureSpec(name="text", dtype=DataType.STRING), FeatureSpec(name="text_pair", dtype=DataType.STRING), ], outputs=[ FeatureSpec(name="outputs", dtype=DataType.STRING), ], )
ModelSignature( inputs=[ FeatureSpec(name="text", dtype=DataType.STRING), ], outputs=[ FeatureGroupSpec( name="labels", specs=[ FeatureSpec(name="label", dtype=DataType.STRING), FeatureSpec(name="score", dtype=DataType.DOUBLE), ], shape=(-1,), ), ], )
文本生成任务的签名:
ModelSignature( inputs=[FeatureSpec(name="inputs", dtype=DataType.STRING)], outputs=[ FeatureSpec(name="outputs", dtype=DataType.STRING), ], )
ModelSignature( inputs=[ FeatureGroupSpec( name="inputs", specs=[ FeatureSpec(name="role", dtype=DataType.STRING), FeatureSpec(name="content", dtype=DataType.STRING), ], shape=(-1,), ), ], outputs=[ FeatureGroupSpec( name="outputs", specs=[ FeatureSpec(name="generated_text", dtype=DataType.STRING), ], shape=(-1,), ) ], )
现在,PyTorch 和 TensorFlow 模型在记录到模型注册表时,默认期望单个张量输入和输出。要使用多个张量(以前的行为方式),请设置
options={"multiple_inputs": True}。单张量输入的示例:
import torch class TorchModel(torch.nn.Module): def __init__(self, n_input: int, n_hidden: int, n_out: int, dtype: torch.dtype = torch.float32) -> None: super().__init__() self.model = torch.nn.Sequential( torch.nn.Linear(n_input, n_hidden, dtype=dtype), torch.nn.ReLU(), torch.nn.Linear(n_hidden, n_out, dtype=dtype), torch.nn.Sigmoid(), ) def forward(self, tensor: torch.Tensor) -> torch.Tensor: return cast(torch.Tensor, self.model(tensor)) # Sample usage: data_x = torch.rand(size=(batch_size, n_input)) # Log model with single tensor reg.log_model( model=model, ..., sample_input_data=data_x ) # Run inference with single tensor mv.run(data_x)
对于多张量输入或输出,请使用:
reg.log_model( model=model, ..., sample_input_data=[data_x_1, data_x_2], options={"multiple_inputs": True} )
当模型可以部署到 Snowpark Container Services 时,
enable_explainability现在默认为False。
错误修复¶
建模错误修复:
修复了某些指标中的以下错误:允许在存储过程中自动安装不受支持的 numpy 版本,从而导致在执行时出现 numpy 错误。
模型注册表错误修复:
修复了以下错误:将受支持的模型指定为
CustomModel属性时,会造成不正确的Model does not have _is_inference_api错误消息。修复了以下错误:当具有 500 个以上的输入特征的模型部署到 SPCS 时,推理不起作用。
新功能¶
新的模型注册表功能:
支持使用单个
torch.Tensor、tensorflow.Tensor和tensorflow.Variable作为输入或输出数据。支持 XGBoost 模型的
xgboost.DMatrix datatype。
版本 1.7.5(2025 年 3 月 6 日)¶
snowflake-ml-python 1.7.5 添加了对 Python 3.12 的支持。
错误修复¶
模型注册表错误修复:
修复了一个兼容性问题,当使用
snowflake-ml-python1.7.0 或更高版本保存采用 keras 2.x 的tensorflow.keras模型时,该模型无法在 Snowflake 中运行。当relax_version设置为True``(或默认值)并且有新版本的 ``snowflake-ml-python可用时,会发生此问题。如果您已在日志中记录受影响的模型,则可以使用ModelVerison.load加载模型,然后使用最新版本的snowflake-ml-python重新记录模型日志,从而恢复该模型。移除了阻止将不具有非 null 值的数据传递给
ModelVersion.run的验证。
新功能¶
新的模型注册表功能:
支持具有自动映射功能的 Hugging Face 模型配置。
支持使用 ternsorflow 和 pytorch 后端的 keras 3.x 模型。
新的模型可解释性功能:
支持原生和
snowflake-ml-pythonsklearn 管道。
版本 1.7.4(2025 年 1 月 28 日)¶
重要
snowflake.ml.fileset.FileSet 已弃用,并将在未来版本中移除。改为使用 snowflake.ml.dataset.Dataset 和 snowflake.ml.data.DataConnector。
错误修复¶
注册表错误修复:
修复了使用不正确的数据类型加载 Hugging Face 管道时的问题。
Fixed an issue in which only one row was actually used when inferring a model signature.
新功能¶
新的 Cortex 功能:
Complete函数的全新guardrails选项。
版本 1.7.3(2025 年 1 月 9 日)¶
依赖项升级¶
fsspec和s3fs必须是 2024.6.1 或更高版本,不得低于 2026 版本。mlflow必须是 2.16.0 或更高版本,并且低于 3 版本。
新功能¶
新的 Cortex 功能:
Cortex 函数现在具有“snake_case”名称。 例如,
ClassifyText现在是classify_text。旧的“CamelCase”名称仍然有效,但将从未来版本中移除。
新的模型注册表功能:
注册表现在支持超过 500,000 个功能。
向
Registry.log_model添加了user_files实参以在模型中包含图像或其他文件。添加了对处理具有自动映射功能的 Hugging Face 模型配置的支持。
新数据特性:
添加了
DataConnector.from_sql构造函数。
错误修复¶
注册表错误修复:
修复了在将非范围索引 pandas DataFrame 作为
ModelVersion.run输入时发生的错误。改进了随机模型注册名称生成,以避免冲突。
修复了在使用具有 ARRAY 列类型且包含 NULL 值的 Snowpark DataFrame 推断签名或运行引用时出现的问题
ModelVersion.run现在接受完全限定的服务名称。修复了任何仅包含数据预处理的 scikit-learn 模型(包括仅预处理的管道模型)中的
log_model错误。
监控错误修复:
修复了使用完全限定名称创建监控的问题。