MCPcopy Create free account

hub / github.com/JonasGeiping/cramming / types & classes

Types & classes86 in github.com/JonasGeiping/cramming

↓ 10 callersClassRotary
cramming/architectures/embeddings.py:76
↓ 4 callersClassEmbeddingComponent
cramming/architectures/components.py:15
↓ 4 callersClassFFNComponent
Note: The FF layer is not auto-scaled when using a GLU type activation. Better do this manually and choose a sensible intermed_size that is nicely
cramming/architectures/components.py:65
↓ 3 callersClassAttentionComponent
cramming/architectures/components.py:48
↓ 3 callersClassPredictionHeadComponent
cramming/architectures/components.py:201
↓ 3 callersClassScriptableLM
Definitely can represent BERT, but also a lot of other things. To be used for MLM schemes.
cramming/architectures/scriptable_bert.py:46
↓ 3 callersClassScriptableLMForSequenceClassification
Classification head and pooler.
cramming/architectures/fixed_cramlm.py:145
↓ 3 callersClassShampooPreconditioner
Shampoo preconditioners for some generic layer. NOTE: Does not support sparse gradients at this time. Args: param (Tensor): Paramete
cramming/backend/optimizers/shampoo/shampoo_utils.py:220
↓ 2 callersClassAdagradPreconditioner
Adagrad/Adam/RMSProp preconditioner for a generic layer. Stores preconditioner using same format as parameter p. Operations are performed in-plac
cramming/backend/optimizers/shampoo/shampoo_utils.py:147
↓ 2 callersClassCumsum
cramming/architectures/attention.py:737
↓ 2 callersClassCumsumExp
cramming/architectures/attention.py:750
↓ 2 callersClassFLASH
FLASH as described in Transformer Quality in Linear Time. This is FLASH-QUAD, as we're not too interested in long-range sequences here.
cramming/architectures/attention.py:634
↓ 2 callersClassFourierMixing
Fourier mixing layer as described in the FNet paper. Layer takes input with size [Batch, Seq, Hidden] and returns output of the same size. Thi
cramming/architectures/attention.py:527
↓ 2 callersClassFunnelAttention
Self-attention layer abstract class. This is a funnel crammed into the gpt neo-x implementation from: https://github.com/EleutherAI/gpt-neox/
cramming/architectures/attention.py:320
↓ 2 callersClassLARS
:class:`LARS` [LARC in apex] is a pytorch implementation of both the scaling and clipping variants of LARS, in which the ratio between gradie
cramming/backend/optimizers/optimizer_modifiers.py:39
↓ 2 callersClassPoolingComponent
cramming/architectures/components.py:176
↓ 2 callersClassRotarySanityCheck
not again...
cramming/architectures/embeddings.py:132
↓ 2 callersClassScaledIdentity
cramming/architectures/attention.py:722
↓ 2 callersClassScriptableFunnelLM
A funnel transformer variation. For now only implemented for fixed sequence lengths, but this is not a necessary limitation.
cramming/architectures/funnel_transformers.py:89
↓ 2 callersClassScriptableLM
Definitely can represent BERT, but also a lot of other things. To be used for MLM schemes.
cramming/architectures/fixed_cramlm.py:57
↓ 2 callersClassScriptableLMForPreTraining
Definitely can represent BERT, but also a lot of other things. To be used for MLM schemes.
cramming/architectures/fixed_cramlm.py:84
↓ 2 callersClassScriptableRecurrentLM
Definitely can represent BERT, but also a lot of other things. To be used for MLM schemes.
cramming/architectures/recurrent_transformers.py:91
↓ 2 callersClassSeqFirstSelfAttention
Self-attention layer abstract class. This is the gpt neo-x implementation from: https://github.com/EleutherAI/gpt-neox/blob/main/megatron/mod
cramming/architectures/attention.py:112
↓ 2 callersClassSeqFirstTuFormAttention
Self-attention layer abstract class. Seq-first variant 1 THSA layer takes input with size [Seq, Batch, Hidden] and returns output of the
cramming/architectures/attention.py:449
↓ 2 callersClassTorchNormalize
cramming/architectures/attention.py:696
↓ 2 callersClassTorchSoftmax
cramming/architectures/attention.py:677
↓ 2 callersClassUniformGibbs
This is code based on https://github.com/taka-yamakoshi/TelephoneGame/blob/master/model/bert.py.
cramming/data/generation_gibbs.py:9
↓ 1 callersClassAdagradGrafting
cramming/backend/optimizers/shampoo/shampoo_utils.py:658
↓ 1 callersClassAdamGrafting
cramming/backend/optimizers/shampoo/shampoo_utils.py:688
↓ 1 callersClassBPTTforPreTraining
Modified pretraining for depth-recurrent models. Only works with models that expose the ScriptableRecurrentLM interface.
cramming/architectures/recurrent_transformers.py:141
↓ 1 callersClassBertAttentionWrapper
mini wrapper around BERT attention from huggingface for sanity checks.
cramming/architectures/attention.py:64
↓ 1 callersClassBlockShampooPreconditioner
Shampoo with blocking applied to the parameters. NOTE: Does not support sparse gradients at this time. Args: param (Tensor): Paramet
cramming/backend/optimizers/shampoo/shampoo_utils.py:483
↓ 1 callersClassCachedDataset
Cache a given dataset into RAM or SDRAM (GPU memory). This is only a good idea if you have enough RAM, especially if mapping into SDRAM.
cramming/data/cached_datasets.py:24
↓ 1 callersClassCrossEntropyWithZLoss
Cross Entropy plus logit regularization via z_loss.
cramming/architectures/losses.py:5
↓ 1 callersClassFlashMultiHeadAttention
Wrapper for flash MHA.
cramming/architectures/attention.py:268
↓ 1 callersClassFocalLoss
cramming/architectures/losses.py:158
↓ 1 callersClassFourierMixingParametrized
Fourier mixing layer as described in the FNet paper. Layer takes input with size [Seq, batch, Hidden] and returns output of the same size. Thi
cramming/architectures/attention.py:573
↓ 1 callersClassFunnelAttentionComponent
cramming/architectures/funnel_transformers.py:26
↓ 1 callersClassFunnelLayer
A funnel layer.
cramming/architectures/funnel_transformers.py:44
↓ 1 callersClassGLU
*-GLU activation functions. Implementation mostly following megatron
cramming/architectures/components.py:265
↓ 1 callersClassIdentity
mini wrapper around BERT attention from huggingface for sanity checks.
cramming/architectures/attention.py:51
↓ 1 callersClassIncorrectCrossEntropyLoss
CrossEntropyLoss, but only on incorrectly classified examples.
cramming/architectures/losses.py:176
↓ 1 callersClassInfiniteDataLoader
Lazy copy-paste from https://gist.github.com/MFreidank/821cc87b012c53fade03b0c7aba13958.
cramming/backend/utils.py:253
↓ 1 callersClassL1Loss
L1 Loss as a drop-in replacement for Cross Entropy Loss. Only for 2dim inputs and 1dim labels This implementation includes a mean reduction in ba
cramming/architectures/losses.py:79
↓ 1 callersClassLMDBDataset
Implement LMDB caching and access. Originally based on https://github.com/pytorch/vision/blob/master/torchvision/datasets/lsun.py and htt
cramming/data/lmdb_datasets.py:20
↓ 1 callersClassLearnablePositional
Shorthand for a learnable embedding.
cramming/architectures/embeddings.py:61
↓ 1 callersClassMSELoss
MSE Loss as a drop-in replacement for Cross Entropy Loss. This implementation includes a mean reduction in batch dimension and a 1/num_classes/M
cramming/architectures/losses.py:29
↓ 1 callersClassMSELossFast
MSE Loss as a drop-in replacement for Cross Entropy Loss. Only for 2dim inputs and 1dim labels This implementation includes a mean reduction in b
cramming/architectures/losses.py:55
↓ 1 callersClassPatchedDataCollatorForLanguageModeling
cramming/backend/utils.py:158
↓ 1 callersClassProgressiveBatching
cramming/backend/optimizers/progressive_batching.py:17
↓ 1 callersClassRMSNorm
The RMS variant of scaling norms.
cramming/architectures/components.py:305
↓ 1 callersClassRMSPropGrafting
cramming/backend/optimizers/shampoo/shampoo_utils.py:683
↓ 1 callersClassRotaryEleutherAI
The rotary position embeddings from RoFormer_ (Su et. al). A crucial insight from the method is that the query and keys are transformed b
cramming/architectures/embeddings.py:183
↓ 1 callersClassSAM
cramming/backend/optimizers/optimizer_modifiers.py:132
↓ 1 callersClassSGDGrafting
cramming/backend/optimizers/shampoo/shampoo_utils.py:644
↓ 1 callersClassSanityCheckforPreTraining
Make big go fast.
cramming/architectures/sanity_check.py:6
↓ 1 callersClassScaleNorm
Quick and simple scale norm implementation. Do we also need FixNorm (cosine in the last layer)? It's a maybe here: https://github.com/lucidra
cramming/architectures/components.py:288
↓ 1 callersClassScaledSinosoidal
Sinusoidal with scaling (see FLASH paper).
cramming/architectures/embeddings.py:41
↓ 1 callersClassScriptableLMForPreTraining
Definitely can represent BERT, but also a lot of other things. To be used for MLM schemes.
cramming/architectures/scriptable_bert.py:138
↓ 1 callersClassScriptableLMForSequenceClassification
Classification head and pooler.
cramming/architectures/scriptable_bert.py:222
↓ 1 callersClassSelfAttentionPyTorch
Minimal wrapper around pytorch self attention.
cramming/architectures/attention.py:85
↓ 1 callersClassSequential
Modified sequential class.
cramming/architectures/components.py:318
↓ 1 callersClassSequentialwithMask
Modified sequential class.
cramming/architectures/recurrent_transformers.py:278
↓ 1 callersClassSinusoidalPositional
r"""Inject some information about the relative or absolute position of the tokens in the sequence. The positional encodings have the same dimensio
cramming/architectures/embeddings.py:9
↓ 1 callersClassSzegedyLoss
Regression directly back to input embedding. Remove the decoding layer if using this loss. As mentioned at https://twitter.com/ChrSzegedy/status/
cramming/architectures/losses.py:105
↓ 1 callersClassTorchEngine
This class mirrors deepspeed functionality.
cramming/backend/torch_default.py:40
↓ 1 callersClassTransformerLayer
A transformer-encoder structure based on the components from above.
cramming/architectures/fixed_cramlm.py:30
↓ 1 callersClassTransformerLayerSimplified
A transformer-encoder structure based on the components from above.
cramming/architectures/recurrent_transformers.py:40
↓ 1 callersClassTuFormAttention
Self-attention layer abstract class. This is a simplification of the tuformer implementationfrom https://github.com/xliu1231/fairseq_tuformer
cramming/architectures/attention.py:387
↓ 1 callersClass_ModelArgWrapper
Wrap arguments.
cramming/backend/torch_default.py:428
↓ 1 callersClasscrammedBertConfig
cramming/architectures/scriptable_bert.py:38
ClassAdahessian
Implements Adahessian algorithm. It has been proposed in `ADAHESSIAN: An Adaptive Second Order Optimizer for Machine Learning`. Arguments:
cramming/backend/optimizers/adahessian.py:35
ClassFLASHLayer
A FLASH-quad layer.
cramming/architectures/components.py:157
ClassGrafting
cramming/backend/optimizers/shampoo/shampoo_utils.py:617
ClassGraftingType
cramming/backend/optimizers/shampoo/shampoo_utils.py:30
ClassLargeDimMethod
cramming/backend/optimizers/shampoo/shampoo_utils.py:38
ClassMetaOptimizer
base class for a meta optimizer that wraps and modifies an existing pytorch optimizer.
cramming/backend/optimizers/optimizer_modifiers.py:14
ClassNewtonConvergenceFlag
cramming/backend/optimizers/shampoo/matrix_functions.py:20
ClassPreconditioner
Preconditioner class.
cramming/backend/optimizers/shampoo/shampoo_utils.py:115
ClassPreconditionerType
cramming/backend/optimizers/shampoo/shampoo_utils.py:25
ClassRootInvMethod
cramming/backend/optimizers/shampoo/matrix_functions.py:25
ClassScriptableLMForTokenClassification
Classification head.
cramming/architectures/scriptable_bert.py:300
ClassSeqFirstTuFormAttention2
Self-attention layer abstract class. Seq-first variant 2 THSA layer takes input with size [Seq, Batch, Hidden] and returns output of the
cramming/architectures/attention.py:487
ClassShampoo
Implements Shampoo algorithm. See details in: - https://arxiv.org/pdf/1802.09568.pdf - https://arxiv.org/pdf/2002.09018.pdf If root_
cramming/backend/optimizers/shampoo/shampoo.py:28
ClassTransformerLayer
A transformer-encoder structure based on the components from above.
cramming/architectures/components.py:86
Classconfig
cramming/architectures/attention.py:70