Skip to content

Instantly share code, notes, and snippets.

View yenchenlin's full-sized avatar
👋
Hi!

Yen-Chen Lin yenchenlin

👋
Hi!
View GitHub Profile
@qsh-zh
qsh-zh / torch_activation_checkpointing.md
Created February 24, 2025 10:38
torch_activation_checkpointing

Tutorial: PyTorch Gradient Checkpointing with Detailed Torch Background and Implementation

In this tutorial, we'll dive deep into gradient checkpointing in PyTorch, a memory optimization technique for neural network training. We'll cover its purpose, mechanics, and provide detailed insights into PyTorch's internal implementation, including advanced features like early stopping and selective checkpointing. Additionally, we'll address the user's specific requests for background on Torch operations, Torch dispatch, and detailed implementation analysis. Practical examples, flowcharts, and comprehensive explanations are included to ensure clarity.

Introduction to Gradient Checkpointing

Gradient checkpointing reduces memory consumption during the training of deep neural networks. Normally, during the forward pass, all intermediate activations are stored in memory for gradient computation in the backward pass. This can lead to high memory usage, especially for large models. Gradient checkpointing addresses t

@digiter
digiter / FixCommandForMacKeyboard.md
Last active December 2, 2022 19:48
Map Command Key to Control For ubuntu + mac keyboard

For each machine running xmodmap will give you the mapping and keycode, take a look first then write the script. I use ubuntu and mac keyboard. The below maps both left and right control and super.

Create an .Xmodmap file in your Linux home directory, with the following contents, then execute xmodmap .Xmodmap

clear control
clear mod4

keycode 37 = Super_L
keycode 105 = Super_R
@JaviLorbada
JaviLorbada / FRP iOS Learning resources.md
Last active April 20, 2025 21:15
The best FRP iOS resources.

Videos

@titipata
titipata / caffe_install.md
Last active January 27, 2022 03:27
My notes on how to install caffe on Ubuntu

Caffe Installation

Note on how to install caffe on Ubuntu. Sucessfully install using CPU, more information for GPU see this link

###Installation

  • verify all the preinstallation according to CUDA guide e.g.
lspci | grep -i nvidia
@ryin
ryin / tmux_local_install.sh
Last active May 3, 2025 02:56
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=1.8