Skip to content

Instantly share code, notes, and snippets.

root@computeinstance-e00ccn3b72xn1s8y6y:/workspace# mkdir -p /workspace/syad && cd /workspace/syad
git clone --depth=1 --branch main --single-branch https://github.com/HazyResearch/ThunderKittens ThunderKittens 2>/dev/null || true
# --- versions ---
. /etc/os-release 2>/dev/null; UBU="${NAME:-Linux} ${VERSION_ID:-$(uname -r)}"
CUDA=$(nvcc --version 2>/dev/null | sed -n 's/.*release \([0-9.]\+\).*/\1/p' | head -1 || echo "")
TORCH=$(python -c "import torch; print(torch.__version__)" 2>/dev/null || echo "not found")
TRT=$(python -c "import tensorrt as trt; print(trt.__version__)" 2>/dev/null || echo "not found")
GPU=$(nvidia-smi --query-gpu=name --format=csv,noheader 2>/dev/null | paste -sd ' / ' - || echo "not found")
HASH=$(git -C ThunderKittens rev-parse --short=12 HEAD 2>/dev/null || echo "unknown")
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@syadegari
syadegari / sample_plots.ipynb
Last active August 8, 2023 14:27
sample plots using matplotlib
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
import torch
import torch.nn as nn
import torch.nn.functional as F
class Encoder(nn.Module):
def __init__(self, nonlin_fn=F.relu, dropout=0.2):
super(Encoder, self).__init__()
self.conv1 = nn.Conv2d(1, 32, 2)
self.conv2 = nn.Conv2d(32, 16, 2)
self.conv3 = nn.Conv2d(16, 4, 2)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
class model(nn.Module):
'''
Convolutional part
conv -> relu -> pool -> dropout
FC part
fc -> relu'''
def __init__(self, inp, out, conv_layers, fc_layers,
kernel_size=3, pool_size=2, p=0.2):
super(model, self).__init__()