Skip to content

Instantly share code, notes, and snippets.

View guilt's full-sized avatar
🎯
Focusing

Karthik Kumar Viswanathan guilt

🎯
Focusing
View GitHub Profile
@guilt
guilt / Interconnect-Comparison.md
Created July 22, 2025 23:45
AI Interconnects Study

Comparison of Interconnect Technologies: Hardware, Latency, Lanes, Overhead, Throughput, Vendor, and OS Support

Interconnect Hardware Support Latency Number of Lanes Protocol Overhead True Unidirectional Throughput Per Lane True Unidirectional Throughput (Overall) True Bidirectional Throughput Vendor Support OS Support
NVLink NVIDIA GPUs (Pascal, Volta, Hopper, Blackwell), NVIDIA CPUs (e.g., Grace) Sub-µs (0.1–0.5 µs, intra-node P2P) 72 (18 ports × 4 lanes, NVLink 5.0) ~2.5–3.5% (128b/130b, headers) 6.09 GB/s (48.72 Gbps) 438.75 GB/s 877.5 GB/s NVIDIA Linux (primary), Windows (limited via WSL)
InfiniBand CPUs, NVIDIA/AMD/Intel GPUs (via GPUDirect RDMA), NICs (e.g., Mellanox) ~1–5 µs (point-to-point) 32 (8 ports × 4 lanes, N
@guilt
guilt / transformers.py
Last active December 25, 2025 23:25
Easy-to-read Transformers implementation, written by Grok 3.0.
try:
import cupy as cp
except ImportError:
import numpy as cp
try:
from rich.progress import Progress, BarColumn, TextColumn, TimeRemainingColumn, TimeElapsedColumn
except ImportError:
Progress = None
@guilt
guilt / argParse.sh
Last active July 19, 2025 09:18
Argument Parsing in Bash
#!/usr/bin/env sh
# Variable for the script description
_ARGPARSE_SCRIPT_DESCRIPTION=""
# Use this one wierd trick to shorten your CLI Boolean Flags
_ARGPARSE_FLAG_BEHAVIOUR="Add this flag to set the argument to 'true' (don't use '--flag true')"
# Declare an associative array for argument properties
_ARGPARSE_ARG_VALUES=()
@guilt
guilt / Pi-Setup-Steps.md
Last active July 22, 2025 23:47
Raspberry and Orange Setup Steps

Raspberry Pi Setup Steps

  1. Make the Box Ready. Either Keep the Box or Attach the Racking Unit
  2. Write Image, note down Hostname
  3. Install MicroSD Card
  4. Connect PoE and Reboot

Raspberry Pi Imaging Manual

  1. Use rapios-lite
@guilt
guilt / authy.spec
Created June 17, 2023 21:15
Authy Snap into RPM
%define _snapid H8ZpNgIoPyvmkgxOWw5MSzsXK1wRZiHn
%define _snaprev 18
Name: authy
Version: 2.2.3
Release: 1%{?dist}
Summary: Two factor authentication desktop application
ExclusiveArch: x86_64
License: Proprietary
URL: https://authy.com/
@guilt
guilt / env.nu
Last active May 11, 2023 22:39
NuShell Windows
# Custom Aliases
alias dir = ls
alias del = rm
alias ren = mv
alias move = mv
alias rmdir = rm
alias rd = rmdir
alias open = start
@guilt
guilt / unroll.c
Last active February 24, 2023 04:24
Header-Only Efficient Loop Unrolling in C and C++.
// Demo of unroll.h
#include "unroll.h"
int main()
{
int v;
U_unroll(v, 17, {
printf("Up Unroll\n");
});
@guilt
guilt / SDCascade.py
Last active July 19, 2025 10:13
Stable Diffusion
import os
from accelerate import Accelerator
from diffusers import StableCascadeDecoderPipeline, StableCascadePriorPipeline
from slugify import slugify
import torch
priorModelId = "stabilityai/stable-cascade-prior"
modelId = "stabilityai/stable-cascade"
dataType = torch.bfloat16 #Use torch.float32 alternatively
@guilt
guilt / ROCM-Setup-Steps.md
Last active July 22, 2025 23:47
ROCM Setup Steps

ROCm Setup Steps

ROCm Docker Image

  1. Install Docker and ensure you can run docker ps correctly, add yourself to the docker group if necessary.
  2. Run build-rocm.sh builds a ROCm docker image for your Linux System. It is configured to use the render group configured in your Linux distribution and ensure that /dev/kfd and /dev/dri are writeable by the render group users. Ensure you are added to the render group if necessary.
  3. Run launch-rocm.sh if you wish to only use ROCm with the docker image you built.