diff --git a/pyproject.toml b/pyproject.toml index 8d639119..a8a57499 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -10,6 +10,8 @@ select = [ "F", # isort "I", + # numpy + "NPY", # pyupgrade "UP", # flake8-bugbear diff --git a/source/cloud/azure/azureml.md b/source/cloud/azure/azureml.md index 8b923148..4a1b4750 100644 --- a/source/cloud/azure/azureml.md +++ b/source/cloud/azure/azureml.md @@ -65,8 +65,6 @@ echo "kernel install completed" Select `local file`, then `Browse`, and upload that script. -Optional to enable SSH access to your compute (if needed). - ![Screenshot of the provision setup script screen](../../images/azureml-provision-setup-script.png) Refer to [Azure ML documentation](https://learn.microsoft.com/en-us/azure/machine-learning/how-to-customize-compute-instance) for more details on how to create the setup script but it should resemble: @@ -100,8 +98,7 @@ from azure.identity import DefaultAzureCredential # If it isn't found, open a shell and look in the # directory indicated by 'echo ${JUPYTER_SERVER_ROOT}'. ml_client = MLClient.from_config( - credential=DefaultAzureCredential(), - path="./config.json" + credential=DefaultAzureCredential(), path="./config.json" ) ``` @@ -216,7 +213,7 @@ command_job = command( "max_depth": 10, "max_features": 1.0, }, - compute="rapids-cluster", + compute=gpu_compute.name, ) # submit training job @@ -239,7 +236,7 @@ command_job_for_sweep = command_job( # apply hyperparameter sweep_job sweep_job = command_job_for_sweep.sweep( - compute="rapids-cluster", + compute=gpu_compute.name, sampling_algorithm="random", primary_metric="Accuracy", goal="Maximize", diff --git a/source/examples/rapids-azureml-hpo/train_rapids.py b/source/examples/rapids-azureml-hpo/train_rapids.py index 63ce4f5f..7e941cba 100644 --- a/source/examples/rapids-azureml-hpo/train_rapids.py +++ b/source/examples/rapids-azureml-hpo/train_rapids.py @@ -20,7 +20,6 @@ import cudf import cuml import mlflow -import numpy as np from rapids_csp_azure import PerfTimer, RapidsCloudML @@ -62,13 +61,13 @@ def main(): cv_folds = args.cv_folds n_estimators = args.n_estimators - mlflow.log_param("n_estimators", np.int(args.n_estimators)) + mlflow.log_param("n_estimators", int(args.n_estimators)) max_depth = args.max_depth - mlflow.log_param("max_depth", np.int(args.max_depth)) + mlflow.log_param("max_depth", int(args.max_depth)) n_bins = args.n_bins - mlflow.log_param("n_bins", np.int(args.n_bins)) + mlflow.log_param("n_bins", int(args.n_bins)) max_features = args.max_features - mlflow.log_param("max_features", np.str(args.max_features)) + mlflow.log_param("max_features", str(args.max_features)) print("\n---->>>> cuDF version <<<<----\n", cudf.__version__) print("\n---->>>> cuML version <<<<----\n", cuml.__version__) @@ -156,9 +155,9 @@ def main(): global_best_test_accuracy = test_accuracy mlflow.log_metric( - "Total training inference time", np.float(training_time + infer_time) + "Total training inference time", float(training_time + infer_time) ) - mlflow.log_metric("Accuracy", np.float(global_best_test_accuracy)) + mlflow.log_metric("Accuracy", float(global_best_test_accuracy)) print("\n Accuracy :", global_best_test_accuracy) print("\n accuracy per fold :", accuracy_per_fold) print("\n train-time per fold :", train_time_per_fold) @@ -171,5 +170,5 @@ def main(): with PerfTimer() as total_script_time: main() print(f"Total runtime: {total_script_time.duration:.2f}") - mlflow.log_metric("Total runtime", np.float(total_script_time.duration)) + mlflow.log_metric("Total runtime", float(total_script_time.duration)) print("\n Exiting script")