Skip to content

Instantly share code, notes, and snippets.

View db434's full-sized avatar

Daniel Bates db434

  • Monumo Ltd
  • Cambridge, UK
View GitHub Profile
@db434
db434 / dynamic-experiment.py
Created April 29, 2020 19:04
Exercise lat-dynamic with a range of different input options
# Sweep through a range of parameters for a dynamic convolution workload.
# To be executed from the main directory of lat-dynamic.
from multiprocessing import Pool
import os
# ResNet34 block parameters.
blocks = {
"block1": {"channels": "64", "in_size": "58"},
"block2": {"channels": "128", "in_size": "30"},
@db434
db434 / Makefile
Last active June 1, 2020 10:47
Template Loki convolution code
TARGET := template
OBJS := template.o
LIBLOKI_DIR ?= /usr/groups/comparch-loki/tools/releases/libloki/current
LAT_IFC_DIR ?= /usr/groups/comparch-loki/tools/releases/lat-ifc/current
LAT_NN_DIR ?= /usr/groups/comparch-loki/tools/releases/lat-nn/current
$(TARGET): $(OBJS)
loki-clang -L$(LIBLOKI_DIR)/lib -L$(LAT_IFC_DIR)/lib -L$(LAT_NN_DIR)/lib -o $@ $+ -lloki -llat-nn -llat-ifc
@db434
db434 / group_conv.py
Created January 9, 2018 12:47
Debugging suspiciously slow grouped convolution in PyTorch.
import argparse
import os
import subprocess
import sys
import torch
def main():
parser = argparse.ArgumentParser()
parser.add_argument("--batch", type=int, default=256)
parser.add_argument("--img-size", type=int, default=32)