MCPcopy Create free account

hub / github.com/apple/axlearn / functions

Functions7,799 in github.com/apple/axlearn

↓ 23 callersMethodpatch
Patches the command string. Args: command: The original user command string. Returns: The patched command st
axlearn/cloud/common/user_command_patcher.py:13
↓ 23 callersFunctionsequence_mask
Computes a mask over sequence positions for each given length. Args: lengths: [...]. int32 max_len: T, int dtype: outputs
axlearn/common/utils.py:2023
↓ 23 callersMethodwrite
(path: str, value: jax.Array)
axlearn/common/summary_writer.py:285
↓ 22 callersMethodadd_module_output
(self, name: str, value: Tensor)
axlearn/common/module.py:1127
↓ 22 callersMethoddtype
(self)
axlearn/common/base_layer.py:599
↓ 22 callersMethodinit_states
(self, *, batch_size: int)
axlearn/common/rnn.py:182
↓ 22 callersMethodoutput_shape
(self, *, input_shape: Sequence[Optional[int]])
axlearn/common/layers.py:822
↓ 22 callersMethodresult
(self, timeout: Optional[int] = None)
axlearn/common/array_serialization.py:987
↓ 22 callersMethodstop
Stops and disposes resources.
axlearn/common/checkpointer.py:344
↓ 21 callersFunction_checkpointer_config
( checkpointer_cls: Type[BaseCheckpointer] = Checkpointer, )
axlearn/common/checkpointer_test.py:69
↓ 21 callersFunctionassert_all_close
(x, y, atol=1e-5, rtol=1e-5, err_msg=None)
axlearn/common/transducer_test.py:100
↓ 21 callersMethoddefault_config
(cls)
axlearn/common/lora.py:202
↓ 21 callersFunctiongenerate_attention_data
Generates QKV and Bias for unit test purposes.
axlearn/common/flash_attention/test_utils.py:73
↓ 21 callersFunctioninfer_mesh_shape
Infer the value for -1 from len(jax.devices()) and other dims if there is -1 in mesh shape. Args: mesh_shape: The original MeshShape, whi
axlearn/common/utils.py:1891
↓ 21 callersFunctionscaled_hidden_dim
(scale: float = 4)
axlearn/common/attention.py:3112
↓ 21 callersMethodvisit
Recursively visits objects within this Config instance. Visit can traverse Config, lists, tuples, dataclasses, and namedtuples. By default, v
axlearn/common/config.py:722
↓ 20 callersMethod_patch_bastion
( self, mock_popen_spec: Optional[dict] = None, validator_cfg: Optional[JobValidator.C
axlearn/cloud/common/bastion_test.py:789
↓ 20 callersMethodadd_state_update
Adds a state update to the output collection of the current context.
axlearn/common/module.py:1123
↓ 20 callersMethoddefault_config
(cls)
axlearn/common/bert.py:325
↓ 20 callersMethoddefault_config
(cls)
axlearn/common/vision_transformer.py:180
↓ 20 callersMethodget_invocation_context
(self)
axlearn/common/module.py:1084
↓ 20 callersFunctionmaybe_shard
(x: NestedTensor, partition_spec: Optional[PartitionSpec])
axlearn/common/utils.py:644
↓ 20 callersMethodmesh
(self)
axlearn/common/trainer.py:424
↓ 20 callersFunctionset_dropout_rate_recursively
Sets Dropout.Config.rate recursively. Args: cfg: the root config under which to look for Dropout.Config. dropout_rate: the target
axlearn/common/layers.py:241
↓ 19 callersMethodcall
(self, y_true, y_pred)
axlearn/common/loss_test.py:717
↓ 19 callersFunctionmask_fn
(query_position: Tensor, key_position: Tensor)
axlearn/common/attention_bias.py:823
↓ 19 callersMethodrun
(self, result=None)
axlearn/cloud/gcp/job_test.py:27
↓ 19 callersFunctionset_current_context
( context: InvocationContext, *, require_parent: bool = True )
axlearn/common/module.py:608
↓ 19 callersFunctionset_data_dir
Sets the environment variable DATA_DIR to the given `data_dir`. Args: data_dir: The data_dir. Raises: ValueError: If the env
axlearn/common/utils.py:1532
↓ 19 callersFunctionsliding_window_causal_mask
Returns a causal MaskFn for sliding window attentions of a given window size. Implements the `MaskFn` protocol. Note: Setting sliding_window
axlearn/common/attention_bias.py:771
↓ 19 callersFunctionvectorized_tree_map
Similar to jax.tree.map(), but vectorizes `fn` on VDict's.
axlearn/common/utils.py:467
↓ 18 callersFunctionbuild_vit_model_config
(**kwargs)
axlearn/common/vision_transformer.py:553
↓ 18 callersMethoddefault_config
(cls)
axlearn/vision/detection_heads.py:242
↓ 18 callersFunctiondefault_mock_settings
Default settings to use in tests.
axlearn/cloud/gcp/test_utils.py:15
↓ 18 callersMethodfrom_spec
Converts a spec to a bundler. Possible options: - remote_dir: The remote directory to copy the bundle to. Must be compatible with tf_
axlearn/cloud/gcp/bundler.py:85
↓ 18 callersFunctionmatch_regex_rules
Matches the given string against a sequence of regex-based rules. Args: x: The str to match against the rules. rules: A sequence
axlearn/common/utils.py:1572
↓ 18 callersFunctionset_bias_recursively
Sets config.bias to `bias` for all relevant descendant configs in `cfg`.
axlearn/common/layers.py:1287
↓ 17 callersMethod__init__
(self, cfg: Config, *, parent: Module)
axlearn/common/attention.py:835
↓ 17 callersMethod_step_log
(self, msg, *args, **kwargs)
axlearn/common/trainer.py:414
↓ 17 callersFunctionfn
(q, k, v, b)
axlearn/common/flash_attention/gpu_attention_benchmark.py:262
↓ 17 callersFunctioninfer_tpu_type
Infers tpu type (e.g. v4-8 or v6e-8-1) from instance type (e.g. tpu-v4-8, v4-8, tpu-v6e-8-1 or v6e-8-1).
axlearn/common/compiler_options.py:316
↓ 17 callersMethodis_configured
Returns True if a probe type has been configured (grpc_port or http_port is set).
axlearn/cloud/gcp/k8s_readiness_probe.py:140
↓ 17 callersFunctionsplit
Split `bias` into an iterable of biases of `len(cls) + 1` instances, where the ith instances has type cls[i] or ZeroAttentionBias. Each bias
axlearn/common/attention_bias.py:321
↓ 16 callersFunction_create_dummy_state
(prng_key, model_config=DummyModel.default_config(), use_ema=False)
axlearn/common/state_builder_test.py:746
↓ 16 callersMethod_mask_fn
(self, example: dict[str, Tensor], **kwargs)
axlearn/common/input_mlm_test.py:62
↓ 16 callersMethodasdict
(self)
axlearn/audio/aligner/ctc_aligner.py:203
↓ 16 callersFunctionbuild_remat_spec
Configures how the Transformer or Conformer stack will save the linearization points. We try to save activations from the forward pass that are i
axlearn/common/attention.py:4528
↓ 16 callersFunctionconstant_initializer
(value: Any)
axlearn/common/param_init.py:205
↓ 16 callersFunctioncreate_default_config
( directory: Union[pathlib.Path, str], *, contents: Optional[dict] = None )
axlearn/cloud/common/config_test.py:40
↓ 16 callersMethodflatten
Reshape scan outputs back from [num_chunks, ...] to original shape. Trims off any padding added to make seq_len divisible by scan_chunk.
axlearn/common/causal_lm.py:763
↓ 16 callersFunctionpolicy
(prim, *_, **params)
axlearn/common/utils.py:186
↓ 16 callersFunctionrange_dataset
(*, start, stop, step=1, seed=None)
axlearn/common/input_grain_test.py:39
↓ 16 callersMethodsubmit
Submits the command to bastion.
axlearn/cloud/gcp/jobs/launch.py:568
↓ 15 callersMethod_append_to_job_history
(self, job: Job, *, msg: str, state: JobLifecycleState)
axlearn/cloud/common/bastion.py:949
↓ 15 callersFunction_matmul_fp32
A wrapper around jax.lax.dot to conduct float32 matmul
axlearn/common/rattention/kernels/linear_attention_kernels.py:36
↓ 15 callersFunction_parse
(argv: list[str])
axlearn/cli/utils_test.py:17
↓ 15 callersMethoddefault_config
(cls)
axlearn/vision/retinanet.py:79
↓ 15 callersMethodget_recursively
Recursively find the target key in the config and return its value. Args: path: A sequence of keys for indexing to get the target
axlearn/common/config.py:544
↓ 15 callersMethodget_shape
(self)
axlearn/vision/mask_generator.py:87
↓ 15 callersFunctiongpt_decoder_config
Build a decoder transformer config in the style of GPT. Reference: https://github.com/openai/gpt-2. Args: stack_cfg: A config of Sta
axlearn/common/causal_lm.py:873
↓ 15 callersMethodmatch
Computes groundtruth assignment for anchors based on pairwise similarity. Args: per_level_anchor_boxes: A dictionary containing a
axlearn/vision/matchers.py:59
↓ 15 callersFunctionmaybe_to_iter_dataset
Converts `grain.MapDataset` to `grain.IterDataset`. If the dataset is already a `grain.IterDataset`, is a no-op. See also `On grain.MapDatase
axlearn/common/input_grain.py:401
↓ 15 callersFunctionrepeat
JAX implementation of `einops.repeat`. einops.repeat allows reordering elements and repeating them in arbitrary combinations. This operation
axlearn/common/ein_ops.py:120
↓ 15 callersFunctionset_norm_recursively
Sets normalization layer configs to `norm_cfg` for all relevant descendants in `cfg`.
axlearn/common/layers.py:1301
↓ 14 callersMethod_maybe_record_event
(self, event: measurement.Event, *args, **kwargs)
axlearn/common/trainer.py:559
↓ 14 callersMethoddefault_config
(cls)
axlearn/common/causal_lm.py:397
↓ 14 callersMethoddefault_config
(cls)
axlearn/common/multiway_transformer.py:281
↓ 14 callersMethoddefault_config
(cls)
axlearn/common/repeat_test.py:82
↓ 14 callersFunctiondeserialize_jobspec
Loads job spec from filepath or file.
axlearn/cloud/common/bastion.py:381
↓ 14 callersFunctionf
(g, p, s)
axlearn/common/optimizers.py:609
↓ 14 callersMethodget_backend_overrides
(self, name: str, default: Any)
axlearn/common/flash_attention/common.py:172
↓ 14 callersMethodinit_states
(self, shape: BaseKVCache.Shape, *, dtype: jnp.dtype)
axlearn/common/kv_cache/kv_cache.py:29
↓ 14 callersFunctionreconstruct_kv
Retrieve key/value from page tables given pages. Args: page_tables: [batch_size, pages_per_sequence], specifying page indices. pa
axlearn/common/kv_cache/paged_kv_storage.py:37
↓ 14 callersFunctionrekey
Replace the feature keys according to mapping in `key_map`. Like seqio's rekey, except: 1. We allow for a configurable default value
axlearn/common/input_tf_data.py:1087
↓ 14 callersFunctionscaled_hidden_dim
(scale: float, *, round_up_to_multiples_of: int = 256)
axlearn/experiments/text/gpt/common.py:83
↓ 14 callersMethodscan
Implements the pipeline recurrence. The input `fn` specifies the single-stage implementation. Each scan iteration typically wraps `ja
axlearn/common/pipeline.py:211
↓ 14 callersMethodsource_to_target
(self, source: Builder.State, aux: Any)
axlearn/common/state_builder_test.py:144
↓ 14 callersFunctiontop_k_accuracy
Compute Top@K accuracy. Args: sim: The similarity logits between each source and target. Shape: [M, N]. dtype: float. gt_targets:
axlearn/common/metrics_retrieval.py:19
↓ 13 callersMethod_job_config
(self, bundler_cls: type[Bundler], **kwargs)
axlearn/cloud/gcp/pathways_utils_test.py:631
↓ 13 callersFunction_setup_fake_repo
(temp_dir: Union[pathlib.Path, str])
axlearn/cloud/common/config_test.py:35
↓ 13 callersFunctioncheck_state_structure
( ckpt_structure: list[tuple[str, Any]], target_structure: list[tuple[str, Any]], *, validatio
axlearn/common/checkpointer.py:127
↓ 13 callersFunctioncompute_conv_paddings
Compute output paddings w.r.t. conv_padding. The output paddings value is determined by the padding value at the anchor point in the window.
axlearn/common/convolution.py:269
↓ 13 callersFunctioncontrastive_logits
Computes contrastive logits between two tensors. Args: x: A float Tensor of shape [num_features_in_x, feature_size]. y: A float T
axlearn/common/loss.py:442
↓ 13 callersMethoddefault_config
(cls)
axlearn/common/conformer.py:187
↓ 13 callersMethoddefault_config
(cls)
axlearn/common/pipeline_test.py:102
↓ 13 callersMethodflush
Flushes the written records.
axlearn/common/inference_output.py:53
↓ 13 callersFunctionget_credentials
Get gcloud credentials, or exits if unauthenticated. Args: impersonate_account: Service account to impersonate, if not None. impe
axlearn/cloud/gcp/utils.py:38
↓ 13 callersMethodinit
(self, model_params: Nested[OptParam])
axlearn/common/learner_test.py:1472
↓ 13 callersFunctionload_configs
Loads configs for the given namespace. The strategy is as follows: 1. Attempt to read the default config file; 2. Attempt to search for a
axlearn/cloud/common/config.py:30
↓ 13 callersMethodrun
(self, *args, **kwargs)
axlearn/cloud/gcp/jobs/launch_test.py:665
↓ 13 callersMethodset
(self, **kwargs)
axlearn/common/config_test.py:153
↓ 13 callersFunctionsplit_prng_key
Splits prng_key to keys iteratively and return the stacked keys. Args: prng_key: The input key. This can be a single key or a StackedKeyA
axlearn/common/utils.py:539
↓ 12 callersFunction_make_paths
(paths: list[str])
axlearn/common/file_system_test.py:16
↓ 12 callersMethod_mock_bert_trainer_config_and_state
( self, max_len: int = 512, hidden_dim: int = 32 )
axlearn/common/state_builder_test.py:298
↓ 12 callersMethod_random_dense
(self, shape, key, dtype, limit)
axlearn/common/mixture_of_experts_test.py:1340
↓ 12 callersMethod_share_with_descendants
Share `module` with self's descendant modules. Args: module: The module to share. Must be a descendant module of `self`.
axlearn/common/module.py:995
↓ 12 callersMethoddefault_config
(cls)
axlearn/common/layers.py:734
↓ 12 callersMethoddefault_config
(cls: type["DeBERTaV2Encoder"])
axlearn/common/deberta.py:415
↓ 12 callersFunctionds_fn
()
axlearn/common/input_fake.py:240
↓ 12 callersMethodfind_first
Find first index >= start_index where predicate is True.
axlearn/common/segment_tree.py:107
← previousnext →101–200 of 7,799, ranked by callers