Skip to content

Releases: snowflakedb/snowflake-ml-python

1.30.0

13 Mar 01:26
8a0b9a5

Choose a tag to compare

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 through mlflow.*.log_model() were supported. This also
    enables logging custom mlflow.pyfunc.PythonModel subclasses saved locally.

Bug Fixes

  • Registry: Fixed Prophet model handler to correctly mark the predict method as partitioned, ensuring it
    uses a partitioned TABLE_FUNCTION when deployed to Snowflake.
  • Registry: Support text-generation models without chat template. The model will have signatures to automatically take
    plain strings as input without needing to specify the signatures in log_model.
    The signature can be overridden if the user chooses to.

Behavior Changes

  • Registry: Huggingface models with task text-generation that 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

24 Feb 19:38
48b6aa6

Choose a tag to compare

1.29.0

New Features

  • Model serving: Introducing InferenceEngine.PYTHON_GENERIC enum value.
    Users can pass InferenceEngine.PYTHON_GENERIC to 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 a NameError.
  • 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.StringDtype correctly.

Behavior Changes

Deprecations

1.28.0

17 Feb 21:03
6507ae9

Choose a tag to compare

1.28.0

New Features

Bug Fixes

Behavior Changes

Deprecations

1.27.0

13 Feb 00:08
4c46d2d

Choose a tag to compare

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() with overwrite=True failing when changing between
    external and managed feature views.

Behavior Changes

Deprecations

1.26.0

05 Feb 21:29
261c2bd

Choose a tag to compare

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_batch for 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 ParamSpec in 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_prefix parameter and with_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.
    Use StorageConfig with StorageFormat.ICEBERG to create Iceberg-backed Feature Views that store
    data in open Apache Iceberg format on external cloud storage. A new default_iceberg_external_volume
    parameter is available in FeatureStore to set a default external volume for Iceberg Feature Views.

Bug Fixes

Behavior Changes

Deprecations

1.25.1

03 Feb 23:55
d1be5f7

Choose a tag to compare

1.25.1

Bug Fixes

  • ML Job: Reverted changes related to the introduction of ML Job Definitions.

1.25.0

28 Jan 18:14
b3664c3

Choose a tag to compare

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_service API will now accept autocapture as a new argument to indicate
    whether inference data will be captured.

  • Model serving: Introduced the min_instances field in the mv.create_service() and
    HuggingFacePipelineModel.log_model_and_create_service() APIs (defaulting to 0). The service now launches
    with the min_instances and automatically scales between min_instances and max_instances based on
    traffic and hardware utilization. When min_instances is 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 shows autocapture_enabled column to indicate if model
    service has autocapture enabled.

  • Model serving: The mv.create_service() and HuggingFacePipelineModel.log_model_and_create_service() APIs now
    include a min_instances field (defaulting to 0). When these APIs are called without specifying min_instances,
    the system will now launch the service with 1 instance and enable auto scaling. This replaces the previous behavior,
    where min_instances was automatically set to match max_instances, resulting in the immediate launch of the
    maximum number of instances.

Deprecations

1.24.0

23 Jan 01:40
ea47b33

Choose a tag to compare

1.24.0

New Features

  • Feature Store: Added tile-based aggregation support with a new Feature API 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_data is 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

16 Jan 03:38
1dba704

Choose a tag to compare

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

09 Jan 19:38
bd38256

Choose a tag to compare

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,
)

Bug Fixes

Behavior Changes

Deprecations