Skip to content

Instantly share code, notes, and snippets.

View KellenSunderland's full-sized avatar

Kellen Sunderland KellenSunderland

View GitHub Profile
@KellenSunderland
KellenSunderland / main.cpp
Last active January 13, 2019 17:11
rvalue test
#include <iostream>
#include <utility>
#include <vector>
#include <cstring>
using namespace std;
class MyType {
public:
@KellenSunderland
KellenSunderland / run_model.py
Created April 29, 2019 21:16
MXNet Benchmarking Script
import mxnet as mx
import numpy as np
import importlib
from collections import namedtuple
import time
def runMx(ctx,mod,data,num_batches,runType):
print('%s MXNet' % (runType))
Batch = namedtuple('Batch', ['data'])
t = 0
@KellenSunderland
KellenSunderland / config.mk
Created April 29, 2019 21:25
Regression config
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
@KellenSunderland
KellenSunderland / Dockerfile
Last active May 2, 2019 00:32
Reproduce Regression
FROM kellens/build.ubuntu_gpu_tensorrt:latest
WORKDIR /work
RUN wget https://gist.githubusercontent.com/KellenSunderland/686522830475dfc7073b5d7a97e89d24/raw/a0b12e63b5fbf51f4c2794a9a8dae22a2ac8cab1/run_model.py && \
wget https://raw.githubusercontent.com/apache/incubator-mxnet/master/example/fcn-xs/symbol_fcnxs.py
RUN git clone --recursive https://github.com/apache/incubator-mxnet.git --branch v1.4.x mxnet-v1.4.0-cmake && \
mkdir -p /work/mxnet-v1.4.0-cmake/lib/ && \
git clone --recursive https://github.com/apache/incubator-mxnet.git --branch v1.4.x mxnet-v1.4.0-make && \
@KellenSunderland
KellenSunderland / reproduce.sh
Last active May 2, 2019 01:24
Reproduce Regression
#!/bin/bash
wget https://gist.githubusercontent.com/KellenSunderland/219fc25d7f796ae5442cfe162d27cc9c/raw/d9015ebd878391930b5ba186ab4ba77042eee943/Dockerfile
nvidia-docker build -f Dockerfile . -t mxnet/regression
nvidia-docker run -ti -e "PYTHONPATH=/work/mxnet-v1.4.0-cmake/python" mxnet/regression python2 run_model.py
nvidia-docker run -ti -e "PYTHONPATH=/work/mxnet-v1.3.0-cmake/python" mxnet/regression python2 run_model.py
nvidia-docker run -ti -e "PYTHONPATH=/work/mxnet-v1.2.0-cmake/python" mxnet/regression python2 run_model.py
nvidia-docker run -ti -e "PYTHONPATH=/work/mxnet-v1.4.0-cmake-profiler/python" mxnet/regression python2 run_model.py
nvidia-docker run -ti -e "PYTHONPATH=/work/mxnet-v1.4.0-make/python" mxnet/regression python2 run_model.py
@KellenSunderland
KellenSunderland / TensorRTCompilation.MD
Last active November 16, 2019 00:30
MXNet with TensorRT support compilation guide

FROM UBUNTU 18.04

sudo apt-get install tmux htop libssl-dev
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && sudo apt update
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt update
sudo apt install -y cuda
wget https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb
sudo dpkg -i nvidia-machine-learning-repo-*.deb
FILE SIZE VM SIZE
-------------- --------------
73.8% 279Mi 75.2% 279Mi [section .nv_fatbin]
7.5% 28.5Mi 4.9% 18.4Mi [46244 Others]
1.1% 4.03Mi 1.0% 3.58Mi mshadow::MapExp<>()
0.9% 3.56Mi 1.0% 3.56Mi __sti____cudaRegisterAll()
0.9% 3.37Mi 0.9% 3.36Mi mxnet::op::ElemwiseBinaryOp::RspRspOp<>()
0.0% 2.70Ki 0.7% 2.78Mi precalc_xorwow_matrix
0.0% 2.71Ki 0.7% 2.78Mi precalc_xorwow_offset_matrix
0.7% 2.78Mi 0.7% 2.78Mi [section .gcc_except_table]