Cerebras Command Line Pattern
On This Page
Cerebras Command Line Pattern#
Note
This applies only to the pipeline models in both Slurm/Singularity and Kubernetes.
Cerebras provides the following Bash scripts:
csrun_cpufor compiling.cs_input_analyzerfor determining optimal Slurm resources, andcsrun_wsefor running on the Cerebras system.
This section describes the command line pattern you must follow to use these scripts.
Compile on a CPU node#
For example, to compile a model for training on a CPU node in a validate_only mode, here is an example csrun_cpu command:
csrun_cpu --mount_dirs="/data/ml,/lab/ml" \ python run.py --mode=train --validate_only
In the above example:
The
python run.py --mode=train --validate_onlyis a full Python command passed in as an argument for thecsrun_cpuscript. The other argument for thecsrun_cpuis--mount_dirs="/data/ml,/lab/ml".Note that
--mode=train --validate_onlyis the argument for therun.pyscript. Thecsrun_cpuwill use the data located in--mount_dirs="/data/ml,/lab/ml"and launches a Python session to execute therun.pycode in the--mode=train --validate_onlymode on the CPU node.
Run on Cerebras system#
Similarly, to run the model on the Cerebras system located at the IP address 10.255.253.0, here is an example command:
csrun_wse --total-nodes=3 --tasks-per-node=5 --cpus-per-task=16 \
python run.py --mode=train --cs_ip=10.255.253.0
In the above example:
The
python run.py --mode=train --cs_ip=10.255.253.0is a full Python command passed in as an argument for thecsrun_wsescript. The other arguments for thecsrun_wseare--total-nodes=3 --tasks-per-node=5 --cpus-per-task=16.The
csrun_wsewill use the Slurm settings of 3 nodes, with 5 workers each and 16 cpus assigned per worker, and will launch a Python session to execute therun.pycode in the--mode=trainmode on the Cerebras system located at IP address10.255.253.0.
See also
In addition to the arguments such as --validate_only, --mode=train and --cs_ip=10.255.253.0 shown above, the run.py supports several command line arguments. See The run.py Template for full details.