MCPcopy Create free account

hub / github.com/JonasGeiping/cramming / functions

Functions411 in github.com/JonasGeiping/cramming

↓ 1 callersMethod_initialize_preconditioners
Initialize Shampoo preconditioners and inverse preconditioners.
cramming/backend/optimizers/shampoo/shampoo.py:133
↓ 1 callersFunction_initialize_wandb
(setup, cfg)
cramming/utils.py:435
↓ 1 callersMethod_label_to_onehot
(target, M: float = 1.0, num_classes: int = 100)
cramming/architectures/losses.py:49
↓ 1 callersMethod_label_to_onehot
(target, M: float = 1.0, num_classes: int = 100)
cramming/architectures/losses.py:99
↓ 1 callersFunction_load_fake_dataset
(cfg_data, details, path=None)
cramming/data/pretraining_preparation.py:280
↓ 1 callersFunction_make_suffix_array
(text_file, tmpdir, path_to_rust_code)
cramming/data/deduplicate.py:69
↓ 1 callersFunction_matrix_inverse_root_newton
Compute matrix square root using coupled inverse Newton iteration. alpha <- -1 / p X <- 1/c * I M <- 1/c^p * A repeat
cramming/backend/optimizers/shampoo/matrix_functions.py:133
↓ 1 callersFunction_matrix_root_eigen
Compute matrix (inverse) root using eigendecomposition of symmetric positive (semi-)definite matrix. A = Q L Q^T => A^{1/r} = Q L^{1/r} Q
cramming/backend/optimizers/shampoo/matrix_functions.py:70
↓ 1 callersFunction_move_stream_to_fixed_map
Save streaming dataset to a fixed mapping-style database.
cramming/data/pretraining_preparation.py:175
↓ 1 callersMethod_script_model
(self, model)
cramming/backend/torch_default.py:265
↓ 1 callersFunction_sort_tokenized_dataset_by_word_length
(tokenized_dataset, tokenizer, num_threads=1)
cramming/data/curriculum_sorting.py:96
↓ 1 callersMethod_update_cos_sin_tables
(self, x: torch.Tensor, seq_dimension: int = -2)
cramming/architectures/embeddings.py:210
↓ 1 callersMethod_update_preconditioners
Updates preconditioners. Note: If using L2-regularization/weight decay, it is computed within this function and therefore should not be
cramming/backend/optimizers/shampoo/shampoo.py:259
↓ 1 callersFunction_write_tmp_file
(dataset, dirname)
cramming/data/deduplicate.py:60
↓ 1 callersMethodattention
(self, query_layer, key_layer, value_layer, attention_mask: Optional[torch.Tensor] = None, training: bool = Fa
cramming/architectures/attention.py:168
↓ 1 callersMethodattention
tuformer attention in batch first implementation (hopefully)
cramming/architectures/attention.py:470
↓ 1 callersMethodattention
tuformer attention in batch first implementation (hopefully)
cramming/architectures/attention.py:510
↓ 1 callersFunctionbatch_iterator
(batch_size=4096)
cramming/data/tokenizer_preparation.py:78
↓ 1 callersFunctioncheck_deadline
These measurements are deliberately wall-clock based.
pretrain.py:89
↓ 1 callersFunctioncheck_early_termination
Early termination based on terrible loss.
pretrain.py:95
↓ 1 callersMethodcoefficient_of_variation
unbiased cov test.
cramming/backend/optimizers/progressive_batching.py:119
↓ 1 callersFunctioncollect_stats
(step, loss_vals, train_time, stats, model_engine, dataloader, cfg)
pretrain.py:104
↓ 1 callersMethodcompute_norm
(self, grad: Tensor)
cramming/backend/optimizers/shampoo/shampoo_utils.py:136
↓ 1 callersFunctionconstruct_fixed_cramlm
See the config file for details on what is possible.
cramming/architectures/fixed_cramlm.py:19
↓ 1 callersFunctionconstruct_huggingface_model
construct model from given configuration. Only works if this arch exists on the hub.
cramming/architectures/huggingface_interface.py:7
↓ 1 callersFunctionconstruct_scriptable_bert
See the config file for details on what is possible.
cramming/architectures/scriptable_bert.py:24
↓ 1 callersFunctionconstruct_scriptable_funnel
See the config file for details on what is possible.
cramming/architectures/funnel_transformers.py:15
↓ 1 callersFunctionconstruct_scriptable_recurrent
See the config file for details on what is possible.
cramming/architectures/recurrent_transformers.py:25
↓ 1 callersMethodcopy_mean_grad
(self)
cramming/backend/optimizers/progressive_batching.py:157
↓ 1 callersMethodcosine_test
Experimental.
cramming/backend/optimizers/progressive_batching.py:100
↓ 1 callersFunctioncreate_database
Create an LMDB database from the given pytorch dataset. https://github.com/Lyken17/Efficient-PyTorch/blob/master/tools/folder2lmdb.py Remove
cramming/data/lmdb_datasets.py:147
↓ 1 callersFunctiondeduplicate_huggingface_dataset
"Seamlessly" run exact deduplication as in Lee et al.
cramming/data/deduplicate.py:40
↓ 1 callersMethoddirection_norm
(self, grad: Tensor)
cramming/backend/optimizers/shampoo/shampoo_utils.py:628
↓ 1 callersMethodfirst_step
(self, zero_grad=False)
cramming/backend/optimizers/optimizer_modifiers.py:141
↓ 1 callersFunctionflag_communication
A quick and dirty communication through NCCL. Should not be a major burden.
pretrain.py:138
↓ 1 callersMethodflash_inner
(self, qkv)
cramming/architectures/attention.py:299
↓ 1 callersFunctionflatten
Straight-up from https://stackoverflow.com/a/6027615/3775820.
cramming/utils.py:463
↓ 1 callersMethodforward
Inputs of shape [B, S, H]. Implementation directly based on FLASH pseudocode (see paper appendix)
cramming/architectures/attention.py:663
↓ 1 callersMethodforward_checkpointed
(self, hidden_states, attention_mask: Optional[torch.Tensor] = None)
cramming/architectures/scriptable_bert.py:124
↓ 1 callersMethodforward_inference
(self, *inputs, **kwargs)
cramming/backend/torch_default.py:136
↓ 1 callersFunctionget_attention_mechanism
( idx, hidden_size, cfg_attention, )
cramming/architectures/attention.py:11
↓ 1 callersMethodget_total_score
(self, sentences)
cramming/data/generation_gibbs.py:64
↓ 1 callersMethodget_trace
compute the Hessian vector product with a random vector v, at the current gradient point, i.e., compute the gradient of <gradsH,v>.
cramming/backend/optimizers/adahessian.py:66
↓ 1 callersMethodgradinit
Run data-based initialization search as described in Zhu et al., "GradInit: Learning to Initialize Neural Networks for Stable and Efficient Tr
cramming/backend/torch_default.py:368
↓ 1 callersFunctioninitialize_deepspeed
Initialize deepspeed. Module is imported lazily here.
cramming/backend/deepspeed_integration.py:22
↓ 1 callersFunctioninitialize_torch
initialize a torch engine.
cramming/backend/torch_default.py:28
↓ 1 callersMethodinner_product_test
Inner product similar to description in Bollapragada,Byrd,Nocedal, "Adaptive Sampling Strategies for Stochastic Optimization". This is only a
cramming/backend/optimizers/progressive_batching.py:63
↓ 1 callersFunctionlaunch
(cfg)
eval.py:111
↓ 1 callersFunctionlaunch
(cfg)
pretrain.py:152
↓ 1 callersFunctionlaunch
(cfg)
load_local_model.py:44
↓ 1 callersFunctionmatrix_inverse_root
Computes matrix root inverse. Args: A (Tensor): Square matrix of interest. root (int): Root of interest. Any natural number.
cramming/backend/optimizers/shampoo/matrix_functions.py:30
↓ 1 callersFunctionmerge_small_dims
Reshapes tensor by merging small dimensions. Args: tensor_size (Tensor or List[int]): The shape of the tensor. threshold (int): T
cramming/backend/optimizers/shampoo/shampoo_utils.py:45
↓ 1 callersMethodmoving_average_computation
(self)
cramming/backend/torch_default.py:228
↓ 1 callersFunctionmulti_dim_cat
Concatenates multiple tensors to form single tensor across multiple dimensions. Args: split_grad (List[Tensor]): List of gradient chunks.
cramming/backend/optimizers/shampoo/shampoo_utils.py:92
↓ 1 callersMethodnorm_test
Sohams version.
cramming/backend/optimizers/progressive_batching.py:85
↓ 1 callersFunctionpreprocess_dataset
A lot of loading and preprocessing.
cramming/data/pretraining_preparation.py:119
↓ 1 callersMethodpush_to_hub
Analogous to save_final_model, but save model to hugginface hub.
cramming/backend/torch_default.py:342
↓ 1 callersFunctionraw_dataset_preprocessing
Some dataset "improvements". These are optional filtering or normalization rules that are only applied to the pretraining corpus. This separates t
cramming/data/pretraining_preparation.py:348
↓ 1 callersMethodrecord_batch_size
(self)
cramming/backend/torch_default.py:176
↓ 1 callersMethodrecord_tokens_per_step
Tokens in each microbatch step.
cramming/backend/torch_default.py:182
↓ 1 callersMethodrope_fn
(cos: torch.Tensor, sin: torch.Tensor, query_layer: torch.Tensor, key_layer: torch.Tensor)
cramming/architectures/embeddings.py:92
↓ 1 callersFunctionrun_chains
(model, tokenizer, sampling_method="gibbs_mixture_mask_init", device=torch.device("cpu"))
cramming/data/generation_gibbs.py:77
↓ 1 callersMethodsample_words
(self, probs, pos, sentences)
cramming/data/generation_gibbs.py:50
↓ 1 callersMethodsave_final_model
This checkpoint can be used for downstream tasks. The default behavior is to save this checkpoint to a checkpoints folder under base_directory
cramming/backend/torch_default.py:325
↓ 1 callersMethodsave_training_checkpoint
Path, identifier and additional client state. This checkpoint can be used to resume training. The default behavior is to save this checkpoint
cramming/backend/torch_default.py:309
↓ 1 callersMethodschedule_batch_size
Optionally implement linear batch size ramp-ups.
cramming/backend/torch_default.py:194
↓ 1 callersMethodschedule_curriculum
Optionally implement linear sequence lengths curriculum.
cramming/backend/torch_default.py:213
↓ 1 callersMethodsecond_step
(self, zero_grad=False)
cramming/backend/optimizers/optimizer_modifiers.py:157
↓ 1 callersFunctionset_deterministic
Switch pytorch into a deterministic computation mode.
cramming/utils.py:355
↓ 1 callersFunctionset_random_seed
.
cramming/utils.py:344
↓ 1 callersMethodset_sequence_curriculum_
Assume huggingface data is B S
cramming/backend/torch_default.py:167
↓ 1 callersMethodset_train_batch_size
Allow dynamic modifications of batch size.
cramming/backend/torch_default.py:162
↓ 1 callersFunctionsystem_startup
Decide and print GPU / CPU / hostname info. Generate local distributed setting if running in distr. mode. Set all required and interesting enviro
cramming/utils.py:75
↓ 1 callersFunctiontest_generation
()
cramming/data/generation_gibbs.py:138
↓ 1 callersFunctionto_device
Move batch of data into device memory.
cramming/backend/deepspeed_integration.py:104
↓ 1 callersMethodtorch_mask_tokens
Prepare masked tokens inputs/labels for masked language modeling: 80% MASK, 10% random, 10% original.
cramming/backend/utils.py:166
↓ 1 callersFunctionupdate_ema
Update exponential moving average in parameters and buffers.
cramming/backend/utils.py:35
↓ 1 callersMethodupdate_sample_statistics
Update sample statistics based on welford accumulation. At any step variance can be finalized via running_variance / count
cramming/backend/optimizers/progressive_batching.py:136
↓ 1 callersFunctionupdated_latest_weight_average
(model_parameters, model_buffers, store, last_k=10)
cramming/backend/utils.py:45
FunctionScriptedGLU
(*args, **kwargs)
cramming/architectures/components.py:261
FunctionScriptedRMSNorm
(hidden_size: int, eps: float = 1e-8)
cramming/architectures/components.py:284
FunctionScriptedScaleNorm
(hidden_size: int, eps: float = 1e-5)
cramming/architectures/components.py:280
Method__getattr__
Call this only if all other attributes are exhausted.
cramming/backend/optimizers/optimizer_modifiers.py:30
Method__getattr__
Call this only if all attributes of Subset are exhausted.
cramming/data/lmdb_datasets.py:115
Method__getattr__
This is only called if all attributes of Subset are exhausted.
cramming/data/cached_datasets.py:73
Method__getitem__
Get from database. This is either unordered or cursor access for now. Future: Write this class as a proper https://pytorch.org/docs/stable/da
cramming/data/lmdb_datasets.py:123
Method__getitem__
Get sample, target from cache.
cramming/data/cached_datasets.py:63
Method__getstate__
(self)
cramming/backend/optimizers/optimizer_modifiers.py:21
Method__getstate__
(self)
cramming/data/lmdb_datasets.py:84
Method__init__
(self, model)
cramming/backend/torch_default.py:431
Method__init__
(self, *args, use_80_20_rule=True, token_drop=False, **kwargs)
cramming/backend/utils.py:159
Method__init__
(self, optimizer, progress_rule="norm-based", theta=0.9, monotone=False, min_sample_guard=2, max_sample_guard=
cramming/backend/optimizers/progressive_batching.py:18
Method__init__
(self, params, lr=0.15, betas=(0.9, 0.999), eps=1e-4, weight_decay=0, hessian_power=1, single_gpu=True)
cramming/backend/optimizers/adahessian.py:51
Method__init__
(self, optimizer)
cramming/backend/optimizers/optimizer_modifiers.py:17
Method__init__
(self, optimizer, trust_coefficient=0.02, clip=False, eps=1e-8)
cramming/backend/optimizers/optimizer_modifiers.py:66
Method__init__
(self, base_optimizer_instance, rho=0.05)
cramming/backend/optimizers/optimizer_modifiers.py:133
Method__init__
(self)
cramming/backend/optimizers/shampoo/shampoo_utils.py:118
Method__init__
( self, param, beta2: float = 1.0, epsilon: float = 1e-3, use_bias_cor
cramming/backend/optimizers/shampoo/shampoo_utils.py:169
Method__init__
( self, param, beta2: float = 1.0, epsilon: float = 1e-12, use_bias_co
cramming/backend/optimizers/shampoo/shampoo_utils.py:240
Method__init__
( self, param, beta2: float = 1.0, epsilon: float = 1e-12, use_bias_co
cramming/backend/optimizers/shampoo/shampoo_utils.py:504
← previousnext →101–200 of 411, ranked by callers