Basic Usage

Step 1. Install snark with pip3

  pip3 install snark

In case of difficulties with installation, take a look at the troubleshooting section.

Step 2. Go to to sign up. Sign in through the CLI

  snark login

Step 3. Create Yaml description

Snark uses yaml training workflow descriptions. Below is a basic MNIST example.

  version: 1
      image: pytorch/pytorch:latest
        gpu: K80
        - git clone
        - cd examples/mnist
        - python

This yaml file describes an mnist experiment which uses pytorch on a single K80 GPU. The workflow runs as a combination of three commands described by the file. Save as mnist.yml.

Step 4. Start the workflow

Use snark up to start the workflow.

  snark up -f mnist.yml

Snark up starts the experiment described by the yaml file. It spins up a cluster with 1 K80 GPU. In general workflows executed by snark can be of different nature:

  • single-GPU ML training
  • distributed ML training
  • hyperparameter search

Step 5 List Experiments

snark ps command will list the experiments along with their ids and states.

  snark ps

Experiment Ids are used to tear down the workflows.

Step 6 Tear Down Experiments Snark workflows can be torn down using snark down command

  snark down {experiment_id}

The snark down command shuts down all cloud resources utilized by the experiment workflow.


Login to to check the GPU usage and credits left.


On the cli, use snark ps to keep track of all experiments.

  snark ps


To check the state of each task per experiment run.

snark ps {experiment_id}


To get logs of running experiments

  snark logs {experiment_id}


Snark executes serverless ML workflows described in Yaml files. This section walks through properties that can be used in the Yaml file.

Multiple Experiments

Snark executes experiments described in Yaml file. Those experiments are ML workflows such as model training, hyper parameter search etc.

Here is how to declare them in the Yaml file:

  version: 1
    yolo: # the experiment name
      # here go the details of the workflow
      # description of another experiment

snark ps will show the experiment ids and states after they are run.

Docker Image

Snark executes the workflow commands against the given docker image. Note: Currently only public images are accepted

  version: 1
      image: pytorch/pytorch # if no tag is provided, snark will pull :latest image

Multiple GPUs

This property describes the hardware to run the experiment on.

  version: 1
      image: pytorch/pytorch 
        gpu: K80 # use K80 GPU
        gpu_count: 2 # use 2 K80 GPUs

gpu is the name of the gpu to use gpu_count describes the number of gpus for the given experiment to run on. By default it’s value is 1.

Supported GPUs are K80 and V100 and the supported gpu_counts for them are (1, 8, 16) and (1, 4, 8) respectively


Snark Workflows comprise of commands. The commands are executed against the docker image provided.

  version: 1
      image: pytorch/pytorch 
        gpu: K80
        gpu_count: 2
      commands: # Commands is an array of commands to execute against the image declared above
        - git clone
        - cd examples/mnist
        - python

The above example demonstrates how snark workflows are executed: using provided image and running the given commands on that image.


If you get a Permission denied message:

  sudo pip3 install snark

If you don’t have sudo access:

  pip3 install snark --user

AND add the following to your ~/.bashrc file:

  export PY_USER_BIN=$(python3 -c 'import site; print(site.USER_BASE + "/bin")')

AND reload your ~/.bashrc:

  source ~/.bashrc

Snark Not Found

If you tried all above and still get snark not found error message, try:

  1. Updating your pip3 through pip3 install --upgrade pip3
  2. Try installing specific version through tarball:
  pip3 uninstall snark
  pip3 install

In case of questions or issues please contact us at