Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Commit

Permalink
Remove multiphase from WebUI (#2396)
Browse files Browse the repository at this point in the history
As requirement of #2390 , removed multiphase from WebUI, document, and put all trials flatten on WebUI.

1. The major change is to split trial-jobs to trials in webui, and use parameter id as part of trial id.
2. If multiphase is enabled, the limitation of trial controls job count only, not trials actually.
3. When multiphase enabled, the trial status may not be right. Previous trials in a job will be marked as success, only last trial presents the job's status.
4. multiphase related documents and UX are removed.

minor changes,
1. Update dev document for webui development.
  • Loading branch information
squirrelsc authored May 10, 2020
1 parent 31a247b commit 7e35d32
Show file tree
Hide file tree
Showing 16 changed files with 148 additions and 290 deletions.
87 changes: 0 additions & 87 deletions docs/en_US/AdvancedFeature/MultiPhase.md

This file was deleted.

7 changes: 2 additions & 5 deletions docs/en_US/Release.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@

* Documentation
- Update the docs structure -Issue #1231
- [Multi phase document improvement](AdvancedFeature/MultiPhase.md) -Issue #1233 -PR #1242
- (deprecated) Multi phase document improvement -Issue #1233 -PR #1242
+ Add configuration example
- [WebUI description improvement](Tutorial/WebUI.md) -PR #1419

Expand Down Expand Up @@ -234,12 +234,10 @@
* Add `enas-mode` and `oneshot-mode` for NAS interface: [PR #1201](https://github.com/microsoft/nni/pull/1201#issue-291094510)
* [Gaussian Process Tuner with Matern kernel](Tuner/GPTuner.md)

* Multiphase experiment supports
* (deprecated) Multiphase experiment supports
* Added new training service support for multiphase experiment: PAI mode supports multiphase experiment since v0.9.
* Added multiphase capability for the following builtin tuners:
* TPE, Random Search, Anneal, Naïve Evolution, SMAC, Network Morphism, Metis Tuner.

For details, please refer to [Write a tuner that leverages multi-phase](AdvancedFeature/MultiPhase.md)

* Web Portal
* Enable trial comparation in Web Portal. For details, refer to [View trials status](Tutorial/WebUI.md)
Expand Down Expand Up @@ -549,4 +547,3 @@ Initial release of Neural Network Intelligence (NNI).
* Support CI by providing out-of-box integration with [travis-ci](https://github.com/travis-ci) on ubuntu
* Others
* Support simple GPU job scheduling

4 changes: 2 additions & 2 deletions docs/en_US/Tuner/CustomizeTuner.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class CustomizedTuner(Tuner):
...
```

`receive_trial_result` will receive the `parameter_id, parameters, value` as parameters input. Also, Tuner will receive the `value` object are exactly same value that Trial send. If `multiPhase` is set to `true` in the experiment configuration file, an additional `trial_job_id` parameter is passed to `receive_trial_result` and `generate_parameters` through the `**kwargs` parameter.
`receive_trial_result` will receive the `parameter_id, parameters, value` as parameters input. Also, Tuner will receive the `value` object are exactly same value that Trial send.

The `your_parameters` return from `generate_parameters` function, will be package as json object by NNI SDK. NNI SDK will unpack json object so the Trial will receive the exact same `your_parameters` from Tuner.

Expand Down Expand Up @@ -109,4 +109,4 @@ More detail example you could see:
### Write a more advanced automl algorithm

The methods above are usually enough to write a general tuner. However, users may also want more methods, for example, intermediate results, trials' state (e.g., the methods in assessor), in order to have a more powerful automl algorithm. Therefore, we have another concept called `advisor` which directly inherits from `MsgDispatcherBase` in [`src/sdk/pynni/nni/msg_dispatcher_base.py`](https://github.com/Microsoft/nni/tree/master/src/sdk/pynni/nni/msg_dispatcher_base.py). Please refer to [here](CustomizeAdvisor.md) for how to write a customized advisor.
The methods above are usually enough to write a general tuner. However, users may also want more methods, for example, intermediate results, trials' state (e.g., the methods in assessor), in order to have a more powerful automl algorithm. Therefore, we have another concept called `advisor` which directly inherits from `MsgDispatcherBase` in [`src/sdk/pynni/nni/msg_dispatcher_base.py`](https://github.com/Microsoft/nni/tree/master/src/sdk/pynni/nni/msg_dispatcher_base.py). Please refer to [here](CustomizeAdvisor.md) for how to write a customized advisor.
13 changes: 0 additions & 13 deletions docs/en_US/Tutorial/ExperimentConfig.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ This document describes the rules to write the config file, and provides some ex
+ [trainingServicePlatform](#trainingserviceplatform)
+ [searchSpacePath](#searchspacepath)
+ [useAnnotation](#useannotation)
+ [multiPhase](#multiphase)
+ [multiThread](#multithread)
+ [nniManagerIp](#nnimanagerip)
+ [logDir](#logdir)
Expand Down Expand Up @@ -94,8 +93,6 @@ searchSpacePath:
#choice: true, false, default: false
useAnnotation:
#choice: true, false, default: false
multiPhase:
#choice: true, false, default: false
multiThread:
tuner:
#choice: TPE, Random, Anneal, Evolution
Expand Down Expand Up @@ -130,8 +127,6 @@ searchSpacePath:
#choice: true, false, default: false
useAnnotation:
#choice: true, false, default: false
multiPhase:
#choice: true, false, default: false
multiThread:
tuner:
#choice: TPE, Random, Anneal, Evolution
Expand Down Expand Up @@ -171,8 +166,6 @@ trainingServicePlatform:
#choice: true, false, default: false
useAnnotation:
#choice: true, false, default: false
multiPhase:
#choice: true, false, default: false
multiThread:
tuner:
#choice: TPE, Random, Anneal, Evolution
Expand Down Expand Up @@ -283,12 +276,6 @@ Use annotation to analysis trial code and generate search space.

Note: if __useAnnotation__ is true, the searchSpacePath field should be removed.

### multiPhase

Optional. Bool. Default: false.

Enable [multi-phase experiment](../AdvancedFeature/MultiPhase.md).

### multiThread

Optional. Bool. Default: false.
Expand Down
6 changes: 2 additions & 4 deletions docs/en_US/Tutorial/SetupNniDeveloperEnvironment.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,8 @@ It doesn't need to redeploy, but the nnictl may need to be restarted.

#### TypeScript

* If `src/nni_manager` will be changed, run `yarn watch` continually under this folder. It will rebuild code instantly.
* If `src/webui` or `src/nasui` is changed, use **step 3** to rebuild code.

The nnictl may need to be restarted.
* If `src/nni_manager` is changed, run `yarn watch` continually under this folder. It will rebuild code instantly. The nnictl may need to be restarted to reload NNI manager.
* If `src/webui` or `src/nasui` are changed, run `yarn start` under the corresponding folder. The web UI will refresh automatically if code is changed.


---
Expand Down
1 change: 0 additions & 1 deletion docs/en_US/hpo_advanced.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ Advanced Features
.. toctree::
:maxdepth: 2

Enable Multi-phase <AdvancedFeature/MultiPhase>
Write a New Tuner <Tuner/CustomizeTuner>
Write a New Assessor <Assessor/CustomizeAssessor>
Write a New Advisor <Tuner/CustomizeAdvisor>
Expand Down
88 changes: 0 additions & 88 deletions docs/zh_CN/AdvancedFeature/MultiPhase.md

This file was deleted.

17 changes: 9 additions & 8 deletions src/webui/src/components/Modals/ExperimentDrawer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
import { MANAGER_IP, DRAWEROPTION } from '../../static/const';
import MonacoEditor from 'react-monaco-editor';
import '../../static/style/logDrawer.scss';
import { TrialManager } from '../../static/model/trialmanager';

interface ExpDrawerProps {
isVisble: boolean;
Expand Down Expand Up @@ -37,27 +38,27 @@ class ExperimentDrawer extends React.Component<ExpDrawerProps, ExpDrawerState> {
axios.get(`${MANAGER_IP}/trial-jobs`),
axios.get(`${MANAGER_IP}/metric-data`)
])
.then(axios.spread((res, res1, res2) => {
if (res.status === 200 && res1.status === 200 && res2.status === 200) {
if (res.data.params.searchSpace) {
res.data.params.searchSpace = JSON.parse(res.data.params.searchSpace);
.then(axios.spread((resExperiment, resTrialJobs, resMetricData) => {
if (resExperiment.status === 200 && resTrialJobs.status === 200 && resMetricData.status === 200) {
if (resExperiment.data.params.searchSpace) {
resExperiment.data.params.searchSpace = JSON.parse(resExperiment.data.params.searchSpace);
}
const trialMessagesArr = res1.data;
const interResultList = res2.data;
const trialMessagesArr = TrialManager.expandJobsToTrials(resTrialJobs.data);
const interResultList = resMetricData.data;
Object.keys(trialMessagesArr).map(item => {
// not deal with trial's hyperParameters
const trialId = trialMessagesArr[item].id;
// add intermediate result message
trialMessagesArr[item].intermediate = [];
Object.keys(interResultList).map(key => {
const interId = interResultList[key].trialJobId;
const interId = `${interResultList[key].trialJobId}-${interResultList[key].parameterId}`;
if (trialId === interId) {
trialMessagesArr[item].intermediate.push(interResultList[key]);
}
});
});
const result = {
experimentParameters: res.data,
experimentParameters: resExperiment.data,
trialMessage: trialMessagesArr
};
if (this._isCompareMount === true) {
Expand Down
4 changes: 2 additions & 2 deletions src/webui/src/components/Modals/Killjob.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ class KillJob extends React.Component<KillJobProps, KillJobState> {
onKill = (): void => {
this.setState({ isCalloutVisible: false }, () => {
const { trial } = this.props;
killJob(trial.key, trial.id, trial.status);
killJob(trial.key, trial.jobId, trial.status);
});
}

Expand Down Expand Up @@ -127,4 +127,4 @@ class KillJob extends React.Component<KillJobProps, KillJobState> {
}
}

export default KillJob;
export default KillJob;
Loading

0 comments on commit 7e35d32

Please sign in to comment.