-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
|
||
Overview | ||
-------- | ||
This is a new way to launch experiments since ``nni v2.0``. Before, you need to configure our experiment in a yaml configuration file and launch the experiment through ``nnictl`` command. Now, you can also configure and run your experiment directly in the python file. If you are familiar with python programming, this will undoubtedly bring you more convenience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
our experiment -> your experiment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
|
||
experiment = Experiment(tuner=foo_tuner, training_service='local') | ||
|
||
Now, you have a ``Experiment`` instance with ``foo_tuner`` you have initialized in the previous step, and this experiment will launch trials on your local machine due to ``training_service='local'``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw training_service. Name of training service. Supported value: "local", "remote", "openpai"
from the code comments, I don't know whether it supports other training services.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
|
||
Example | ||
------- | ||
Below is an example for this new launching approach. You can also find this code in ``examples/trials/mnist-tfv2/launch.py``. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe
:githublink:`mnist-tfv2/launch.py <examples/trials/mnist-tfv2/launch.py>`
will be better.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed it
experiment.config.training_service.use_active_gpu = True | ||
|
||
experiment.run(8081) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should add a note
to indicate whether experiments launched from python can be managed by nnictl or nni client.
|
||
.. | ||
|
||
Step 1 - Initialize a tuner you want to use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think "step by step" is not the best way to introduce a library, seems too verbose...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is a quick start to a new way to launch experiment, not just a library, like https://nni.readthedocs.io/en/v2.0/Tutorial/QuickStart.html#three-steps-to-start-an-experiment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I think writing Python program and using a "ctl" tool is different. But I'm okay with current version.
|
||
Overview | ||
-------- | ||
This is a new way to launch experiments since ``nni v2.0``. Before, you need to configure your experiment in a yaml configuration file and launch the experiment through ``nnictl`` command. Now, you can also configure and run your experiment directly in the python file. If you are familiar with python programming, this will undoubtedly bring you more convenience. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"the python file" -> "a python file"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
|
||
.. code-block:: python | ||
|
||
from nni.algorithms.hpo.foo_tuner import FooTuner |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we really have FooTuner
? better to use a real and simple tuner as example
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
|
||
.. | ||
|
||
Step 2 - Initialize a experiment instance and configure it |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"a experiment" -> "an experiment"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
|
||
.. code-block:: python | ||
|
||
experiment.config.experiment_name = 'test' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to make this part more real, for example, setting up a real local experiment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
|
||
Use the form like ``experiment.config.foo = 'bar'`` to configure your experiment. | ||
|
||
See `parameter configuration <TBD>`__ required by different training services. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here is a broken link
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
waiting for #3222
.. autoclass:: nni.experiment.Experiment | ||
:members: | ||
|
||
.. autoclass:: nni.experiment.TrialJob |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can this class be used in the new launch approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will check it
nni/experiment/experiment.py
Outdated
@@ -69,7 +69,7 @@ def __init__(self, tuner: Tuner, training_service: str) -> None: | |||
A tuner instance. | |||
training_service | |||
Name of training service. | |||
Supported value: "local", "remote", "openpai". | |||
Supported value: "local", "remote", "openpai", "aml", "kubeflow", "frameworkcontroller", "adl". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so we support all the training services in v2.0?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems we don't support heterogeneous
and DLTS
? @liuzhe-lz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add "and hybrid training service."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made some change suggestions directly to the Howto.rst file.
TODO: modify experiment config url