MCPcopy Create free account

hub / github.com/apple/axlearn / functions

Functions7,799 in github.com/apple/axlearn

↓ 8 callersMethodaccumulate
The default way this summary should be accumulated. Args: other: The summary from later in training/eval to accumulate into this
axlearn/common/summary.py:31
↓ 8 callersFunctionas_numpy_array
Converts `x` to numpy ndarray recursively. Args: x: a jnp array, numpy array, TF/PyTorch Tensor, or a nested structure of arrays or Tenso
axlearn/common/utils.py:612
↓ 8 callersMethodbatches
Yields per-feed physical input batches (using `input_dispatcher` if configured). The caller should use `host_to_global_array` to construct a
axlearn/common/input_base.py:213
↓ 8 callersMethodbias_and_residual
Split this bias into a bias of type `cls` and a residual. If the two returned biases are added together, the result is equivalent to
axlearn/common/attention_bias.py:146
↓ 8 callersFunctionchain
(*args)
axlearn/common/optimizers.py:81
↓ 8 callersMethodckpt_dir
Obtains the checkpoint dir for the given step.
axlearn/common/checkpointer.py:1103
↓ 8 callersMethoddecode
Decodes encoded boxes with respect to anchors. Args: encoded_boxes: A [..., 4] float tensor with encoded boxes. ancho
axlearn/vision/box_coder.py:105
↓ 8 callersMethodencode_tf
Tokenizes string Scalar to an int32 Tensor, without adding EOS.
axlearn/experiments/text/gpt/vocabulary_fuji_v3.py:48
↓ 8 callersFunctionexpand_vdicts
Expands each VDict in `tree` to a list. Args: tree: A nested tree of Tensors. All leaf nodes under a VDict must be tensors with the same
axlearn/common/utils.py:483
↓ 8 callersFunctionget_resource_limits
Attempts to read resource limits, both total and per-project. Also reads user quota project membership. Args: path: Absolute path to
axlearn/cloud/common/quota.py:50
↓ 8 callersFunctioninfer_tpu_version
Infer TPU version from the TPU type. Args: tpu_type: A string of the format {version}-{cores}. Returns: Inferred TPU version
axlearn/common/compiler_options.py:325
↓ 8 callersFunctionjit_fn
(x_dist, y_dist)
axlearn/cloud/gcp/tpu_health_check_main.py:29
↓ 8 callersFunctionlist_blobs
List files on GS with <url> prefix. Args: url: gs:// prefixed url. Returns: List of full paths to objects with <url> prefix.
axlearn/cloud/gcp/storage.py:34
↓ 8 callersFunctionnamed_runner_configs
Returns runner config(s) optionally filtered by name.
axlearn/cloud/gcp/runners/__init__.py:37
↓ 8 callersMethodoutput_shape
Computes the output shape given input shape. Args: input_shape: Values for the input dimensions [batch_size, seq_len]. Each value
axlearn/audio/frontend.py:262
↓ 8 callersFunctionprune_tree
Returns a shallow copy of the input tree with subtrees pruned based on `should_prune`. This is a shallow copy because leaf nodes (non-dict values
axlearn/common/utils.py:1427
↓ 8 callersFunctionread_per_param_settings
Extracts per-param settings for the given trainer config. Given a trainer config specified by `module` and `config_name`, initializes the trainer
axlearn/common/test_utils.py:507
↓ 8 callersFunctionregister_validator
Registers a custom config field validator. Args: match_fn: A function that returns True if the value should be validated by `validate_fn`
axlearn/common/config.py:298
↓ 8 callersFunctionrepeat_kv_heads
Repeats key or value heads dim to match the query. TODO(dhwang2): optimize computation like GroupedQueryAttention.
axlearn/common/flash_attention/common.py:476
↓ 8 callersFunctionright_shift_and_zero_pad
Right shift the tensor and pad zeros on the left side, e.g., [2, 5, 3] with shift_size=2 -> [0, 0, 2]. Args: x: input tensor of
axlearn/common/rattention/kernels/linear_attention_kernels.py:41
↓ 8 callersMethodsave
See `BaseCheckpointer.save` for details. In addition to behavior in `BaseCheckpointer`, saving only happens if the configured checkpo
axlearn/common/checkpointer.py:1108
↓ 8 callersMethodset
(self, **kwargs)
axlearn/common/layers.py:110
↓ 8 callersFunctionset_layer_norm_eps_recursively
Sets LayerNorm.Config.eps recursively. Args: cfg: The root config under which to look for LayerNorm.Config. eps: The target value
axlearn/common/layers.py:266
↓ 8 callersFunctionslice_count
Returns the number of slices.
axlearn/common/elastic_input.py:403
↓ 8 callersMethodsummaries
(self)
axlearn/common/metrics.py:149
↓ 8 callersMethodtree_flatten
(self)
axlearn/common/checkpointer_test.py:1189
↓ 8 callersMethodupdate
Updates prefix merger state given the next candidate token.
axlearn/audio/decoder_asr.py:123
↓ 8 callersMethodupdate_capacity
Update when a bin's capacity changes.
axlearn/common/segment_tree.py:184
↓ 8 callersMethodwait_until_finished
Waits for async CloudBuild to finish by polling for status. Is a no-op if `cfg.is_async` is False. Args: name: Bundle na
axlearn/cloud/gcp/bundler.py:279
↓ 7 callersMethod_build_head_container
(self)
axlearn/cloud/gcp/pathways_utils.py:1495
↓ 7 callersFunction_compute_rms_norms
Computes the RMS norm for each leaf tensor of `x` and optionally adds summaries. Summaries will be added if `summary_suffix` is not None *and* th
axlearn/common/optimizers.py:412
↓ 7 callersMethod_compute_summaries
( self, task: str, ignore_target_label: Union[int, jnp.float32], input_batch:
axlearn/common/metrics_glue_test.py:85
↓ 7 callersMethod_constrain_input_batch
Applies sharding constraints in-place for relevant named tensors in the input batch.
axlearn/common/causal_lm.py:811
↓ 7 callersFunction_create_dummy_config
(temp_dir: str)
axlearn/cloud/common/bundler_test.py:34
↓ 7 callersMethod_delete
(self)
axlearn/cloud/gcp/runners/gke.py:671
↓ 7 callersMethod_ds_fn
(self)
axlearn/common/input_tf_data_test.py:806
↓ 7 callersMethod_execute_remote_cmd
Executes a command on an existing VM. Args: cmd: Command to run. detached_session: If not None, run commands behind `
axlearn/cloud/gcp/job.py:294
↓ 7 callersFunction_get_build_request_filter
Constructs a filter string to query build requests based on image name and tags. To filter builds by multiple tags, use "AND", "OR", or "NOT" to
axlearn/cloud/gcp/cloud_build.py:69
↓ 7 callersMethod_get_levels_up
(self)
axlearn/vision/fpn.py:724
↓ 7 callersMethod_get_status
(self)
axlearn/cloud/gcp/runners/gke.py:547
↓ 7 callersFunction_ids_to_onehots
(ids: Tensor, *, codebook_size: int, dtype: jnp.dtype)
axlearn/common/quantizer.py:271
↓ 7 callersFunction_ids_to_word_starts
Computes start of word indexes. Note: The function expects morphun tokenized input. Args: inputs: int Tensor [seq_len] of piece ids.
axlearn/common/input_mlm.py:29
↓ 7 callersMethod_job_config
( self, *, name: str, command: str, env_vars: Optional[dict] = None, **kwargs )
axlearn/cloud/gcp/runners/gke_test.py:295
↓ 7 callersFunction_private_flags
Defines all launch flags, and amends `app.usage` with additional launch help info.
axlearn/cloud/gcp/jobs/launch.py:781
↓ 7 callersFunction_ref_asymmetric_contrastive_loss_from_logits
( logits, temperature: float = 1.0, soft_labels: Tensor = None )
axlearn/common/loss_test.py:192
↓ 7 callersFunction_run
Wraps absl_main by returning (returncode, stdout, stderr).
axlearn/cli/utils_test.py:38
↓ 7 callersMethod_runner_config
( self, *, mesh_shape: tuple[int, int], mesh_axis_names: tuple[str, str],
axlearn/common/inference_test.py:229
↓ 7 callersMethod_test_backward
Shared backward test: compares gradients of FlashAttention against reference.
axlearn/common/flash_attention/layer_test.py:608
↓ 7 callersMethod_test_forward
Shared forward test: compares FlashAttention output against reference.
axlearn/common/flash_attention/layer_test.py:431
↓ 7 callersMethod_tpu_child_config
Helper to create a TPUReplicatedJob config for composite job tests.
axlearn/cloud/gcp/jobset_utils_test.py:921
↓ 7 callersMethodas_dense_kv
Return a dense `(k_proj, v_proj)` pair from a dense `KVState`. Subclasses that emit paged or otherwise non-dense storage override this
axlearn/common/kv_cache/base_kv_cache.py:118
↓ 7 callersFunctionasymmetric_contrastive_loss_from_logits
Asymmetric contrastive loss from logits. When soft_labels is None, minimizing the loss will maximize the gap between logits[i, i] and logits[
axlearn/common/loss.py:464
↓ 7 callersFunctionbert_encoder_config_from_hf
( hf_cfg, vocab_size: Optional[int] = None, layer_norm_epsilon: Optional[float] = None, dropou
axlearn/common/bert_test.py:37
↓ 7 callersMethodbuild
Builds sharding specifications for the flash attention operation. This method is called to build the sharding map specifications that will be
axlearn/common/flash_attention/common.py:300
↓ 7 callersFunctionbuild_vitdet_model_config
(**kwargs)
axlearn/vision/vitdet_transformer.py:248
↓ 7 callersMethodbundle
Produces a code bundle for the local directory. Args: name: Bundle name. Returns: The bundle identifier.
axlearn/cloud/common/bundler.py:231
↓ 7 callersFunctioncalculate_mean_metrics
( *, metric_name: str, query_metrics: Tensor, query_padding: Tensor, query_categories: Opt
axlearn/common/metrics_retrieval.py:656
↓ 7 callersFunctioncanonicalize_to_string
Converts lists to delimited strings.
axlearn/cloud/common/utils.py:209
↓ 7 callersMethodcompile_train_step
Produce a lowered and compiled training step. Args: trainer_state: The global trainer state (or state specs). If
axlearn/common/trainer.py:1223
↓ 7 callersFunctioncopy_partition
Copies OptStateSpec and optionally assigns with a different memory kind. Args: specs: Nested[OptStateSpec] to copy from. pattern:
axlearn/common/optimizers.py:145
↓ 7 callersFunctioncreate_current_timestamp
Create a timestamp protobuf with current time. Returns: Timestamp protobuf set to current time
axlearn/ft/utils.py:415
↓ 7 callersFunctioncustom_leaderworkerset_kwargs
()
axlearn/cloud/gcp/utils.py:434
↓ 7 callersMethoddefault_config
(cls)
axlearn/common/mixture_of_experts.py:1448
↓ 7 callersFunctiondefault_output_dim_to_partition_spec
Builds a default mapping from tensor dims to partition specs for the FlashAttention outputs. Maps attention heads over the default tensor-paralle
axlearn/common/flash_attention/layer.py:376
↓ 7 callersFunctiondefault_project
Default project from active `gcp_settings`. Project is used along with env_id to identify `gcp_settings`. Returns: the project in active `gc
axlearn/cloud/gcp/config.py:68
↓ 7 callersMethoddefine_flags
(cls, fv)
axlearn/cloud/common/utils_test.py:409
↓ 7 callersMethoddistort
Applies Mixup and/or Cutmix to batch of images and transforms labels. Args: images (tf.Tensor): Of shape [batch_size, height, wid
axlearn/vision/augment.py:905
↓ 7 callersMethodencode
Encodes boxes with respect to anchors. Args: boxes: A [..., 4] float tensor with boxes to encode. Boxes must be of the form
axlearn/vision/box_coder.py:56
↓ 7 callersMethodexecute
Wraps _execute with retries. All args and kwargs are forwarded. Retries are triggered automatically when _execute throws an exception.
axlearn/cloud/common/job.py:115
↓ 7 callersFunctionexists
Analogous to tf.io.gfile.exists.
axlearn/common/file_system.py:140
↓ 7 callersMethodextend_step
( self, cached_states: NestedTensor, data: Tensor, *, is_prefill: bool
axlearn/common/attention.py:3583
↓ 7 callersFunctionfunc
Wrap original function to pass in key-word args.
axlearn/common/gradient_accumulation.py:310
↓ 7 callersFunctionget_cloud_build_status
Gets the status of the latest CloudBuild by filtering on the build tags and image name. In order: 1. Queries the last known region where a bu
axlearn/cloud/gcp/cloud_build.py:192
↓ 7 callersMethodget_summaries
(self)
axlearn/common/module.py:526
↓ 7 callersFunctionget_trainer_config_fn
Builds a TrainerConfigFn according to the model and input specs. Args: model_cfg: The model config. learner_cfg: The learner conf
axlearn/experiments/text/gpt/common.py:681
↓ 7 callersMethodget_workload_labels
(self)
axlearn/cloud/gcp/jobset_utils.py:1092
↓ 7 callersMethodinit_nvml
It is not thread-safe. Please see the docstring of the class for more details. Users should not call `init_nvml` multiple times.
axlearn/common/monitoring/gpu_client.py:24
↓ 7 callersMethodis_valid
Return True for a valid git summary, i.e. collected from valid git repository checkout, and False otherwise.
axlearn/cloud/common/git_summary.py:215
↓ 7 callersFunctionlayer_norm_config
(eps=1e-6)
axlearn/common/vision_transformer.py:54
↓ 7 callersMethodlist
Lists running jobs and optionally prints them in tabular format. Args: output_file: Output file. If None, prints to stdout, other
axlearn/cloud/gcp/jobs/launch.py:359
↓ 7 callersFunctionmask_tree
Mask out tree leaves that are not transformed by the optimizer. Args: tree: A nested structure with ParameterSpec, OptParams or Tensor as
axlearn/common/update_transformation.py:355
↓ 7 callersMethodnamed_trainer_configs
()
axlearn/experiments/trainer_config_utils_test.py:226
↓ 7 callersFunctiononline_softmax_log_probs_pallas
Fused streaming log-normalizer and top-k via Pallas (TPU). This kernel supports only forward. Backprop will be added latter This function is
axlearn/common/kernels/online_softmax_log_probs.py:213
↓ 7 callersMethodpiece_to_id
Encode a token to id.
axlearn/experiments/text/gpt/vocabulary_fuji_v3.py:28
↓ 7 callersMethodping
Returns True iff job is alive.
axlearn/common/liveness_monitor.py:28
↓ 7 callersMethodpredict
Produce decoder hidden states. Args: input_batch: a dict with the following entries: input_ids: an int Tensor of
axlearn/common/causal_lm.py:569
↓ 7 callersFunctionpytree_children
Generate the (key, value) pairs for the immediate children of a pytree `node`. Reference: jax._src.tree_util.generate_key_paths() Example:
axlearn/common/utils.py:1935
↓ 7 callersFunctionread_param_init_specs_recursively
Given a layer, returns all nested parameter initialization specs. Args: layer: The layer to read from recursively. delegates: An
axlearn/common/test_utils.py:453
↓ 7 callersMethodrestore_checkpoint
Restores trainer state from checkpoint. If successful, sets self._step and self._trainer_state to the restored step and state, respec
axlearn/common/trainer.py:944
↓ 7 callersFunctionsample_text_embedding_stream_encoder_config
( output_dim: int, output_proj: Linear.Config = None, hidden_dim: Optional[int] = None, )
axlearn/common/text_dual_encoder_test.py:49
↓ 7 callersFunctionscale_from_learning_rate
( learning_rate: schedule.Schedule, *, flip_sign=True )
axlearn/common/optimizers.py:271
↓ 7 callersFunctionset_vision_encoder_config
Configure the CLIP image stream encoder. Args: num_layers: An integer indicating the number of transformer blocks. model_dim: An
axlearn/vision/clip.py:238
↓ 7 callersMethodtree_unflatten
(cls, keys, values)
axlearn/common/utils.py:453
↓ 7 callersFunctionwith_partition_fn
( base: optax.GradientTransformation, partition_fn: TransformPartitionSpecFn )
axlearn/common/optimizers.py:131
↓ 6 callersMethod__init__
(self, cfg: Config, *, parent: Module)
axlearn/vision/fpn.py:99
↓ 6 callersMethod__init__
(self, cfg: Config, *, parent: Module)
axlearn/vision/resnet.py:133
↓ 6 callersMethod__init__
(self, cfg: Config)
axlearn/common/trainer_config_modifier.py:99
↓ 6 callersMethod__init__
(self, cfg: Config, *, parent: Optional[Module])
axlearn/common/dit.py:575
↓ 6 callersMethod__init__
(self, cfg: Config, *, parent: Module)
axlearn/common/lora.py:412
↓ 6 callersMethod_backend
(self)
axlearn/common/flash_attention/layer.py:123
← previousnext →301–400 of 7,799, ranked by callers