HybridMode.rst 1.48 KB
Newer Older
1
**Run an Experiment on Hybrid Mode**
2
3
===========================================

4
Run NNI on hybrid mode means that NNI will run trials jobs in multiple kinds of training platforms. For example, NNI could submit trial jobs to remote machine and AML simultaneously.
5

6
7
Setup environment
-----------------
8

9
NNI has supported `local <./LocalMode.rst>`__\ , `remote <./RemoteMachineMode.rst>`__\ , `PAI <./PaiMode.rst>`__\ , and `AML <./AMLMode.rst>`__ for hybrid training service. Before starting an experiment using these mode, users should setup the corresponding environment for the platforms. More details about the environment setup could be found in the corresponding docs.
10

11
12
Run an experiment
-----------------
13

14
Use ``examples/trials/mnist-tfv1`` as an example. The NNI config YAML file's content is like:
15
16
17

.. code-block:: yaml

SparkSnail's avatar
SparkSnail committed
18
19
20
21
    experimentName: MNIST
    searchSpaceFile: search_space.json
    trialCommand: python3 mnist.py
    trialCodeDirectory: .
22
    trialConcurrency: 2
SparkSnail's avatar
SparkSnail committed
23
24
25
    trialGpuNumber: 0
    maxExperimentDuration: 24h
    maxTrialNumber: 100
26
    tuner:
SparkSnail's avatar
SparkSnail committed
27
      name: TPE
28
29
      classArgs:
        optimize_mode: maximize
SparkSnail's avatar
SparkSnail committed
30
31
32
33
34
35
36
37
38
39
    trainingService:
      - platform: remote
        machineList:
          - host: 127.0.0.1
            user: bob
            password: bob
      - platform: local

To use hybrid training services, users should set training service configurations as a list in `trainingService` field.  
Currently, hybrid support setting `local`, `remote`, `pai` and `aml` training services.