You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/machine-learning/prompt-flow/how-to-create-manage-runtime.md
+1-64Lines changed: 1 addition & 64 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ ms.topic: how-to
9
9
author: cloga
10
10
ms.author: lochen
11
11
ms.reviewer: lagayhar
12
-
ms.date: 07/14/2023
12
+
ms.date: 09/13/2023
13
13
---
14
14
15
15
# Create and manage runtimes (preview)
@@ -20,22 +20,6 @@ Prompt flow's runtime provides the computing resources required for the applicat
20
20
> 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.
21
21
> For more information, see [Supplemental Terms of Use for Microsoft Azure Previews](https://azure.microsoft.com/support/legal/preview-supplemental-terms/).
22
22
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.
| 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
-
39
23
## Permissions/roles need to use runtime
40
24
41
25
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
107
91
108
92
:::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":::
109
93
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":::
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
-
157
94
## Update runtime from UI
158
95
159
96
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.
Copy file name to clipboardExpand all lines: articles/machine-learning/prompt-flow/how-to-customize-environment-runtime.md
+5-47Lines changed: 5 additions & 47 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,6 @@ In your local environment, create a folder contains following files, the folder
32
32
|--image_build
33
33
| |--requirements.txt
34
34
| |--Dockerfile
35
-
| |--environment-build.yaml
36
35
| |--environment.yaml
37
36
```
38
37
@@ -67,9 +66,9 @@ RUN pip install -r requirements.txt
67
66
> [!NOTE]
68
67
> 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).
69
68
70
-
### Step 2: Use Azure Machine Learning environment to build image
#### Define your environment in `environment_build.yaml`
71
+
#### Define your environment in `environment.yaml`
73
72
74
73
In your local compute, you can use the CLI (v2) to create a customized environment based on your docker image.
75
74
@@ -88,11 +87,11 @@ az account set --subscription <subscription ID>
88
87
az configure --defaults workspace=<Azure Machine Learning workspace name> group=<resource group>
89
88
```
90
89
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.
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>
106
105
```
107
106
108
107
> [!NOTE]
109
108
> Building the image may take several minutes.
110
109
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.
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
-
152
110
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).
153
111
154
112
To learn more about environment CLI, see [Manage environments](../how-to-manage-environments-v2.md#manage-environments).
Copy file name to clipboardExpand all lines: articles/machine-learning/prompt-flow/migrate-managed-inference-runtime.md
+2-10Lines changed: 2 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -23,16 +23,8 @@ From **September 2013**, we'll stop the creation for managed online endpoint/dep
23
23
24
24
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.
25
25
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).
0 commit comments