Skip to main content

Gensyn AI CPU Only

Setup swapfile

sudo fallocate -l 32G /swapfile
sudo dd if=/dev/zero of=/swapfile bs=1G count=32 status=progress
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile
swapon --show
free -h
echo '/swapfile swap swap defaults 0 0' | sudo tee -a /etc/fstab

Install this that

etc. etc.

sudo apt update && sudo apt install -qy net-tools python3 python3-venv python3-pip curl wget screen git lsof iproute2 nano unzip build-essential

Nodejs + Yarn

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.5/install.sh | bash
source ~/.bashrc
nvm install 'lts/*'
nvm use 'lts/*'
curl -sSL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt-get update -y
sudo apt-get install yarn -y

Ngrok

Create an account HERE

curl -sSL https://ngrok-agent.s3.amazonaws.com/ngrok.asc \
| sudo tee /etc/apt/trusted.gpg.d/ngrok.asc >/dev/null \
&& echo "deb https://ngrok-agent.s3.amazonaws.com buster main" \
| sudo tee /etc/apt/sources.list.d/ngrok.list \
&& sudo apt update \
&& sudo apt install ngrok
ngrok config add-authtoken YOUR_AUTH_TOKEN
screen -S ngrok
ngrok http http://localhost:3000

CTRL + A + D

Clone + Setup

Clone

git clone https://github.com/gensyn-ai/rl-swarm
cd rl-swarm
swarm.pem

If you have existsting swarm.pem, import swarm.pem first before continue to the next step

Edit config

config_file="$HOME/rl-swarm/hivemind_exp/configs/mac/grpo-qwen-2.5-0.5b-deepseek-r1.yaml"
sed -i \
-e 's/^torch_dtype: .*/torch_dtype: float32/' \
-e 's/^bf16: .*/bf16: false/' \
-e 's/^tf32: .*/tf32: false/' \
"$config_file"


sed -i 's/^max_steps: .*/max_steps: 20/' "$config_file"
sed -i 's/^logging_steps: .*/logging_steps: 5/' "$config_file"


sed -i \
-e 's/^max_prompt_length: .*/max_prompt_length: 128/' \
-e 's/^max_completion_length: .*/max_completion_length: 512/' \
"$config_file"

Start

Screen

screen -S gensyn

Shell

python3 -m venv .venv
source .venv/bin/activate
CPU_ONLY=true ./run_rl_swarm.sh
  • Y
  • A
  • 0.5
PS1: unbound variable error

For error like this

line 6: PS1: unbound variable
>> Shutting down trainer...
Terminated
  • edit bashrc file
nano $HOME/.bashrc
  • Find this [ -z "$PS1" ] && return edit with [ -z "${PS1-}" ] && return

Wait the installation process done

CTRL + A + D

Daemon Error

IF there's an error like this

hivemind.p2p.p2p_daemon_bindings.utils.P2PDaemonError: Daemon failed to start in 15.0 seconds
>> Shutting down trainer...
  • Edit startup timeout
sed -i -E 's/(startup_timeout: *float *= *)[0-9.]+/\1120/' $(python3 -c "import hivemind.p2p.p2p_daemon as m; print(m.__file__)")

Other Error? Join their Discord and ask their team