You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior batch simulations relied on ``.pkl`` files to communicate data. In order to facilitate collation, specific data values can be sent directly via runtime memory at the end of the simulation via:
2965
+
Prior batch simulations relied on ``.pkl`` files to communicate data. In order to facilitate collation, specific data values can be sent directly via sockets at the end of the simulation via:
2966
2966
2967
2967
***sim.send(<data>)**: sends ``<data>`` to the batch ``dispatcher``
2968
2968
2969
2969
For ``search`` jobs, it is important to match the data sent with the metric specified in the search function. For instance, if the search call specifies a metric "loss", then ``sim.send`` should specify a key: value pair: ``{'loss': <value>}``.
2970
2970
2971
2971
6. Specifying a batch job
2972
2972
^^^^^^^^^^^^^^^^^^^^^^^^^
2973
-
Batch job handling is implemented from``netpyne.batchtools.search``. Below is a selection of relevant arguments for the ``search`` function, the full list of arguments can be referenced by calling:
2973
+
Batch job handling is implemented from``netpyne.batchtools.search``. Below is a selection of relevant arguments for the ``search`` function, the full list of arguments is available by calling:
2974
2974
2975
2975
.. code-block:: python
2976
2976
2977
2977
from netpyne.batchtools import search
2978
2978
help(search)
2979
2979
2980
-
**search (truncatedAPI)**
2980
+
**Search API (truncated):**
2981
2981
2982
2982
.. code-block:: python
2983
2983
@@ -2987,21 +2987,22 @@ Batch job handling is implemented from ``netpyne.batchtools.search``. Below is a
2987
2987
run_config: Optional[dict] =None, # batch configuration, (keyword: string pairs to customize the submit template)
2988
2988
params: Optional[dict] =None, # search space (dictionary of parameter keys: tune search spaces)
2989
2989
algorithm: Optional[str] ="variant_generator", # search algorithm to use, see SEARCH_ALG_IMPORT for available options
2990
-
label: Optional[str] ='search', # label for the search, any files generated will be prefixed with this string
2990
+
label: Optional[str] ="search", # label for the search, any files generated will be prefixed with this string
2991
2991
output_path: Optional[str] ='./batch', # directory for storing generated files, either relative to the current working directory if starting with '.' or an absolute path if starting with '/'
2992
2992
checkpoint_path: Optional[str] ='./checkpoint', # directory for storing checkpoint files, either relative to the current working directory if starting with '.' or an absolute path if starting with '/'
2993
2993
max_concurrent: Optional[int] =1, # number of concurrent trials to run at one time
2994
-
num_samples: Optional[int] =1, # number of trials to run, for parameter grids, a value of 1 means that the search will sample the parameter space of each value in the grid
2995
-
metric: Optional[str] =None, # metric to optimize (this should match some key: value pair in the returned data
2996
-
mode: Optional[str] ="min", # either 'min' or 'max' (whether to minimize or maximize the metric
2994
+
num_samples: Optional[int] =1, # number of trials to run; for parameter grids, a value of 1 means that the search will sample the parameter space of each value in the grid
2995
+
metric: Optional[str] =None, # metric to optimize (this should match some key: value pair in the returned data)
2996
+
mode: Optional[str] ="min", # either 'min' or 'max' (whether to minimize or maximize the metric)
2997
2997
sample_interval: Optional[int] =15, # interval to poll for new results (in seconds)
2998
2998
attempt_restore: Optional[bool] =True, # whether to attempt to restore from a checkpoint
2999
2999
) -> study: # results of the search
3000
3000
3001
-
The basic search implemented with the ``search`` function uses ``ray.tune``as the search algorithm backend, creates a `.csv` storing the results, andreturning a ``study``object containing. It takes the following parameters;
3001
+
The default parameter search implemented with the ``search`` function uses ``ray.tune``as the search algorithm backend, creates a `.csv` storing the results, andreturns a ``study``object containing the output. It takes the following two parameters:
3002
3002
3003
-
***job_type**: "``sge``", "``sh``", "``ssh_slurm``", "``ssh_sge``" specifies how the job should be submitted, "``sge``" will submit batch jobs through the Sun Grid Engine. "``sh``" will submit bach jobs through the shell on a local machine, "``ssh_slurm``"or"``ssh_sge``" will submit batch jobs through Slurm workload manager or Sun Grid Engine through an SSH connection.
3004
-
***comm_type**: either "``socket``" (INET socket), "``sfs``" (shared file system), "``sftp``" (secure file transfer protocol for jobs run through SSH) or``None``, specifying how the job should communicate with the dispatcher. If the ``comm_type``is specified as``None``, the search will notawaitor receive any data from the simulation before executing the next job submission. This is only applicable to searches that are executed in`"grid"`, `"variant_generator"`or`"random"` algorithms where results are not used to infer subsequent search suggestions...
3003
+
***job_type**: specifies how the job should be submitted; **"sge"** will submit batch jobs through the Sun Grid Engine; **"sh"** will submit bach jobs through the shell on a local machine; **"ssh_slurm"**or"ssh_sge" will submit batch jobs through Slurm workload manager or Sun Grid Engine through an SSH connection.
3004
+
3005
+
***comm_type**: specifies how the job should communicate with the dispatcher either; **"socket"** (INET socket), **"sfs"** (shared file system), **"sftp"** (secure file transfer protocol for jobs run through SSH) or**"None"**. If the ``comm_type``is specified as"None", the search will notawaitor receive any data from the simulation before executing the next job submission. This is only applicable to searches that are executed in"grid", "variant_generator"or"random" algorithms, where results are not used to infer subsequent search suggestions.
3005
3006
3006
3007
Currently, the following argument pairs are acceptable for``job_type``and``comm_type``::
3007
3008
@@ -3019,7 +3020,7 @@ Currently, the following argument pairs are acceptable for ``job_type`` and ``co
3019
3020
'sh' , 'sfs'-> job run directly on local shell, communication via shared file system
3020
3021
'sh' , None-> job run directly on local shell, no communication (only grid or random searches)
3021
3022
3022
-
***run_config**: a dictionary of keyword: string pairs to customize the submit template, the expected keyword: string pairs are dependent on the job_type
3023
+
***run_config**: a dictionary of keyword: string pairs to customize the submit template, the expected keyword: string pairs are dependent on the job_type:
3023
3024
3024
3025
.. code-block::
3025
3026
@@ -3077,9 +3078,9 @@ Currently, the following argument pairs are acceptable for ``job_type`` and ``co
3077
3078
3078
3079
3079
3080
3080
-
***params**: a dictionary of config values to perform the search over. The keys of the dictionary should match the keys of the config object to be updated. Lists or numpy generators >2 values will enforce a grid or choice search over the values; otherwise, a list of two values will create a uniform distribution sample space except when the search algorithm is explicitly set to `"grid"`
3081
+
***params**: a dictionary of config values to perform the search over. The keys of the dictionary should match the keys of the config object to be updated. Lists or numpy generators >2 values will enforce a grid or choice search over the values; otherwise, a list of two values will create a uniform distribution sample space except when the search algorithm is explicitly set to `"grid"`
3081
3082
3082
-
**usage1**: updating a constant value specified in the ``SimConfig``object
3083
+
**Usage1**: updating a constant value specified in the ``SimConfig``object:
3083
3084
3084
3085
.. code-block:: python
3085
3086
@@ -3100,7 +3101,7 @@ Currently, the following argument pairs are acceptable for ``job_type`` and ``co
3100
3101
'foo': range(10)
3101
3102
}
3102
3103
3103
-
**usage2**: updating a nested objectin the ``SimConfig``object
3104
+
**Usage2**: updating a nested objectin the ``SimConfig``object:
3104
3105
3105
3106
.. code-block:: python
3106
3107
@@ -3127,7 +3128,7 @@ Currently, the following argument pairs are acceptable for ``job_type`` and ``co
3127
3128
# cfg.foo = {'bar': {'baz': 0}}
3128
3129
# params = {'foo.bar.baz': range(10)}
3129
3130
3130
-
**usage3**: updating a listobjectin the ``SimConfig``object
3131
+
**Usage3**: updating a listobjectin the ``SimConfig``object:
3131
3132
3132
3133
.. code-block:: python
3133
3134
@@ -3160,21 +3161,20 @@ Currently, the following argument pairs are acceptable for ``job_type`` and ``co
3160
3161
*"grid": forces grid based search over the parameter space, but otherwise functions similar to "variant generator"
3161
3162
*"variant_generator": grid and random based search of the parameter space (see: https://docs.ray.io/en/latest/tune/api/suggestion.html)
3162
3163
*"random": grid and random based search of the parameter space (see: https://docs.ray.io/en/latest/tune/api/suggestion.html)
***label**: a label for the search, used for output file naming
3174
3174
3175
3175
***output_path**: the directory for storing generated files, can be a relative or absolute path
3176
3176
3177
-
***checkpoint_path**: the directory for storing internal ray checkpoint files (maintained by ``ray.tune``)in case the search needs to be restored, can be a relative or absolute path. This checkpoint path maintains search state and allows for restoring searches. On successful completion of a search, the default behavior of the search is to delete the checkpoint directory.
3177
+
***checkpoint_path**: the directory for storing internal ray checkpoint files (maintained by ``ray.tune``)in case the search needs to be restored; can be a relative or absolute path. This checkpoint path maintains search state and allows for restoring searches. On successful completion of a search, the default behavior of the search is to delete the checkpoint directory.
3178
3178
3179
3179
***max_concurrent**: the number of concurrent trials to run at one time
0 commit comments