FastFile Mode
sagemaker.inputs.TrainingInput(S3_INPUT_FOLDER, input_mode='FastFile')
"""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, |
"""BitMask""" | |
class BitMask: | |
__slots__ = ("size", "mask") | |
def __init__(self, size: int = 16): | |
"""Create a bit mask to store (size) 0/1 status""" | |
self.size = size | |
self.mask = 1 << size | |
"""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): |
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
"""Universal Decorator | |
Universal decorators can decorate functions, classes, bound methods | |
(class method / instance method) referenced outside of class definition | |
and descriptors (class methods, static methods) defined inside class definition. | |
""" | |
from __future__ import annotations | |
import inspect |