Releases: snowflakedb/snowflake-ml-python
1.30.0
1.30.0
New Features
- Experiment Tracking live logging (PrPr): In SPCS, call
set_live_logging_status(True)to automatically capture and
persist outputs to stdout and stderr while a run is active. The captured logs can be viewed from the Experiments UI. - Registry: Support logging MLflow models created via
mlflow.*.save_model()to the Snowflake Model
Registry. Previously, only models logged throughmlflow.*.log_model()were supported. This also
enables logging custommlflow.pyfunc.PythonModelsubclasses saved locally.
Bug Fixes
- Registry: Fixed Prophet model handler to correctly mark the
predictmethod as partitioned, ensuring it
uses a partitionedTABLE_FUNCTIONwhen deployed to Snowflake. - Registry: Support
text-generationmodels without chat template. The model will have signatures to automatically take
plain strings as input without needing to specify the signatures inlog_model.
The signature can be overridden if the user chooses to.
Behavior Changes
- Registry: Huggingface models with task
text-generationthat do not have chat templates will be logged with signature
that supports plain text (string) as input.
Deprecations
- Registry: Removed support for logging Hugging Face Pipelines in config-only mode. Config-only
models could not run in warehouse and required an External Access Integration (EAI) with egress
to Hugging Face hosts. Use remote logging or local download instead — these approaches support
warehouse execution and store model weights at log time, enabling fully air-gapped services.
1.29.0
1.29.0
New Features
- Model serving: Introducing
InferenceEngine.PYTHON_GENERICenum value.
Users can passInferenceEngine.PYTHON_GENERICto use a Python-based inference server for model serving.
Bug Fixes
- Registry: Fixed a bug where using inference parameters (ParamSpec) with table function or
partitioned model methods would fail at runtime with aNameError. - Registry: Fixed a bug where MLflow models with string columns failed during inference with
"Can not safely convert string to <U0>" errors due to MLflow's schema validation not handling
pd.StringDtypecorrectly.
Behavior Changes
Deprecations
1.28.0
1.28.0
New Features
Bug Fixes
Behavior Changes
Deprecations
1.27.0
1.27.0
New Features
Bug Fixes
-
Registry: Fixed a bug where
model_version.run()required READ privilege on the model instead of
USAGE, causing inference to fail for users with only USAGE privilege granted (introduced in 1.21.0). -
Feature Store: Fixed
register_feature_view()withoverwrite=Truefailing when changing between
external and managed feature views.
Behavior Changes
Deprecations
1.26.0
1.26.0
New Features
- ML Job: Added support for creating
MLJobDefinition(PrPr) and launching jobs with different
arguments without re-uploading payloads.
# /path/to/repo/my_script.py
def main(*args):
print("Hello world", *args)
if __name__ == '__main__':
import sys
main(*sys.argv[1:])
from snowflake.ml.jobs.job_definition import MLJobDefinition
job_def = MLJobDefinition.register(
"/path/to/repo/my_script.py",
# If you register a source directory, provide the entrypoint file:
# entrypoint="/path/to/repo/my_script.py",
compute_pool= "test_comput_pool",
stage_name="payload_stage",
)
job1 = job_def()
job2 = job_def(arg1="ML Job")
from snowflake.ml import jobs
@jobs.remote(compute_pool = "test_compute_pool", stage_name = "payload_stage")
def test_job(arg1: str = "world") -> None:
print(f"hello {arg1}")
# this is a job definition handle
job_def_remote = test_job
job1 = job_def_remote()
job2 = job_def_remote(arg1="ML Job")
- Job-based Batch Inference (PuPr):
ModelVersion.run_batchfor job-based batch inference in Snowpark Container
Services is now in public preview.
from snowflake.ml.registry import Registry
from snowflake.ml.model import OutputSpec
registry = Registry(session)
mv = registry.log_model( ... )
job = mv.run_batch(
compute_pool = "SYSTEM_COMPUTE_POOL_GPU",
X=input_df,
output_spec=OutputSpec(stage_location="@my_db.my_schema.my_stage/output/"),
)- Registry: Added support for inference parameters via
ParamSpecin model signatures. This allows you to define
constant parameters that can be passed at inference time without being part of the input data.
import pandas as pd
from snowflake.ml.model import custom_model, model_signature
from snowflake.ml.registry import Registry
# Define a custom model with inference parameters
class MyModelWithParams(custom_model.CustomModel):
@custom_model.inference_api
def predict(
self,
input_df: pd.DataFrame,
*,
temperature: float = 1.0, # keyword-only param with default
) -> pd.DataFrame:
return pd.DataFrame({"output": input_df["feature"] * temperature})
# Create sample data
model = MyModelWithParams(custom_model.ModelContext())
sample_input = pd.DataFrame({"feature": [1.0, 2.0, 3.0]})
sample_output = model.predict(sample_input, temperature=1.0)
# Define ParamSpec for the inference parameter
params = [
model_signature.ParamSpec(
name="temperature",
dtype=model_signature.DataType.FLOAT,
default_value=1.0,
),
]
# Infer signature with params
sig = model_signature.infer_signature(
input_data=sample_input,
output_data=sample_output,
params=params,
)
# Log model with the signature
registry = Registry(session)
mv = registry.log_model(
model=model,
model_name="my_model_with_params",
version_name="v1",
signatures={"predict": sig},
)
# Run inference with custom parameter value
result = mv.run(sample_input, function_name="predict", params={"temperature": 2.0})-
Feature Store: Added
auto_prefixparameter andwith_name()method to avoid column name collisions when
joining multiple feature views in dataset generation. -
Feature Store: Added support for Dynamic Iceberg Tables as the backing storage for Feature Views.
UseStorageConfigwithStorageFormat.ICEBERGto create Iceberg-backed Feature Views that store
data in open Apache Iceberg format on external cloud storage. A newdefault_iceberg_external_volume
parameter is available inFeatureStoreto set a default external volume for Iceberg Feature Views.
Bug Fixes
Behavior Changes
Deprecations
1.25.1
1.25.1
Bug Fixes
- ML Job: Reverted changes related to the introduction of ML Job Definitions.
1.25.0
1.25.0
New Features
-
ML Job: Added support for creating ML job definitions and launching jobs with different
arguments without re-uploading payloads. -
Inference Autocapture (PuPr): The
create_serviceAPI will now acceptautocaptureas a new argument to indicate
whether inference data will be captured. -
Model serving: Introduced the
min_instancesfield in themv.create_service()and
HuggingFacePipelineModel.log_model_and_create_service()APIs (defaulting to 0). The service now launches
with themin_instancesand automatically scales betweenmin_instancesandmax_instancesbased on
traffic and hardware utilization. Whenmin_instancesis set to 0, the service will automatically suspend
if no traffic is detected for a period of time.
Bug Fixes
Behavior Changes
-
Inference Autocapture (PuPr):
list_services()now showsautocapture_enabledcolumn to indicate if model
service has autocapture enabled. -
Model serving: The
mv.create_service()andHuggingFacePipelineModel.log_model_and_create_service()APIs now
include amin_instancesfield (defaulting to 0). When these APIs are called without specifyingmin_instances,
the system will now launch the service with 1 instance and enable auto scaling. This replaces the previous behavior,
wheremin_instanceswas automatically set to matchmax_instances, resulting in the immediate launch of the
maximum number of instances.
Deprecations
1.24.0
1.24.0
New Features
-
Feature Store: Added tile-based aggregation support with a new
FeatureAPI for efficient and
point-in-time correct time-series feature computation using pre-computed tiles stored in Dynamic Tables. -
Registry: Added auto-signature inference for SentenceTransformer models. When logging a SentenceTransformer
model,sample_input_datais now optional. If not provided, the signature is automatically inferred from
the model's embedding dimension. Supported methods:encode,encode_query,encode_document,
encode_queries,encode_documents.
import sentence_transformers
from snowflake.ml.registry import Registry
# Create model
model = sentence_transformers.SentenceTransformer("all-MiniLM-L6-v2")
# Log model without sample_input_data - signature is auto-inferred
registry = Registry(session)
mv = registry.log_model(
model=model,
model_name="my_sentence_transformer",
version_name="v1",
)
# Run inference with auto-inferred signature (input: "text", output: "output")
import pandas as pd
result = mv.run(pd.DataFrame({"text": ["Hello world"]}))Bug Fixes
Behavior Changes
Deprecations
1.23.0
1.23.0
New Features
- ML Jobs: Enabled support for Python 3.11 and Python 3.12 by default. Jobs will automatically select a
runtime environment matching the client Python version.
Bug Fixes
- Registry: Fix failures on empty output in HuggingFace's Token Classification (aka Named Entity Recognition) models.
- Model serving: don't parse instance or container statuses to fix bug with missing container status.
Behavior Changes
Deprecations
1.22.0
1.22.0
New Features
- Registry: Introducing remotely logging a transformer pipeline model using SPCS job.
# create reference of the model
model = huggingface.TransformersPipeline(
model="TinyLlama/TinyLlama-1.1B-Chat-v1.0",
task="text-generation",
)
# Remotely log the model, a SPCS job will run async and log the model
mv = registry.log_model(
model=model,
model_name="tinyllama_remote_log",
target_platforms=["SNOWPARK_CONTAINER_SERVICES"],
signatures=openai_signatures.OPENAI_CHAT_SIGNATURE,
)