Skip to content

Instantly share code, notes, and snippets.

View aadith-warrier's full-sized avatar

Aadith S Warrier aadith-warrier

View GitHub Profile
@aadith-warrier
aadith-warrier / install_minkowski_engine.md
Created June 15, 2025 14:55
Install Minkowski Engine anywhere

Minkowski Engine Install for SLURM/HPC environments with no sudo access.

CUDA < 12.4 should work. 12.4+ works with some patches check this issue.

module load <cuda 11.8> 

export CUDA_HOME=<path to cuda 11.8>  # adjust this to your environment check by running 'module show <module_name>'
export PATH=$CUDA_HOME/bin:$PATH
export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
@Flova
Flova / plot_grad_flow.py
Last active March 12, 2025 14:27
Plot the gradient flow (PyTorch)
# Based on https://discuss.pytorch.org/t/check-gradient-flow-in-network/15063/10
def plot_grad_flow(named_parameters):
'''Plots the gradients flowing through different layers in the net during training.
Can be used for checking for possible gradient vanishing / exploding problems.
Usage: Plug this function in Trainer class after loss.backwards() as
"plot_grad_flow(self.model.named_parameters())" to visualize the gradient flow'''
ave_grads = []
max_grads= []