nano /etc/docker/daemon.json
## add this config
{
"data-root": "/newlocation"
}
- Launch: t3.2xlarge ($0.33/h) / m5d.4xlarge ($0.904) / g4dn.4xlarge ($1.2/h) / p3.2xlarge ($3.02/h)
- Image: Deep Learning AMI (Ubuntu 22.04)
- Configure Security Group:
- open custom TCP and port 9999
- open HTTPS, HTTP to anywhere
- Attach an Elastic IP to the instance
ssh into EC2 from MobaXterm and run
-
Squash commits into a single commit and rebase feature branch onto
upstream/develop
git fetch upstream && git rebase -i $(git merge-base feature_name upstream/develop)
-
Cleanup git repository aggressively
use bfg https://rtyley.github.io/bfg-repo-cleaner/
java -jar bfg.jar --delete-files your_unwanted_files
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import functools | |
from typing import Any, Mapping | |
def singleton(cls): | |
'''a class decorator that wraps class definition so that only one class instance can exist''' | |
existing_instances = dict() | |
@functools.wraps(cls) | |
def singleton_class(*args, **kwargs): | |
if cls not in existing_instances: |
Short Name | Full Name | URL |
---|---|---|
CAME | Confidence-guided Adaptive Memory Efficient Optimization (ACL23 outstanding paper award) | https://github.com/huawei-noah/Pretrained-Language-Model/blob/master/CAME/came.py |
LOMO | LOw-Memory Optimization | https://github.com/OpenLMLab/LOMO/blob/main/src/lomo.py |
LORA (Low Rank Adaption): https://github.com/microsoft/LoRA or https://github.com/huggingface/peft/blob/main/src/peft/tuners/lora.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""Data Strutures that extend OrderedDict""" | |
from collections import Counter, OrderedDict | |
from typing import Any, Hashable, Optional, Tuple, List | |
from hypothesis import given, strategies as st | |
__all__ = ["OrderedDefaultDict", "MinMaxCounter"] | |
class OrderedDefaultDict(OrderedDict): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""MinHeap and MaxHeap (Optimized Implementation)""" | |
from abc import ABC, abstractmethod | |
from collections import Counter, UserList | |
from functools import singledispatchmethod | |
from heapq import ( | |
_heapify_max, | |
_heappop_max, | |
_heapreplace_max, | |
_siftdown, | |
_siftdown_max, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""UnionFind (Disjoint Sets)""" | |
from typing import Optional, Iterable, Hashable, Any | |
class UnionFind: | |
def __init__( | |
self, initial_disjoint_items: Optional[Iterable[Hashable]] = None | |
): | |
"""Initialize a UnionFind of disjoint sets""" |
NewerOlder