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

Change command lines as serial. #3367

Merged
merged 8 commits into from
Feb 23, 2021
Merged

Change command lines as serial. #3367

merged 8 commits into from
Feb 23, 2021

Conversation

acured
Copy link
Contributor

@acured acured commented Feb 7, 2021

No description provided.

@SparkSnail
Copy link
Contributor

What's the purpose of this change?

@@ -46,7 +46,7 @@ class WindowsCommands extends OsCommands {
}

public generateGpuStatsScript(scriptFolder: string): string {
return `powershell -command $env:Path=If($env:prePath){$env:prePath}Else{$env:Path};$env:METRIC_OUTPUT_DIR='${scriptFolder}';$app = Start-Process -FilePath python -NoNewWindow -passthru -ArgumentList '-m nni.tools.gpu_tool.gpu_metrics_collector' -RedirectStandardOutput ${scriptFolder}\\scriptstdout -RedirectStandardError ${scriptFolder}\\scriptstderr;Write $PID ^| Out-File ${scriptFolder}\\pid -NoNewline -encoding utf8;wait-process $app.ID`;
return `powershell -command $setEnv = Start-Job -script {$env:Path=If($env:prePath){$env:prePath}Else{$env:Path};$env:METRIC_OUTPUT_DIR='${scriptFolder}'};wait-job $setEnv;$app = Start-Process -FilePath python -NoNewWindow -passthru -ArgumentList '-m nni.tools.gpu_tool.gpu_metrics_collector' -RedirectStandardOutput ${scriptFolder}\\scriptstdout -RedirectStandardError ${scriptFolder}\\scriptstderr;Write $PID ^| Out-File ${scriptFolder}\\pid -NoNewline -encoding utf8;wait-process $app.ID`;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why need to put $env into Start-Job?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@acured because did not finish changing environment variables before starting the gpu_metrics_collector?

Copy link
Contributor Author

@acured acured Feb 22, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@J-shang Right, to fix this issue.

@acured
Copy link
Contributor Author

acured commented Feb 22, 2021

What's the purpose of this change?

To fix this issue

preCommand: command1 && command2 && command3

**注意**:因为 ``preCommand`` 每次都会在其他命令之前执行,所以强烈建议不要设置 **preCommand** 来对系统进行更改,即 ``mkdir`` or ``touch``.
pythonPath: ${replace_to_python_environment_path_in_your_remote_machine}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't modify the Chinese doc directly, this part will auto-update.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

@SparkSnail
Copy link
Contributor

Please add eng doc.

@acured
Copy link
Contributor Author

acured commented Feb 22, 2021

Please add eng doc.

Done.

@SparkSnail
Copy link
Contributor

Please add eng doc.

Done.

Miss ExperimentConfig.rst

@acured
Copy link
Contributor Author

acured commented Feb 22, 2021

Please add eng doc.

Done.

Miss ExperimentConfig.rst

Done.

@J-shang J-shang merged commit 06e5aa7 into microsoft:master Feb 23, 2021
@J-shang J-shang mentioned this pull request Feb 24, 2021
94 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants