Skip to content

Instantly share code, notes, and snippets.

View merrymercy's full-sized avatar
:octocat:

Lianmin Zheng merrymercy

:octocat:
View GitHub Profile
@fmela
fmela / stacktrace.cxx
Last active September 22, 2023 10:58
A C++ function that produces a stack backtrace with demangled function & method names.
/*
* Copyright (c) 2009-2017, Farooq Mela
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
import argparse
import json
parser = argparse.ArgumentParser()
parser.add_argument('in_file', type=str)
parser.add_argument('out_file', type=str)
args = parser.parse_args()
def transform(line):
@kylemcdonald
kylemcdonald / Interprocess Queue Performance.ipynb
Created September 8, 2019 15:10
Testing the performance of Queue-based IPC in Python 3.7.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@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):