- Analogy: Like a dance routine: steps can be combined, there's a neutral pose, and every move has an undo.
- Joke: Why did the group go to therapy? It had identity issues.
-
Definition: A set
$G$ with operation$*$ satisfying associativity, identity, and inverses.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# this needs a sqlite dump from nsight nsys utility | |
# for example on windows i ran this: | |
# "C:\Program Files\NVIDIA Corporation\Nsight Systems 2025.1.3\target-windows-x64\nsys.exe" profile --trace=cuda,nvtx --export sqlite --output profile_matmul you_cuda_program.exe | |
# once that dump is there run the follow python code on it basically it takes few key tables and animate a timeline | |
import sqlite3 | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib.patches import Patch | |
from mpl_toolkits.mplot3d import Axes3D |
Part I: Algebraic Structures & Topological Foundations
Groups and Group Theory
- Group: Abstract set with a binary operation satisfying associativity, identity, and invertibility. Captures symmetry and structure.
- Subgroup: A subset that is itself a group under the same operation.
- Normal Subgroup: Invariant under conjugation; key to forming quotient groups.
- Quotient Group: The result of identifying elements differing by a normal subgroup; often used in symmetry reduction.
- Group Homomorphism & Isomorphism: Structure-preserving maps between groups; isomorphisms show structural equivalence.
- Group Action: A group acting on a set reveals symmetry in geometry and algebra.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.decomposition import PCA | |
from itertools import product | |
def generate_4d_honeycomb(grid_size=4, spacing=2.0): | |
"""Generate a 4D hexagonal-like lattice (offset in x/y, uniform in z/w).""" | |
points = [] | |
edges = [] | |
point_index = {} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import colormaps | |
from matplotlib.animation import FuncAnimation | |
from mpl_toolkits.mplot3d import Axes3D | |
from transformers import GPT2LMHeadModel, GPT2Tokenizer | |
from sklearn.decomposition import PCA | |
# === CONFIG === |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import torch | |
import argparse | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from matplotlib import cm | |
from matplotlib import colormaps | |
from mpl_toolkits.mplot3d import Axes3D | |
from transformers import GPT2LMHeadModel, GPT2Tokenizer | |
from sklearn.decomposition import PCA | |
from sklearn.manifold import TSNE |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
import os | |
# --- GELU Activation --- | |
def gelu(x): | |
return 0.5 * x * (1 + np.tanh(np.sqrt(2 / np.pi) * (x + 0.044715 * x**3))) | |
def gelu_derivative(x): | |
tanh_term = np.tanh(np.sqrt(2 / np.pi) * (x + 0.044715 * x**3)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import matplotlib.pyplot as plt | |
from mpl_toolkits.mplot3d.art3d import Poly3DCollection | |
import matplotlib.colors as mcolors | |
# Timeline JSON-style data | |
timeline = [ | |
{"step": "kernel_launch", "objects": {"threads": 4096, "blocks": 16, "warps": 128}}, | |
{"step": "index_calculation", "objects": {"row_index": 4096, "col_index": 4096}}, | |
{"step": "tile_phase_0_shared_memory_load", "objects": {"global_reads": 8192, "shared_stores": 8192}}, | |
{"step": "tile_phase_0_sync_1", "objects": {"sync_barriers": 16}}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from nnsight import LanguageModel | |
import torch | |
import argparse | |
import os | |
import sys | |
import time | |
def clear_terminal(): | |
os.system('cls' if os.name == 'nt' else 'clear') |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
NewerOlder