Skip to content

Commit c1ede59

Browse files
authored
roscon notebook updates that run locally (#29)
* update npu notebooks * add latest gpu notebooks * update notebooks for local runs
1 parent 5dc28ad commit c1ede59

12 files changed

Lines changed: 371 additions & 183 deletions

File tree

packages/workshops/roscon25/roscon25-gpu/notebooks/0_overview.ipynb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"source": [
88
"# GPU-Accelerated Robot Policies\n",
99
"\n",
10-
"In this tutorial we will cover the necessary tools you need to inspect your AMD GPU usage. You will learn how to run local Large Language Models (LLMs) and Vision Language Models (VLMs) with projects like Llama.cpp. Additionally we'll walk you through running robot policy models specifically tailored for robotics and we will show you how to integrate an AMD system.\n",
10+
"<img src=\"images/gpu.png\" width=\"600\" height=\"300\">\n",
11+
"\n",
12+
"In this tutorial we will cover the necessary tools you need to inspect your AMD GPU usage. You will learn how to run local Large Language Models (LLMs) and Vision Language Models (VLMs) with projects like `llama.cpp`. Additionally we'll walk you through running robot policy models specifically tailored for robotics and we will show you how to integrate an AMD system.\n",
1113
"\n",
1214
"## Overview\n",
1315
"\n",

packages/workshops/roscon25/roscon25-gpu/notebooks/1_gpu_utilities.ipynb

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,6 @@
2424
"\n",
2525
"Vulkan is an open standard for high performance graphics designed for modern multicore CPU systems and GPUs. Vulkan enables very low level access to GPU hardware. Although built as a graphics API, Vulkan offers general purpose computation through \"compute shaders\". Shaders are small programs written in a domain specific languages like glsl that run on GPU compute units.\n",
2626
"\n",
27-
"In diagram X you can see how these entry points appear within the system.\n",
28-
"\n",
2927
"## Utilities\n",
3028
"\n",
3129
"### ROCm SMI\n",
@@ -56,7 +54,7 @@
5654
"Device Node IDs Temp Power Partitions SCLK MCLK Fan Perf PwrCap VRAM% GPU% \n",
5755
"\u001b[3m (DID, GUID) (Edge) (Socket) (Mem, Compute, ID) \u001b[0m\n",
5856
"==================================================================================================================\n",
59-
"0 1 0x1586, 15162 29.0°C 7.098W N/A, N/A, 0 N/A N/A 0% auto N/A 0% 0% \n",
57+
"0 1 0x1586, 14139 38.0°C 12.093W N/A, N/A, 0 N/A N/A 0% auto N/A 1% 1% \n",
6058
"==================================================================================================================\n",
6159
"============================================== End of ROCm SMI Log ===============================================\n"
6260
]
@@ -140,7 +138,7 @@
140138
" [--rasdisable BLOCK ERRTYPE] [--rasinject BLOCK] [--gpureset] [--load FILE | --save FILE]\n",
141139
" [--autorespond RESPONSE] [--loglevel LEVEL] [--json] [--csv]\n",
142140
"\n",
143-
"AMD ROCm System Management Interface | ROCM-SMI version: 4.0.0+dd54e5d\n",
141+
"AMD ROCm System Management Interface | ROCM-SMI version: 4.0.0+1a5c7ec\n",
144142
"\n",
145143
"options:\n",
146144
" -h, --help show this help message and exit\n",
@@ -295,7 +293,7 @@
295293
"source": [
296294
"## amdgpu_top\n",
297295
"\n",
298-
"`amdgpu_top` is another utility providing realtime statistics of AMD GPUs including utilization, memory consumption and specifics of individual processes. In a separate terminal, launch `amdgpu`. It can be closed by typing `q`. "
296+
"`amdgpu_top` is another utility providing realtime statistics of AMD GPUs including utilization, memory consumption and specifics of individual processes. In a separate terminal, launch `amdgpu_top`. It can be closed by typing `q`. "
299297
]
300298
},
301299
{
@@ -331,13 +329,15 @@
331329
"execution_count": 4,
332330
"id": "ecede7e7-a819-430a-ba98-71ffb9380441",
333331
"metadata": {
334-
"jp-MarkdownHeadingCollapsed": true
332+
"jp-MarkdownHeadingCollapsed": true,
333+
"scrolled": true
335334
},
336335
"outputs": [
337336
{
338337
"name": "stdout",
339338
"output_type": "stream",
340339
"text": [
340+
"error: XDG_RUNTIME_DIR is invalid or not set in the environment.\n",
341341
"==========\n",
342342
"VULKANINFO\n",
343343
"==========\n",
@@ -434,7 +434,7 @@
434434
},
435435
{
436436
"cell_type": "code",
437-
"execution_count": 4,
437+
"execution_count": 5,
438438
"id": "fcf440fa-04d8-4380-8b3e-9ff9defd729b",
439439
"metadata": {
440440
"jp-MarkdownHeadingCollapsed": true
@@ -446,7 +446,7 @@
446446
"text": [
447447
"Hello ROSCON\n",
448448
"GPU detected: AMD Radeon Graphics\n",
449-
"Total memory: 98304 MB\n"
449+
"Total memory: 32768 MB\n"
450450
]
451451
}
452452
],
@@ -466,7 +466,7 @@
466466
},
467467
{
468468
"cell_type": "code",
469-
"execution_count": 9,
469+
"execution_count": 6,
470470
"id": "dd369436-5ada-4be9-ac49-d0109189dd45",
471471
"metadata": {},
472472
"outputs": [
@@ -497,12 +497,28 @@
497497
"! cat hip/test.hip"
498498
]
499499
},
500+
{
501+
"cell_type": "markdown",
502+
"id": "79f95ba8-067f-44ca-bf6d-160669a52b0b",
503+
"metadata": {},
504+
"source": [
505+
"## Key Takeaways\n",
506+
"\n",
507+
"In this notebook you have learned\n",
508+
"\n",
509+
"- How to use `rocm-smi` and `amdgpu_top` to monitor GPU status.\n",
510+
"- How to use `vulkaninfo` to verify your Vulkan installation.\n",
511+
"- How to compile a basic HIP program.\n",
512+
"\n",
513+
"## Cleanup\n",
514+
"\n",
515+
"Make sure to `ctrl+c` and close the terminals before moving onto the next notebook."
516+
]
517+
},
500518
{
501519
"cell_type": "markdown",
502520
"id": "ac2313db-cc41-4589-b2d9-4974abe55ca7",
503-
"metadata": {
504-
"jp-MarkdownHeadingCollapsed": true
505-
},
521+
"metadata": {},
506522
"source": [
507523
"## References\n",
508524
"\n",

packages/workshops/roscon25/roscon25-gpu/notebooks/2_running_llms.ipynb

Lines changed: 52 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,18 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "db5dcdaa-b22d-46d8-bed4-d89148a5cdc3",
5+
"id": "c82d5231-3e32-491a-851c-1c1832ee8af0",
66
"metadata": {},
77
"source": [
8-
"# Running Large Language Models\n",
8+
"# Running LLMs with llama.cpp\n",
99
"\n",
10+
"In this notebook we will use llama.cpp to execute LLMs (Large Language Models). `llama.cpp` enables model loading and inference on a variety of CPU and GPU platforms including Ryzen AI through ROCm and Vulkan.\n",
1011
"\n",
1112
"## Goals\n",
1213
"\n",
13-
"* Learn to use `llama.cpp` to run inference on the AMD GPU"
14-
]
15-
},
16-
{
17-
"cell_type": "markdown",
18-
"id": "c82d5231-3e32-491a-851c-1c1832ee8af0",
19-
"metadata": {},
20-
"source": [
21-
"\n",
22-
"# LLMs with llama.cpp\n",
14+
"* Learn to use `llama.cpp` to run inference on the AMD GPU\n",
2315
"\n",
24-
"In this notebook we will use llama.cpp to execute LLMs (Large Language Models). `llama.cpp` enables model loading and inference on a variety of CPU and GPU platforms including Ryzen AI through ROCm and Vulkan.\n",
25-
"\n",
26-
"To launch `llama.cpp`, open a separate terminal and run the command below. `llama.cpp` will pull the model, detect the AMD GPU and start a chat dialog. Try asking the model a question."
16+
"To launch `llama.cpp`, open a terminal and run the commands below. `llama.cpp` will pull the model, detect the AMD GPU and start a chat dialog. Try asking the model a question."
2717
]
2818
},
2919
{
@@ -51,7 +41,7 @@
5141
"id": "aff4aafe-e673-44a6-82b6-82ac23e85763",
5242
"metadata": {},
5343
"source": [
54-
"`llama.cpp` also supports a server/client architecture amd can serve up models from a variety of model zoos. We will cover this in the next notebook."
44+
"`llama.cpp` also supports a server/client architecture and can serve up models from a variety of model zoos. We will cover this in the next notebook."
5545
]
5646
},
5747
{
@@ -66,7 +56,7 @@
6656
"On this platform, `llama.cpp` is compiled with ROCm and Vulkan backends. `llama-bench` is a utility that allows you to benchmark models under multiple backends. Run the code below in a terminal to compare the model execution under ROCm and Vulkan.\n",
6757
"\n",
6858
"```bash\n",
69-
"llama-bench -m /ryzers/.cache/llamacpp/unsloth_Llama-3.2-3B-Instruct-GGUF_Llama-3.2-3B-Instruct-Q4_K_M.gguf -dev ROCm0,Vulkan0\n",
59+
"llama-bench -m /root/.cache/llama.cpp/unsloth_Qwen3-1.7B-GGUF_Qwen3-1.7B-Q4_K_M.gguf -dev ROCm0,Vulkan0\n",
7060
"```\n",
7161
"\n",
7262
"You should see output similar to:\n",
@@ -90,35 +80,77 @@
9080
},
9181
{
9282
"cell_type": "markdown",
93-
"id": "7300b4f1-1cc2-4049-b127-23aa7cb76155",
83+
"id": "ee2eb148-0f24-4b8e-a335-07d6510cde87",
9484
"metadata": {},
9585
"source": [
9686
"The above output displays for each device, ROCm or Vulkan, the performance in tokens/second **(t/s)**. The performance tests are **pp512** and **tg128**. **pp512** is a prompt processing test and indicates how quickly the model can process prompts of 512 tokens. **tg128** is a token generation test which indicates how quickly the model can generate token."
9787
]
9888
},
89+
{
90+
"cell_type": "markdown",
91+
"id": "7300b4f1-1cc2-4049-b127-23aa7cb76155",
92+
"metadata": {},
93+
"source": [
94+
"## Key Takeaways\n",
95+
"\n",
96+
"Now you know:\n",
97+
"- How to run an LLM using `llama.cpp`.\n",
98+
"- How to compare runtimes for executing your LLM.\n"
99+
]
100+
},
101+
{
102+
"cell_type": "markdown",
103+
"id": "4949cf4d-d5da-4677-a492-f214e1ac70b0",
104+
"metadata": {},
105+
"source": [
106+
"## Next Steps\n",
107+
"\n",
108+
"(At home) Try downloading and running more models from https://huggingface.co/models. Be sure to select GGUF format in the *libraries* search box.\n",
109+
"\n",
110+
"<img src=\"images/hf.png\" width=\"800\" height=\"200\">\n",
111+
"\n",
112+
"When you select a model, click \"Use this model\" and click `llama.cpp` to see the command to run.\n",
113+
"\n",
114+
"<img src=\"images/model.png\" width=\"300\" height=\"200\">\n",
115+
"\n"
116+
]
117+
},
99118
{
100119
"cell_type": "markdown",
101120
"id": "ac2313db-cc41-4589-b2d9-4974abe55ca7",
102121
"metadata": {},
103122
"source": [
104123
"\n",
105124
"\n",
125+
"## Cleanup\n",
126+
"\n",
127+
"Make sure to `ctrl+c` and close the terminals before moving onto the next notebook.\n",
128+
"\n",
106129
"## References\n",
107130
"\n",
108-
"* [Llama.cpp](https://github.com/ggml-org/llama.cpp)"
131+
"* [Llama.cpp](https://github.com/ggml-org/llama.cpp)\n",
132+
"* [Huggingface models](https://huggingface.co/models)"
109133
]
110134
},
111135
{
112136
"cell_type": "markdown",
113137
"id": "b285bb33-051c-4edb-bb43-14e4efa00fde",
114138
"metadata": {},
115139
"source": [
116-
"\n",
140+
"**Continue to:** [3_vlm_ros_integration](3_vlm_ros_integration.ipynb)\n",
117141
"\n",
118142
"\n",
119143
"---\n",
120144
"Copyright© 2025 AMD, Inc SPDX-License-Identifier: MIT"
121145
]
146+
},
147+
{
148+
"cell_type": "code",
149+
"execution_count": null,
150+
"id": "ae918e00-eec7-41b4-ab76-8d617e0cfe3b",
151+
"metadata": {},
152+
"outputs": [],
153+
"source": []
122154
}
123155
],
124156
"metadata": {

0 commit comments

Comments
 (0)