Skip to content

Commit a40b658

Browse files
authored
Merge pull request #251260 from cloga/lochen-remove-automatic-runtime
remove-automatic runtime
2 parents dbd92ef + 78cac2e commit a40b658

File tree

3 files changed

+8
-121
lines changed

3 files changed

+8
-121
lines changed

articles/machine-learning/prompt-flow/how-to-create-manage-runtime.md

Lines changed: 1 addition & 64 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ ms.topic: how-to
99
author: cloga
1010
ms.author: lochen
1111
ms.reviewer: lagayhar
12-
ms.date: 07/14/2023
12+
ms.date: 09/13/2023
1313
---
1414

1515
# Create and manage runtimes (preview)
@@ -20,22 +20,6 @@ Prompt flow's runtime provides the computing resources required for the applicat
2020
> Prompt flow is currently in public preview. This preview is provided without a service-level agreement, and are not recommended for production workloads. Certain features might not be supported or might have constrained capabilities.
2121
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
2222
23-
## Runtime type
24-
25-
You can choose between two types of runtimes for Prompt flow: [compute instance (CI)](../concept-compute-instance.md), [automatic](../how-to-use-serverless-compute.md) and [managed online endpoint/deployment](../concept-endpoints-online.md). Here are some differences between them to help you decide which one suits your needs.
26-
27-
| Runtime type |Compute instance runtime| Automatic runtime |Managed online deployment runtime (deprecated)|
28-
|----------------------------------------------|------------------------|--------------------|----------------------------------------------|
29-
| Team shared | N |Y |Y|
30-
| User isolation | Y |Y |N|
31-
| OBO/identity support | Y |N |N|
32-
| Easily manually customization of environment | Y |N |N|
33-
| Multiple runtimes on single resource | Y |Y |N|
34-
| Custom virtual network support | Y |N |N|
35-
| Managed virtual network support | Y |N |N|
36-
37-
If you're new to Prompt flow, we recommend you to start with compute instance runtime first.
38-
3923
## Permissions/roles need to use runtime
4024

4125
You need to assign enough permission to use runtime in Prompt flow. To assign a role, you need to have `owner` or have `Microsoft.Authorization/roleAssignments/write` permission on resource.
@@ -107,53 +91,6 @@ When performing a bulk test, you can use the original runtime in the flow or cha
10791

10892
:::image type="content" source="./media/how-to-create-manage-runtime/runtime-authoring-bulktest.png" alt-text="Screenshot of the bulk run and evaluate wizard on the bulk run setting page with runtime highlighted. " lightbox = "./media/how-to-create-manage-runtime/runtime-authoring-bulktest.png":::
10993

110-
### Using automatic runtime in prompt flow authoring
111-
112-
There's `automatic` runtime, which uses serverless compute, when using automatic runtime you didn't need to manage the compute resource manually and environments.
113-
114-
- Compute resource is warming up when you're using it, so the first run may take several minutes to prepare the compute. If you didn't specify `instance_type` when submit flow run we'll use `Standard_E4s_v3` as default instance type. You can use flow UI and CLI / SDK to change it to the other version. Make sure you have enough quota on this instance type.
115-
116-
:::image type="content" source="./media/how-to-create-manage-runtime/runtime-config-automatic-instance-type.png" alt-text="Screenshot of show how to specify instance type in flow. " lightbox = "./media/how-to-create-manage-runtime/runtime-config-automatic-instance-type.png":::
117-
118-
119-
```yaml
120-
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json
121-
flow: <path_to_flow>
122-
data: <path_to_flow_data>
123-
124-
# define cloud resource
125-
resources:
126-
instance_type: Standard_E4s_v3 # use this part to specify instance type for batch run
127-
connections:
128-
note_name1:
129-
connection: <connection_name>
130-
deployment_name: <deployment_name>
131-
note_name2:
132-
connection: <connection_name>
133-
deployment_name: <deployment_name>
134-
```
135-
136-
```python
137-
instance_type = 'Standard_E4s_v3' # use this part to specify instance type for batch run
138-
base_run = pf.run(
139-
flow=flow,
140-
data=data,
141-
runtime=runtime,
142-
connections=connections,
143-
resources={'instance_type': instance_type},
144-
)
145-
```
146-
147-
- In the environment of the runtime support dynamic package installation, you can specify the packages you want in `requirements.txt` in your prompt flow folder. Every time you use the `automatic` runtime, we'll install the packages you defined in `requirements.txt`. You need to ensure in `flow.dag.yaml` you have defined the `python_requirements_txt` in `environment` section.
148-
149-
```yaml
150-
...
151-
environment:
152-
python_requirements_txt: requirements.txt
153-
```
154-
155-
- `automatic` runtime tries its best to reuse the same compute session to provide better performance, if there's no activity in the compute session for 30 minutes, the compute resource will be released.
156-
15794
## Update runtime from UI
15895

