Skip to content

Instantly share code, notes, and snippets.

View EthanZhong02's full-sized avatar
๐ŸŒ

EthanZhong02

๐ŸŒ
View GitHub Profile
"""Matmul K-block size vs numerical error, standalone.
C = A @ B, tiled over BLOCK_M x BLOCK_N x BLOCK_K. Sweeps BLOCK_K -- the
number of serial tl.dot steps K is split into (K/BLOCK_K) -- and measures
error against an fp64 reference. tl.dot is opaque from Triton source, so
--dump-ptx exists to count the mma.sync/fma per BLOCK_K directly.
python matmul_error_vs_reduction_depth.py --K 1024 4096 16384 --dtype fp16 fp32
python matmul_error_vs_reduction_depth.py --dump-ptx --dtype fp16
"""Reduction depth vs numerical error, standalone.
Row-wise sum in Triton. BLOCK_SIZE trades serial chunk depth (N/BLOCK_SIZE)
against in-chunk tree depth (log2(BLOCK_SIZE)); error is measured against an
fp64 reference and plotted against the sum of the two. For fp16 storage both
accumulator dtypes are swept, so that pair differs in exactly one variable.
python accumulation_error_vs_reduction_depth.py --N 1024 4096 16384 --dtype fp16 fp32
python accumulation_error_vs_reduction_depth.py --dump-ptx --dtype fp16
@EthanZhong02
EthanZhong02 / SimpleHTTPServerWithUpload.py
Created January 4, 2020 04:26 — forked from touilleMan/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload - Python3 version
#!/usr/bin/env python3
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
see: https://gist.github.com/UniIsland/3346170
"""
@EthanZhong02
EthanZhong02 / server.py
Created July 13, 2019 13:16 — forked from mdonkers/server.py
Simple Python 3 HTTP server for logging all GET and POST requests
#!/usr/bin/env python3
"""
Very simple HTTP server in python for logging requests
Usage::
./server.py [<port>]
"""
from http.server import BaseHTTPRequestHandler, HTTPServer
import logging
class S(BaseHTTPRequestHandler):
@EthanZhong02
EthanZhong02 / SimpleHTTPServerWithUpload.py
Created July 1, 2019 01:43 — forked from UniIsland/SimpleHTTPServerWithUpload.py
Simple Python Http Server with Upload
#!/usr/bin/env python
"""Simple HTTP Server With Upload.
This module builds on BaseHTTPServer by implementing the standard GET
and HEAD requests in a fairly straightforward manner.
"""
@EthanZhong02
EthanZhong02 / root-ro
Last active November 27, 2018 08:16 — forked from niun/root-ro
Read-only Root-FS with overlayfs for Raspian
#!/bin/sh
#
# Read-only Root-FS for Raspian
#
# Modified 2018 by Zhong Sheng to support using filesystem other than tmpfs as upper filesystem
#
# Modified 2015 by Pascal Rosin to work on raspian-ua-netinst with
# overlayfs integrated in Linux Kernel >= 3.18.
#
# Originally written by Axel Heider (Copyright 2012) for Ubuntu 11.10.
@EthanZhong02
EthanZhong02 / map.sublime-syntax
Last active March 9, 2018 03:42
This is a sublime-syntax file for *Sublime Text 3* which highlights the MAP FILE generated by Keil MDK-ARM, you can just put it into Packages/User folder to apply it :-)
%YAML 1.2
---
# See http://www.sublimetext.com/docs/3/syntax.html
name: ARM Map
file_extensions:
- map
scope: text.map
# first_line_match: