Skip to content

Commit

Permalink
Update docs from 35b0c22
Browse files Browse the repository at this point in the history
  • Loading branch information
olivedevteam committed Jul 27, 2023
1 parent 82d7af4 commit 94df1ed
Show file tree
Hide file tree
Showing 8 changed files with 329 additions and 28 deletions.
35 changes: 26 additions & 9 deletions _sources/overview/options.md.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,35 @@ more details.
The default value is 3. User can increase if there are network issues and the operations fail.
- `operation_retry_interval: [int]` The initial interval in seconds between retries for Azure ML operations like resource creation and download. The interval doubles after each retry. The default value is 5. User can increase if there are network issues and the operations fail.
- `default_auth_params: Dict[str, Any]` Default auth parameters for AzureML client. Please refer to [azure DefaultAzureCredential](https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python#parameters) for more details. For example, if you want to exclude managed identity credential, you can set the following:
```json
"azureml_client": {
"subscription_id": "my_subscription_id",
"resource_group": "my_resource_group",
"workspace_name": "my_workspace",
"default_auth_params": {
"exclude_managed_identity_credential": true
```json
"azureml_client": {
...
"default_auth_params": {
"exclude_managed_identity_credential": true
}
}
}
```
```

### Example
#### `azureml_client` with `aml_config_path`:
##### `aml_config.json`:
```json
{
"subscription_id": "<subscription_id>",
"resource_group": "<resource_group>",
"workspace_name": "<workspace_name>",
}
```
##### `azureml_client`:
```json
"azureml_client": {
"aml_config_path": "aml_config.json",
"read_timeout" : 4000,
"max_operation_retries" : 4,
"operation_retry_interval" : 5
},
```
#### `azureml_client` with azureml config fields:
```json
"azureml_client": {
"subscription_id": "<subscription_id>",
Expand Down
60 changes: 60 additions & 0 deletions _sources/tutorials/azureml_scripts.md.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Azure ML scripts

Olive provides a couple of scripts to help you manage your Azure ML assets.

## Scripts list

### `manage_compute_instance`
This Python script provides a command-line interface for managing compute resources in an Azure Machine Learning workspace.

* `--create` or `-c`: A flag indicating that a new compute resource should be created. This is mutually exclusive with `--delete` - only one of them can be specified at a time.

* `--delete` or `-d`: A flag indicating that an existing compute resource should be deleted. This is mutually exclusive with `--create` - only one of them can be specified at a time.

* `--subscription_id`: The ID of your Azure subscription.

* `--resource_group`: The name of your Azure resource group.

* `--workspace_name`: The name of your Azure Machine Learning workspace.

* `--aml_config_path`: The path to your AzureML config file. If this is provided, subscription_id, resource_group and workspace_name are ignored.

* `--compute_name`: The name of the new compute resource. This is a required argument.

* `--vm_size`: The VM size of the new compute resource. This is required if you are creating a compute instance.

* `--location`: The location where the new compute resource should be created. This is required if you are creating a compute instance.

* `--min_nodes`: The minimum number of nodes for the new compute resource. If this is not provided, the default value is 0.

* `--max_nodes`: The maximum number of nodes for the new compute resource. If this is not provided, the default value is 2.

* `--idle_time_before_scale_down`: The number of idle seconds before the compute resource scales down. If this is not provided, the default value is 120 seconds.

`aml_config_path` is a json file for your azureml config:
```json
{
"subscription_id": "<subscription_id>",
"resource_group": "<resource_group>",
"workspace_name": "<workspace_name>",
}
```

#### Usage

You can run the script to create an AzureML compute instance from the command line like this:

```
python -m olive.scripts.manage_compute_instance --create --subscription_id <subscription_id> --resource_group <resource_group> --workspace_name <workspace_name> --compute_name <compute_name> --vm_size <vm_size> --location <location> --min_nodes <min_nodes> --max_nodes <max_nodes> --idle_time_before_scale_down <idle_time_before_scale_down>
```

or

```
python -m olive.scripts.manage_compute_instance --create --aml_config_path </path/to/aml_config.json> --compute_name <compute_name> --vm_size <vm_size> --location <location> --min_nodes <min_nodes> --max_nodes <max_nodes> --idle_time_before_scale_down <idle_time_before_scale_down>
```

You can delete an AzureML compute instance by:
```
python -m olive.scripts.manage_compute_instance --delete --compute_name <compute_name>
```
6 changes: 3 additions & 3 deletions _sources/tutorials/configure_systems.rst.txt
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,9 @@ System Configuration
aml_system = AzureMLSystem(
aml_compute="cpu-cluster",
aml_docker_config={
"base_image": "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04",
"conda_file_path": "conda.yaml"
}
"base_image": "mcr.microsoft.com/azureml/openmpi4.1.0-ubuntu20.04",
"conda_file_path": "conda.yaml"
}
)
Please refer to this `example <https://github.com/microsoft/Olive/blob/main/examples/bert/conda.yaml>`__
Expand Down
Binary file modified objects.inv
Binary file not shown.
54 changes: 42 additions & 12 deletions overview/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@
<li class="toctree-l1"><a class="reference internal" href="quicktour.html">Quick Tour</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Olive Options</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#azure-ml-client">Azure ML Client</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a></li>
<li class="toctree-l3"><a class="reference internal" href="#example">Example</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#azureml-client-with-aml-config-path"><code class="docutils literal notranslate"><span class="pre">azureml_client</span></code> with <code class="docutils literal notranslate"><span class="pre">aml_config_path</span></code>:</a></li>
<li class="toctree-l4"><a class="reference internal" href="#azureml-client-with-azureml-config-fields"><code class="docutils literal notranslate"><span class="pre">azureml_client</span></code> with azureml config fields:</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#input-model-information">Input Model Information</a><ul>
Expand Down Expand Up @@ -173,7 +177,7 @@ <h2>Azure ML Client<a class="headerlink" href="#azure-ml-client" title="Permalin
<a class="reference external" href="https://learn.microsoft.com/en-us/azure/machine-learning/how-to-setup-authentication?tabs=sdk">this</a> for
more details.</p>
<p><code class="docutils literal notranslate"><span class="pre">azureml_client:</span> <span class="pre">[Dict]</span></code></p>
<ul class="simple">
<ul>
<li><p><code class="docutils literal notranslate"><span class="pre">subscription_id:</span> <span class="pre">[str]</span></code> Azure account subscription id.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">resource_group:</span> <span class="pre">[str]</span></code> Azure account resource group name.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">workspace_name:</span> <span class="pre">[str]</span></code> Azure ML workspace name.</p></li>
Expand All @@ -182,20 +186,45 @@ <h2>Azure ML Client<a class="headerlink" href="#azure-ml-client" title="Permalin
<li><p><code class="docutils literal notranslate"><span class="pre">max_operation_retries:</span> <span class="pre">[int]</span></code> The maximum number of retries for Azure ML operations like resource creation and download.
The default value is 3. User can increase if there are network issues and the operations fail.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">operation_retry_interval:</span> <span class="pre">[int]</span></code> The initial interval in seconds between retries for Azure ML operations like resource creation and download. The interval doubles after each retry. The default value is 5. User can increase if there are network issues and the operations fail.</p></li>
<li><p><code class="docutils literal notranslate"><span class="pre">default_auth_params:</span> <span class="pre">Dict[str,</span> <span class="pre">Any]</span></code> Default auth parameters for AzureML client. Please refer to <a class="reference external" href="https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python#parameters">azure DefaultAzureCredential</a> for more details. For example, if you want to exclude managed identity credential, you can set the following:</p></li>
</ul>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="nt">&quot;azureml_client&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;subscription_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;my_subscription_id&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;resource_group&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;my_resource_group&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;workspace_name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;my_workspace&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;default_auth_params&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;exclude_managed_identity_credential&quot;</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span>
<span class="w"> </span><span class="p">}</span>
<span class="p">}</span>
<li><p><code class="docutils literal notranslate"><span class="pre">default_auth_params:</span> <span class="pre">Dict[str,</span> <span class="pre">Any]</span></code> Default auth parameters for AzureML client. Please refer to <a class="reference external" href="https://learn.microsoft.com/en-us/python/api/azure-identity/azure.identity.defaultazurecredential?view=azure-python#parameters">azure DefaultAzureCredential</a> for more details. For example, if you want to exclude managed identity credential, you can set the following:</p>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span>&quot;azureml_client&quot;: {
...
&quot;default_auth_params&quot;: {
&quot;exclude_managed_identity_credential&quot;: true
}
}
</pre></div>
</div>
</li>
</ul>
<section id="example">
<h3>Example<a class="headerlink" href="#example" title="Permalink to this heading"></a></h3>
<section id="azureml-client-with-aml-config-path">
<h4><code class="docutils literal notranslate"><span class="pre">azureml_client</span></code> with <code class="docutils literal notranslate"><span class="pre">aml_config_path</span></code>:<a class="headerlink" href="#azureml-client-with-aml-config-path" title="Permalink to this heading"></a></h4>
<section id="aml-config-json">
<h5><code class="docutils literal notranslate"><span class="pre">aml_config.json</span></code>:<a class="headerlink" href="#aml-config-json" title="Permalink to this heading"></a></h5>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;subscription_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&lt;subscription_id&gt;&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;resource_group&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&lt;resource_group&gt;&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;workspace_name&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&lt;workspace_name&gt;&quot;</span><span class="p">,</span>
<span class="p">}</span>
</pre></div>
</div>
</section>
<section id="azureml-client">
<h5><code class="docutils literal notranslate"><span class="pre">azureml_client</span></code>:<a class="headerlink" href="#azureml-client" title="Permalink to this heading"></a></h5>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="nt">&quot;azureml_client&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;aml_config_path&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;aml_config.json&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;read_timeout&quot;</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="mi">4000</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;max_operation_retries&quot;</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="mi">4</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;operation_retry_interval&quot;</span><span class="w"> </span><span class="p">:</span><span class="w"> </span><span class="mi">5</span>
<span class="p">},</span>
</pre></div>
</div>
</section>
</section>
<section id="azureml-client-with-azureml-config-fields">
<h4><code class="docutils literal notranslate"><span class="pre">azureml_client</span></code> with azureml config fields:<a class="headerlink" href="#azureml-client-with-azureml-config-fields" title="Permalink to this heading"></a></h4>
<div class="highlight-json notranslate"><div class="highlight"><pre><span></span><span class="nt">&quot;azureml_client&quot;</span><span class="p">:</span><span class="w"> </span><span class="p">{</span>
<span class="w"> </span><span class="nt">&quot;subscription_id&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&lt;subscription_id&gt;&quot;</span><span class="p">,</span>
<span class="w"> </span><span class="nt">&quot;resource_group&quot;</span><span class="p">:</span><span class="w"> </span><span class="s2">&quot;&lt;resource_group&gt;&quot;</span><span class="p">,</span>
Expand All @@ -208,6 +237,7 @@ <h3>Example<a class="headerlink" href="#example" title="Permalink to this headin
</div>
</section>
</section>
</section>
<section id="input-model-information">
<h2>Input Model Information<a class="headerlink" href="#input-model-information" title="Permalink to this heading"></a></h2>
<p><code class="docutils literal notranslate"><span class="pre">input_model:</span> <span class="pre">[Dict]</span></code></p>
Expand Down
2 changes: 1 addition & 1 deletion searchindex.js

Large diffs are not rendered by default.

Loading

0 comments on commit 94df1ed

Please sign in to comment.