"sgl-kernel/python/sgl_kernel/load_utils.py" did not exist on "e8b71445c043505e0c37d689c78957995a045235"
SetupNniDeveloperEnvironment.rst 2.32 KB
Newer Older
qianyj's avatar
qianyj committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
Setup NNI development environment
=================================

NNI development environment supports Ubuntu 1604 (or above), and Windows 10 with Python3 64bit.

Installation
------------

1. Clone source code
^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   git clone https://github.com/Microsoft/nni.git

Note, if you want to contribute code back, it needs to fork your own NNI repo, and clone from there.

2. Install from source code
^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. code-block:: bash

   python3 -m pip install -U -r dependencies/setup.txt
   python3 -m pip install -r dependencies/develop.txt
   python3 setup.py develop

This installs NNI in `development mode <https://setuptools.readthedocs.io/en/latest/userguide/development_mode.html>`__,
so you don't need to reinstall it after edit.

3. Check if the environment is ready
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Now, you can try to start an experiment to check if your environment is ready.
For example, run the command

.. code-block:: bash

   nnictl create --config examples/trials/mnist-pytorch/config.yml

And open WebUI to check if everything is OK

4. Reload changes
^^^^^^^^^^^^^^^^^

Python
******

Nothing to do, the code is already linked to package folders.

TypeScript (Linux and macOS)
****************************

* If ``ts/nni_manager`` is changed, run ``yarn watch`` under this folder. It will watch and build code continually. The ``nnictl`` need to be restarted to reload NNI manager.
* If ``ts/webui`` is changed, run ``yarn dev``\ , which will run a mock API server and a webpack dev server simultaneously. Use ``EXPERIMENT`` environment variable (e.g., ``mnist-tfv1-running``\ ) to specify the mock data being used. Built-in mock experiments are listed in ``src/webui/mock``. An example of the full command is ``EXPERIMENT=mnist-tfv1-running yarn dev``.

TypeScript (Windows)
********************

Currently you must rebuild TypeScript modules with `python3 setup.py build_ts` after edit.

5. Submit Pull Request
^^^^^^^^^^^^^^^^^^^^^^

All changes are merged to master branch from your forked repo. The description of Pull Request must be meaningful, and useful.

We will review the changes as soon as possible. Once it passes review, we will merge it to master branch.

For more contribution guidelines and coding styles, you can refer to the `contributing document <Contributing.rst>`__.