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
d047d6f4
Unverified
Commit
d047d6f4
authored
Mar 03, 2021
by
J-shang
Committed by
GitHub
Mar 03, 2021
Browse files
fix reuse local and trial (#3408)
parent
79d3c492
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
3 deletions
+9
-3
nni/tools/trial_tool/trial.py
nni/tools/trial_tool/trial.py
+6
-2
ts/nni_manager/training_service/reusable/environments/localEnvironmentService.ts
..._service/reusable/environments/localEnvironmentService.ts
+3
-1
No files found.
nni/tools/trial_tool/trial.py
View file @
d047d6f4
...
...
@@ -3,6 +3,7 @@
import
ctypes
import
os
import
sys
import
shlex
import
tarfile
import
time
...
...
@@ -88,8 +89,11 @@ class Trial:
trial_command
=
self
.
args
.
trial_command
gpuIndices
=
self
.
data
.
get
(
'
gpuIndices
'
)
gpuIndices
=
self
.
data
.
get
(
"
gpuIndices
"
)
if
(
gpuIndices
is
not
None
):
if
sys
.
platform
==
"win32"
:
trial_command
=
'set CUDA_VISIBLE_DEVICES="%s " && call %s'
%
(
gpuIndices
,
trial_command
)
else
:
trial_command
=
'CUDA_VISIBLE_DEVICES="%s " %s'
%
(
gpuIndices
,
trial_command
)
self
.
log_pipe_stdout
=
self
.
trial_syslogger_stdout
.
get_pipelog_reader
()
...
...
ts/nni_manager/training_service/reusable/environments/localEnvironmentService.ts
View file @
d047d6f4
...
...
@@ -92,9 +92,11 @@ export class LocalEnvironmentService extends EnvironmentService {
private
getScript
(
environment
:
EnvironmentInformation
):
string
[]
{
const
script
:
string
[]
=
[];
if
(
process
.
platform
===
'
win32
'
)
{
script
.
push
(
`$env:PATH="
${
process
.
env
.
path
}
"`
)
script
.
push
(
`cd $env:
${
this
.
experimentRootDir
}
`
);
script
.
push
(
`New-Item -ItemType "directory" -Path
${
path
.
join
(
this
.
experimentRootDir
,
'
envs
'
,
environment
.
id
)}
-Force`
);
environment
.
command
=
`cd envs\
\$
{environment.id} && python -m nni.tools.trial_tool.trial_runner`
;
script
.
push
(
`cd envs\
\$
{environment.id}`
);
environment
.
command
=
`python -m nni.tools.trial_tool.trial_runner`
;
script
.
push
(
`cmd.exe /c
${
environment
.
command
}
--job_pid_file
${
path
.
join
(
environment
.
runnerWorkingFolder
,
'
pid
'
)}
2>&1 | Out-File "
${
path
.
join
(
environment
.
runnerWorkingFolder
,
'
trial_runner.log
'
)}
" -encoding utf8`
,
`$NOW_DATE = [int64](([datetime]::UtcNow)-(get-date "1/1/1970")).TotalSeconds`
,
...
...
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