Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
nni
Commits
0a21a901
Unverified
Commit
0a21a901
authored
Sep 09, 2020
by
J-shang
Committed by
GitHub
Sep 09, 2020
Browse files
fix some spelling (#2855)
Co-authored-by:
Ning Shang
<
nishang@microsoft.com
>
parent
2a8b0f6f
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
14 additions
and
14 deletions
+14
-14
src/nni_manager/training_service/reusable/commandChannel.ts
src/nni_manager/training_service/reusable/commandChannel.ts
+2
-2
src/nni_manager/training_service/reusable/environment.ts
src/nni_manager/training_service/reusable/environment.ts
+4
-4
src/nni_manager/training_service/reusable/environments/amlEnvironmentService.ts
...ng_service/reusable/environments/amlEnvironmentService.ts
+1
-1
src/nni_manager/training_service/reusable/trial.ts
src/nni_manager/training_service/reusable/trial.ts
+3
-3
src/nni_manager/training_service/reusable/trialDispatcher.ts
src/nni_manager/training_service/reusable/trialDispatcher.ts
+4
-4
No files found.
src/nni_manager/training_service/reusable/commandChannel.ts
View file @
0a21a901
...
@@ -65,8 +65,8 @@ export abstract class CommandChannel {
...
@@ -65,8 +65,8 @@ export abstract class CommandChannel {
protected
abstract
sendCommandInternal
(
environment
:
EnvironmentInformation
,
message
:
string
):
Promise
<
void
>
;
protected
abstract
sendCommandInternal
(
environment
:
EnvironmentInformation
,
message
:
string
):
Promise
<
void
>
;
protected
abstract
createRunnerConnection
(
environment
:
EnvironmentInformation
):
RunnerConnection
;
protected
abstract
createRunnerConnection
(
environment
:
EnvironmentInformation
):
RunnerConnection
;
public
async
sendCommand
(
environment
:
EnvironmentInformation
,
comman
t
Type
:
string
,
data
:
any
):
Promise
<
void
>
{
public
async
sendCommand
(
environment
:
EnvironmentInformation
,
comman
d
Type
:
string
,
data
:
any
):
Promise
<
void
>
{
const
command
=
encodeCommand
(
comman
t
Type
,
JSON
.
stringify
(
data
));
const
command
=
encodeCommand
(
comman
d
Type
,
JSON
.
stringify
(
data
));
this
.
log
.
debug
(
`CommandChannel: env
${
environment
.
id
}
sending command:
${
command
}
`
);
this
.
log
.
debug
(
`CommandChannel: env
${
environment
.
id
}
sending command:
${
command
}
`
);
await
this
.
sendCommandInternal
(
environment
,
command
.
toString
(
"
utf8
"
));
await
this
.
sendCommandInternal
(
environment
,
command
.
toString
(
"
utf8
"
));
}
}
...
...
src/nni_manager/training_service/reusable/environment.ts
View file @
0a21a901
...
@@ -65,7 +65,7 @@ export class EnvironmentInformation {
...
@@ -65,7 +65,7 @@ export class EnvironmentInformation {
public
nodeCount
:
number
=
1
;
public
nodeCount
:
number
=
1
;
// it's used to aggregate node status for multiple node trial
// it's used to aggregate node status for multiple node trial
public
nodes
:
Map
<
string
,
NodeInfomation
>
;
public
nodes
:
Map
<
string
,
NodeInfo
r
mation
>
;
public
gpuSummaries
:
Map
<
string
,
TrialGpuSummary
>
=
new
Map
<
string
,
TrialGpuSummary
>
();
public
gpuSummaries
:
Map
<
string
,
TrialGpuSummary
>
=
new
Map
<
string
,
TrialGpuSummary
>
();
// use can specify which gpus can be used by NNI.
// use can specify which gpus can be used by NNI.
...
@@ -80,7 +80,7 @@ export class EnvironmentInformation {
...
@@ -80,7 +80,7 @@ export class EnvironmentInformation {
this
.
id
=
id
;
this
.
id
=
id
;
this
.
name
=
name
;
this
.
name
=
name
;
this
.
envId
=
envId
?
envId
:
name
;
this
.
envId
=
envId
?
envId
:
name
;
this
.
nodes
=
new
Map
<
string
,
NodeInfomation
>
();
this
.
nodes
=
new
Map
<
string
,
NodeInfo
r
mation
>
();
}
}
public
setStatus
(
status
:
EnvironmentStatus
):
void
{
public
setStatus
(
status
:
EnvironmentStatus
):
void
{
...
@@ -145,12 +145,12 @@ export abstract class EnvironmentService {
...
@@ -145,12 +145,12 @@ export abstract class EnvironmentService {
return
new
WebCommandChannel
(
commandEmitter
);
return
new
WebCommandChannel
(
commandEmitter
);
}
}
public
createEnvi
o
rnmentInfomation
(
envId
:
string
,
envName
:
string
):
EnvironmentInformation
{
public
createEnvir
o
nmentInfo
r
mation
(
envId
:
string
,
envName
:
string
):
EnvironmentInformation
{
return
new
EnvironmentInformation
(
envId
,
envName
);
return
new
EnvironmentInformation
(
envId
,
envName
);
}
}
}
}
export
class
NodeInfomation
{
export
class
NodeInfo
r
mation
{
public
id
:
string
;
public
id
:
string
;
public
status
:
TrialJobStatus
=
"
UNKNOWN
"
;
public
status
:
TrialJobStatus
=
"
UNKNOWN
"
;
public
endTime
?:
number
;
public
endTime
?:
number
;
...
...
src/nni_manager/training_service/reusable/environments/amlEnvironmentService.ts
View file @
0a21a901
...
@@ -45,7 +45,7 @@ export class AMLEnvironmentService extends EnvironmentService {
...
@@ -45,7 +45,7 @@ export class AMLEnvironmentService extends EnvironmentService {
return
new
AMLCommandChannel
(
commandEmitter
);
return
new
AMLCommandChannel
(
commandEmitter
);
}
}
public
createEnvi
o
rnmentInfomation
(
envId
:
string
,
envName
:
string
):
EnvironmentInformation
{
public
createEnvir
o
nmentInfo
r
mation
(
envId
:
string
,
envName
:
string
):
EnvironmentInformation
{
return
new
AMLEnvironmentInformation
(
envId
,
envName
);
return
new
AMLEnvironmentInformation
(
envId
,
envName
);
}
}
...
...
src/nni_manager/training_service/reusable/trial.ts
View file @
0a21a901
...
@@ -5,7 +5,7 @@
...
@@ -5,7 +5,7 @@
import
{
TrialJobApplicationForm
,
TrialJobDetail
,
TrialJobStatus
}
from
"
../../common/trainingService
"
;
import
{
TrialJobApplicationForm
,
TrialJobDetail
,
TrialJobStatus
}
from
"
../../common/trainingService
"
;
import
{
GPUInfo
}
from
"
../../training_service/common/gpuData
"
;
import
{
GPUInfo
}
from
"
../../training_service/common/gpuData
"
;
import
{
EnvironmentInformation
,
NodeInfomation
}
from
"
./environment
"
;
import
{
EnvironmentInformation
,
NodeInfo
r
mation
}
from
"
./environment
"
;
export
class
TrialDetail
implements
TrialJobDetail
{
export
class
TrialDetail
implements
TrialJobDetail
{
public
id
:
string
;
public
id
:
string
;
...
@@ -23,7 +23,7 @@ export class TrialDetail implements TrialJobDetail {
...
@@ -23,7 +23,7 @@ export class TrialDetail implements TrialJobDetail {
// init settings of trial
// init settings of trial
public
settings
=
{};
public
settings
=
{};
// it's used to aggregate node status for multiple node trial
// it's used to aggregate node status for multiple node trial
public
nodes
:
Map
<
string
,
NodeInfomation
>
;
public
nodes
:
Map
<
string
,
NodeInfo
r
mation
>
;
// assigned GPUs for multi-trial scheduled.
// assigned GPUs for multi-trial scheduled.
public
assignedGpus
:
GPUInfo
[]
|
undefined
;
public
assignedGpus
:
GPUInfo
[]
|
undefined
;
...
@@ -37,6 +37,6 @@ export class TrialDetail implements TrialJobDetail {
...
@@ -37,6 +37,6 @@ export class TrialDetail implements TrialJobDetail {
this
.
workingDirectory
=
workingDirectory
;
this
.
workingDirectory
=
workingDirectory
;
this
.
form
=
form
;
this
.
form
=
form
;
this
.
tags
=
[];
this
.
tags
=
[];
this
.
nodes
=
new
Map
<
string
,
NodeInfomation
>
();
this
.
nodes
=
new
Map
<
string
,
NodeInfo
r
mation
>
();
}
}
}
}
src/nni_manager/training_service/reusable/trialDispatcher.ts
View file @
0a21a901
...
@@ -21,7 +21,7 @@ import { TrialConfig } from '../common/trialConfig';
...
@@ -21,7 +21,7 @@ import { TrialConfig } from '../common/trialConfig';
import
{
TrialConfigMetadataKey
}
from
'
../common/trialConfigMetadataKey
'
;
import
{
TrialConfigMetadataKey
}
from
'
../common/trialConfigMetadataKey
'
;
import
{
validateCodeDir
}
from
'
../common/util
'
;
import
{
validateCodeDir
}
from
'
../common/util
'
;
import
{
Command
,
CommandChannel
}
from
'
./commandChannel
'
;
import
{
Command
,
CommandChannel
}
from
'
./commandChannel
'
;
import
{
EnvironmentInformation
,
EnvironmentService
,
NodeInfomation
,
RunnerSettings
,
TrialGpuSummary
}
from
'
./environment
'
;
import
{
EnvironmentInformation
,
EnvironmentService
,
NodeInfo
r
mation
,
RunnerSettings
,
TrialGpuSummary
}
from
'
./environment
'
;
import
{
GpuScheduler
}
from
'
./gpuScheduler
'
;
import
{
GpuScheduler
}
from
'
./gpuScheduler
'
;
import
{
MountedStorageService
}
from
'
./storages/mountedStorageService
'
;
import
{
MountedStorageService
}
from
'
./storages/mountedStorageService
'
;
import
{
StorageService
}
from
'
./storageService
'
;
import
{
StorageService
}
from
'
./storageService
'
;
...
@@ -587,7 +587,7 @@ class TrialDispatcher implements TrainingService {
...
@@ -587,7 +587,7 @@ class TrialDispatcher implements TrainingService {
const
environmentService
=
component
.
get
<
EnvironmentService
>
(
EnvironmentService
);
const
environmentService
=
component
.
get
<
EnvironmentService
>
(
EnvironmentService
);
const
envId
=
uniqueString
(
5
);
const
envId
=
uniqueString
(
5
);
const
envName
=
`nni_exp_
${
this
.
experimentId
}
_env_
${
envId
}
`
;
const
envName
=
`nni_exp_
${
this
.
experimentId
}
_env_
${
envId
}
`
;
const
environment
=
environmentService
.
createEnvi
o
rnmentInfomation
(
envId
,
envName
);
const
environment
=
environmentService
.
createEnvir
o
nmentInfo
r
mation
(
envId
,
envName
);
environment
.
command
=
`sh ../install_nni.sh && python3 -m nni_trial_tool.trial_runner`
;
environment
.
command
=
`sh ../install_nni.sh && python3 -m nni_trial_tool.trial_runner`
;
...
@@ -737,7 +737,7 @@ class TrialDispatcher implements TrainingService {
...
@@ -737,7 +737,7 @@ class TrialDispatcher implements TrainingService {
if
(
environment
.
nodeCount
>
1
)
{
if
(
environment
.
nodeCount
>
1
)
{
let
node
=
environment
.
nodes
.
get
(
nodeId
);
let
node
=
environment
.
nodes
.
get
(
nodeId
);
if
(
node
===
undefined
)
{
if
(
node
===
undefined
)
{
node
=
new
NodeInfomation
(
nodeId
);
node
=
new
NodeInfo
r
mation
(
nodeId
);
environment
.
nodes
.
set
(
nodeId
,
node
);
environment
.
nodes
.
set
(
nodeId
,
node
);
}
}
const
oldNodeStatus
=
node
.
status
;
const
oldNodeStatus
=
node
.
status
;
...
@@ -796,7 +796,7 @@ class TrialDispatcher implements TrainingService {
...
@@ -796,7 +796,7 @@ class TrialDispatcher implements TrainingService {
let
node
=
environment
.
nodes
.
get
(
nodeId
);
let
node
=
environment
.
nodes
.
get
(
nodeId
);
if
(
node
===
undefined
)
{
if
(
node
===
undefined
)
{
node
=
new
NodeInfomation
(
nodeId
);
node
=
new
NodeInfo
r
mation
(
nodeId
);
trial
.
nodes
.
set
(
nodeId
,
node
);
trial
.
nodes
.
set
(
nodeId
,
node
);
}
}
if
(
undefined
===
node
)
{
if
(
undefined
===
node
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment