Skip to content

ajitrajasekharan/multi_gpu_test

Repository files navigation

multi_gpu_test

Parallelization with PyTorch on multi GPU machines (tested on Google Cloud GPU machines) This is an assortment of utilities/scripts

Install steps

After procuring a GPU machine (see https://medium.com/@ajitrajasekharan/setting-up-a-machine-with-gpu-s-in-google-cloud-step-by-step-instructions-c6aa1086d8f9 for instructions)

  • Run first.sh - this will install basic utilities for next steps
  • Run second.sh - Follow instructions in displayed link to get drivers for Nvidia. Install for Ubuntu 16.04 is provided in this repository (in second.sh - commented by default)
  • Confirm proper installation using nvidia_smi

nvidia_smi command output

  • Run third.sh - this will install anaconda, pytorch.

Perform multi-gpu test

  • conda activate bert
  • python multi_gpu.py

Output of multi_gpu.py

note the batch of 30 inputs is spread across 8 GPUs - 7 GPUs get 4 inputs and the last gets 2 (7*4 + 2 = 30).

Attribution

License

MIT License

About

Scripts to set up an nvidia GPU machine (ubuntu)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published