Skip to content

Releases: snowflakedb/snowflake-ml-python

1.8.6

18 Jun 21:12
950a646
Compare
Choose a tag to compare

1.8.6

Bug Fixes

New Features

  • Registry: Add service container info to logs.

1.8.5

28 May 01:43
66197a8
Compare
Choose a tag to compare

1.8.5

Bug Fixes

  • Registry: Fixed a bug when listing and deleting container services.
  • Registry: Fixed explainability issue with scikit-learn pipelines, skipping explain function creation.
  • Explainability: bump minimum streamlit version down to 1.30

1.8.4

12 May 21:17
6910e96
Compare
Choose a tag to compare

1.8.4

Bug Fixes

  • Registry: Default enable_explainability to True when the model can be deployed to Warehouse.
  • Registry: Add custom_model.partitioned_api decorator and deprecate partitioned_inference_api.
  • Registry: Fixed a bug when logging pytroch and tensorflow models that caused
    UnboundLocalError: local variable 'multiple_inputs' referenced before assignment.

Breaking change

  • ML Job: Updated property id to be fully qualified name; Introduced new property name to represent the ML Job name
  • ML Job: Modified list_jobs() to return ML Job name instead of id
  • Registry: Error in log_model if enable_explainability is True and model is only deployed to
    Snowpark Container Services, instead of just user warning.

New Features

  • ML Job: Extend @remote function decorator, submit_file() and submit_directory() to accept database and
    schema parameters
  • ML Job: Support querying by fully qualified name in get_job()
  • Explainability: Added visualization functions to snowflake.ml.monitoring to plot explanations in notebooks.
  • Explainability: Support explain for categorical transforms for sklearn pipeline
  • Support categorical type for xgboost.DMatrix inputs.

1.8.3

28 Apr 19:53
5e30f0e
Compare
Choose a tag to compare

1.8.3

Bug Fixes

Behavior Change

New Features

  • Registry: Default to the runtime cuda version if available when logging a GPU model in Container Runtime.
  • ML Job: Added as_list argument to MLJob.get_logs() to enable retrieving logs
    as a list of strings
  • Registry: Support ModelVersion.run_job to run inference with a single-node Snowpark Container Services job.
  • DataConnector: Removed PrPr decorators

1.8.2

15 Apr 20:59
dde003f
Compare
Choose a tag to compare

1.8.2

Bug Fixes

Behavior Change

New Features

  • ML Job now available as a PuPr feature
  • ML Job: Add ability to retrieve results for @remote decorated functions using
    new MLJobWithResult.result() API, which will return the unpickled result
    or raise an exception if the job execution failed.
  • ML Job: Pre-created Snowpark Session is now available inside job payloads using
    snowflake.snowpark.context.get_active_session()
  • Registry: Introducing save_location to log_model using the options argument.
    User's can provide the path to write the model version's files that get stored in Snowflake's stage.
  • Registry: Include model dependencies in pip requirements by default when logging in Container Runtime.
reg.log_model(
    model=...,
    model_name=...,
    version_name=...,
    ...,
    options={"save_location": "./model_directory"},
)
  • ML Job (PrPr): Add instance_id argument to get_logs and show_logs method to support multi node log retrieval
  • ML Job (PrPr): Add job.get_instance_status(instance_id=...) API to support multi node status retrieval

1.8.1

26 Mar 21:19
92ff883
Compare
Choose a tag to compare

1.8.1

Bug Fixes

  • Registry: Fix a bug that caused unsupported model type error while logging a sklearn model with score_samples
    inference method.
  • Registry: Fix a bug that model inference service creation fails on an existing and suspended service.

Behavior Change

New Features

  • ML Job (PrPr): Update Container Runtime image version to 1.0.1
  • ML Job (PrPr): Add enable_metrics argument to job submission APIs to enable publishing service metrics to Event Table.
    See Accessing Event Table service metrics
    for retrieving published metrics
    and Costs of telemetry data collection
    for cost implications.
  • Registry: When creating a copy of a ModelVersion with log_model, raise an exception if unsupported arguments are provided.

1.8.0

20 Mar 18:33
9709d06
Compare
Choose a tag to compare

1.8.0

Bug Fixes

  • Modeling: Fix a bug in some metrics that allowed an unsupported version of numpy to be installed
    automatically in the stored procedure, resulting in a numpy error on execution
  • Registry: Fix a bug that leads to incorrect Model is does not have _is_inference_api error message when assigning
    a supported model as a property of a CustomModel.
  • Registry: Fix a bug that inference is not working when models with more than 500 input features
    are deployed to SPCS.

