Why and how to use GPUs when running a workflow

Allie Hajian
  • Updated

Graphical Processing Units (GPUs) are a kind of computer processor. They can accelerate certain tasks that are specifically coded to use them, providing faster turnaround and cost savings compared to virtual machines (VMs) only using traditional CPUs. Learn how to set 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 need to edit the WDL script to set the runtime parameters appropriately. To edit the WDL script, upload your workflow to the Broad Methods Repository, and follow the instructions in Create, edit, and share a new workflow

icon-warning2.png


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

 

Note: 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):
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 don't need to export this workflow to Terra again. Just go to the Workflow tab to toggle between the snapshots when you click into the workflow.

G0-tip-icon.png


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?

Comments

0 comments

Please sign in to leave a comment.