MCPcopy Create free account

hub / github.com/HazyResearch/prefix-linear-attention / functions

Functions1,739 in github.com/HazyResearch/prefix-linear-attention

↓ 3 callersMethod_process_doc
(self, doc)
lm-eval-harness/lm_eval/tasks/scrolls/task.py:451
↓ 3 callersFunction_sacreformat
Format refs and preds for sacrebleu corpus calculation. It is very particular
lm-eval-harness/lm_eval/api/metrics.py:337
↓ 3 callersFunctionbuild_filter_ensemble
Create a filtering pipeline.
lm-eval-harness/lm_eval/filters/__init__.py:33
↓ 3 callersFunctioncompute_inner_o
(qk, value, decay_value)
based/models/triton/kernels/intra_chunk_contribution/fn_only_gv.py:305
↓ 3 callersFunctionconvert_choice
(choice)
lm-eval-harness/lm_eval/tasks/super_glue/copa/utils.py:1
↓ 3 callersMethodcopy_to
Copy current averaged parameters into given collection of parameters. Args: parameters: Iterable of `torch.nn.Parameter`;
train/src/utils/ema.py:106
↓ 3 callersMethoddoc_to_target
(self, doc)
lm-eval-harness/lm_eval/api/task.py:1444
↓ 3 callersMethodexpanded_size
(self)
based/models/mixers/linear_attention.py:325
↓ 3 callersMethodforward
(self, *args, **kwargs)
train/src/tasks/seq.py:109
↓ 3 callersMethodforward
(self, *args, **kwargs)
train/src/tasks/seq_hf.py:112
↓ 3 callersFunctionfused_dense_func
( x: Tensor, weight: Tensor, bias: Optional[Tensor] = None, return_residual: bool = False,
based/ops/fused_dense.py:118
↓ 3 callersMethodget_original
Restores the original order of a new array based on the old array's order Args: newarr (List[Any]): The array to be restored
lm-eval-harness/lm_eval/utils.py:195
↓ 3 callersMethodgroup
Groups elements of an iterable based on a provided function. Parameters: - arr (Iterable): The iterable to be grouped.
lm-eval-harness/lm_eval/models/utils.py:446
↓ 3 callersMethodhas_test_docs
Whether the task has a test set
lm-eval-harness/lm_eval/api/task.py:272
↓ 3 callersFunctionhash_args
(attr, args)
lm-eval-harness/lm_eval/api/model.py:155
↓ 3 callersFunctionload_config_hf
(model_name)
based/utils/hf.py:9
↓ 3 callersFunctionload_config_hf
(model_name)
based/models/mixers/mamba/utils/hf.py:9
↓ 3 callersMethodload_state_dict
(self, state_dict, strict=True)
based/models/transformer/gpt.py:645
↓ 3 callersFunctionmean
(arr)
lm-eval-harness/lm_eval/api/metrics.py:25
↓ 3 callersMethodnormalize_string
(self, s: str)
lm-eval-harness/lm_eval/decontamination/janitor.py:210
↓ 3 callersFunctionoa_completion
Query OpenAI API for completion. Retry with back-off until they respond
lm-eval-harness/lm_eval/models/openai_completions.py:45
↓ 3 callersFunctionprepare_cumsum
(query, key, value, g_key, g_value, normalizer_gk=8, normalizer_gv=8, clamp_min=-3)
based/models/triton/kernels/inter_chunk_contribution/preprocess_cumsum_gk.py:260
↓ 3 callersMethodprepare_data
(self, stage=None)
train/src/datamodules/t5_data.py:65
↓ 3 callersMethodregister
Register a tensor with a configurable learning rate and 0 weight decay
synthetic/zoology/mixers/hyena.py:15
↓ 3 callersMethodreset
(self, max_seqlen, max_batch_size)
based/generation.py:30
↓ 3 callersMethodreset
(self, max_seqlen, max_batch_size)
train/src/generation.py:35
↓ 3 callersMethodrestore
Restore the parameters stored with the `store` method. Useful to validate the model with EMA parameters without affecting the
train/src/utils/ema.py:141
↓ 3 callersFunctionshard_last_dim
(state_dict, key, multiple_of=1)
based/models/transformer/gpt.py:697
↓ 3 callersMethodshared_step
(self, batch: Any, batch_idx: int, phase='train')
train/src/tasks/seq.py:122
↓ 3 callersMethodshared_step
(self, batch: Any, batch_idx: int, phase='train')
train/src/tasks/seq_hf.py:125
↓ 3 callersFunctionsqrelu_fwd
(x)
based/ops/activations.py:97
↓ 3 callersMethodstep
x: (batch, dim)
train/src/tasks/decoders.py:31
↓ 3 callersMethodtest
(self, epoch_idx: int)
synthetic/zoology/train.py:94
↓ 3 callersFunctiontrain
(config: TrainConfig)
synthetic/zoology/train.py:195
↓ 3 callersFunctionupdate_graph_cache
( model, cache, batch_size, seqlen_og, max_seqlen, decoding_seqlens=(1,), tensor_p
based/generation.py:615
↓ 3 callersFunctionupdate_graph_cache
( model, cache, batch_size, seqlen_og, max_seqlen, decoding_seqlens=(1,), tensor_p
train/src/generation.py:698
↓ 2 callersMethod__init__
(self, config: GPT2Config, process_group=None, device=None, dtype=None, multiple_of=256)
based/models/transformer/gpt.py:384
↓ 2 callersMethod__init__
num_heads_kv: can be used to toggle MQA / GQA. If None, use num_heads. return_residual: whether to return the input x along with the
based/models/mixers/slide_attention.py:287
↓ 2 callersMethod__init__
( self, input_dim: int, **kwargs: any )
based/models/mixers/linear_attention.py:64
↓ 2 callersMethod__init__
( self, d_model, d_state: int=16, d_conv:int=4, expand: int=2,
synthetic/zoology/mixers/mamba.py:27
↓ 2 callersMethod__init__
(self, d_model: int, l_max: int, **kwargs)
synthetic/zoology/mixers/listing.py:22
↓ 2 callersMethod__init__
(self, path)
train/src/datamodules/datasets/indexed_dataset.py:141
↓ 2 callersMethod_apply_rotary_update_kvcache_attention
Fast path that combine 3 steps: apply rotary to Q and K, update kv cache, and apply attention. q: (batch_size, seqlen_q, nheads, head
based/models/mixers/mha.py:512
↓ 2 callersMethod_apply_rotary_update_kvcache_attention
Fast path that combine 3 steps: apply rotary to Q and K, update kv cache, and apply attention. q: (batch_size, seqlen_q, nheads, head
based/models/mixers/mha.py:865
↓ 2 callersMethod_apply_rotary_update_kvcache_attention
Fast path that combine 3 steps: apply rotary to Q and K, update kv cache, and apply attention. q: (batch_size, seqlen_q, nheads, head
based/models/mixers/slide_attention.py:390
↓ 2 callersMethod_config_is_python_task
(self, config)
lm-eval-harness/lm_eval/tasks/__init__.py:102
↓ 2 callersMethod_config_is_task
(self, config)
lm-eval-harness/lm_eval/tasks/__init__.py:92
↓ 2 callersMethod_dataloader
(self, dataset, **loader_args)
train/src/datamodules/base.py:92
↓ 2 callersMethod_do_init
(self, path, skip_warmup)
train/src/datamodules/datasets/indexed_dataset.py:487
↓ 2 callersMethod_get_state
Returns the state tensors for the given layer. Adds support for nested states.
based/models/mixers/convolution.py:153
↓ 2 callersMethod_get_states_from_cache
(self, inference_params, batch_size, initialize_states=False)
based/models/mixers/mamba/modules/mamba_simple.py:266
↓ 2 callersMethod_get_tasklist
(self, name)
lm-eval-harness/lm_eval/tasks/__init__.py:119
↓ 2 callersMethod_get_yaml_path
(self, name)
lm-eval-harness/lm_eval/tasks/__init__.py:107
↓ 2 callersFunction_layer_norm_bwd
( dy, x, weight, bias, eps, mean, rstd, dresidual=None, dy1=None, weig
based/ops/triton/layer_norm.py:560
↓ 2 callersFunction_layer_norm_bwd
( dy, x, weight, bias, eps, mean, rstd, dresidual=None, has_residual=False
based/models/mixers/mamba/ops/triton/layernorm.py:293
↓ 2 callersFunction_layer_norm_bwd
( dy, x, weight, bias, eps, mean, rstd, dresidual=None, has_residual=False
synthetic/zoology/mixers/mamba_ssm/triton/layernorm.py:293
↓ 2 callersFunction_layer_norm_bwd
( dy, x, weight, bias, eps, mean, rstd, dresidual=None, dy1=None, weig
train/src/ops/layer_norm.py:560
↓ 2 callersFunction_layer_norm_fwd
( x, weight, bias, eps, residual=None, x1=None, weight1=None, bias1=None,
based/ops/triton/layer_norm.py:255
↓ 2 callersFunction_layer_norm_fwd
( x, weight, bias, eps, residual=None, out_dtype=None, residual_dtype=None, is_rms_norm=False )
based/models/mixers/mamba/ops/triton/layernorm.py:123
↓ 2 callersFunction_layer_norm_fwd
( x, weight, bias, eps, residual=None, out_dtype=None, residual_dtype=None, is_rms_norm=False )
synthetic/zoology/mixers/mamba_ssm/triton/layernorm.py:123
↓ 2 callersFunction_layer_norm_fwd
( x, weight, bias, eps, residual=None, x1=None, weight1=None, bias1=None,
train/src/ops/layer_norm.py:255
↓ 2 callersMethod_loglikelihood_tokens
( self, requests: List[Tuple[Tuple[str, str], List[int], List[int]]], disable_tqdm: bo
lm-eval-harness/lm_eval/models/vllm_causallms.py:342
↓ 2 callersMethod_loglikelihood_tokens
( self, requests, disable_tqdm: bool = False, override_bs=None )
lm-eval-harness/lm_eval/models/neuron_optimum.py:531
↓ 2 callersMethod_loglikelihood_tokens
( self, requests, disable_tqdm: bool = False )
lm-eval-harness/lm_eval/models/openai_completions.py:209
↓ 2 callersMethod_loglikelihood_tokens
( self, requests: List[Tuple[Tuple[str, str], List[int], List[int]]], disable_tqdm: bo
lm-eval-harness/lm_eval/models/huggingface.py:952
↓ 2 callersMethod_model_call
:param inps: torch.Tensor A torch tensor of shape [batch, (sequence_ctx + sequence_cont)] or of shape [batch, sequenc
lm-eval-harness/lm_eval/models/huggingface.py:730
↓ 2 callersMethod_model_generate
( self, requests: List[List[int]] = None, generate: bool = False, max_tokens:
lm-eval-harness/lm_eval/models/vllm_causallms.py:164
↓ 2 callersMethod_model_generate
(self, context, max_length, stop, **generation_kwargs)
lm-eval-harness/lm_eval/models/huggingface.py:759
↓ 2 callersMethod_name_is_task
(self, name)
lm-eval-harness/lm_eval/tasks/__init__.py:77
↓ 2 callersMethod_normalize_answer
(text)
lm-eval-harness/lm_eval/tasks/scrolls/task.py:351
↓ 2 callersMethod_reorder
Reorders the elements in the array based on the sorting function. Parameters: - arr (Union[List, Tuple[Tuple[int, Any], ...]
lm-eval-harness/lm_eval/models/utils.py:407
↓ 2 callersMethod_scrolls_metrics
(self)
lm-eval-harness/lm_eval/tasks/scrolls/task.py:193
↓ 2 callersMethod_split_chunks
( self, dirty_string: str, dirty_parts: Sequence[Tuple] )
lm-eval-harness/lm_eval/decontamination/janitor.py:170
↓ 2 callersFunction_tokens_length_to_inputs_length_targets_length
(tokens_length)
train/src/datamodules/t5_data.py:346
↓ 2 callersMethod_train_dataloader
(self, dataset, **kwargs)
train/src/datamodules/base.py:218
↓ 2 callersFunction_update_kv_cache
kv: (batch_size, seqlen, 2, nheads, head_dim) or (batch_size, 1, 2, nheads, head_dim)
based/models/mixers/mha.py:347
↓ 2 callersMethod_update_kvcache_attention
Write kv to inference_params, then do attention
based/models/mixers/mha.py:552
↓ 2 callersMethod_update_kvcache_attention
Write kv to inference_params, then do attention
based/models/mixers/mha.py:905
↓ 2 callersMethod_update_kvcache_attention
Write kv to inference_params, then do attention
based/models/mixers/slide_attention.py:436
↓ 2 callersFunction_warmup_mmap_file
(path)
train/src/datamodules/datasets/indexed_dataset.py:345
↓ 2 callersMethodbackward
(ctx, dA)
based/models/triton/kernels/intra_chunk_contribution/fn_only_gk.py:318
↓ 2 callersMethodbuild
(self, seed: int)
synthetic/zoology/data/non_autoreg.py:17
↓ 2 callersMethodcheck_index
(self, i)
train/src/datamodules/datasets/indexed_dataset.py:174
↓ 2 callersFunctionclean
Ignore capitalization and determiners.
lm-eval-harness/lm_eval/tasks/super_glue/wsc/t5_utils.py:79
↓ 2 callersMethodcleaned_context
(self, context)
lm-eval-harness/lm_eval/tasks/based_triviaqa/task.py:38
↓ 2 callersFunctionclear_torch_cache
()
lm-eval-harness/lm_eval/models/utils.py:191
↓ 2 callersFunctioncode
(dtype)
train/src/datamodules/datasets/indexed_dataset.py:113
↓ 2 callersFunctioncombine_qkv_headdim
(state_dicts, state_dict, key)
based/models/transformer/gpt.py:818
↓ 2 callersFunctioncombine_word_embeddings
(state_dicts, state_dict, key)
based/models/transformer/gpt.py:810
↓ 2 callersFunctioncompute_input_and_target_lengths
This function is copy of `random_spans_helper <https://github.com/google-research/text-to-text-transfer-transformer/blob/84f8bcc14b5f2c03de51bd3587609
train/src/datamodules/t5_data.py:323
↓ 2 callersMethodconstruct_requests
Uses RequestFactory to construct Requests and returns an iterable of Requests which will be sent to the LM. :param doc: T
lm-eval-harness/lm_eval/api/task.py:490
↓ 2 callersMethodcreate_sentinel_ids
Sentinel ids creation given the indices that should be masked. The start indices of each mask are replaced by the sentinel ids in inc
train/src/datamodules/t5_data.py:213
↓ 2 callersMethodcustom_enc_dec_encode
SA: 051024 Only use encoder region for prefill in JRT.
train/src/generation.py:573
↓ 2 callersMethoddownload
Downloads and returns the task dataset. Override this method to download the dataset from a custom API. :param data_dir: str
lm-eval-harness/lm_eval/api/task.py:223
↓ 2 callersMethodexpanded_size
(self)
based/models/mixers/prefix_linear_attention.py:260
↓ 2 callersFunctionextended_json_dump
Extended JSON dump that can handle pydantic models.
lm-eval-harness/lm_eval/models/local_utils/jrt_utils.py:112
↓ 2 callersFunctionfetch_wandb_runs
Fetches run data from a W&B project into a pandas DataFrame. Parameters: - project_name (str): The name of the W&B project.
synthetic/zoology/analysis/utils.py:97
↓ 2 callersMethodfewshot_context
Returns a fewshot context string that is made up of a prepended description (if provided), the `num_fewshot` number of examples, and an append
lm-eval-harness/lm_eval/api/task.py:555
↓ 2 callersMethodfewshot_docs
(self)
lm-eval-harness/lm_eval/api/task.py:925
↓ 2 callersMethodfilter_input_ids
Puts sentinel mask on `input_ids` and fuse consecutive mask tokens into a single mask token by deleting. This will reduce the sequenc
train/src/datamodules/t5_data.py:232
← previousnext →101–200 of 1,739, ranked by callers