Skip to content

Instantly share code, notes, and snippets.

@namgyu-youn
namgyu-youn / run_benchmark.py
Created June 13, 2026 07:07
[llm-d] Video Token Estimation
#!/usr/bin/env python3
"""
Benchmark: video token estimation for Qwen3-VL using Video-MME.
Usage: python run_benchmark.py --base-url http://localhost:8000 [--num-videos 10]
Dependencies: pip install requests huggingface_hub datasets yt-dlp transformers
Reference: github.com/QwenLM/Qwen3-VL (vision_process.py)
"""
import argparse, base64, math, time
import numpy as np, requests, yt_dlp
@namgyu-youn
namgyu-youn / log.txt
Created April 6, 2026 11:45
[torchao] W8A8-INT GPU Profiling Result
repro:
```
import gc, time, torch
from collections import defaultdict
from contextlib import contextmanager
from transformers import AutoModelForCausalLM, AutoTokenizer
from torchao.quantization import Int8DynamicActivationInt8WeightConfig, quantize_
import warnings, logging
warnings.filterwarnings("ignore", category=UserWarning, module="torchao")
@namgyu-youn
namgyu-youn / log.txt
Created January 8, 2026 18:08
[TorchAO] SmoothQuant benchmark error in vLLM
./benchmarks/quantization/measure_accuracy_and_performance.sh smoothquant_int8 meta-llama/Llama-3.2-1B
Skipping import of cpp extensions due to incompatible torch version 2.9.0+cu128 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
torch.__version__='2.9.0+cu128'
torch.cuda.get_device_name()='NVIDIA A100 80GB PCIe MIG 2g.20gb'
torchao.__version__='0.15.0'
vllm.__version__='0.13.0'
processing quant_recipe smoothquant_int8
Skipping import of cpp extensions due to incompatible torch version 2.9.0+cu128 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
@namgyu-youn
namgyu-youn / log.txt
Created January 8, 2026 17:57
[TorchAO] AWQ benchmark error in vLLM
> ./benchmarks/quantization/measure_accuracy_and_performance.sh awq_int4_weight_only meta-llama/Llama-3.2-1B
torch.__version__='2.9.0+cu128'
torch.cuda.get_device_name()='NVIDIA A100 80GB PCIe MIG 1g.10gb'
torchao.__version__='0.16.0+git529289d8'
vllm.__version__='0.13.0'
processing quant_recipe awq_int4_weight_only
@namgyu-youn
namgyu-youn / log.txt
Last active January 8, 2026 18:09
[TorchAO] GEMM perf: `torch._int_mm` vs. Triton
import torch
import torchao.kernel.int8_scaled_mm_triton # noqa: F401
from torchao.kernel.intmm import int_scaled_matmul
def benchmark_in_ms(warmup, iters, f):
"""Benchmark using CUDA events."""
for _ in range(warmup):
f()
@namgyu-youn
namgyu-youn / error.txt
Last active April 27, 2026 07:07
torchao W8A8-INT deployment at vLLM
torch.__version__='2.9.0+cu128'
torch.cuda.get_device_name()='NVIDIA A100 80GB PCIe'
torchao.__version__='0.15.0'
vllm.__version__='0.13.0'
processing quant_recipe int8_rowwise
Skipping import of cpp extensions due to incompatible torch version 2.9.0+cu128 for torchao version 0.15.0 Please see https://github.com/pytorch/ao/issues/2919 for more info
Running model_id='meta-llama/Llama-3.1-8B' with quant_recipe_name='int8_rowwise'
How to fix a corrupt zsh history file
Occasionally you may find you have a corrupt zsh history file preventing you from using the `fc` command or searching the history. Here's how to fix it.
Estimated reading time: 1 minutes
Table of contents
Corrupt ZSH history file
How to fix it
Making it a script
Corrupt ZSH history file
If you use zsh for your shell very occasionally you may find the following message appearing indicating a corrupt history file. This is normally after a reboot.