Skip to content

Commit 41e0340

Browse files
committed
update
1 parent 787da19 commit 41e0340

File tree

6 files changed

+100
-3
lines changed

6 files changed

+100
-3
lines changed

articles/ai-studio/how-to/create-manage-runtime.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,7 @@ Automatic is the default option for a runtime. You can start an automatic runtim
9999
On a flow page, you can use the following options to manage an automatic runtime:
100100

101101
- **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.
102103
- **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.
103104
- **Edit** opens the runtime configuration page, where you can define the VM side and the idle time for the runtime.
104105
- **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:
139140
140141
:::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":::
141142
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+
142155
### Update a compute instance runtime on a runtime page
143156

144157
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).
-37.6 KB
Loading
144 KB
Loading

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

Lines changed: 85 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ Before you create a compute instance runtime, make sure that a compute instance
112112

113113
:::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":::
114114

115-
## Use a runtime in prompt flow authoring
115+
## Use a runtime in prompt flow authoring UI
116116

117117
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.
118118

@@ -122,13 +122,97 @@ When you're performing evaluation, you can use the original runtime in the flow
122122

123123
:::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":::
124124

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)
134+
135+
```yaml
136+
$schema: https://azuremlschemas.azureedge.net/promptflow/latest/Run.schema.json
137+
flow: <path_to_flow>
138+
data: <path_to_flow>/data.jsonl
139+
140+
column_mapping:
141+
url: ${data.url}
142+
143+
# define cloud resource
144+
# 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.
190+
191+
```yaml
192+
inputs:
193+
question:
194+
type: string
195+
outputs:
196+
output:
197+
type: string
198+
reference: ${answer_the_question_with_context.output}
199+
environment:
200+
python_requirements_txt: requirements.txt
201+
additional_includes:
202+
- ../requirements.txt
203+
...
204+
```
205+
206+
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+
125208
## Update a runtime on the UI
126209

127210
### Update an automatic runtime (preview) on a flow page
128211

129212
On a flow page, you can use the following options to manage an automatic runtime (preview):
130213

131214
- **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.
132216
- **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.
133217
- **Edit** opens the runtime configuration page, where you can define the VM side and the idle time for the runtime.
134218
- **Stop** deletes the current runtime. If there's no active runtime on the underlying compute, the compute resource is also deleted.
-37.6 KB
Loading

articles/machine-learning/prompt-flow/tools-reference/troubleshoot-guidance.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,9 @@ Check if this compute instance is assigned to you and you have access to the wor
144144

145145
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.
146146

147-
### Find Python packages installed in runtime
147+
### Find Python packages installed in compute instance runtime
148148

149-
Follow these steps to find Python packages installed in runtime:
149+
Follow these steps to find Python packages installed in compute instance runtime:
150150

151151
- Add a Python node in your flow.
152152
- Put the following code in the code section:

0 commit comments

Comments
 (0)