-
Notifications
You must be signed in to change notification settings - Fork 31
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ce4ccaa
commit 3983602
Showing
1 changed file
with
129 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,9 +34,27 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Name: azure-ai-ml\n", | ||
"Version: 1.8.0\n", | ||
"Summary: Microsoft Azure Machine Learning Client Library for Python\n", | ||
"Home-page: https://github.com/Azure/azure-sdk-for-python\n", | ||
"Author: Microsoft Corporation\n", | ||
"Author-email: [email protected]\n", | ||
"License: MIT License\n", | ||
"Location: /anaconda/envs/rapids/lib/python3.10/site-packages\n", | ||
"Requires: azure-common, azure-core, azure-mgmt-core, azure-storage-blob, azure-storage-file-datalake, azure-storage-file-share, colorama, isodate, jsonschema, marshmallow, msrest, opencensus-ext-azure, pydash, pyjwt, pyyaml, strictyaml, tqdm, typing-extensions\n", | ||
"Required-by: \n", | ||
"Note: you may need to restart the kernel to use updated packages.\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"# verify Azure ML SDK version\n", | ||
"\n", | ||
|
@@ -62,9 +80,19 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Workspace name: rapids-aml-cluster\n", | ||
"Subscription id: fc4f4a6b-4041-4b1c-8249-854d68edcf62\n", | ||
"Resource group: rapidsai-deployment\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from azure.ai.ml import MLClient\n", | ||
"from azure.identity import DefaultAzureCredential\n", | ||
|
@@ -104,9 +132,18 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"data uri: \n", | ||
" azureml://subscriptions/fc4f4a6b-4041-4b1c-8249-854d68edcf62/resourcegroups/rapidsai-deployment/workspaces/rapids-aml-cluster/datastores/workspaceartifactstore/paths/airline_20000000.parquet\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"datastore_name = \"workspaceartifactstore\"\n", | ||
"dataset = \"airline_20000000.parquet\"\n", | ||
|
@@ -146,9 +183,17 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"found compute target. Will use rapids-cluster\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"from azure.ai.ml.entities import AmlCompute\n", | ||
"\n", | ||
|
@@ -214,7 +259,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -242,7 +287,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -267,16 +312,36 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"\u001b[32mUploading code (0.33 MBs): 100%|██████████| 325450/325450 [00:00<00:00, 2363322.62it/s]\n", | ||
"\u001b[39m\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"Environment({'intellectual_property': None, 'is_anonymous': False, 'auto_increment_version': False, 'auto_delete_setting': None, 'name': 'rapids-mlflow', 'description': 'RAPIDS environment with azureml-mlflow', 'tags': {}, 'properties': {}, 'print_as_yaml': True, 'id': '/subscriptions/fc4f4a6b-4041-4b1c-8249-854d68edcf62/resourceGroups/rapidsai-deployment/providers/Microsoft.MachineLearningServices/workspaces/rapids-aml-cluster/environments/rapids-mlflow/versions/10', 'Resource__source_path': None, 'base_path': '/mnt/batch/tasks/shared/LS_root/mounts/clusters/skirui1/code', 'creation_context': <azure.ai.ml.entities._system_data.SystemData object at 0x7f9ce47101f0>, 'serialize': <msrest.serialization.Serializer object at 0x7f9ce4710d30>, 'version': '10', 'latest_version': None, 'conda_file': None, 'image': None, 'build': <azure.ai.ml.entities._assets.environment.BuildContext object at 0x7f9ce4713580>, 'inference_config': None, 'os_type': 'Linux', 'arm_type': 'environment_version', 'conda_file_path': None, 'path': None, 'datastore': None, 'upload_hash': None, 'translated_conda_file': None})" | ||
] | ||
}, | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"# RUN THIS CODE ONCE TO SETUP ENVIRONMENT\n", | ||
"from azure.ai.ml.entities import Environment, BuildContext\n", | ||
"\n", | ||
"env_docker_image = Environment(\n", | ||
" build=BuildContext(path=os.getcwd()),\n", | ||
" name=\"test-rapids-mlflow\",\n", | ||
" name=\"rapids-mlflow\",\n", | ||
" description=\"RAPIDS environment with azureml-mlflow\",\n", | ||
")\n", | ||
"\n", | ||
|
@@ -300,20 +365,46 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 8, | ||
"metadata": { | ||
"tags": [ | ||
"library/randomforest", | ||
"library/cudf" | ||
] | ||
}, | ||
"outputs": [], | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"Class AutoDeleteSettingSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.\n", | ||
"Class AutoDeleteConditionSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.\n", | ||
"Class BaseAutoDeleteSettingSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.\n", | ||
"Class IntellectualPropertySchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.\n", | ||
"Class ProtectionLevelSchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.\n", | ||
"Class BaseIntellectualPropertySchema: This is an experimental class, and may change at any time. Please see https://aka.ms/azuremlexperimental for more information.\n", | ||
"\u001b[32mUploading code (0.33 MBs): 100%|██████████| 327210/327210 [00:00<00:00, 1802654.05it/s]\n", | ||
"\u001b[39m\n", | ||
"\n" | ||
] | ||
}, | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"'https://ml.azure.com/runs/zen_eye_lm7dcp68jz?wsid=/subscriptions/fc4f4a6b-4041-4b1c-8249-854d68edcf62/resourcegroups/rapidsai-deployment/workspaces/rapids-aml-cluster&tid=43083d15-7273-40c1-b7db-39efd9ccc17a'" | ||
] | ||
}, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"from azure.ai.ml import command, Input\n", | ||
"\n", | ||
"\n", | ||
"command_job = command(\n", | ||
" environment=\"test-rapids-mlflow:1\",\n", | ||
" environment=\"rapids-mlflow:1\",\n", | ||
" experiment_name=experiment_name,\n", | ||
" code=os.getcwd(),\n", | ||
" inputs={\n", | ||
|
@@ -368,7 +459,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -391,7 +482,7 @@ | |
"\n", | ||
"# Define the limits for this sweep\n", | ||
"sweep_job.set_limits(\n", | ||
" max_total_trials=5, max_concurrent_trials=2, timeout=18000, trial_timeout=3600\n", | ||
" max_total_trials=10, max_concurrent_trials=2, timeout=18000, trial_timeout=3600\n", | ||
")\n", | ||
"\n", | ||
"\n", | ||
|
@@ -409,7 +500,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -426,9 +517,17 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"metadata": {}, | ||
"outputs": [], | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"Monitor your job at https://ml.azure.com/runs/eager_turtle_r7fs2xzcty?wsid=/subscriptions/fc4f4a6b-4041-4b1c-8249-854d68edcf62/resourcegroups/rapidsai-deployment/workspaces/rapids-aml-cluster&tid=43083d15-7273-40c1-b7db-39efd9ccc17a\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"aml_url = returned_sweep_job.studio_url\n", | ||
"\n", | ||
|
@@ -451,7 +550,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -467,11 +566,11 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 14, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"ml_client.compute.begin_delete(gpu_compute_target.name).wait()" | ||
"ml_client.compute.begin_delete(gpu_compute_target).wait()" | ||
] | ||
} | ||
], | ||
|