-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Conversation
docs/en_US/Release.rst
Outdated
@@ -110,7 +110,7 @@ Training service | |||
"""""""""""""""" | |||
|
|||
|
|||
* Support configuring python environment using "preCommand" in remote mode (#2875) | |||
* Support configuring python environment using "pythonPath" in remote mode (#2875) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the release doc of v1.9, please revert it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reverted.
nni/experiment/config/convert.py
Outdated
@@ -105,7 +105,7 @@ def _handle_training_service(ts, data): | |||
'gpuIndices': _convert_gpu_indices(machine.get('gpuIndices')), | |||
'maxTrialNumPerGpu': machine.get('maxTrialNumPerGpu'), | |||
'useActiveGpu': machine.get('useActiveGpu'), | |||
'preCommand': machine.get('trialPrepareCommand') | |||
'pythonPath': machine.get('trialPrepareCommand') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
trialPrepareCommand
-> trialPythonPath
trial_prepare_command
-> trial_python_path
also in other files, like experiment_config.rst
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -538,7 +538,7 @@ If `trialGpuNumber`_ is less than the length of this value, only a subset will b | |||
This will be used as ``CUDA_VISIBLE_DEVICES`` environment variable. | |||
|
|||
|
|||
trialPrepareCommand | |||
trialPythonPath | |||
------------------- | |||
|
|||
Command(s) to run before launching each trial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The path will insert to PATH
before launching each trial.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -538,10 +538,10 @@ If `trialGpuNumber`_ is less than the length of this value, only a subset will b | |||
This will be used as ``CUDA_VISIBLE_DEVICES`` environment variable. | |||
|
|||
|
|||
trialPrepareCommand | |||
trialPythonPath |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what is the difference between pythonPath
and trialPythonPath
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pythonPath is config v1
trialPythonPath is config v2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why use different names?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just follow the previous naming way: preCommand
is config v1, trialPrepareCommand
is config v2. Or use pythonPath
is enough? @liuzhe-lz
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think pythonPath
is enough.
It was named trialPrepareCommand
because the command executes once per trial. preCommand
made me guess it would execute once per machine.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could someone explain when to use pythonPath
and when trialPythonPath
should be used?
@@ -144,7 +144,7 @@ Files in ``codeDir`` will be uploaded to remote machines automatically. You can | |||
Configure python environment | |||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
|
|||
By default, commands and scripts will be executed in the default environment in remote machine. If there are multiple python virtual environments in your remote machine, and you want to run experiments in a specific environment, then use **preCommand** to specify a python environment on your remote machine. | |||
By default, commands and scripts will be executed in the default environment in remote machine. If there are multiple python virtual environments in your remote machine, and you want to run experiments in a specific environment, then use **pythonPath** to specify a python path environment on your remote machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
python path evnironment
seems strange, python environment
is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
# preCommand: source ${replace_to_absolute_path_recommended_here}/bin/activate | ||
# preCommand: source ${replace_to_conda_path}/bin/activate ${replace_to_conda_env_name} | ||
preCommand: export PATH=${replace_to_python_environment_path_in_your_remote_machine}:$PATH | ||
pythonPath: ${replace_to_python_environment_path_in_your_remote_machine} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to add comments to show concrete path examples here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The doc said "The path will insert to PATH before launching each trial". Is /usr/bin/python3.7
supposed to be a directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a directory, "python3.7" is a folder name..I will rename it to "yourPythonPath" to avoid the misunderstanding.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then I suggest /opt/python3.7/bin
for Linux example.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@acured , how to set |
Set the natively python path(located) directly. |
did you tested using |
For "pip install" I am going to test, for "python" it is working fine. |
------------------- | ||
|
||
Command(s) to run before launching each trial. | ||
The path will insert to PATH before launching each trial. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please make it clear whether it's inserted at front or at tail.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
After a test, It will cause an issue when working on windows anaconda if only set the native python path without active the env. To fix this issue, user have to set other two path: "../script" and "../Library/bin", I already add it in config_remote.yml in this PR. There is no issue on linux. |
------------------- | ||
|
||
Command(s) to run before launching each trial. | ||
The path will insert at the front of PATH. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggest to add detailed description here, for example, what is this field used for? how to set the path for different python environments and OS, add examples like the ones you wrote in the example yaml file below
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ts/nni_manager/training_service/remote_machine/test/shellExecutor.test.ts
Show resolved
Hide resolved
@@ -144,7 +144,7 @@ Files in ``codeDir`` will be uploaded to remote machines automatically. You can | |||
Configure python environment | |||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | |||
|
|||
By default, commands and scripts will be executed in the default environment in remote machine. If there are multiple python virtual environments in your remote machine, and you want to run experiments in a specific environment, then use **preCommand** to specify a python environment on your remote machine. | |||
By default, commands and scripts will be executed in the default environment in remote machine. If there are multiple python virtual environments in your remote machine, and you want to run experiments in a specific environment, then use **pythonPath** to specify a python environment on your remote machine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How does it work? If I execute a command line tool that uses python, for example, nnictl, lightgbm, horovodrun, will it work?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When you set this pythonPath, it will be added to the front of env PATH in current terminal, which means when you run any tool that calls python or run python directly from the terminal, this python your provided the path will be chosen first.
But it only works for current terminal which your set the pythonPath at first.
No description provided.