Set up a Cerebras virtual environment#
Before you launch your first job in the Cerebras Wafer-Scale cluster, create a Python virtual environment to install Cerebras’s software dependencies. You need to create the virtual environment only once for every release.
Prerequisites#
Python version#
Use Python 3.8 to set up your environment.
Create a Cerebras virtual environment#
1. Create your Python virtual environment. It can also be pre-configured by a system administrator and could have a different name. For demonstration purposes, let’s create a virtual environment named venv_cerebras_pt
using the following command:
/opt/python3.8/bin/python3.8 -m venv venv_cerebras_pt
2. Install the cerebras_pytorch
package using the following commands:
source venv_cerebras_pt/bin/activate
Note that now you should be in the (venv_cerebras_pt)
environment.
pip install --upgrade pip
pip install cerebras_pytorch==2.2.1
Validate the setup#
To confirm that your Cerebras PyTorch python package is correctly installed in your environment, you can utilize a utility called cerebras_install_check
. This tool helps verify that the installed Cerebras software in your environment is compatible with the deployed appliance versions. Follow these steps to use the utility:
1. First, activate your virtual environment where the Cerebras PyTorch package is installed. If you named your virtual environment “venv_cerebras_pt”, you can activate it using:
source venv_cerebras_pt/bin/activate
After this command, your command line prompt should indicate that you’re in the “venv_cerebras_pt” environment.
2. With the environment activated, run the cerebras_install_check
command:
cerebras_install_check
By compiling a model as part of its verification process, cerebras_install_check
offers a thorough check, ensuring that every aspect of the Cerebras environment is set up correctly. If the utility detects any issues, it will provide detailed feedback for troubleshooting and resolution.