Adding hyperparameter search plugins
Add or remove hyperparameter search algorithms as plugins to or from WML Accelerator. Hyperparameter search algorithm plugins can also be queried by type of name.
- Installing a search plugin using local or upload install
- Querying a search plugin by type or name
- Deleting a search plugin
Installing a search plugin
There are two methods to install hyperparameter search plugins, local and upload installation. If the script files are large, it is recommenced that the files are copied to the server before you use the local installation method.
- Local install
- Use this method if the plugin scripts are located on the dlpd server, or in a shared folder that the dlpd service can access.
- Upload install
- Use this method if you want to upload the plugin scripts from a client host.
| Parameter name | Type | Description | Required |
| plugin_algorithm_name | string |
Name of the user plugin. The plugin name should start with a letter, and only contains letters, numbers and dashes only, up to 100 characters |
true |
| plugin_tar_file_path | string | The full path of the user plugin algorithm tar file. The tar file should end with suffix “.tar”. | true |
| conda_home_path | string |
The full path of the user conda home used to run the plugin scripts. The path should exist in management hosts and can be access by the CLUSTERADMIN operating system user. If not specified, will use the default DLI_CONDA_HOME. If specified, the conda_env_name should also be specified. |
false |
| conda_env_name | string |
The user conda env name used to run the plugin scripts If conda_home_path is specified, it will use the conda environment specified in conda_home_path to run the plugin scripts. Otherwise, DLI_CONDA_HOME is used. |
false |
| enable_remote_execution | boolean |
Specify whether to enable the execution mode of the plugin algorithm, valid values:
The default value is false. Enable remote execution mode can save management host resources, but it can impact the time it takes to start Spark applications. |
false
|
| log_level | string | Specify the log level for the plugin algorithm, such as: DEBUG,
INFO, WARNING, ERROR,
CRITICAL. The default value is INFO. |
false |
| cpd-route | string | The route is determined by: |
true |
- Only Python 3 is supported for the plugin tuning.
- Make sure dependent python modules are installed in the conda
environment:
> source ${conda_home_path}/etc/profile.d/conda.sh > conda activate ${conda_env_name} > pip install --yes dill== 0.3.1.1 glog==0.3.5 protobuf==3.7.1 > conda deactivate - If plugin_tar_file_path is specified and the path is also set in the body of the data, the path value will not take effect. The uploaded files found in the location specified by plugin_tar_file_path will be used.
- How to tar your plugin scripts into a plugin tar file:
- Put all your scripts under a plugin root folder, for example: /tmp/your_plugin_root_folder, the folder must contain a optimizer.py file which implements the BasePluginOptimizer class, together with other modules and files for the hyperparameter search plugin.
- Navigate to the plugin root folder,
/tmp/your_plugin_root_folder:
cd /tmp/your_plugin_root_folder/ - Tar the plugin scripts:
tar cf /tmp/test.tar * - Replace
${plugin_tar_file_path}in the request command with /tmp/test.tar.
Querying a search plugin
- Query plugins by type
-
Use the following rest command to query all supported tuning algorithms:
Parameters are as follows:> curl -k -X GET \ --header 'Authorization: Bearer <jwttoken>' \ -H 'Accept: application/json' \ 'https://${cpd-route}/platform/rest/deeplearning/v1/hypersearch/algorithm?type=${algo_type}'Parameter name Type Description Required algo_type string The type of tuning algorithm.
Specify type=USER_PLUGIN to query all the user installed plugin algorithm.
Specify type=BUILD_IN to query all the build-in algorithms.
If the parameter is not specified, all algorithms (including build-in and user installed) will be returned.
false cpd-route string The route is determined by: oc get route -n ${cpd-namespace}true
- Query plugins by name
-
Use the following rest command to query all supported tuning algorithms:
Parameters are as follows:> curl -k -X GET \ --header 'Authorization: Bearer <jwttoken>' \ -H 'Accept: application/json' \ 'https://${cpd-route}/platform/rest/deeplearning/v1/hypersearch/algorithm/${plugin_algorithm_name}'Parameter name Type Description Required plugin_algorithm_name string name of the user plugin algorithm. true cpd-route string The route is determined by: oc get route -n ${cpd-namespace}true
Deleting a search plugin
> curl -k -X DELETE \
--header 'Authorization: Bearer <jwttoken>' \
'https://${cpd-route}/platform/rest/deeplearning/v1/hypersearch/algorithm/${plugin_algorithm_name}| Parameter name | Type | Description | Required |
| plugin_algorithm_name | string | name of the user plugin algorithm. | true |
| cpd-route | string | The route is determined by: |
true |