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
1f28d136
"docs/vscode:/vscode.git/clone" did not exist on "eb39749fa235446ef7960f400bbf4c5de903000f"
Unverified
Commit
1f28d136
authored
Jan 06, 2021
by
J-shang
Committed by
GitHub
Jan 06, 2021
Browse files
fix pai mode config (#3269)
parent
969c4c2f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
10 deletions
+17
-10
nni/experiment/config/convert.py
nni/experiment/config/convert.py
+12
-8
nni/experiment/config/openpai.py
nni/experiment/config/openpai.py
+5
-2
No files found.
nni/experiment/config/convert.py
View file @
1f28d136
...
...
@@ -18,6 +18,15 @@ def to_v1_yaml(config: ExperimentConfig, skip_nnictl: bool = False) -> Dict[str,
data
=
config
.
json
()
ts
=
data
.
pop
(
'trainingService'
)
data
[
'trial'
]
=
{
'command'
:
data
.
pop
(
'trialCommand'
),
'codeDir'
:
data
.
pop
(
'trialCodeDirectory'
),
}
if
'trialGpuNumber'
in
data
:
data
[
'trial'
][
'gpuNum'
]
=
data
.
pop
(
'trialGpuNumber'
)
if
isinstance
(
ts
,
list
):
hybrid_names
=
[]
for
conf
in
ts
:
...
...
@@ -70,14 +79,6 @@ def to_v1_yaml(config: ExperimentConfig, skip_nnictl: bool = False) -> Dict[str,
if
tuner_gpu_indices
is
not
None
:
data
[
'tuner'
][
'gpuIndicies'
]
=
tuner_gpu_indices
data
[
'trial'
]
=
{
'command'
:
data
.
pop
(
'trialCommand'
),
'codeDir'
:
data
.
pop
(
'trialCodeDirectory'
),
}
if
'trialGpuNumber'
in
data
:
data
[
'trial'
][
'gpuNum'
]
=
data
.
pop
(
'trialGpuNumber'
)
return
data
def
_handle_training_service
(
ts
,
data
):
...
...
@@ -113,6 +114,9 @@ def _handle_training_service(ts, data):
data
[
'trial'
][
'image'
]
=
ts
[
'dockerImage'
]
data
[
'trial'
][
'nniManagerNFSMountPath'
]
=
ts
[
'localStorageMountPoint'
]
data
[
'trial'
][
'containerNFSMountPath'
]
=
ts
[
'containerStorageMountPoint'
]
data
[
'trial'
][
'paiStorageConfigName'
]
=
ts
[
'storageConfigName'
]
data
[
'trial'
][
'cpuNum'
]
=
ts
[
'trialCpuNumber'
]
data
[
'trial'
][
'memoryMB'
]
=
ts
[
'trialMemorySize'
]
data
[
'paiConfig'
]
=
{
'userName'
:
ts
[
'username'
],
'token'
:
ts
[
'token'
],
...
...
nni/experiment/config/openpai.py
View file @
1f28d136
...
...
@@ -2,7 +2,7 @@
# Licensed under the MIT license.
from
dataclasses
import
dataclass
from
pathlib
import
Path
from
pathlib
import
Path
,
PurePosixPath
from
typing
import
Any
,
Dict
,
Optional
from
.base
import
PathLike
...
...
@@ -17,6 +17,9 @@ class OpenpaiConfig(TrainingServiceConfig):
host
:
str
username
:
str
token
:
str
trial_cpu_number
:
int
trial_memory_size
:
str
storage_config_name
:
str
docker_image
:
str
=
'msranni/nni:latest'
local_storage_mount_point
:
PathLike
container_storage_mount_point
:
str
...
...
@@ -34,7 +37,7 @@ class OpenpaiConfig(TrainingServiceConfig):
_validation_rules
=
{
'platform'
:
lambda
value
:
(
value
==
'openpai'
,
'cannot be modified'
),
'local_storage_mount_point'
:
lambda
value
:
Path
(
value
).
is_dir
(),
'container_storage_mount_point'
:
lambda
value
:
(
Path
(
value
).
is_absolute
(),
'is not absolute'
),
'container_storage_mount_point'
:
lambda
value
:
(
PurePosix
Path
(
value
).
is_absolute
(),
'is not absolute'
),
'openpai_config_file'
:
lambda
value
:
Path
(
value
).
is_file
()
}
...
...
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