Set up Cerebras’s virtual environment#

To launch a job in the Cerebras cluster, you need to create a Python virtual environment with Cerebras’s software dependencies. Create the virtual environment only once for every release.

Use Python 3.8 to set up your Python virtual environment. The name of the python3.8 executable may be different on your system (e.g, python, python3, python3.8, /opt/python3.8/bin/python3.8). Please ensure that you are using the correct name corresponding to the executable for python3.8.

Follow the steps on this page to set up your Cerebras virtual environment.

Create the virtual environment#

1. Create your environment named venv_cerebras_pt for a PyTorch environment using the following command:

$ /opt/python3.8/bin/python3.8 -m venv venv_cerebras_pt

Note

If you install Python from the source, install bzip2-devel and sqlite-devel on Linux, or you will have Python partially installed. Common Python packages might fail with an error message: “ModuleNotFoundError: No module named ‘_bz2’.

2. Install the cerebras_pytorch package using the following commands:

$ source venv_cerebras_pt/bin/activate

(venv_cerebras_pt) $ pip install --upgrade pip

(venv_cerebras_pt) $ pip install /opt/cerebras/wheels/cerebras_pytorch-1.9.0+1a41ffc316-cp38-cp38-linux_x86_64.whl --find-links=/opt/cerebras/wheels

If the path of Cerebras packages is not the default one (/opt/cerebras/wheels), replace the previous command with the location provided by your system administrator.

Note

If your user node requires a proxy to access to external packages, you can add the flag --proxy <proxy address> to the pip commands to install the Cerebras packages.

Test compatible software versions(optional)#

After installing the Cerebras wheels and activating your virtual environment, the cerebras_install_check utility will be available on the command line.

Use this utility to confirm the deployed versions of the appliance software are compatible by issuing the following command:

$ source venv_cerebras_pt/bin/activate
(venv_cerebras_pt) $ cerebras_install_check

This tool should automatically pick up the appliance configuration, but if you want to specify the appliance address manually, issue the following command:

(venv_cerebras_pt) $ cerebras_install_check -m <appliance_address>

You can now begin training your model on the Cerebras Wafer-Scale Cluster!