Skip to content

Instantly share code, notes, and snippets.

@lakshayg
lakshayg / gb200-baseline-vs-bolt-fdata-26.01.csv
Last active July 2, 2026 18:29
PyTorch BOLT Performance Improvement
We can make this file beautiful and searchable if this error is corrected: It looks like row 7 should actually have 8 columns, instead of 1 in line 6.
Recipe,Metric,mean - GB200 Baseline,stddev - GB200 Baseline,mean - GB200+fdata,stddev - GB200+fdata,Improvement,Goal
recipe/llama-3_8b_megatron-pyt_perf-train_bf16_nodes-2_gpus-4_bs-1_mode-pretrain_tp-2_pp-1_fp8-hybrid,avg total throughput,17.05370,0.12936,19.60670,0.15883,15.0%,maximize
recipe/mixtral_8x7b_megatron-pyt_perf-train_bf16_nodes-4_gpus-4_bs-1_mode-pretrain_tp-4_pp-1_fp8-off,avg total throughput,11.86150,0.10561,13.60410,0.12851,14.7%,maximize
recipe/nemotron-h_8b_megatron-pyt_perf-train_bf16_nodes-2_gpus-4_bs-2_mode-pretrain_tp-1_pp-1_fp8-off_ub-off,avg total throughput,20.24090,0.29675,20.56870,0.29039,1.6%,maximize
recipe/sd_v1-5_diffusers-pyt_perf-train_amp_nodes-1_gpus-1_bs-64_mode-phase1_dlc-off,avg_train_throughput,312.69000,1.94407,311.76200,1.15084,-0.3%,maximize
recipe/llama-3_8b_megatron-pyt_perf-infer_bf16_nodes-1_gpus-1_bs-1_mode-pretrain_tp-1_pp-1_fp8-hybrid,test evaluation throughput,10.22430,0.04710,10.33030,0.18208,1.0%,maximize
recipe/mixtral_8x7b_megatron-pyt_perf-infer_bf16_nod
@lakshayg
lakshayg / llvm.sources
Created March 12, 2026 18:05
Adding LLVM sources to Ubuntu 24.04
# wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key | sudo tee /etc/apt/trusted.gpg.d/apt.llvm.org.asc
# cp llvm.sources /etc/apt/sources.list.d/llvm.sources
Types: deb deb-src
URIs: http://apt.llvm.org/noble/
Suites: llvm-toolchain-noble-21
Components: main
Signed-By: /etc/apt/trusted.gpg.d/apt.llvm.org.asc

BOLT - a post-link optimizer developed to speed up large applications

SYNOPSIS

llvm-bolt <executable> [-o outputfile] <executable>.bolt [-data=perf.fdata] [options]

OPTIONS

Generic options:

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <cstdio>
#include <vector>
#include <cuda_runtime.h>
#include <cusolverDn.h>
#include <limits>
#define CHECK_CUDA(call) \
do { \
cudaError_t err = call; \
if (err != cudaSuccess) { \
@lakshayg
lakshayg / sudoku.pi
Created August 7, 2024 18:41
Solve sudoku using the cp module in Picat (http://picat-lang.org/)
import cp. % ::, all_different
import util. % transpose
write_sudoku(S) =>
foreach (R in S)
foreach (X in R)
printf("%d ", X)
end,
printf("%n")
end.
@lakshayg
lakshayg / ttt.c
Last active July 2, 2026 19:32
Tic-Tac-Toe in C
#include <assert.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
/// TicTacToe ==========================================================================================================
typedef char Player;
const Player EMPTY = ' ';
//
// A solution to the problem described in
// https://www.youtube.com/watch?v=_-AfhLQfb6w
//
// How many sets of 5, 5-letter words exist such
// that the set has 25 distinct characters?
//
// It takes ~8sec to run on my machine.
//
// Usage: ./a.out < words_alpha.txt
@lakshayg
lakshayg / knights_and_knaves.prolog
Created March 5, 2024 22:36
A prolog program to solve the knight and knaves logic puzzles
person(knight).
person(knave).
persons(List) :- maplist(person, List).
claim(knight, Stmt) :- Stmt.
claim(knave, Stmt) :- \+Stmt.
% A puzzle taken from https://dmackinnon1.github.io/knaves/
% You have met a group of 6 islanders. Their names are Justin, Samuel, Ira, Frank, Beatrix, and Pamela.
@lakshayg
lakshayg / sudoku.hs
Last active March 7, 2024 18:03
Solve sudoku in haskell
import Data.Char (ord)
import Data.Maybe (isJust)
data CellValue = CellValue { index :: Int
, row :: Int
, col :: Int
, box :: Int
, value :: Int
}