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/ai-studio/how-to/create-manage-runtime.md
+13Lines changed: 13 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -99,6 +99,7 @@ Automatic is the default option for a runtime. You can start an automatic runtim
99
99
On a flow page, you can use the following options to manage an automatic runtime:
100
100
101
101
-**Install packages** triggers `pip install -r requirements.txt` in the flow folder. The process can take a few minutes, depending on the packages that you install.
102
+
-**View installed packages** shows the packages that are installed in the runtime. It includes the packages baked to base image and packages specify in the `requirements.txt` file in the flow folder.
102
103
-**Reset** deletes the current runtime and creates a new one with the same environment. If you encounter a package conflict, you can try this option.
103
104
-**Edit** opens the runtime configuration page, where you can define the VM side and the idle time for the runtime.
104
105
-**Stop** deletes the current runtime. If there's no active runtime on the underlying compute, the compute resource is also deleted.
@@ -139,6 +140,18 @@ If you want to use a private feed in Azure DevOps, follow these steps:
139
140
140
141
:::image type="content" source="../media/prompt-flow/how-to-create-manage-runtime/runtime-advanced-setting-msi.png" alt-text="Screenshot that shows the toggle for using a workspace user-assigned managed identity." lightbox = "../media/prompt-flow/how-to-create-manage-runtime/runtime-advanced-setting-msi.png":::
141
142
143
+
#### Change the base image for automatic runtime (preview)
144
+
145
+
By default, we use the latest prompt flow image as the base image. If you want to use a different base image, you need build your own base image, this docker image should be built from prompt flow base image that is `mcr.microsoft.com/azureml/promptflow/promptflow-runtime-stable:<newest_version>`. If possible use the [latest version of the base image](https://mcr.microsoft.com/v2/azureml/promptflow/promptflow-runtime-stable/tags/list). To use the new base image, you need to reset the runtime via the `reset` command. This process takes several minutes as it pulls the new base image and reinstalls packages.
146
+
147
+
:::image type="content" source="../media/prompt-flow/how-to-create-manage-runtime/runtime-creation-automatic-image-flow-dag.png" alt-text="Screenshot of actions for customizing an base image for an automatic runtime on a flow page." lightbox = "../media/prompt-flow/how-to-create-manage-runtime/runtime-creation-automatic-image-flow-dag.png":::
148
+
149
+
```yaml
150
+
environment:
151
+
image: <your-custom-image>
152
+
python_requirements_txt: requirements.txt
153
+
```
154
+
142
155
### Update a compute instance runtime on a runtime page
143
156
144
157
Azure AI Studio gets regular updates to the base image (`mcr.microsoft.com/azureml/promptflow/promptflow-runtime-stable`) to include the latest features and bug fixes. To get the best experience and performance, periodically update your runtime to the [latest version](https://mcr.microsoft.com/v2/azureml/promptflow/promptflow-runtime-stable/tags/list).
Copy file name to clipboardExpand all lines: articles/machine-learning/prompt-flow/how-to-create-manage-runtime.md
+85-1Lines changed: 85 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -112,7 +112,7 @@ Before you create a compute instance runtime, make sure that a compute instance
112
112
113
113
:::image type="content" source="./media/how-to-create-manage-runtime/runtime-creation-ci-existing-custom-application-ui.png" alt-text="Screenshot of the option to use an existing custom application and the box for selecting an application." lightbox = "./media/how-to-create-manage-runtime/runtime-creation-ci-existing-custom-application-ui.png":::
114
114
115
-
## Use a runtime in prompt flow authoring
115
+
## Use a runtime in prompt flow authoring UI
116
116
117
117
When you're authoring a flow, you can select and change the runtime from the **Runtime** dropdown list on the upper right of the flow page.
118
118
@@ -122,13 +122,97 @@ When you're performing evaluation, you can use the original runtime in the flow
122
122
123
123
:::image type="content" source="./media/how-to-create-manage-runtime/runtime-authoring-bulktest.png" alt-text="Screenshot of runtime details on the wizard page for configuring an evaluation." lightbox = "./media/how-to-create-manage-runtime/runtime-authoring-bulktest.png":::
124
124
125
+
## Use a runtime to submit a flow run in CLI/SDK
126
+
127
+
Same as authoring UI, you can also specify the runtime in CLI/SDK when you submit a flow run.
128
+
129
+
# [Azure CLI](#tab/cli)
130
+
131
+
In you `run.yml` you can specify the runtime name or use the automatic runtime. If you specify the runtime name, it will use the runtime with the name you specified. If you specify automatic, it will use the automatic runtime. If you don't specify the runtime, it will use the automatic runtime by default.
132
+
133
+
In automatic runtime case, you can also specify the instance type, if you don't specify the instance type, Azure Machine Learning chooses an instance type (VM size) based on factors like quota, cost, performance and disk size, learn more about [serverless compute](../how-to-use-serverless-compute.md)
# if omitted, it will use the automatic runtime, you can also specify the runtime name, specify automatic will also use the automatic runtime.
145
+
# runtime: <runtime_name>
146
+
147
+
148
+
# define instance type only work for automatic runtime, will be ignored if you specify the runtime name.
149
+
resources:
150
+
instance_type: <instance_type>
151
+
152
+
```
153
+
154
+
Submit this run via CLI:
155
+
156
+
```sh
157
+
pfazure run create --file run.yml
158
+
```
159
+
160
+
# [Python SDK](#tab/python)
161
+
162
+
```python
163
+
# load flow
164
+
flow ="<path_to_flow>"
165
+
data ="<path_to_flow>/data.jsonl"
166
+
167
+
168
+
# define cloud resource
169
+
# runtime = <runtime_name>
170
+
define instance type
171
+
resources = {"instance_type": <instance_type>}
172
+
173
+
# create run
174
+
base_run = pf.run(
175
+
flow=flow,
176
+
data=data,
177
+
runtime=runtime, # if omitted, it will use the automatic runtime, you can also specify the runtime name, specif automatic will also use the automatic runtime.
178
+
# resources = resources, # only work for automatic runtime, will be ignored if you specify the runtime name.
179
+
column_mapping={
180
+
"url": "${data.url}"
181
+
},
182
+
)
183
+
print(base_run)
184
+
```
185
+
186
+
Learn full e2e code first example: [Integrate prompt flow with LLM-based application DevOps](./how-to-integrate-with-llm-app-devops.md)
187
+
188
+
### Referencing files outside of the flow folder - automatic runtime only
189
+
Sometimes, you may want to reference a `requirements.txt` file that is outside of the flow folder. For example, you may want have big project which include multiple flows, and they share the same `requirements.txt` file. To do this, You can add this field `additional_includes` into the `flow.dag.yaml`. The value of this field is a list of the relative file/folder path to the flow folder. For example, if requirements.txt is in the parent folder of the flow folder, you can add `../requirements.txt` to the `additional_includes` field.
When you submit flow run using automatic runtime, the `requirements.txt` file will be copied to the flow folder, and use it to start your automatic runtime.
207
+
125
208
## Update a runtime on the UI
126
209
127
210
### Update an automatic runtime (preview) on a flow page
128
211
129
212
On a flow page, you can use the following options to manage an automatic runtime (preview):
130
213
131
214
-**Install packages** triggers `pip install -r requirements.txt` in the flow folder. This process can take a few minutes, depending on the packages that you install.
215
+
-**View installed packages** shows the packages that are installed in the runtime. It includes the packages baked to base image and packages specify in the `requirements.txt` file in the flow folder.
132
216
-**Reset** deletes the current runtime and creates a new one with the same environment. If you encounter a package conflict issue, you can try this option.
133
217
-**Edit** opens the runtime configuration page, where you can define the VM side and the idle time for the runtime.
134
218
-**Stop** deletes the current runtime. If there's no active runtime on the underlying compute, the compute resource is also deleted.
Copy file name to clipboardExpand all lines: articles/machine-learning/prompt-flow/tools-reference/troubleshoot-guidance.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -144,9 +144,9 @@ Check if this compute instance is assigned to you and you have access to the wor
144
144
145
145
This error occurs because you're cloning a flow from others that's using a compute instance as the runtime. Because the compute instance runtime is user isolated, you need to create your own compute instance runtime or select a managed online deployment/endpoint runtime, which can be shared with others.
146
146
147
-
### Find Python packages installed in runtime
147
+
### Find Python packages installed in compute instance runtime
148
148
149
-
Follow these steps to find Python packages installed in runtime:
149
+
Follow these steps to find Python packages installed in compute instance runtime:
0 commit comments