Giter VIP home page Giter VIP logo

gpu-python-tutorial's Introduction

GPU development with Python 101 Tutorial

Welcome to the GPU Development in Python 101 tutorial.

Since joining NVIDIA I’ve gotten to grips with the fundamentals of writing accelerated code in Python. I was amazed to discover that I didn’t need to learn C++ and I didn’t need new development tools. Writing GPU code in Python is easier today than ever, and in this tutorial, I will share what I’ve learned and how you can get started with accelerating your code.

In this tutorial we will cover:

  • What is a GPU and why is it different to a CPU?
  • An overview of the CUDA development model.
  • Numba: A high performance compiler for Python.
  • Writing your first GPU code in Python.
  • Managing memory.
  • Understanding what your GPU is doing with pyNVML (memory usage, utilization, etc).
  • RAPIDS: A suite of GPU accelerated data science libraries.
  • Working with Numpy style arrays on the GPU.
  • Working with Pandas style dataframes on the GPU.
  • Performing some scikit-learn style machine learning on the GPU.

Attendees will be expected to have a general knowledge of Python and programming concepts, but no GPU experience will be necessary. The key takeaway for attendees will be the knowledge that they don’t have to do much differently to get their code running on a GPU.

Running the tutorial

This tutorial has been updated to run on Google Colab (as of Dec 2023) which allows anyone with a Google account to get an interactive Python environment with a GPU.

To run each notebook you need to click the link on the table below to open it in Colab, and then set the runtime to include a GPU. You will need to do this for every notebook.

To do this you need to:

  • Select the arrow next to "Connect" in the top right
  • Select "Change runtime type"
  • Choose a GPU (the T4 is available in the free tier and is more than enough for this tutorial)
  • Hit save

Notebooks

Notebook Link
0.0 Welcome
1.0 CPU GPU Comparison
2.0 Numba
2.1 Numba Lab
2.2 Numba Lab (solution)
3.0 Numba Gauss
3.1 Numba Lab 2
3.2 Numba Lab 2 (solution)
4.0 pyNVML
4.1 CUDA Array Interface
5.0 Cupy
5.1 Cupy Lab
5.2 Cupy Lab (solution)
6.0 cuDF
7.0 cuML
8.0 Multi-GPU with Dask

gpu-python-tutorial's People

Contributors

edrogers avatar jacobtomlinson avatar jrbourbeau avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.