Skip to content
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sdk/ml/azure-ai-ml/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
## 1.36.0 (unreleased)

### Features Added
- Added Fabric Spark compute attachment support, including typed attach, detach, get, and list results.
- Added Spark runtime 3.5 support for model monitoring serverless Spark compute while retaining runtime 3.4 support.

### Bugs Fixed
Expand Down
35 changes: 35 additions & 0 deletions sdk/ml/azure-ai-ml/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -5432,6 +5432,41 @@ namespace azure.ai.ml.entities
): ...


class azure.ai.ml.entities.FabricSparkCompute(Compute):
property base_path: str # Read-only
property created_on: Optional[str] # Read-only
property creation_context: Optional[SystemData] # Read-only
property id: Optional[str] # Read-only
property provisioning_errors: Optional[str] # Read-only
property provisioning_state: Optional[str] # Read-only
property type: Optional[str] # Read-only

def __init__(
self,
*,
description: Optional[str] = ...,
environment_id: str,
fabric_workspace_id: str,
identity: Optional[IdentityConfiguration] = ...,
lakehouse_id: str,
name: str,
pool_id: str,
pool_name: Optional[str] = ...,
tags: Optional[Dict[str, str]] = ...,
**kwargs: Any
) -> None: ...

def __repr__(self) -> str: ...

def __str__(self) -> str: ...

def dump(
self,
dest: Union[str, PathLike, IO[AnyStr]],
**kwargs: Any
) -> None: ...


class azure.ai.ml.entities.Feature(RestTranslatableMixin):

def __init__(
Expand Down
3 changes: 2 additions & 1 deletion sdk/ml/azure-ai-ml/api.metadata.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
apiMdSha256: c39d5bf8320fae3388fc50ddcd9e5a7cbca070b46ffced33935ae06133a3364e
apiMdSha256: 4eceeb67e3f43723bec05fb770198bc746d73dd373881d98619979d4fe64393c
packageVersion: 1.36.0
parserVersion: 0.3.31
pythonVersion: 3.12.13
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@
EstimatedVMPrice,
EstimatedVMPrices,
ExternalFQDNResponse,
FabricSpark,

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you confirm that these changes "fabric compute" related do not create regression in existing flows by submitting the samples pipeline: https://dev.azure.com/azure-sdk/internal/_build?definitionId=5066

FabricSparkProperties,
FQDNEndpoint,
FQDNEndpointDetail,
FQDNEndpoints,
Expand Down Expand Up @@ -866,6 +868,8 @@
"EstimatedVMPrice",
"EstimatedVMPrices",
"ExternalFQDNResponse",
"FabricSpark",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As we are adding new type for fabric compute, can you add sample for this in samples folder: https://github.com/Azure/azure-sdk-for-python/tree/main/sdk/ml/azure-ai-ml/samples

"FabricSparkProperties",
"FQDNEndpoint",
"FQDNEndpointDetail",
"FQDNEndpoints",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ class ComputeType(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""DATA_LAKE_ANALYTICS."""
SYNAPSE_SPARK = "SynapseSpark"
"""SYNAPSE_SPARK."""
FABRIC_SPARK = "FabricSpark"
"""FABRIC_SPARK."""


class ComputeWeekDay(str, Enum, metaclass=CaseInsensitiveEnumMeta):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -751,6 +751,64 @@ def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)


class FabricSparkProperties(_Model):
Comment thread
vaibhj marked this conversation as resolved.
"""An existing Fabric workspace, Lakehouse, published Environment, and custom Spark pool."""

fabric_workspace_id: str = rest_field(
name="fabricWorkspaceId", visibility=["read", "create", "update", "delete", "query"]
)
lakehouse_id: str = rest_field(name="lakehouseId", visibility=["read", "create", "update", "delete", "query"])
environment_id: str = rest_field(name="environmentId", visibility=["read", "create", "update", "delete", "query"])
pool_id: str = rest_field(name="poolId", visibility=["read", "create", "update", "delete", "query"])
pool_name: Optional[str] = rest_field(name="poolName", visibility=["read"])

@overload
def __init__(
self,
*,
fabric_workspace_id: str,
lakehouse_id: str,
environment_id: str,
pool_id: str,
pool_name: Optional[str] = None,
) -> None: ...

@overload
def __init__(self, mapping: Mapping[str, Any]) -> None: ...

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)


class FabricSpark(Compute, discriminator="FabricSpark"):
"""An attached Fabric custom Spark pool."""

properties: Optional["_models.FabricSparkProperties"] = rest_field(
visibility=["read", "create", "update", "delete", "query"]
)
compute_type: Literal[ComputeType.FABRIC_SPARK] = rest_discriminator(
name="computeType", visibility=["read", "create", "update", "delete", "query"]
) # type: ignore

@overload
def __init__(
self,
*,
compute_location: Optional[str] = None,
description: Optional[str] = None,
resource_id: Optional[str] = None,
disable_local_auth: Optional[bool] = None,
properties: Optional["_models.FabricSparkProperties"] = None,
) -> None: ...

@overload
def __init__(self, mapping: Mapping[str, Any]) -> None: ...

def __init__(self, *args: Any, **kwargs: Any) -> None:
super().__init__(*args, **kwargs)
self.compute_type = ComputeType.FABRIC_SPARK # type: ignore


class AKS(Compute, discriminator="AKS"):
"""A Machine Learning compute based on AKS.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
directory: specification/machinelearningservices/MachineLearningServices.Management
commit: bce80108d7ce39dccc1e9c2df1b1bd99d018bf7f
directory: specification/machinelearningservices/resource-manager/Microsoft.MachineLearningServices/MachineLearningServices
commit: 99b98e0bdb68f26290317a5b1ad5e7f6a31cc7e6

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed: this source commit is not yet reachable from Azure/azure-rest-api-specs/main. The authoritative FabricSpark contract is in Azure/azure-rest-api-specs#47205, whose published-version Swagger BreakingChange gate is still failing. We cannot replace this pin with a main-reachable commit containing FabricSpark until that upstream PR is approved and merged. I am leaving this thread open rather than claiming the SDK release-validation requirement is met; once the spec lands, I will update the pin to its main-reachable commit, verify the generator contract, and resolve this thread.

This comment was generated by an AI assistant on behalf of the PR author.

repo: Azure/azure-rest-api-specs
additionalDirectories: []
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ---------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# ---------------------------------------------------------

from marshmallow import fields

from azure.ai.ml.constants._compute import ComputeType

from ..core.fields import NestedField, StringTransformedEnum
from .compute import ComputeSchema, IdentitySchema


class FabricSparkComputeSchema(ComputeSchema):
type = StringTransformedEnum(allowed_values=[ComputeType.FABRICSPARK], required=True)
fabric_workspace_id = fields.Str(required=True)
lakehouse_id = fields.Str(required=True)
environment_id = fields.Str(required=True)
pool_id = fields.Str(required=True)
pool_name = fields.Str(dump_only=True)
is_attached_compute = fields.Bool(dump_only=True)
modified_on = fields.Str(dump_only=True)
disable_local_auth = fields.Bool(dump_only=True)
identity = NestedField(IdentitySchema)
6 changes: 4 additions & 2 deletions sdk/ml/azure-ai-ml/azure/ai/ml/constants/_compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ class ComputeType:
ComputeType can be used to specify the compute type for a compute target. It can also be used to
specify the compute type for a compute target that is being created.

Valid values are "managed", "amlcompute", "computeinstance", "virtualmachine", "kubernetes", "DataFactory"
, "synapsespark".
Valid values are "managed", "amlcompute", "computeinstance", "virtualmachine", "kubernetes", "DataFactory",
"synapsespark", and "fabricspark".
"""

MANAGED = "managed"
Expand All @@ -27,6 +27,8 @@ class ComputeType:
"""Data Factory is a compute resource that is managed by Azure Machine Learning."""
SYNAPSESPARK = "synapsespark"
"""Synapse Spark is a compute resource that is managed by Azure Machine Learning."""
FABRICSPARK = "fabricspark"
"""Fabric Spark is an attached custom pool in a Fabric workspace."""


class ComputeTier:
Expand Down
2 changes: 2 additions & 0 deletions sdk/ml/azure-ai-ml/azure/ai/ml/entities/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@
from ._compute.compute_instance import AssignedUserConfiguration, ComputeInstance, ComputeInstanceSshSettings
from ._compute.kubernetes_compute import KubernetesCompute
from ._compute.synapsespark_compute import AutoPauseSettings, AutoScaleSettings, SynapseSparkCompute
from ._compute.fabricspark_compute import FabricSparkCompute
Comment thread
vaibhj marked this conversation as resolved.
from ._compute.unsupported_compute import UnsupportedCompute
from ._compute.virtual_machine_compute import VirtualMachineCompute, VirtualMachineSshSettings
from ._credentials import (
Expand Down Expand Up @@ -399,6 +400,7 @@
"RegistryRegionDetails",
"Registry",
"SynapseSparkCompute",
"FabricSparkCompute",
"AutoScaleSettings",
"AutoPauseSettings",
"WorkspaceModelReference",
Expand Down
18 changes: 16 additions & 2 deletions sdk/ml/azure-ai-ml/azure/ai/ml/entities/_compute/compute.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class Compute(Resource, RestTranslatableMixin):
This class should not be instantiated directly. Instead, use one of its subclasses.

:param type: The compute type. Accepted values are "amlcompute", "computeinstance",
"virtualmachine", "kubernetes", and "synapsespark".
"virtualmachine", "kubernetes", "synapsespark", and "fabricspark".
:type type: str
:param name: Name of the compute resource.
:type name: str
Expand Down Expand Up @@ -106,6 +106,7 @@ def _from_rest_object(cls, obj: ComputeResource) -> "Compute":
from azure.ai.ml.entities import (
AmlCompute,
ComputeInstance,
FabricSparkCompute,
KubernetesCompute,
SynapseSparkCompute,
UnsupportedCompute,
Expand All @@ -118,11 +119,21 @@ def _from_rest_object(cls, obj: ComputeResource) -> "Compute":
ComputeType.VIRTUALMACHINE.lower(): VirtualMachineCompute,
ComputeType.KUBERNETES.lower(): KubernetesCompute,
ComputeType.SYNAPSESPARK.lower(): SynapseSparkCompute,
ComputeType.FABRICSPARK.lower(): FabricSparkCompute,
}
compute_type = obj.properties.compute_type.lower() if obj.properties.compute_type else None

class_type = cast(
Optional[Union[AmlCompute, ComputeInstance, VirtualMachineCompute, KubernetesCompute, SynapseSparkCompute]],
Optional[
Union[
AmlCompute,
ComputeInstance,
VirtualMachineCompute,
KubernetesCompute,
SynapseSparkCompute,
FabricSparkCompute,
]
],
mapping.get(compute_type, None), # type: ignore
)
if class_type:
Expand Down Expand Up @@ -174,6 +185,7 @@ def _load(
from azure.ai.ml.entities import (
AmlCompute,
ComputeInstance,
FabricSparkCompute,
KubernetesCompute,
SynapseSparkCompute,
VirtualMachineCompute,
Expand All @@ -197,6 +209,8 @@ def _load(
if compute_type.lower() == ComputeType.SYNAPSESPARK:
_synapse_spark_load_from_dict: Compute = SynapseSparkCompute._load_from_dict(data, context, **kwargs)
return _synapse_spark_load_from_dict
if compute_type.lower() == ComputeType.FABRICSPARK:
return FabricSparkCompute._load_from_dict(data, context, **kwargs)
msg = f"Unknown compute type: {compute_type}"
raise ValidationException(
message=msg,
Expand Down
Loading
Loading