Skip to content

Instantly share code, notes, and snippets.

@icemelon
icemelon / risc-zero-stark-to-snark-prover_attestation.log
Created April 17, 2024 21:55
Attestation for RISC Zero STARK-to-SNARK Prover MPC Phase 2 Trusted Setup ceremony
Hey, I'm icemelon-2696494 and I have contributed to the RISC Zero STARK-to-SNARK Prover MPC Phase2 Trusted Setup ceremony.
The following are my contribution signatures:
Circuit # 1 (stark_verify)
Contributor # 76
Contribution Hash: 39b65d41 397b0c08 14bdda53 927ce83a
017cafe3 62c4b052 3e6dd66d d28e3435
ad42499c 14d0bf94 24466d8e 7f9a9051
d322c677 ad126e85 012804ef b0b8f960
@icemelon
icemelon / keybase.md
Created July 22, 2021 22:09
Keybase account

Keybase proof

I hereby claim:

  • I am icemelon on github.
  • I am haichen (https://keybase.io/haichen) on keybase.
  • I have a public key whose fingerprint is 5EC6 0F17 91AA D9CF 6B44 8E63 2B99 E22C 56C2 FCA7

To claim this, I am signing this object:

model batch seq length MXNet latency (ms) TVM latency (ms) speedup
BERT 1 64 26.1 12.6 2.1
BERT 1 128 45.8 19.2 2.4
BERT 1 256 99.4 35.3 2.8
DistilBERT 1 64 13.4 6.2 2.2
DistilBERT 1 128 23.2 9.5 2.5
DistilBERT 1 256 50.1 17.5 2.9
@icemelon
icemelon / optimize_bert.py
Last active December 29, 2022 04:09
Optimize the BERT model on CPUs
import time
import argparse
import numpy as np
import mxnet as mx
import gluonnlp as nlp
import tvm
from tvm import relay
import tvm.contrib.graph_runtime as runtime
def timer(thunk, repeat=1, number=10, dryrun=3, min_repeat_ms=1000):
@icemelon
icemelon / test_nth.py
Created April 10, 2020 05:28
test_nth
import numpy as np
import tvm
from tvm import relay
from tvm.relay.ty import TupleType, TensorType
from tvm.relay.prelude import Prelude
from tvm.runtime.container import ADT
def _get_relay_input_vars(input_shapes, prelude):
def _is_int_seq(seq):
@icemelon
icemelon / sch1.py
Last active July 9, 2019 22:08
amlc
for yo in range(128):
for xo in range(128):
C[yo*8:yo*8+8][xo*8:xo*8+8] = 0
for ko in range(128):
for yi in range(8):
for xi in range(8):
for ki in range(8):
C[yo*8+yi][xo*8+xi] +=
A[ko*8+ki][yo*8+yi] * B[ko*8+ki][xo*8+xi]
@icemelon
icemelon / matmul.py
Last active November 14, 2018 01:29
Autotvm matmul
import sys
import numpy
import timeit
import logging
import tvm
from tvm import autotvm
@autotvm.template
def matmul(M, K, N):
A = tvm.placeholder((M, K), name='A')