InstructLab toolbox container for AMD ROCm GPUsΒΆ
The ROCm container file is designed for AMD GPUs with RDNA3 architecture (gfx1100
). The container can be build for RDNA2 (gfx1030
) and older GPUs, too. Please refer to AMDβs system requirements for a list of officially supported cards. ROCm is known to work on more consumer GPUs.
The container file creates a toolbox container for toolbox(1)
command line tool. A toolbox containers has seamless access to the entire system including userβs home directory, networking, hardware, SSH agent, and more.
The container has all Python dependencies installed in a virtual env. The virtual env is already activated when you enter the container.
Quick startΒΆ
git clone the
instructlab
andtaxonomy
project into a common folder in your home directory (e.g.~/path/to/instructlab
)add your account to
render
andvideo
group:sudo usermod -a -G render,video $LOGNAME
install build dependency for this container:
sudo dnf install toolbox podman make rocminfo
build the container:
make rocm
ormake rocm-gfx1100
create a toolbox
make rocm-toolbox
enter toolbox
toolbox enter instructlab
. The container has your home directory mounted.
To update InstructLab CLI to latest version: pip install -e ~/path/to/instructlab/instructlab
ilab data generate
and ilab model chat
use the GPU automatically. ilab model train
needs
more powerful and recent GPU and therefore does not use GPU by default. To
train on a GPU, run ilab model train --device cuda
.
Building for other GPU architecturesΒΆ
Use the amdgpu-arch
or rocminfo
tool to get the short name
dnf install clang-tools-extra rocminfo
amdgpu-arch
rocminfo | grep gfx
Map the name to a LLVM GPU target and an override GFX version. PyTorch 2.2.1+rocm5.7 provides a limited set of rocBLAS
Kernels. Fedora 40βs ROCm packages have more Kernels. For now we are limited to what PyTorch binaries provide until Fedora ships python-torch
with ROCm support.
Name |
XNACK/USM |
Version |
PyTorch |
Fedora |
---|---|---|---|---|
|
|
β |
β |
|
|
|
|
β |
β |
|
|
|
β |
β |
|
|
|
β |
β |
|
|
|
β |
β |
|
β |
β |
||
|
β |
β |
||
|
β |
β |
||
|
β |
β |
||
|
β |
β |
||
|
|
β |
β |
|
|
|
β |
β |
|
|
β |
β |
||
|
β |
β |
If your card is not listed or unsupported, try the closest smaller value, e.g. for gfx1031
use target gfx1030
and override 10.3.0
. See ROCm/ROCR-Runtime
isa.cpp
and LLVM User Guide for AMDGPU for more information.
Marketing Name |
Name |
Arch |
Target |
GFX version |
Memory |
Chat |
Train |
---|---|---|---|---|---|---|---|
AMD Radeon RX 7900 XT |
|
RDNA3 |
|
|
20 GiB |
β |
β |
AMD Radeon RX 7900 XTX |
RDNA3 |
24 GiB |
β |
β |
|||
AMD Radeon RX 6700 |
|
RDNA2 |
|
|
10 GiB |
β |
β |
Build the container with additional build arguments:
make rocm-gfx1100 BUILD_ARGS=
Known issuesΒΆ
AMD Instinct MI210 with ISA amdgcn-amd-amdhsa--gfx90a:sramecc+:xnack-
is not supported by Fedora build rocblas-6.0.2-3
. As of late April 2024, Fedora has gfx90a:xnack+
and gfx90a:xnack-
but lacks gfx90a:sramecc+:xnack-
.