Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ The following interactive tutorials are available and can be used on [NVIDIA Bre

| Content | Docker Compose | Brev Instance | Brev Provider |
|---------|----------------|---------------|---------------|
| [CUDA Tile Tutorial](tutorials/cuda-tile/README.md) | [docker-compose.yml](tutorials/cuda-tile/brev/docker-compose.yml) | 1xB300, 1xB200, or 1xRTXPro6000 | Any Blackwell provider; none have Flexible Ports yet |
| [CUDA Tile Tutorial](tutorials/cuda-tile/README.md) | [docker-compose.yml](tutorials/cuda-tile/brev/docker-compose.yml) | 1xA10G or newer Ampere/Ada/Hopper/Blackwell GPU | A10G on AWS or any provider with Ampere-or-newer GPUs |
| [CUDA C++ Tutorial](tutorials/cuda-cpp/README.md) | [docker-compose.yml](tutorials/cuda-cpp/brev/docker-compose.yml) | L40S, L4, or T4 | Crusoe or any other with Flexible Ports |
| [Standard Parallelism Tutorial](tutorials/stdpar/README.md) | [docker-compose.yml](tutorials/stdpar/brev/docker-compose.yml) | 4xL4, 2xL4, 2xL40S, or 1x L40S | GCP, AWS, or any other with Flexible Ports and Linux 6.1.24+, 6.2.11+, or 6.3+ (for HMM) |
| [Accelerated Python Tutorial](tutorials/accelerated-python/README.md) | [docker-compose.yml](tutorials/accelerated-python/brev/docker-compose.yml) | L40S, L4, or T4; 4xL4 or 2xL4 for distributed | Crusoe or any other with Flexible Ports |
Expand Down
4 changes: 2 additions & 2 deletions tutorials/cuda-tile/README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
# CUDA Tile Tutorial

This tutorial teaches youthe CUDA Tile programming model and how to use cuTile Python, cuTile C++, and Tile IR.
This tutorial teaches you the CUDA Tile programming model and how to use cuTile Python, cuTile C++, and Tile IR.

You'll find the following content:

- [Notebooks](./notebooks) containing lessons and exercises, intended for self-paced or instructor-led learning, which can be run on [NVIDIA Brev](https://brev.nvidia.com).
- [Docker Images](https://github.com/NVIDIA/accelerated-computing-hub/pkgs/container/cuda-tile-tutorial) and [Docker Compose files](./brev/docker-compose.yml) for creating Brev Launchables or running locally.

Brev Launchables of this tutorial should use:
- 1xB300, 1xB200, or 1xRTX Pro 6000 instances (a Blackwell GPU is required).
- 1xA10G or newer Ampere, Ada, Hopper, or Blackwell GPU instances.

## Notebooks

Expand Down
7 changes: 1 addition & 6 deletions tutorials/cuda-tile/brev/dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ghcr.io/nvidia/mirrors/nvidia-cuda-13.1.0-devel-ubuntu22.04
FROM nvidia/cuda:13.3.0-devel-ubuntu22.04

ENV ACH_TUTORIAL=cuda-tile \
PYTHON_VERSION=3.12 \
Expand Down Expand Up @@ -50,11 +50,6 @@ RUN curl -fsSL https://keyserver.ubuntu.com/pks/lookup?op=get\&search=0xBA693236
&& rm -f /usr/lib/python3.*/EXTERNALLY-MANAGED \
&& rm -rf /var/lib/apt/lists/*

# Install PyTorch with CUDA 13.0 support.
RUN pip install --no-cache-dir --root-user-action=ignore \
--index-url https://download.pytorch.org/whl/cu130 \
torch==2.10.0

# Copy only requirements.txt first for better Docker layer caching.
COPY tutorials/${ACH_TUTORIAL}/brev/requirements.txt /opt/requirements.txt

Expand Down
13 changes: 7 additions & 6 deletions tutorials/cuda-tile/brev/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,13 @@ jupyterlab-nvidia-nsight
jupyterlab-execute-time

# CUDA
cuda-tile
cuda-python == 13.*
cupy-cuda13x == 13.6.0
numba-cuda[cu13] == 0.20.0
nvmath-python[cu13]
cuda-cccl[test-cu13]
cuda-tile[tileiras] == 1.4.0
cuda-toolkit[nvcc,nvvm,tileiras] == 13.3.1
cuda-python == 13.3.1
cupy-cuda13x == 14.1.1
numba == 0.66.0
numba-cuda[cu13] == 0.30.4
cuda-cccl[test-cu13] == 1.0.2

# NVIDIA developer tools
nvtx
Expand Down
37 changes: 37 additions & 0 deletions tutorials/cuda-tile/brev/test.bash
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
#! /bin/bash
#
# Run tests for the cuda-tile tutorial.

set -euo pipefail

START_TIME=$(date +%s.%N)

nvidia-smi

TUTORIAL_ROOT=/accelerated-computing-hub/tutorials/cuda-tile

if [ $# -gt 0 ]; then
echo "Running: $*"
"$@"
else
NOTEBOOK="${TUTORIAL_ROOT}/notebooks/01__cutile_python_intro__vector_add.ipynb"
OUTPUT="/tmp/01__cutile_python_intro__vector_add.executed.ipynb"

echo "Running: jupyter nbconvert --execute ${NOTEBOOK}"
jupyter nbconvert \
--to notebook \
--execute "${NOTEBOOK}" \
--output "${OUTPUT}" \
--ExecutePreprocessor.timeout=900
fi

END_TIME=$(date +%s.%N)
ELAPSED=$(awk "BEGIN {print $END_TIME - $START_TIME}")

echo ""
awk -v elapsed="$ELAPSED" 'BEGIN {
hours = int(elapsed / 3600)
minutes = int((elapsed % 3600) / 60)
seconds = elapsed % 60
printf "Elapsed time: %dh %dm %.3fs\n", hours, minutes, seconds
}'
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"cuTile Python requires:\n",
"\n",
" - NVIDIA Kernel Driver R580 or later.\n",
" - CUDA Toolkit 13.1 or later.\n",
" - A Blackwell GPU (this restriction will be lifted in later releases).\n",
" - CUDA Toolkit 13.3 or later.\n",
" - An NVIDIA GPU with compute capability 8.x or newer.\n",
"\n",
"You can install cuTile Python via the PIP package `cuda-tile`."
]
Expand All @@ -38,9 +38,13 @@
"import os\n",
"\n",
"if not os.getenv(\"BREV_ENV_ID\") and not os.path.exists(\"/accelerated-computing-hub-installed\"): # If not running in brev\n",
" print(\"Installing PIP packages.\")\n",
" !pip uninstall \"cuda-python\" --yes > /dev/null\n",
" !pip install \"cuda-tile\" \"cupy-cuda13x\" > /dev/null 2>&1\n",
" try:\n",
" import cuda.tile\n",
" import cupy\n",
" from numba import cuda\n",
" except ImportError:\n",
" print(\"Installing PIP packages.\")\n",
" !pip install --upgrade \"cuda-tile[tileiras]==1.4.0\" \"cuda-python==13.3.1\" \"cupy-cuda13x==14.1.1\" \"numba==0.66.0\" \"numba-cuda[cu13]==0.30.4\" > /dev/null 2>&1\n",
" open(\"/accelerated-computing-hub-installed\", \"a\").close()"
]
},
Expand Down Expand Up @@ -166,7 +170,7 @@
"metadata": {},
"outputs": [],
"source": [
"from cuda.core.experimental import Device\n",
"from cuda.core import Device\n",
"\n",
"def get_peak_memory_bandwidth(device_id: int = 0):\n",
" dev = Device(device_id)\n",
Expand Down
Loading