Compile on CPU
On This Page
Compile on CPU¶
We recommend that you:
First use the
csrun_cpuBash script to compile your model successfully on an Original Cerebras Support-Cluster CPU node, andOnly then run the model on the CS system using the
csrun_wseBash script.
See also
See The csrun_cpu Script for detailed documentation on how to use this Bash script.
Benefits¶
Running your model using csrun_cpu first on an Original Cerebras Support-Cluster CPU node has several benefits:
- Validate only
You can run in
validate_onlymode that runs a fast, light-weight verification. See Validate only.- Compile
After a successful
validate_onlyrun, you can run full compilation withcompile_onlymode. See compile-only.- Using compiled artifacts
You can optimize for your specific CS system early on, even while running
compile_onlyon the Original Cerebras Support-Cluster CPU. This enables you to use these compiled artifacts later when you run this network on the CS system and save time in your workflow. You can accomplish this by running thecompile_onlymode with--cs_ipflag and passing in the IP address of the CS system. This will ensure thatcsrun_cpuoptimizes the compile for your specific CS system. See using-compiled-artifacts.Note
To run your model with
validate_onlyorcompile_onlyoption, you do not need access to the CS system. However, if you plan to use the artifacts of this compiled directory for training on the CS system, then you must use--cs_ipflag with thecsrun_cpuand pass the IP address of the CS system.
Using csrun_cpu¶
You can compile your neural network on a CPU without running it on the CS system. Note that to compile on a CPU, you must execute your compile commands within the Cerebras Singularity container. The CGC (Cerebras Graph Compiler) software contains the csrun_cpu script that launches a given user command within the Cerebras Singularity container. For example:
csrun_cpu bashwill launch a Bash shell inside the Cerebras container, and
csrun_cpu pythonwill launch a Python interpreter inside the Cerebras container.
Use the csrun_cpu script to execute a run script like run.py with validate_only or compile_only options on a CPU.