Skip to content

Instantly share code, notes, and snippets.

View ivanium's full-sized avatar

Yifan Qiao ivanium

View GitHub Profile
@ivanium
ivanium / benchmark_cpu_offloading.sh
Created March 18, 2026 17:38
Benchmark vLLM CPU offloading overhead
#!/usr/bin/env bash
# Benchmark CPU KV cache offloading overhead.
# Launches a vllm server, runs `vllm bench serve` against it, then
# repeats with offloading enabled. Uses random (unique) prompts so
# no offloaded prefix is ever hit — isolating the pure store overhead.
#
# Usage:
# bash benchmarks/benchmark_cpu_offloading.sh [MODEL] [INPUT_LEN] [OUTPUT_LEN] [NUM_PROMPTS]
#
# Environment variables:
@ivanium
ivanium / bench_bw.cpp
Last active February 10, 2025 21:16
Benchmarking CUDA H2D/D2H bandwidth
/**
* @file bench_bw.cpp
* @compile nvcc -o bench_bw bench_bw.cpp -O2 -g -std=c++14
*/
#include <cuda_runtime.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@ivanium
ivanium / nsight.sh
Created September 19, 2023 23:41 — forked from mcarilli/nsight.sh
Favorite nsight systems profiling commands for Pytorch scripts
# This isn't supposed to run as a bash script, i named it with ".sh" for syntax highlighting.
# https://developer.nvidia.com/nsight-systems
# https://docs.nvidia.com/nsight-systems/profiling/index.html
# My preferred nsys (command line executable used to create profiles) commands
#
# In your script, write
# torch.cuda.nvtx.range_push("region name")
# ...

Keybase proof

I hereby claim:

  • I am ivanium on github.
  • I am ivanium97 (https://keybase.io/ivanium97) on keybase.
  • I have a public key ASDT37crHhceBToAmdPE9F09wd6Kc601D63x-GSRdQzBRQo

To claim this, I am signing this object: