Skip to main content

Easy-to-run ML workflows on any cloud

Project description

dstack

A better way to run ML workflows

Define ML workflows as code and run via CLI. Use any cloud. Collaborate within teams.

Slack

DocsInstallationQuick startUsage

Last commit PyPI - License

What is dstack?

dstack allows you to define machine learning workflows as code and run them on any cloud.

It helps you set up a reproducible environment, reuse artifacts, and launch interactive development environments and apps.

Installation

Use pip to install dstack:

pip install dstack --upgrade

Configure a remote

To run workflows remotely (e.g. in a configured cloud account), configure a remote using the dstack config command.

dstack config

? Choose backend. Use arrows to move, type to filter
> [aws]
  [gcp]
  [hub]

If you intend to run remote workflows directly in the cloud using local cloud credentials, feel free to choose aws or gcp. Refer to AWS and GCP correspondingly for the details.

If you would like to manage cloud credentials, users and other settings centrally via a user interface, it is recommended to choose hub.

The hub remote is currently in an experimental phase. If you are interested in trying it out, please contact us via Slack.

Define workflows

Define ML workflows, their output artifacts, hardware requirements, and dependencies via YAML.

workflows:
  - name: mnist-data
    provider: bash
    commands:
      - pip install torchvision
      - python mnist/mnist_data.py
    artifacts:
      - path: ./data

  - name: train-mnist
    provider: bash
    deps:
      - workflow: mnist-data
    commands:
      - pip install torchvision pytorch-lightning tensorboard
      - python mnist/train_mnist.py
    artifacts:
      - path: ./lightning_logs

YAML eliminates the need to modify code in your scripts, giving you the freedom to choose frameworks, experiment trackers, and cloud providers.

Providers

dstack supports multiple providers that enable you to set up environment, run scripts, launch interactive dev environments and apps, and perform many other tasks.

Run workflows

Once a workflow is defined, you can use the dstack run command to run it either locally or remotely.

Run locally

By default, workflows run locally on your machine.

dstack run mnist-data

RUN        WORKFLOW    SUBMITTED  STATUS     TAG  BACKENDS
penguin-1  mnist-data  now        Submitted       local

Provisioning... It may take up to a minute. ✓

To interrupt, press Ctrl+C.

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz

The artifacts from local workflows are also stored and can be reused in other local workflows.

Run remotely

To run a workflow remotely (e.g. in a configured cloud account), add the --remote flag to the dstack run command:

dstack run mnist-data --remote

RUN        WORKFLOW    SUBMITTED  STATUS     TAG  BACKENDS
mangust-1  mnist-data  now        Submitted       aws

Provisioning... It may take up to a minute. ✓

To interrupt, press Ctrl+C.

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz

The output artifacts from remote workflows are also stored remotely and can be reused by other remote workflows.

The necessary hardware resources can be configured either via YAML or through arguments in the dstack run command, such as --gpu and --gpu-name.

dstack run train-mnist --remote --gpu 1

RUN       WORKFLOW     SUBMITTED  STATUS     TAG  BACKENDS
turtle-1  train-mnist  now        Submitted       aws

Provisioning... It may take up to a minute. ✓

To interrupt, press Ctrl+C.

GPU available: True, used: True

Epoch 1: [00:03<00:00, 280.17it/s, loss=1.35, v_num=0]

Upon running a workflow remotely, dstack automatically creates resources in the configured cloud account and destroys them once the workflow is complete.

Ports

When a workflow uses ports to host interactive dev environments or applications, the dstack run command automatically forwards these ports to your local machine, allowing you to access them. Refer to Providers and Apps for the details.

More information

For additional information and examples, see the following links:

Licence

Mozilla Public License 2.0

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dstack-0.2.6.tar.gz (109.8 kB view details)

Uploaded Source

Built Distribution

dstack-0.2.6-py3-none-any.whl (13.6 MB view details)

Uploaded Python 3

File details

Details for the file dstack-0.2.6.tar.gz.

File metadata

  • Download URL: dstack-0.2.6.tar.gz
  • Upload date:
  • Size: 109.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dstack-0.2.6.tar.gz
Algorithm Hash digest
SHA256 b5d32c9abe9479635ba5e5c729906036b984f02e19dfd68c0e0d8c15bb2a8bf2
MD5 1247e50ecfe66df5960aefb9ec5ad7e6
BLAKE2b-256 7f34ee03a3f0fb8f921fa846defb782ae0aa710b60e96e1346add88918f1e9f6

See more details on using hashes here.

File details

Details for the file dstack-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: dstack-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 13.6 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.9.16

File hashes

Hashes for dstack-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 a500fb9ba9b6a8a5b957109808a92fb498541181abfcbb582f6553916eb2afe3
MD5 9425c407f988e1cc5963c570ddb1445e
BLAKE2b-256 66e409832bc9355e635cfce873c3e238bfb07c84fab6a82a716ff6bacc778c7c

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page