Behavior Change

  • Registry: With FeatureGroupSpec support, auto inferred model signature for transformers.Pipeline models have been
    updated, including:

    • Signature for fill-mask task has been changed from

      ModelSignature(
          inputs=[
              FeatureSpec(name="inputs", dtype=DataType.STRING),
          ],
          outputs=[
              FeatureSpec(name="outputs", dtype=DataType.STRING),
          ],
      )

      to

      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,),
              ),
          ],
      )
    • Signature for token-classification task has been changed from

      ModelSignature(
          inputs=[
              FeatureSpec(name="inputs", dtype=DataType.STRING),
          ],
          outputs=[
              FeatureSpec(name="outputs", dtype=DataType.STRING),
          ],
      )

      to

      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,),
              ),
          ],
      )
    • Signature for question-answering task when top_k is larger than 1 has been changed from

      ModelSignature(
          inputs=[
              FeatureSpec(name="question", dtype=DataType.STRING),
              FeatureSpec(name="context", dtype=DataType.STRING),
          ],
          outputs=[
              FeatureSpec(name="outputs", dtype=DataType.STRING),
          ],
      )

      to

      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,),
              ),
          ],
      )
    • Signature for text-classification task when top_k is None has been changed from

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

      to

      ModelSignature(
          inputs=[
              FeatureSpec(name="text", dtype=DataType.STRING),
          ],
          outputs=[
              FeatureSpec(name="label", dtype=DataType.STRING),
              FeatureSpec(name="score", dtype=DataType.DOUBLE),
          ],
      )
    • Signature for text-classification task when top_k is not None has been changed from

      ModelSignature(
          inputs=[
              FeatureSpec(name="text", dtype=DataType.STRING),
              FeatureSpec(name="text_pair", dtype=DataType.STRING),
          ],
          outputs=[
              FeatureSpec(name="outputs", dtype=DataType.STRING),
          ],
      )

      to

      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,),
              ),
          ],
      )
    • Signature for text-generation task has been changed from

      ModelSignature(
          inputs=[FeatureSpec(name="inputs", dtype=DataType.STRING)],
          outputs=[
              FeatureSpec(name="outputs", dtype=DataType.STRING),
          ],
      )

      to

      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,),
              )
          ],
      )
  • Registry: PyTorch and TensorFlow models now expect a single tensor input/output by default when logging to Model
    Registry. To use multiple tensors (previous behavior), set options={"multiple_inputs": True}.

    Example with single tensor input:

    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)

    For multiple tensor inputs/outputs, use:

    reg.log_model(
        model=model,
        ...,
        sample_input_data=[data_x_1, data_x_2],
        options={"multiple_inputs": True}
    )
  • Registry: Default enable_explainability to False when the model can be deployed to Snowpark Container Services.

New Features

  • Registry: Added support to single torch.Tensor, tensorflow.Tensor and tensorflow.Variable as input or output
    data.
  • Registry: Support xgboost.DMatrix
    datatype for XGBoost models.

1.7.5

06 Mar 18:53
e5329b9
Compare
Choose a tag to compare

1.7.5

  • Support Python 3.12.
  • Explainability: Support native and snowml sklearn pipeline

Bug Fixes

  • Registry: Fixed a compatibility issue when using snowflake-ml-python 1.7.0 or greater to save a tensorflow.keras
    model with keras 2.x, if relax_version is set or default to True, and newer version of snowflake-ml-python
    is available in Snowflake Anaconda Channel, model could not be run in Snowflake. If you have such model, you could
    use the latest version of snowflake-ml-python and call ModelVersion.load to load it back, and re-log it.
    Alternatively, you can prevent this issue by setting relax_version=False when saving the model.
  • Registry: Removed the validation that disallows data that does not have non-null values being passed to
    ModelVersion.run.
  • ML Job (PrPr): No longer require CREATE STAGE privilege if stage_name points to an existing stage
  • ML Job (PrPr): Fixed a bug causing some payload source and entrypoint path
    combinations to be erroneously rejected with
    ValueError(f"{self.entrypoint} must be a subpath of {self.source}")
  • ML Job (PrPr): Fixed a bug in Ray cluster startup config which caused certain Runtime APIs to fail

Behavior Change

New Features

  • Registry: Added support for handling Hugging Face model configurations with auto-mapping functionality.
  • Registry: Added support for keras 3.x model with tensorflow and pytorch backend
  • ML Job (PrPr): Support any serializable (pickleable) argument for @remote decorated functions

1.7.4

28 Jan 19:49
ae87f58
Compare
Choose a tag to compare

1.7.4

Bug Fixes

  • Registry: Fixed an issue that the hugging face pipeline is loaded using incorrect dtype.
  • Registry: Fixed an issue that only 1 row is used when infer the model signature in the modeling model.

Behavior Changes

  • Registry: ModelVersion.run on a service would require redeploying the service once account opts into nested function.

New Features

  • Add new snowflake.ml.jobs preview API for running headless workloads on SPCS using
    Container Runtime for ML
  • Added guardrails option to Cortex complete function, enabling
    Cortex Guard support

1.7.3

09 Jan 20:29
9abffca
Compare
Choose a tag to compare

1.7.3

  • Added lowercase versions of Cortex functions, added deprecation warning to Capitalized versions.
  • Bumped the requirements of fsspec and s3fs to >=2024.6.1,<2026
  • Bumped the requirement of mlflow to >=2.16.0, <3
  • Registry: Support 500+ features for model registry

Bug Fixes

  • Registry: Fixed a bug when providing non-range index pandas DataFrame as the input to a ModelVersion.run.
  • Registry: Improved random model version name generation to prevent collisions.
  • Registry: Fix an issue when inferring signature or running inference with Snowpark data that has a column whose type
    is ARRAY and contains NULL value.
  • Registry: ModelVersion.run now accepts fully qualified service name.
  • Monitoring: Fix issue in SDK with creating monitors using fully qualified names.
  • Registry: Fix error in log_model for any sklearn models with only data pre-processing including pre-processing only
    pipeline models due to default explainability enablement.

Behavior Changes

New Features

  • Added user_files argument to Registry.log_model for including images or any extra file with the model.
  • Registry: Added support for handling Hugging Face model configurations with auto-mapping functionality
  • DataConnector: Add new DataConnector.from_sql() constructor