Compile on CPU

Compile on CPU

We recommend that you:

  • First use the csrun_cpu Bash script to compile your model successfully on an Original Cerebras Support-Cluster CPU node, and

  • Only then run the model on the CS system using the csrun_wse Bash 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_only mode that runs a fast, light-weight verification. See Validate only.

Compile

After a successful validate_only run, you can run full compilation with compile_only mode. See compile-only.

Using compiled artifacts

You can optimize for your specific CS system early on, even while running compile_only on 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 the compile_only mode with --cs_ip flag and passing in the IP address of the CS system. This will ensure that csrun_cpu optimizes the compile for your specific CS system. See using-compiled-artifacts.

Note

To run your model with validate_only or compile_only option, 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_ip flag with the csrun_cpu and 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 bash

will launch a Bash shell inside the Cerebras container, and

csrun_cpu python

will 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.