For simple notebooks, we recommend downloading the notebook from Goolge Colab as a .ipynb file, running a Vast Jupyter instance with the recommended Pytorch template and then uploading the notebook into Jupyter directly. Jupyter by itself is much more reliable than Google Colab, doesn’t require setting up SSH keys (you can open a terminal inside the browser), and has none of the limitations.
Run any Google Colab notebook on Vast
Colab supports a ‘local runtime’ option to allow people to run colab connecting to their local machine, using their own GPUs. This feature is intentionally restricted to allow only a localhost connection. Getting around that restriction requires using ssh forwarding to make a remote Jupyter instance appear local.Known issues and limitations
Colab is connecting to a remote Jupyter instance using SSH forwarding. If you close your browser, you might not be able to re-open the session. To fix that you will need to stop and then restart Jupyter through the SSH connection, get a new token, and then use that to reconnect to the local runtime in Colab. Another small limitation is that there is no way (unless you get Colabs Pro) to open a terminal from within Colab. A simple Jupyter Vast instance doesn’t have that limitation and you can always open a terminal right in the browser.Step 1 - Create a Pytorch SSH instance
Use this Colab template that uses the common Pytorch image with a direct SSH launch mode. After clicking on that link, your instance configuration will be set. Setup an account, purchase credits and then select an appropriate GPU by clicking the “rent” button.Step 2 - SSH into the instance
Our default SSH command for Linux/macOS already forwards port 8080. The default SSH command can be found by clicking on the Connect button from a rented instance. Run that command. You will then have an active SSH connection to the GPU instance.Step 2.5 - Windows Only
On Windows, Colab is more complicated. The reason is that Windows has no simple SSH client built-in, unlike Linux/macOS. One solution is to install WSL and then use the SSH command provided on the Vast instance. Or you can follow our Windows SSH Guide and use Putty tools to generate your SSH keys and SSH into the instance. There is one additional Windows step if you use Putty tools. After making sure you can SSH into the instance, close the SSH connection and then modify your Putty configuration to forward port 8080 to local host. Go to Connection->SSH->Tunnels. In the “source port” add 8080. Then in “destination” add:Text
Step 3 - Run Jupyter
Run Jupyter with options like these (adjust the port 8080 to match whatever port you forwarded over SSH):Text