15996
We regularly update our base image (`mcr.microsoft.com/azureml/promptflow/promptflow-runtime`) to include the latest features and bug fixes. We recommend that you update your runtime to the [latest version](https://mcr.microsoft.com/v2/azureml/promptflow/promptflow-runtime/tags/list) if possible.

articles/machine-learning/prompt-flow/how-to-customize-environment-runtime.md

Lines changed: 5 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ In your local environment, create a folder contains following files, the folder
3232
|--image_build
3333
| |--requirements.txt
3434
| |--Dockerfile
35-
| |--environment-build.yaml
3635
| |--environment.yaml
3736
```
3837

@@ -67,9 +66,9 @@ RUN pip install -r requirements.txt
6766
> [!NOTE]
6867
> This docker image should be built from prompt flow base image that is `mcr.microsoft.com/azureml/promptflow/promptflow-runtime:<newest_version>`. If possible use the [latest version of the base image](https://mcr.microsoft.com/v2/azureml/promptflow/promptflow-runtime/tags/list).
6968
70-
### Step 2: Use Azure Machine Learning environment to build image
69+
### Step 2: Create custom Azure Machine Learning environment
7170

72-
#### Define your environment in `environment_build.yaml`
71+
#### Define your environment in `environment.yaml`
7372

7473
In your local compute, you can use the CLI (v2) to create a customized environment based on your docker image.
7574

@@ -88,11 +87,11 @@ az account set --subscription <subscription ID>
8887
az configure --defaults workspace=<Azure Machine Learning workspace name> group=<resource group>
8988
```
9089

91-
Open the `environment_build.yaml` file and add the following content. Replace the <environment_name_docker_build> placeholder with your desired environment name.
90+
Open the `environment.yaml` file and add the following content. Replace the <environment_name> placeholder with your desired environment name.
9291

9392
```yaml
9493
$schema: https://azuremlschemas.azureedge.net/latest/environment.schema.json
95-
name: <environment_name_docker_build>
94+
name: <environment_name>
9695
build:
9796
path: .
9897
```
@@ -102,53 +101,12 @@ build:
102101
```bash
103102
cd image_build
104103
az login(optional)
105-
az ml environment create -f environment_build.yaml --subscription <sub-id> -g <resource-group> -w <workspace>
104+
az ml environment create -f environment.yaml --subscription <sub-id> -g <resource-group> -w <workspace>
106105
```
107106

108107
> [!NOTE]
109108
> Building the image may take several minutes.
110109
111-
#### Locate the image in ACR
112-
113-
Go to the environment page to find the built image in your workspace Azure Container Registry (ACR).
114-
115-
:::image type="content" source="./media/how-to-customize-environment-runtime/runtime-update-env-custom-environment-list.png" alt-text="Screenshot of environments on the custom tab. " lightbox = "./media/how-to-customize-environment-runtime/runtime-update-env-custom-environment-list.png":::
116-
117-
Find the image in ACR.
118-
119-
:::image type="content" source="./media/how-to-customize-environment-runtime/runtime-update-env-custom-environment-acr.png" alt-text="Screenshot of environments showing the details tab of the image. " lightbox = "./media/how-to-customize-environment-runtime/runtime-update-env-custom-environment-acr.png":::
120-
121-
> [!IMPORTANT]
122-
> Make sure the `Environment image build status` is `Succeeded` before using it in the next step.
123-
124-
### Step 3: Create a custom Azure Machine Learning environment for runtime
125-
126-
Open the `environment.yaml` file and add the following content. Replace the `<environment_name>` placeholder with your desired environment name and change `<image_build_in_acr>` to the ACR image found in the step 2.3.
127-
128-
```yaml
129-
$schema: https://azuremlschemas.azureedge.net/latest/environment.schema.json
130-
name: <environment_name>
131-
image: <image_build_in_acr>
132-
inference_config:
133-
liveness_route:
134-
port: 8080
135-
path: /health
136-
readiness_route:
137-
port: 8080
138-
path: /health
139-
scoring_route:
140-
port: 8080
141-
path: /score
142-
```
143-
144-
Using following CLI command to create the environment:
145-
146-
```bash
147-
cd image_build # optional if you already in this folder
148-
az login(optional)
149-
az ml environment create -f environment.yaml --subscription <sub-id> -g <resource-group> -w <workspace>
150-
```
151-
152110
Go to your workspace UI page, then go to the **environment** page, and locate the custom environment you created. You can now use it to create a runtime in your Prompt flow. To learn more, see [Create compute instance runtime in UI](how-to-create-manage-runtime.md#create-compute-instance-runtime-in-ui).
153111

154112
To learn more about environment CLI, see [Manage environments](../how-to-manage-environments-v2.md#manage-environments).

articles/machine-learning/prompt-flow/migrate-managed-inference-runtime.md

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,8 @@ From **September 2013**, we'll stop the creation for managed online endpoint/dep
2323

2424
If the existing managed online endpoint/deployment runtime is used by yourself and you didn't share with other users, you can migrate to compute instance runtime.
2525

26-
- Create compute instance yourself or ask the workspace admin to create one for you.
27-
- Using the compute instance to create a runtime. You can reuse the custom environment of the existing managed online endpoint/deployment runtime.
28-
29-
## Migrate to automatic runtime
30-
31-
If the existing managed online endpoint/deployment runtime is shared with other users, you must create a compute instance runtime for everyone. You can also try the new automatic runtime, which can be used in every workspace.
32-
33-
When using the automatic runtime, you don't need to explicitly manage compute resource and environment. Each flow can specify python dependency in `requirements.txt` in `flow.dag.yaml`. You can also change the instance type when submitting the flow. Prompt flow will try its best to reuse the compute session if it requires the same instance type and python dependency.
34-
35-
If the compute resource is idle for 30 minutes, it will automatically clean up. Other users can reuse the compute resource.
26+
- Create compute instance yourself or ask the workspace admin to create one for you. To learn more, see [Create and manage an Azure Machine Learning compute instance](../how-to-create-compute-instance.md).
27+
- Using the compute instance to create a runtime. You can reuse the custom environment of the existing managed online endpoint/deployment runtime. To learn more, see [Customize environment for runtime](how-to-customize-environment-runtime.md).
3628

3729
## Next steps
3830

0 commit comments

Comments
 (0)