Skip to content

Instantly share code, notes, and snippets.

View ramithuh's full-sized avatar

Ramith Hettiarachchi ramithuh

View GitHub Profile
@ramithuh
ramithuh / dgl_4_dgx-spark.md
Last active October 22, 2025 21:57
How to install dgl 2.4.0 with cuda 13.0 and pytorch 2.9

Compiling DGL v2.4.0 on Modern GPUs (Blackwell/Hopper)

This guide provides a comprehensive walkthrough for compiling the Deep Graph Library (DGL) version 2.4.0 from source on modern hardware, specifically targeting systems with NVIDIA Blackwell (e.g., GB10) or Hopper GPUs and a recent CUDA toolkit (13.0+).

The standard build process for this older DGL version fails due to outdated build scripts that are incompatible with new GPU architectures and compilers. The following steps include the necessary patches to overcome these issues and create a fully optimized build.

Key Lessons from this Build

This process highlights several common challenges when compiling older source code on new hardware:

@ramithuh
ramithuh / af3_apptainer.def
Last active October 6, 2025 15:47
Apptainer definition file to build alphafold3 (for aarch64, -- builds triton from scratch when making the container)
Bootstrap: docker
From: nvidia/cuda:12.6.3-base-ubuntu24.04
Stage: spython-base
%files
docker/jackhmmer_seq_limit.patch /hmmer_build/
. /app/alphafold
%post
# Copyright 2024 DeepMind Technologies Limited
#

Cheat Sheet: Copying Folders Between Remote Servers

This guide uses rsync and SSH Agent Forwarding to securely and efficiently copy folders between two servers.

Method 1: Push from Source Server 📤

Use this when you can SSH into the source server.

  1. On Your Local PC (Prep Agent): Load the key for the destination server.
@ramithuh
ramithuh / esmfold_aarch64.md
Created April 23, 2025 05:10
Setup ESMFold on aarch64

Conda Environment and Package Setup for ESMFold

1. Create and Activate Conda Environment

conda create -n esm2 python=3.10
conda activate esm2

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ramithuh
ramithuh / jax_default_device.py
Created May 1, 2023 23:49
specify jax default device to use
import jax
import jax.numpy as jnp
jax.config.update("jax_default_device", jax.devices("cpu")[0])
#runs on cpu
long_vector = jnp.arange(int(1e7))
%timeit jnp.dot(long_vector, long_vector).block_until_ready()
jax.config.update("jax_default_device", jax.devices("gpu")[2])
@ramithuh
ramithuh / wandb_resume.py
Created February 10, 2022 21:00
resume wandb project and log data
import wandb
wandb.init(id="31cnstm6", project="test", resume="must")
wandb.log({"this was added later": 1241241})
@ramithuh
ramithuh / clipboard-compress.sh
Created May 3, 2020 16:04
Compress the screenshots saves in a folder and copy them to clipboard (macOS preview screenshots)
for f in "$@"
do
/usr/local/bin/pngquant 32 --skip-if-larger --strip --ext=.png --force "$f"
/usr/local/bin/zopflipng -y "$f" "$f"
/Users/ramith/Documents/ss/impbcopy "$f"
done
on run {input, parameters}
do shell script "open /Users/ramith/Documents/SEM4_TRONIC_ACA"
return input
end run
num=[0.9955 -1.8936 0.9955];
den=[1 -1.8936 0.9911];
zplane(num,den)
grid on;
%freqz(num,den,100);