Skip to content

Instantly share code, notes, and snippets.

View rahul003's full-sized avatar
🎯
Focusing

Rahul Huilgol rahul003

🎯
Focusing
  • Amazon Web Services
  • Palo Alto, CA
View GitHub Profile
@rahul003
rahul003 / nvsmi
Last active November 30, 2021 22:46
nvidia-smi -q >> /tmp/nvidia-smi.out && grep "Remapping Failure Occurred" /tmp/nvidia-smi.out | grep "Yes" && hostname
@rahul003
rahul003 / comm.h
Last active October 27, 2020 15:15
comm.h for nvidia-pt 1.6
#pragma once
#include <memory>
#include <ATen/ATen.h>
#include <c10d/ProcessGroup.hpp>
#include <torch/csrc/utils/pybind.h>
namespace c10d {
@rahul003
rahul003 / timing.cpp
Last active March 22, 2018 01:01
Timing code snippets
#include <iostream>
#include <chrono>
class Timer {
public:
Timer() : beg_(clock_::now()) {}
void reset() { beg_ = clock_::now(); }
double elapsed() const {
return std::chrono::duration_cast<second_>
(clock_::now() - beg_).count(); }
@rahul003
rahul003 / linux-cuda-install.sh
Created February 21, 2018 22:47
Install Cuda and Cudnn 9.1 on Ubuntu
sudo apt-get install -y linux-headers-$(uname -r)
wget http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
sudo dpkg -i cuda-repo-ubuntu1604_9.1.85-1_amd64.deb
sudo apt-get update
sudo apt-get install -y cuda
/usr/bin/nvidia-persistenced --verbose
sudo apt-get install -y g++ freeglut3-dev build-essential libx11-dev libxmu-dev libxi-dev libglu1-mesa libglu1-mesa-dev
wget http://developer2.download.nvidia.com/compute/machine-learning/cudnn/secure/v7.0.5/prod/9.0_20171129/Ubuntu16_04-x64/libcudnn7_7.0.5.15-1%2Bcuda9.0_amd64.deb?B6oKBFMYCPOY-7IYUsEd5RXHqo4X7I6Y7Ocbi0HI3sKsDx58Lyrsw921spJrwCNsOaLkJuMGkGsNLqGX6FJRAa0qXMfv5E38ZVCRdEspFRIcz7tYXUm6SGdsC-w4Vm5sxwoxmk1a7j0hNVKnj5uMF7ZMrt80tiOM9MdfjvtSV-RRNdFGmavFjX7pqGvpTcFHFwxdYCYZtvzOvD6t10hltLcrA7tJXRdwkQQGaid2W-yjnx7e4lI
@rahul003
rahul003 / mxnet-mac-build.sh
Last active February 21, 2018 23:38
MXNet on Mac with CMake
# install protobuf 25
brew install wget
wget https://raw.githubusercontent.com/mli/deps/master/build/protobuf-2.5.0.tar.gz
tar -xvf protobuf-2.5.0.tar.gz
cd protobuf-2.5.0
export CFLAGS=-fPIC
export CXXFLAGS=-fPIC
./configure
make -j 4
make install
@rahul003
rahul003 / mxnet-ubuntu-build.sh
Last active June 1, 2018 23:31
Setup Fast Build for MXNet on DLAMI v1 Ubuntu
sudo apt-get install -y ninja-build ccache
# ccache for better cached compilers
echo 'export PATH="/usr/lib/ccache:$PATH"' | tee -a ~/.bashrc
source ~/.bashrc
ccache -F 0
ccache -M 0
# OPTIONAL
# llvm-lit for omp build
@rahul003
rahul003 / gen_graph.py
Created March 31, 2015 14:45
Generate graph image from adjacency matrix
import networkx as nx
import matplotlib.pyplot as plt
import pylab
import csv
from random import random
G=nx.Graph()
with open('ai3.csv', 'rb') as csvfile:
spamreader = csv.reader(csvfile, delimiter=',')
for row in spamreader:
@rahul003
rahul003 / backup_cronjob
Last active August 29, 2015 13:59
Example Cron job for backup
# Adding tasks:
# m h dom mon dow command
59 23 * * 1,2,3,4,5,6 /home/rh/git/useful_scripts/backup/incr_backup.sh
59 23 * * 7 /home/rh/git/useful_scripts/backup/full_backup.sh
#view cron tasks
crontab -l
@rahul003
rahul003 / Sublime Text Shortcuts
Last active August 29, 2015 13:57 — forked from harshil93/gist:9514448
Sublime Text Shortcuts
h1. Sublime Text 2 - Useful Shortcuts (PC)
Loosely ordered with the commands I use most towards the top. Sublime also offer "full documentation":http://www.sublimetext.com/docs/2/.
h2. Editing
| *Ctrl+C* | copy current line (if no selection) |
| *Ctrl+X* | cut current line (if no selection) |
| *Ctrl+⇧+K*| delete line |
| *Ctrl+↩* | insert line after |