Skip to content

Instantly share code, notes, and snippets.

View cgmb's full-sized avatar

Cory Bloor cgmb

  • Advanced Micro Devices, Inc.
  • Canada
View GitHub Profile
@cgmb
cgmb / install-fooocus.sh
Last active March 10, 2025 05:47
Install Fooocus on Debian Unstable
#!/bin/bash
# Install Foocus on Debian Unstable on PyTorch Nightly (Tested on of 2025-03-09)
# Tested running in Docker as the root user
cd ~
apt -y update
apt -y upgrade
apt -y install bzip2 ca-certificates gfortran git gzip lsb-release patch python3 tar unzip xz-utils zstd build-essential cmake python3-dev python3-full meson pkg-config cargo libopenblas-dev libgit2-dev
git clone -c feature.manyFiles=true https://github.com/spack/spack.git
cd spack
@cgmb
cgmb / Meta-Llama-3.1-8B-Instruct-Q6_K_bench.log
Created February 7, 2025 01:04
rocblas and llama.cpp performance profiling
./rocblas-bench -f gemm_batched_ex --transposeA T --transposeB N -m 32 -n 2 -k 128 --alpha 1 --a_type f16_r --lda 1024 --b_type f16_r --ldb 4096 --beta 0 --c_type f32_r --ldc --d_type f32_r --ldd 32 --batch_count 32 --compute_type f32_r --algo 0 --solution_index 0 --flags 1
./rocblas-bench -f gemm_batched_ex --transposeA T --transposeB N -m 128 -n 2 -k 32 --alpha 1 --a_type f16_r --lda 2048 --b_type f16_r --ldb 32 --beta 0 --c_type f16_r --ldc --d_type f16_r --ldd 128 --batch_count 32 --compute_type f16_r --algo 0 --solution_index 0 --flags 1
./rocblas-bench -f gemm_batched_ex --transposeA T --transposeB N -m 32 -n 2 -k 128 --alpha 1 --a_type f16_r --lda 1024 --b_type f16_r --ldb 4096 --beta 0 --c_type f32_r --ldc --d_type f32_r --ldd 32 --batch_count 32 --compute_type f32_r --algo 0 --solution_index 0 --flags 1
./rocblas-bench -f gemm_batched_ex --transposeA T --transposeB N -m 128 -n 2 -k 32 --alpha 1 --a_type f16_r --lda 2048 --b_type f16_r --ldb 32 --beta 0 --c_type f16_r --ldc --d_type f16_r --ldd 128 --
@cgmb
cgmb / build-magma.sh
Last active December 19, 2024 20:38
Build magma for HIP
#!/bin/bash
# Build Magma on Ubuntu 24.04
set -eux
export CXX=hipcc
apt-get -y update
apt-get -y upgrade
apt-get -y install git cmake build-essential libopenblas-dev gfortran hipcc librocblas-dev libhipblas-dev librocsparse-dev libhipsparse-dev
git clone https://github.com/icl-utk-edu/magma.git
@cgmb
cgmb / build-llama-cpp.sh
Last active January 26, 2025 00:51
Build llama.cpp on Ubuntu 24.04
#!/bin/sh
# Build llama.cpp on Ubuntu 24.04 with AMD GPU support
sudo apt -y install git wget hipcc libhipblas-dev librocblas-dev cmake build-essential
# ensure you have the necessary permissions by adding yourself to the video and render groups
sudo usermod -aG video,render $USER
# reboot to apply the group changes
# run rocminfo to check everything is working thus far
@cgmb
cgmb / spack-rocm-packages.txt
Created October 20, 2024 11:54
List of Spack packages with ROCm support
adios2
aluminum
amg2023
amrex
amr-wind
arborx
axom
babelstream
beatnik
blaspp
@cgmb
cgmb / pbuilder-failure.txt
Created April 2, 2024 22:25
pbuilder failure
$ pbuilder-dist noble amd64 create
W: /home/cgmb/.pbuilderrc does not exist
I: Logging to /home/cgmb/pbuilder/noble_result/last_operation.log
I: Distribution is noble.
I: Current time: Tue Apr 2 16:24:12 MDT 2024
I: pbuilder-time-stamp: 1712096652
I: Building the build environment
I: running debootstrap
/usr/sbin/debootstrap
I: Target architecture can be executed
@cgmb
cgmb / check-apt.sh
Created April 1, 2024 18:24
Ubuntu Noble package list check
#!/bin/bash
set -euo pipefail
wget -qO- http://archive.ubuntu.com/ubuntu/dists/noble/main/binary-amd64/by-hash/SHA256/8341b8ac157e16be21c3dd6439abf8aa27c3815879f2a9d5164881f7ba0dd0e2 | xz -d > noble-packages.txt
grep '^Package: apt$' noble-packages.txt
@cgmb
cgmb / build-llama-cpp-fedora.sh
Last active February 3, 2025 05:10
How to build llama.cpp on fedora
#!/bin/sh
# Build llama.cpp on Fedora 40 and later
# Tested with `docker run -it --device=/dev/dri --device=/dev/kfd --security-opt seccomp=unconfined --volume $HOME:/mnt/home fedora:40`
dnf -y update
dnf -y install hipcc rocm-hip-devel rocblas-devel hipblas-devel git cmake g++ lld clang-tools-extra llvm
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp/
git checkout b2110
CC=clang CXX=clang++ cmake -H. -Bbuild -DLLAMA_HIPBLAS=ON -DAMDGPU_TARGETS="gfx1030;gfx1100;gfx1101;gfx1102" -DCMAKE_BUILD_TYPE=Release
@cgmb
cgmb / Makefile
Created February 14, 2024 17:41
rocALUTION examples makefile
LDLIBS ?= -lrocalution
examples = amg \
as-precond \
async \
benchmark \
bicgstab \
block-precond \
cg-amg \
cg-rsamg \
@cgmb
cgmb / build-llama-cpp.sh
Last active December 21, 2024 09:41
How to build llama.cpp on Ubuntu Mantic
#!/bin/sh
# Build llama.cpp on Ubuntu 23.10
# Tested with `docker run -it --device=/dev/dri --device=/dev/kfd --security-opt seccomp=unconfined --volume $HOME:/mnt/home debian:sid`
apt -y update
apt -y upgrade
apt -y install git hipcc libhipblas-dev librocblas-dev cmake build-essential
git clone https://github.com/ggerganov/llama.cpp.git
cd llama.cpp/
git checkout b2110