https://github.com/henryiii/pygpu-minicourse
Princeton mini course on GPUs in Python
https://github.com/henryiii/pygpu-minicourse
Last synced: 4 months ago
JSON representation
Princeton mini course on GPUs in Python
- Host: GitHub
- URL: https://github.com/henryiii/pygpu-minicourse
- Owner: henryiii
- Created: 2019-12-01T03:15:00.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2024-10-15T16:12:41.000Z (7 months ago)
- Last Synced: 2025-01-03T02:23:04.688Z (5 months ago)
- Language: Jupyter Notebook
- Size: 353 KB
- Stars: 38
- Watchers: 4
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# PyGPU: High performance Python for GPUs
## Henry Schreiner
This minicourse covers ways to speed up your code using GPUs.
Since many of us do not have a reasonable (NVidia) GPU on our
laptops, the course is designed to be run on our local teaching
cluster. You will need to be on the Princeton network, and will
need to be able to access Adroit (registration beforehand required).## Princeton setup (Adroit)
#### Git clone
Log into our OnDemand site, . You will want to
select "Clusters -> Shell" on the header bar.
Now, you'll want to type:
```bash
git clone https://github.com/henryiii/pygpu-minicourse
```This will get the course materials. Press CTRL+D to quit.
#### Start up a CPU instance
We will be working with a small number of shared GPUs, so you'll want to work
in a CPU only instance, and only submit a notebook to the GPU 1-at-a-time (so
you don't block them for others).Back on the header bar on the original page, click "Interactive Apps" or "My
Interactive sessions", then select "Jupyter". You should see a page that looks
like this:> 
Make sure you have **checked the JupyterLab** checkbox, that you have enough
time (at least 2 hours), and that you have entered our reservation (`pygpu`).
Leave the extra slurm options blank. (without a reservation,
`--gres=gpu --constraint=a100` would pick GPUs and set the type of GPU.)The Anaconda3 version is `custom`. The module name is `course/pygpu/default`.
After you click launch, you should soon see a button that looks like this:

Click it to enter JupyterLab!
### Local setup
If you have a GPU, you can install the environment provided in
`environment.yml` with Conda. You'll probably have to choose a
kernel when you launch it (and you may need the `conda_nb_kernel` package).## Running GPU kernels
Load the `ExampleRunner.ipynb` notebook. You can enter the name of a GPU
notebook (without the extension) at the top of the provided cell, and run that
to submit the notebook as a job.## Survey
Link: See chat.