Skip to content

Instantly share code, notes, and snippets.

View cchan's full-sized avatar

Clive Chan cchan

View GitHub Profile

Keybase proof

I hereby claim:

  • I am cchan on github.
  • I am cchan3141 (https://keybase.io/cchan3141) on keybase.
  • I have a public key ASDXngTLj1owbE-s6GMjagRzspT_u0dDisSc627G2J4Q0wo

To claim this, I am signing this object:

@cchan
cchan / simplesim-3.0-patch
Last active March 19, 2021 19:26
simplesim-3.0 fix for OSX, tested on Big Sur on M1. Run `make sim-tests` to check that it's working for you.
--- syscall.c
+++ syscall.c
@@ -48,6 +48,39 @@
* Copyright (C) 1994-2003 by Todd M. Austin, Ph.D. and SimpleScalar, LLC.
*/
+#ifdef __APPLE__
+
+#define __unix__
+#define unix
@cchan
cchan / bf16_convs.py
Created December 28, 2022 03:52
A janky benchmark script for autocasted convolution in pytorch
import time
import torch
torch.backends.cuda.matmul.allow_tf32 = False
GROUPS = 64
for k in [3, 5, 7]:
x = torch.rand(16,64,1024,1024, device="cuda", dtype=torch.float32)
weight = torch.rand(64,64//GROUPS,k,k, device="cuda", dtype=torch.float32)