"profiler/vscode:/vscode.git/clone" did not exist on "332ccc3367cc48fc0bdcd696574e03943495c24a"
Unverified Commit 7a1f09d9 authored by J-shang's avatar J-shang Committed by GitHub
Browse files

update customized algos doc (#3241)

parent 8e7025ba
......@@ -2,6 +2,8 @@
**How to register customized algorithms as builtin tuners, assessors and advisors**
=======================================================================================
.. contents::
Overview
--------
......@@ -103,8 +105,10 @@ Run following command to register the customized algorithms as builtin algorithm
The ``<path_to_meta_file>`` is the path to the yaml file your created in above section.
6. Use the installed builtin algorithms in experiment
-----------------------------------------------------
Reference `customized tuner example <#example-register-a-customized-tuner-as-a-builtin-tuner>`_ for a full example.
Use the installed builtin algorithms in experiment
--------------------------------------------------
Once your customized algorithms is installed, you can use it in experiment configuration file the same way as other builtin tuners/assessors/advisors, for example:
......@@ -117,7 +121,7 @@ Once your customized algorithms is installed, you can use it in experiment confi
optimize_mode: maximize
Manage builtin algorithms using ``nnictl algo``
---------------------------------------------------
-----------------------------------------------
List builtin algorithms
^^^^^^^^^^^^^^^^^^^^^^^
......@@ -158,3 +162,61 @@ Run following command to uninstall an installed package:
For example:
``nnictl algo unregister demotuner``
Porting customized algorithms from v1.x to v2.x
-----------------------------------------------
All that needs to be modified is to delete ``NNI Package :: tuner`` metadata in ``setup.py`` and add a meta file mentioned in `4. Prepare meta file`_. Then you can follow `Register customized algorithms as builtin tuners, assessors and advisors`_ to register your customized algorithms.
Example: Register a customized tuner as a builtin tuner
-------------------------------------------------------
You can following below steps to register a customized tuner in ``nni/examples/tuners/customized_tuner`` as a builtin tuner.
Install the customized tuner package into python environment
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
There are 2 options to install the package into python environment:
Option 1: install from directory
""""""""""""""""""""""""""""""""
From ``nni/examples/tuners/customized_tuner`` directory, run:
``python setup.py develop``
This command will build the ``nni/examples/tuners/customized_tuner`` directory as a pip installation source.
Option 2: install from whl file
"""""""""""""""""""""""""""""""
Step 1: From ``nni/examples/tuners/customized_tuner`` directory, run:
``python setup.py bdist_wheel``
This command build a whl file which is a pip installation source.
Step 2: Run command:
``pip install dist/demo_tuner-0.1-py3-none-any.whl``
Register the customized tuner as builtin tuner:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Run following command:
``nnictl algo register --meta meta_file.yml``
Check the registered builtin algorithms
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Then run command ``nnictl algo list``\ , you should be able to see that demotuner is installed:
.. code-block:: bash
+-----------------+------------+-----------+--------=-------------+------------------------------------------+
| Name | Type | source | Class Name | Module Name |
+-----------------+------------+-----------+----------------------+------------------------------------------+
| demotuner | tuners | User | DemoTuner | demo_tuner |
+-----------------+------------+-----------+----------------------+------------------------------------------+
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment