Skip to content

Instantly share code, notes, and snippets.

View ariG23498's full-sized avatar
🐢
Un-learning slowly

Aritra Roy Gosthipaty ariG23498

🐢
Un-learning slowly
View GitHub Profile
@ariG23498
ariG23498 / eathmover.ipynb
Created September 8, 2026 11:21
eathmover.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ariG23498
ariG23498 / check.sh
Created August 21, 2026 13:28
Benchmark of NVFP4 kernels with Muse Glimmer
#!/usr/bin/env bash
set -euo pipefail
printf '%-10s %-9s %8s %10s %10s %10s\n' mode precision tokens tok/s seconds peak_GB
printf '%-10s %-9s %8s %10s %10s %10s\n' ---------- --------- -------- ---------- ---------- ----------
uv run example.py "$@" 2>/dev/null | tail -1
uv run example.py --nvfp4 "$@" 2>/dev/null | tail -1
uv run example.py --compile "$@" 2>/dev/null | tail -1
uv run example.py --nvfp4 --compile "$@" 2>/dev/null | tail -1
@ariG23498
ariG23498 / od-muse-glimmer.py
Created August 10, 2026 12:04
Object Detection with Muse Glimmer
import ast
import json
import re
import matplotlib.pyplot as plt
from matplotlib.patches import Rectangle
from transformers import AutoProcessor, AutoModelForMultimodalLM
from transformers.image_utils import load_image
@ariG23498
ariG23498 / compare-simple-liger-kernels.py
Created June 1, 2026 15:07
Test the outputs of a simple geglu mlp with liger and kernels
import torch
import torch.nn as nn
import torch.nn.functional as F
from liger_kernel.transformers import LigerTiledGEGLUMLP
from kernels import get_kernel
# create the inputs and the conigurations
device = "cuda"
batch = 128
seq = 16
@ariG23498
ariG23498 / aot.py
Last active September 18, 2025 06:49
AoT with CausalLMs
import torch
import spaces
from transformers import pipeline
# init pipeline
MODEL_ID = "HuggingFaceTB/SmolLM3-3B"
pipe = pipeline(
task="text-generation",
model=MODEL_ID,
use_cache=False # Note: This is important to bypass the `DynamicCache` not being registerd issue
@ariG23498
ariG23498 / download-dataset.py
Last active February 22, 2026 05:26
fine tune
from huggingface_hub import hf_hub_download
import tarfile
dataset_id = "sayakpaul/ucf101-subset"
fname = "UCF101_subset.tar.gz"
fpath = hf_hub_download(repo_id=dataset_id, filename=fname, repo_type="dataset")
with tarfile.open(fpath) as t:
t.extractall(".")
@ariG23498
ariG23498 / qwq_32b_nf4.py
Created March 6, 2025 07:39
QWQ 32B NF4 Inference
!pip install -Uq transformers bitsandbytes
import torch
from transformers import (
AutoModelForCausalLM,
AutoTokenizer,
)
model_name = "ariG23498/QwQ-32B-nf4"
tokenizer = AutoTokenizer.from_pretrained(model_name)
@ariG23498
ariG23498 / flux-dev-under-8gbs.py
Created October 20, 2024 09:01
Run FLUX Dev under 8gbs of VRAM.
# Taken from: https://gist.github.com/sayakpaul/23862a2e7f5ab73dfdcc513751289bea
from diffusers import FluxPipeline, FluxTransformer2DModel
from transformers import T5EncoderModel
import torch
import gc
def flush():
gc.collect()
@ariG23498
ariG23498 / LoLCATs.ipynb
Last active November 18, 2024 00:31
Demo LoLCATs LLMs
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ariG23498
ariG23498 / scratchpad.ipynb
Last active May 10, 2024 05:54
torch distribtuions
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.