Skip to content

Instantly share code, notes, and snippets.

View yzh119's full-sized avatar

Zihao Ye yzh119

View GitHub Profile
@yzh119
yzh119 / tir_sparse.py
Created July 30, 2021 14:53
sparse workloads in tir
import tvm
from tvm import tir
from tvm.script import ty
@tvm.script.tir
def csr_spmm(indptr_: ty.handle, indices_: ty.handle, a_data: ty.handle, b: ty.handle, c: ty.handle) -> None:
m = tir.var('int32')
n = tir.var('int32')
k = tir.var('int32')
nnz = tir.var('int32')
@yzh119
yzh119 / buggy.py
Created August 5, 2021 08:00
ell spmm with multi-level tiling
import tvm
from tvm import tir
from tvm.script import ty
from tvm.tir.schedule.schedule import Schedule
@tvm.script.tir
def ell_spmm(indices_: ty.handle, a_data: ty.handle, b: ty.handle, c: ty.handle) -> None:
mb = tir.var('int32')
n = tir.var('int32')
@yzh119
yzh119 / cite-formatter.py
Created January 26, 2023 18:30
Automatically add `~` before each appearance of `\cite`
import os
import sys
import glob
import logging
logging.basicConfig(level=logging.INFO)
def fix_cite_format(line_number: int, line: str):
out = ""
@yzh119
yzh119 / retro-sparsetir-artifact.md
Last active February 21, 2023 00:20
Retrospective on SparseTIR artifact

Retrospective on SparseTIR artifact

Once SparseTIR was accepted to ASPLOS 2023, we began constructing the sparsetir-artifact repository for artifact evaluation. Though we already have lots of benchmarking scripts, we found it still not a trivial job to put them together and evaluate in a unified manner. While preparing our artifact, we also found some problems with our profiler and bugs in existing implementations. We carefully addressed these issues and standardized the settings for all baselines. We are writing this post to document the challenges we faced and the lessons we learned from creating the artifact. We aim to provide insight that will benefit researchers and engineers working in related fields.

Notes on performance difference

If you previously read our manuscript on ArXiv, you may have noticed that there are some discrepancies in the reported performance between SparseTIRv3 and our [camera-ready ver