Why and how to use GPUs when running a workflow

Allie Hajian
  • Updated

Graphical Processing Units (GPUs) are a kind of computer processor that can dramatically accelerate certain tasks that are specifically coded to use them, providing faster turnaround and cost savings compared to VMs that only use traditional CPUs. This article outlines how to set the runtime parameters to use GPUs rather than standard CPU-only VMs when running a workflow.

What Are GPUs?

GPUs were originally developed to process graphical information for video games, which require extremely fast rendering to make the graphics realistic. GPUs specialize in handling certain types of calculations for graphical data very efficiently. In the computational biology world, GPUs are commonly used for 

  • Training a neural network (note that using the trained network is usually done on CPU)
  • Any other scientific computing applications that require a lot of matrix or vector operations

How to set WDL runtime parameters to use GPUs

To use GPUs in a workflow, you will need to edit the WDL script to set the runtime parameters appropriately. To edit the WDL script, you will need to upload your workflow to the Broad Methods Repository, following the instructions in this article


Cost caveat: Make sure your workflow's tool supports GPUs!


Note that to use GPUs, your tool (inside the WDL wrapper) must support GPUs and have
that option explicitly enabled.

If you use these GPU parameters but your WDL does not use or support them,
you'll pay
for a GPU that sits idle!

The runtime parameters you will add will look something like this (you may want different numbers or use different zones, for example):
runtime { 
      gpuType: "nvidia-tesla-k80"
      gpuCount: 2
      nvidiaDriverVersion: "418.87.00"
      zones: ["us-central1-c"]

Once you adjust the WDL runtime parameters in the Broad Methods Repository, you will see a new snapshot of the workflow to run. You will not need to export this workflow again to Terra. Just go to the Workflow tab to toggle between the snapshots when you click into the workflow.


Additional GPU resources


For the official "readthedocs" about configuring the runtime to use GPUs, see
https://cromwell.readthedocs. io/en/stable/ RuntimeAttributes/#gpucount- gputype-and- nvidiadriverversion

For GPU regions and zones availability, see
https://cloud.google. com/compute/docs/gpus/gpu- regions-zones


Was this article helpful?

1 out of 1 found this helpful

Have more questions? Submit a request



Please sign in to leave a comment.