MCPcopy Create free account

hub / github.com/apple/axlearn / functions

Functions7,799 in github.com/apple/axlearn

↓ 12 callersFunctionhost_to_global_device_array
A deprecated alias for `host_to_global_array`. Please use `host_to_global_array` instead.
axlearn/common/utils.py:929
↓ 12 callersMethodid
Return the pre-built docker image id associated with the bundler.
axlearn/cloud/gcp/bundler.py:348
↓ 12 callersFunctionl2_normalize
l2_normalize Normalizes along the dimension `axis` using an L2 norm. Args: x: Input tensor. axis: Dimension along which to normal
axlearn/common/normalize.py:10
↓ 12 callersMethodper_head_dim
(self)
axlearn/common/attention.py:1879
↓ 12 callersMethodper_head_dim
Returns the dimension of each attention head.
axlearn/common/rattention/rattention.py:134
↓ 12 callersMethodsort
Sorts the table. Heading remains unchanged.
axlearn/cloud/common/utils.py:361
↓ 12 callersFunctionvalidate_config_field_value
Validates a config field value. Validation is handled by validators registered via `register_validator`. `match_fn`s will be invoked in order
axlearn/common/config.py:315
↓ 11 callersMethod_add_tensor_stats
Adds tensor stats about `value`. Suppose `self.tensor_stats` adds some summaries about `value`, e.g., `self._add_tensor_stats("me
axlearn/common/base_layer.py:803
↓ 11 callersMethod_build_pod
Builds a config for a single Pod, which is a set of containers. https://kubernetes.io/docs/concepts/workloads/pods Returns:
axlearn/cloud/gcp/jobset_utils.py:852
↓ 11 callersMethod_http_route_config
( self, **kwargs, )
axlearn/cloud/gcp/k8s_http_route_test.py:20
↓ 11 callersMethod_jit_forward
(self, layer, inputs, paddings)
axlearn/audio/frontend_test.py:58
↓ 11 callersMethod_local_dir_context
Copies contents of local directory to `temp_dir`, excluding `exclude` paths, and returns the directory. Caller is expected to use as
axlearn/cloud/common/bundler.py:113
↓ 11 callersFunction_make_liveness_probe
(**kwargs)
axlearn/cloud/gcp/k8s_readiness_probe_test.py:16
↓ 11 callersFunction_make_probe
(**kwargs)
axlearn/cloud/gcp/k8s_readiness_probe_test.py:12
↓ 11 callersFunction_make_vocab
(name: str)
axlearn/common/vocabulary_bpe_test.py:71
↓ 11 callersFunction_new_module
(name: str)
axlearn/common/module_test.py:93
↓ 11 callersFunction_text_ds
(texts: list[str], *, repeat=1)
axlearn/common/input_tf_data_test.py:298
↓ 11 callersMethodadd_new_bin
Add a new bin with the given capacity.
axlearn/common/segment_tree.py:203
↓ 11 callersFunctionapply_attention_logit_biases
Applies `attention_logit_biases` on `logits`. Args: logits: A float Tensor. attention_logit_biases: A float Tensor. If None, assu
axlearn/common/attention.py:567
↓ 11 callersMethodassertAllCloseWithOutliers
Like np.testing.assert_allclose, but allows outlier percentiles to be specified. `tolerance_map` is mapping of percentile values (between 0 a
axlearn/common/test_utils.py:277
↓ 11 callersMethodbeam_search_decode
See configured `decoding` implementation for details.
axlearn/common/decoder.py:845
↓ 11 callersFunctionbert_embedding_config
Builds configs for BERT Embedding layer. Defaults are from the BERT-BASE model. Args: max_position_embeddings: Number of positional
axlearn/common/bert.py:351
↓ 11 callersMethodbuild_liveness_probe
Builds a k8s liveness probe dict, omitting any None fields. Returns: A dict corresponding to a k8s liveness probe configuration.
axlearn/cloud/gcp/k8s_readiness_probe.py:234
↓ 11 callersMethodbuild_readiness_probe
Builds a k8s readiness probe dict, omitting any None fields. Returns: A dict corresponding to a k8s readiness probe configuration
axlearn/cloud/gcp/k8s_readiness_probe.py:205
↓ 11 callersFunctiondata_partition_type_to_spec
Returns a PartitionSpec for the given partition type.
axlearn/common/utils.py:821
↓ 11 callersMethoddataset
Returns the input dataset, which should produce per-feed logical batches. Each batch is a pytree of arrays which reside on host memory (i.e.,
axlearn/common/input_base.py:191
↓ 11 callersMethoddefault_config
(cls)
axlearn/vision/beit_image_tokenizer.py:65
↓ 11 callersMethoddefault_config
(cls)
axlearn/common/quantizer.py:116
↓ 11 callersFunctionds_fn
()
axlearn/common/input_tf_data_test.py:64
↓ 11 callersMethodembeddings
Returns weights of shape [num_embeddings, dim].
axlearn/common/layers.py:961
↓ 11 callersMethodeval_shape
Return the shape of the bias tensor. Note: this doesn't materialize the value. jax.eval_shape calls value(), but it only does so usin
axlearn/common/attention_bias.py:62
↓ 11 callersMethodforward
(self, data, **layer_kwargs)
axlearn/common/attention_test.py:4525
↓ 11 callersMethodfrom_flags
(cls, fv: flags.FlagValues, **kwargs)
axlearn/cloud/gcp/k8s_service.py:106
↓ 11 callersMethodfunctional
Transforms `method_fn` (with this context) into a pure functional Callable. The returned Callable will have the same behavior as `method_fn`,
axlearn/common/module.py:535
↓ 11 callersMethodget_value
Get value at a specific index.
axlearn/common/segment_tree.py:144
↓ 11 callersFunctionprecision_recall_f_score
Computes precision, recall, and F-beta score for binary classification. References: https://github.com/scikit-learn/scikit-learn/blob/baf0ea2
axlearn/common/metrics_classification.py:56
↓ 11 callersMethodschedule
Schedules jobs according to quotas. The scheduling behavior depends on the configured `cfg.scheduler`. Args: job_metadat
axlearn/cloud/common/scheduler.py:643
↓ 11 callersFunctionserialize_jobspec
Writes job spec to filepath or file.
axlearn/cloud/common/bastion.py:357
↓ 11 callersFunctionset_recursively
Sets x[path...] = value, where path can be a multi-part index. If any part of the path does not exist in `x`, new sub dicts will be created, e.g.
axlearn/common/utils.py:1062
↓ 11 callersMethodstart
Starts status server.
axlearn/common/status_server.py:53
↓ 11 callersMethodstart
Starts the async copies.
axlearn/common/flash_attention/tpu_paged_attention_kernel.py:76
↓ 10 callersFunction_cached_vocab
Returns a cached SentencePieceVocabulary instance to avoid repeated loading.
axlearn/common/input_mlm_test.py:35
↓ 10 callersMethod_invoke
(self, *, num_iters, xs, **kwargs)
axlearn/common/module_test.py:855
↓ 10 callersMethod_job_config
(self, bundler_cls: type[Bundler], **kwargs)
axlearn/cloud/gcp/jobset_utils_test.py:85
↓ 10 callersMethod_job_config
( self, *, name: str, command: str, env_vars: Optional[dict] = None, **kwargs )
axlearn/cloud/gcp/runners/gke_test.py:1610
↓ 10 callersFunction_match_summary_type
Checks whether a given value is appropriate for the specified summary kind. This is used to determine whether a particular summary value (or wrap
axlearn/common/summary_writer.py:175
↓ 10 callersMethod_search_max_and_index
(cls, index_to_value: Dict[int, float])
axlearn/audio/aligner/ctc_aligner_test.py:296
↓ 10 callersMethod_test_gradient
Shared gradient test: compares TPU flash attention gradients against reference.
axlearn/common/flash_attention/tpu_attention_test.py:302
↓ 10 callersMethod_update_env_list
(self, env_list: list[dict], name: str, value: str)
axlearn/cloud/gcp/pathways_utils.py:508
↓ 10 callersMethodadd_child
(self, name: str)
axlearn/common/module.py:265
↓ 10 callersMethodadd_cmd_from_module
Adds a command that invokes an existing absl script. Args: name: Command name. module: A string of the format `module
axlearn/cli/utils.py:153
↓ 10 callersFunctionbert_transformer_config
Builds configs for BERT transformer stack. Defaults are from the BERT-BASE model. Args: num_layers: Number of transformer encoder la
axlearn/common/bert.py:422
↓ 10 callersMethodencode
Tokenizes string to an int sequence, without adding EOS.
axlearn/experiments/text/gpt/vocabulary_fuji_v3.py:56
↓ 10 callersFunctionget_bundler_config
Constructs a bundler config from the given spec. Bundlers must be registered via `register_bundler`. Args: bundler_type: Type of bun
axlearn/cloud/common/bundler.py:670
↓ 10 callersMethodget_workload_annotations
Returns workload annotations from the underlying builder.
axlearn/cloud/gcp/job.py:178
↓ 10 callersFunctionmb_or_gb
(x)
axlearn/common/trainer.py:1460
↓ 10 callersFunctionopt_param_values
(params: NestedOptParam)
axlearn/common/optimizers.py:127
↓ 10 callersFunctionscale_by_schedule
Scales updates using a custom schedule for the step size. Unlike optax.scale_by_schedule, this implementation uses 1-based steps, i.e., the first
axlearn/common/optimizers.py:226
↓ 10 callersFunctionselect_mesh_config
Selects a mesh rule (if one matches `mesh_selector` to override mesh config. If any of `trainer_config.mesh_rules` matches `mesh_selector`, modif
axlearn/common/trainer.py:1401
↓ 9 callersMethod_create_error_response
Create standardized error response. Args: context: gRPC context code: gRPC status code message: Error mes
axlearn/ft/manager_server.py:101
↓ 9 callersMethod_dummy_context
(self)
axlearn/common/module_test.py:882
↓ 9 callersMethod_execute
(self)
axlearn/cloud/gcp/runners/gke.py:775
↓ 9 callersMethod_job_config
(self, bundler_cls: type[Bundler], instance_type: str = "tpu-v5p-16", **kwargs)
axlearn/cloud/gcp/pathways_utils_test.py:74
↓ 9 callersFunction_mock_piped_popen_fn
See `_mock_popen_fn`.
axlearn/cloud/common/bastion_test.py:760
↓ 9 callersFunction_recursively_to_dict
Recursively converts defaultdicts to dicts.
axlearn/cloud/common/scheduler.py:220
↓ 9 callersFunction_ref_asymmetric_contrastive_loss_from_features
( x, y, temperature: float = 1.0, soft_labels: Tensor = None )
axlearn/common/loss_test.py:182
↓ 9 callersMethod_sync_jobs
Makes the local bastion state consistent with the remote state. This function serves as a synchronization point for user-initiated state chan
axlearn/cloud/common/bastion.py:1091
↓ 9 callersMethod_update_single_job
Handles all state transitions for a single job. Assumptions: 1. A jobspec file exists in the remote job dir at the start of each call
axlearn/cloud/common/bastion.py:1199
↓ 9 callersFunctionbenchmark_sweep
(libraries: list[str], common_kwargs: dict[str, Any], **sweep_args: list[Any])
axlearn/common/flash_attention/gpu_attention_benchmark.py:316
↓ 9 callersMethodbias_and_residual
Split this bias into a bias of type `cls` and a residual. Compared to the default implementation, this determines which instance of `cls` to
axlearn/common/attention_bias.py:264
↓ 9 callersFunctionbinary_cross_entropy
Compute the binary cross entropy loss between logits and targets. Computes a stabilized-gradient version of: -jnp.sum(targets * jnp.log(l
axlearn/common/loss.py:176
↓ 9 callersFunctioncanonicalize_to_list
Converts delimited strings to lists.
axlearn/cloud/common/utils.py:200
↓ 9 callersFunctionclone_tree
(in_tree: NestedTensor)
axlearn/common/state_builder.py:360
↓ 9 callersFunctioncreate_device_mesh
Constructs a device mesh. If `mesh_shape` is specified as a `HybridMeshShape`, we use the `ici_mesh_shape` and `dcn_mesh_shape` directly to c
axlearn/common/utils.py:1767
↓ 9 callersMethoddefault_config
(cls)
axlearn/common/rattention/rattention.py:503
↓ 9 callersFunctiondefault_mha_dim_to_partition_spec
Builds a default FlashAttention mapping from tensor dims to partition specs for the MHA impl. Maps attention heads over the default tensor-parall
axlearn/common/flash_attention/layer.py:353
↓ 9 callersMethodeinsum_maybe_quantized
Implements activation-kernel einsum with quantization (e.g. fakequant, fp8-fp8, etc.) Args: subscripts: Specifies the subscripts
axlearn/common/quantized_dot_general/layers.py:90
↓ 9 callersFunctionenable_sliding_window_attention
Enable sliding window attention. Args: cfg: MultiheadAttention Config. sliding_window_size: Sliding window size. Returns:
axlearn/common/kv_cache/sliding_window_kv_cache.py:159
↓ 9 callersMethodeval_step
Runs eval for the given step. Args: step: Current step. prng_key: PRNG key. model_params: Model parameter
axlearn/common/evaler.py:619
↓ 9 callersFunctionextract_text
(example: dict[str, tf.Tensor], input_key: str = "text")
axlearn/common/input_test_utils.py:102
↓ 9 callersFunctionfake_audio
Generates fake audio data with a fixed seed.
axlearn/audio/test_utils.py:11
↓ 9 callersMethodfilter
(self, record)
axlearn/cloud/common/utils.py:32
↓ 9 callersMethodfn
(carry, forward_state_tn)
axlearn/common/repeat_test.py:105
↓ 9 callersFunctionforward
(model_params: Nested[Tensor], *, inputs: Any)
axlearn/common/learner.py:671
↓ 9 callersFunctiongenerate_job_name
Generate a unique job name.
axlearn/cloud/common/utils.py:68
↓ 9 callersFunctionget_or_none
(x: Optional[dict], key: Any)
axlearn/common/utils.py:1565
↓ 9 callersFunctioninfer_cli_name
Attempts to infer the CLI name.
axlearn/cloud/common/utils.py:160
↓ 9 callersFunctionmake_config_name
Makes config name string as a function of architecture and model-size. Useful to keep config names synced with fine-tuning configs. Args:
axlearn/experiments/text/gpt/common.py:655
↓ 9 callersFunctionparse_kv_flags
Parses sequence of k:v into a dict. Args: kv_flags: A sequence of strings in the format "k:v". If a key appears twice, the last
axlearn/cloud/common/utils.py:120
↓ 9 callersMethodset_recursively
Recursively find the target key in the config and set its value. Args: path: A sequence of keys for indexing to set the target va
axlearn/common/config.py:564
↓ 9 callersMethodshould_run
(self)
axlearn/cloud/common/scheduler.py:139
↓ 9 callersMethodto_flat_dict
Returns a flattened dict with path -> value mappings. Args: omit_default_values: Omit a field from the output dict if its value r
axlearn/common/config.py:616
↓ 8 callersFunction_attr_fields_dict_cache
Cache the fields dict for type. Args: type_obj: Type to be cached. Returns: A dictionary of fields for the type.
axlearn/common/config.py:460
↓ 8 callersMethod_check_summary
( self, summary_collection: dict[str, Any], name: str, value: Union[Tensor, WeightedSummary] )
axlearn/audio/decoder_asr_test.py:470
↓ 8 callersFunction_config_search_paths
Paths to search for config file, ordered by precedence.
axlearn/cloud/common/config.py:152
↓ 8 callersMethod_create_success_response
Create standardized success response. Args: response_type: Response message type **kwargs: Additional response fields
axlearn/ft/manager_server.py:113
↓ 8 callersFunction_get_config_fn
Returns a TrainerConfigFn for training ResNet on ImageNet. Args: backbone: The ResNet backbone config. train_batch_size: Global t
axlearn/experiments/vision/resnet/imagenet_trainer.py:61
↓ 8 callersFunction_get_latest_build_status_in_region
Gets the CloudBuild status for the latest build in a given region (no caching). Args: project_id: The GCP project ID. image_name:
axlearn/cloud/gcp/cloud_build.py:134
↓ 8 callersMethod_model_config
(self, vocab_size: int, seq_len: int)
axlearn/common/causal_lm_test.py:101
↓ 8 callersFunction_parse_spec_and_check_if_should_skip
Parses health check spec and returns timeout if the `check_type` is in the check_spec. Also checks if environment variables satisfy health check
axlearn/cloud/gcp/tpu_health_check.py:43
← previousnext →201–300 of 7,799, ranked by callers