Skip to content

Instantly share code, notes, and snippets.

View sandeepkumar-skb's full-sized avatar
:octocat:
Get comfortable being uncomfortable

Sandeep Kumar Behera sandeepkumar-skb

:octocat:
Get comfortable being uncomfortable
View GitHub Profile
import onnx
import sys
name = sys.argv[1]
model = onnx.load(name)
onnx.checker.check_model(model)
print(onnx.helper.printable_graph(model.graph))
@sandeepkumar-skb
sandeepkumar-skb / onnx_tensorrt_inference.py
Created June 26, 2020 03:25 — forked from CasiaFan/onnx_tensorrt_inference.py
Acceleration inference of onnx model with TensorRT
import tensorrt as trt
import numpy as np
import pycuda.autoinit
import pycuda.driver as cuda
import time
model_path = "model.onnx"
input_size = 32
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
# Path to your oh-my-zsh installation.
export ZSH="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
#ZSH_THEME="agnoster"
########################
ZSH_THEME="powerlevel9k/powerlevel9k"
#!/bin/bash
sudo apt-get update
sudo apt upgrade
sudo apt install zsh
sudo apt-get install powerline fonts fonts-powerline
echo "################Cloning OH MY ZSH####################"
echo ""
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" TODO: this may not be in the correct place. It is intended to allow overriding <Leader>.
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif
docker run -it --ipc=host --gpus all --user $(id -u):$(id -g) -v /etc/passwd:/etc/passwd:ro -v /etc/group:/etc/group:ro -v `pwd`:/host <docker_image>
@sandeepkumar-skb
sandeepkumar-skb / profile.py
Created July 17, 2020 19:44 — forked from mkolod/profile.py
A CUDA memory profiler for pytorch
'''
Memory profiling utilities
'''
import gc
import inspect
import linecache
import os.path
import sys
import time
import threading
@sandeepkumar-skb
sandeepkumar-skb / profile.py
Last active July 17, 2020 19:44 — forked from mkolod/profile.py
A CUDA memory profiler for pytorch
'''
Memory profiling utilities
'''
import gc
import inspect
import linecache
import os.path
import sys
import time
import threading
#include <iostream>
#include <chrono>
void cpu_all_reduce(int* sum, int* data, int n){
int temp_sum = 0;
for (int i=0; i<n; ++i){
temp_sum += data[i];
}
*sum = temp_sum;
}
#include <iostream>
#include <chrono>
void cpu_all_reduce(int* sum, int* data, int n){
int temp_sum = 0;
for (int i=0; i<n; ++i){
temp_sum += data[i];
}
*sum = temp_sum;