Installation and Setup
Contents
Installation and Setup¶
This guide provides step-by-step instructions for installing the Singularity container build of the Cerebras Software Development Kit (SDK).
This is the way to use the SDK if you’re running the fabric simulator locally on your own machine, or you’re using a legacy Cerebras system installation.
For information about using the SDK on Cerebras Wafer-Scale Clusters running in Appliance Mode, see Running SDK on a Wafer-Scale Cluster.
Summary¶
The files you downloaded from Cerebras will contain the SDK software consisting of several scripts, folders, and other files such as the EULA.
The SDK software is composed of a Singularity Image File named cbcore_sdk-0.9.0-{build id}.sif
. There are helper scripts to access the relevant functionality of the SIF: cslc
, cs_python
, csdb
, cs_readelf
, and sdk_debug_shell
.
Requirements¶
Singularity: Singularity is required for hosting the Cerebras SDK container image. See the Singularity Quick Start guide for instructions on how to set up Singularity.
Overlay Filesystem: The SDK requires that the overlay filesystem functionality is available on your Linux system. If your Linux kernel version is 3.18 or later then the overlay filesystem functionality is already available.
Bash: The SDK requires Bash on your Linux system.
Make sure your system has the required software before proceeding to the installation.
(Optional) Hash check with sha256sum
¶
After downloading the files on Dropbox, you should have the following files in the same directory:
Cerebras-SDK-0.9.0-{build_id}.tar.gz
: The tarball containing the Singularity container.
sha256sum.txt
: A text file containing the hash of all the tarball.
Verify that the downloaded files are not corrupted. Follow these steps:
In the directory where you have downloaded the tar file, verify the checksum:
$ cd /my/install/location $ sha256sum --check sha256sum.txt
If you see the output that shows OK
, then the downloaded files are not corrupted and are good to use.
Extract the files¶
To extract the SDK contents, first set the following environment variables.
The
SDK_INSTALL_LOCATION
is the location you want to install the Cerebras SDK. This can be any (writable) directory.SDK_INSTALL_LOCATION
andSDK_TAR_PATH
should be absolute paths.$ SDK_INSTALL_LOCATION=/my/install/location $ SDK_INSTALL_PATH=$SDK_INSTALL_LOCATION/cs_sdk $ SDK_TAR_PATH=/path/to/Cerebras-SDK-0.9.0-{build id}.tar.gz
Create the directory where you will install the Cerebras SDK, and extract the files from the downloaded tar file into that directory.
$ mkdir -p $SDK_INSTALL_PATH $ tar -C $SDK_INSTALL_PATH -xvf $SDK_TAR_PATH
Extracted files¶
Verify that the following files are present in the $SDK_INSTALL_PATH
directory:
cbcore_sdk-0.9.0-{build id}.sif
: This is the SDK software. This file is about 3GB.
cerebras-software-eula.pdf
: This is the End User License Agreement.
csdb
: This is a script for running hardware debug tools.
cslc
: This is a script for running the CSL compiler.
cs_python
: This is a script for running Python code using the version of Python provided in the.sif
.
cs_readelf
: This is a script for running a Cerebras alternative toreadelf
.
sdk_debug_shell
: This is a script for running simulation debug tools, including the smoke test and the SDK GUI.
sdk-gui-LICENSE.txt
: This is the license for the GUI tool included.
csl-extras-{build id}.tar.gz
: This is a tarball containing example programs and additional extras.
csl_examples/
: This is a folder containing SDK example programs, including tutorials.
syntax_highlight/
: This is a folder containing a CSL syntax highlighter for vi/vim and VS Code IDE.
Installing the SDK software¶
Continue with the below steps to install the SDK software.
Add the Cerebras SDK to your PATH.
$ PATH_CMD='export PATH='$SDK_INSTALL_PATH':$PATH' $ eval $PATH_CMD
Add PATH update command to .bashrc:
$ echo $PATH_CMD >> ~/.bashrc
Test¶
Make sure you are in the install directory by running the below command:
$ cd $SDK_INSTALL_PATH
Untar the examples if you have not done so already, and run a basic smoke test to verify that the included examples compile and run as expected:
$ tar -xzvf csl-extras-{build id}.tar.gz $ sdk_debug_shell smoke csl-extras-{build id}
This smoke test will run all example programs in the simulator. If successful, your final output should be as below:
SUCCESS! PASSED SMOKE CHECK COMPLETED SUCCESSFULLY
A successful smoke
test indicates that the package is installed and setup correctly.
(Optional) Test for verifying SDK Debug GUI tool using the
gemm-collectives_2d
example:Run the
gemm-collectives_2d
test:$ cd $SDK_INSTALL_PATH/csl-extras-{build id}/benchmarks/SdkRuntime/gemm_collectives_2d $ ./commands.sh
Run the SDK Debug GUI:
$ sdk_debug_shell visualize
This will provide a URL.
Navigate to this URL in your browser:
Click this link to open URL: http://<url>:8000/sdk-gui?session_id=... Click this link to open URL: http://<ip address>:<port>/sdk-gui?session_id=... Press Ctrl-C to exit
If you navigate to either URL, you will see the following after selecting a PE: