Skip to content

Instantly share code, notes, and snippets.

@viktor-shcherb
viktor-shcherb / collect_repo_stats.py
Created December 15, 2024 14:05
Script to collect repository attribution in The Stack
import dataclasses
import threading
from argparse import ArgumentParser
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from dataclasses import dataclass
from pathlib import Path
from typing import Iterator, List, Dict, DefaultDict, Union
import pandas as pd
@viktor-shcherb
viktor-shcherb / c4wxcx6grm5mdf7cs7cte5z5yvvg6bvgjklli7xfjxr6kwefpzbt.py
Created November 21, 2024 23:35
Result of the compilation of fused MHA with FlexAttention and a complicated mask
import triton
import triton.language as tl
from triton.compiler.compiler import AttrsDescriptor
from torch._inductor.runtime import triton_helpers, triton_heuristics
from torch._inductor.runtime.triton_helpers import libdevice, math as tl_math
from torch._inductor.runtime.hints import AutotuneHint, ReductionHint, TileHint, DeviceProperties
@triton_heuristics.template(