MCPcopy Create free account

hub / github.com/apple/axlearn / functions

Functions7,799 in github.com/apple/axlearn

↓ 2,642 callersMethodset
(self, **kwargs)
axlearn/common/config.py:539
↓ 1,367 callersMethoddefault_config
(cls: type["T5Encoder"])
axlearn/common/t5.py:256
↓ 1,110 callersMethodinstantiate
Instantiates an instance of `T`. The field values specified in **kwargs take precedence over those set in the config.
axlearn/common/config.py:1112
↓ 581 callersMethodastype
Return a new bias whose dtype is `dtype`.
axlearn/common/attention_bias.py:117
↓ 510 callersMethodget
Convenience function for accessing box coordinates. Returns: A tensor with shape [N, 4] representing box coordinates.
axlearn/vision/utils_detection.py:791
↓ 489 callersMethod_add_child
Adds a child module. Args: name: The child module name. child_config: The config of the child module. **k
axlearn/common/module.py:935
↓ 476 callersFunctionassert_allclose
(actual, desired, atol=1e-6, rtol=1e-3, err_msg="")
axlearn/common/test_utils.py:71
↓ 432 callersMethodmap
(self, element: int)
axlearn/common/input_grain_test.py:48
↓ 428 callersMethoditems
Returns (key, value) pairs sorted by keys.
axlearn/common/config.py:535
↓ 426 callersFunctionconfig_for_function
Returns an instance of FunctionConfigBase, which invokes `fn` upon instantiation. Example: ``` cfg = config_for_function(pow).set
axlearn/common/config.py:1082
↓ 406 callersMethodinitialize_parameters_recursively
( self, prng_key: Tensor, *, prebuilt: Optional[Nested[Optional[ParameterSpec]]] = None )
axlearn/common/repeat.py:151
↓ 406 callersMethodjoin
(self, timeout=None)
axlearn/common/array_serialization.py:972
↓ 354 callersMethodinstantiate
(cfg)
axlearn/cloud/gcp/jobs/launch_test.py:787
↓ 307 callersMethodset
Convenience function for setting box coordinates. Args: boxes: a tensor of shape [N, 4] representing box corners Raises:
axlearn/vision/utils_detection.py:799
↓ 301 callersMethodassertNestedAllClose
(self, a, b, atol=1e-6, rtol=1e-3)
axlearn/common/test_utils.py:244
↓ 228 callersMethodclone
Returns a clone of the original config with the optional keyword overrides. Unlike `self.set`, this function does not modify the config in-pl
axlearn/common/config.py:580
↓ 206 callersMethoddefault_config
(cls)
axlearn/vision/resnet.py:455
↓ 204 callersMethodassertNestedEqual
(self, a, b)
axlearn/common/test_utils.py:264
↓ 173 callersMethodupdate
Computes `model_params` updates from `update`. Args: updates: The updates to potentially transform and then apply. Retur
axlearn/common/learner.py:245
↓ 159 callersMethodkeys
(self)
axlearn/common/config.py:532
↓ 150 callersMethodadd_summary
Adds the named value to `OutputCollection.summaries`. Args: name: The name of the item to add. value: The value to ad
axlearn/common/module.py:1114
↓ 135 callersMethodpatch
(self, command: str, **kwargs: dict)
axlearn/cloud/gcp/jobset_utils_test.py:77
↓ 105 callersMethoddefault_config
(cls)
axlearn/common/flash_attention/layer.py:108
↓ 86 callersFunctionflatten_items
Flattens `tree` and returns a list of (path, value) pairs.
axlearn/common/utils.py:421
↓ 86 callersMethodshape
(self)
axlearn/common/optimizer_base.py:42
↓ 83 callersFunctionmesh_shape_from_axes
Builds a 6D logical mesh from the provided spec. Args: pipeline: Pipeline-paralellism. Typically means partitioning model layers across t
axlearn/experiments/text/gpt/common.py:158
↓ 81 callersFunctionshapes
Returns a tree of the same structure as `nested_tensor` but with corresponding shapes instead of tensors.
axlearn/common/utils.py:367
↓ 79 callersMethoddefault_config
(cls)
axlearn/audio/decoder_asr.py:1144
↓ 78 callersMethodload
(name: str, *, split: Optional[str] = None, download: bool = True)
axlearn/common/config_test.py:538
↓ 78 callersFunctionsafe_not
Inverts a boolean mask. Commonly used to switch between paddings and mask. Args: mask: A boolean tensor. Returns: A boo
axlearn/common/utils.py:2042
↓ 77 callersFunctionchild_context
(name: str, **kwargs)
axlearn/common/module.py:637
↓ 77 callersMethodvalue
Returns a value for logging.
axlearn/common/summary.py:20
↓ 75 callersMethoddefault_config
(cls)
axlearn/cloud/gcp/k8s_service.py:132
↓ 75 callersFunctiongcp_settings
Reads a specific value from config file under the "GCP" namespace. Args: key: The config field. fv: The flag values, which can ov
axlearn/cloud/gcp/config.py:105
↓ 71 callersMethodvlog
(self, level: int, msg: str, *args, **kwargs)
axlearn/common/module.py:912
↓ 70 callersMethoddefault_config
(cls)
axlearn/cloud/common/utils_test.py:555
↓ 69 callersFunctionload_golden
Load golden data for a specific test from the module-level .npz file. Args: module_name: Dotted module path, e.g. "axlearn.common.causal_
axlearn/common/golden.py:12
↓ 68 callersMethodupdate
Update an existing job without resubmission. This will fetch the existing job from Bastion, change the trainer command, increment the
axlearn/cloud/gcp/jobs/launch.py:468
↓ 66 callersMethoddefault_config
(cls)
axlearn/cloud/gcp/runners/gke.py:893
↓ 65 callersFunctionmaybe_instantiate
(x: ConfigOr[T])
axlearn/common/config.py:914
↓ 59 callersMethoddefault_config
(cls)
axlearn/common/state_builder_test.py:454
↓ 58 callersMethodinit
(prng_key_i)
axlearn/common/repeat.py:154
↓ 57 callersFunctionas_tensor
Converts `x` to Tensor recursively. Args: x: a jnp array, numpy array, TF/PyTorch Tensor, or a nested structure of arrays or Tensors.
axlearn/common/utils.py:587
↓ 54 callersMethodlower
Traces and lowers the function using the provided arguments.
axlearn/common/debug_utils.py:57
↓ 52 callersFunctionwith_sharding_constraint
(x: Tensor, shardings)
axlearn/common/utils.py:637
↓ 50 callersMethodreplace
(self: _N, **overrides)
axlearn/common/flax_struct.py:143
↓ 50 callersMethodvalue_and_grad
(params, input_batch, layer, k3)
axlearn/common/mixture_of_experts_test.py:1507
↓ 47 callersMethoddefault_config
(cls)
axlearn/common/rattention/utils.py:36
↓ 47 callersFunctionnew_output_collection
()
axlearn/common/module.py:282
↓ 46 callersMethoddefault_config
(cls)
axlearn/common/attention.py:1377
↓ 46 callersFunctionget_activation_fn
(name)
axlearn/common/layers.py:74
↓ 46 callersMethodwait_until_finished
Waits for async writes to finish.
axlearn/common/checkpointer.py:330
↓ 45 callersMethod_log_unsupported
Logs this class is unsupported with `reason`. The log message will be formatted as `Not using {self.name()} because {reason}`. This
axlearn/common/flash_attention/common.py:179
↓ 44 callersMethoddefault_config
(cls)
axlearn/common/utils_test.py:1117
↓ 44 callersFunctionnew_jobspec
Constructs a JobSpec with basic schema validation.
axlearn/cloud/common/bastion.py:333
↓ 42 callersMethoddefault_config
(cls)
axlearn/common/evaler_test.py:81
↓ 42 callersFunctionfunctional
Invokes <module>.<method> in a pure functional fashion. The invocation will not depend on external inputs or have any side effects. The results o
axlearn/common/module.py:1203
↓ 42 callersFunctionmock_gcp_settings
( module_name: Union[str, Sequence[str]], settings: Optional[dict[str, str]] = None )
axlearn/cloud/gcp/test_utils.py:37
↓ 42 callersMethodrestore
()
axlearn/common/checkpointer_test.py:1433
↓ 40 callersMethodpath
(self)
axlearn/common/module.py:898
↓ 39 callersFunctionget_recursively
Recursively indexes through the nested tensor. Args: x: The tensor to index. path: The sequence of keys used to recursively
axlearn/common/utils.py:1029
↓ 39 callersMethodrun
Runs training. Args: prng_key: The pseudo random generator key. return_evaler_summaries: Whether to force run evalers
axlearn/common/trainer.py:571
↓ 38 callersFunctionrearrange
JAX implementation of `einops.rearrange`. This function provides a concise and readable way to perform common tensor manipulations such as re
axlearn/common/ein_ops.py:48
↓ 37 callersMethoddecode
Detokenizes int sequence to a string, up through first EOS.
axlearn/common/input_grain_text.py:43
↓ 36 callersMethodcreate_parameter_specs_recursively
(self)
axlearn/common/repeat.py:125
↓ 36 callersMethoddefault_config
(cls)
axlearn/vision/coca.py:838
↓ 36 callersFunctiontree_paths
Returns a tree of the same structure as `nested_tensor` but with corresponding paths instead of values. E.g., tree_paths({'a': 1, 'b'
axlearn/common/utils.py:396
↓ 35 callersFunctioncurrent_context
()
axlearn/common/module.py:601
↓ 35 callersFunctiondefine_flags
Define flags on `fv` by recursively invoking `cfg.klass.define_flags`. Flags are defined in topological order, i.e., parent flags will be defined
axlearn/cloud/common/utils.py:489
↓ 35 callersFunctionopen
Analogous to tf.io.gfile.GFile.
axlearn/common/file_system.py:159
↓ 34 callersFunctionfrom_flags
Read values from `fv` by recursively invoking `cfg.klass.from_flags`. The config precedence is `kwargs` followed by `fv` followed by `cfg`. In ot
axlearn/cloud/common/utils.py:538
↓ 34 callersFunctionis_supported_mesh_shape
Checks if a function intended for a mesh shape is compatible with the current device(s).
axlearn/common/test_utils.py:119
↓ 32 callersMethodadd
(weight)
axlearn/common/metrics_test.py:145
↓ 32 callersFunctionrandom_int_array
(*, shape: tuple)
axlearn/common/text_dual_encoder_test.py:110
↓ 32 callersMethodwrite
Writes data in a non-blocking manner.
axlearn/cloud/common/writer.py:33
↓ 30 callersMethod_remat_name
Tags 'x' with 'name' using a custom jax.extend.core.Primitive, which is otherwise a no-op. This is useful for custom activation remat
axlearn/common/base_layer.py:783
↓ 30 callersMethodfind_best_fit
Find the smallest available capacity >= item_weight.
axlearn/common/segment_tree.py:175
↓ 29 callersFunctionfake_grain_source
Returns a fake grain input source.
axlearn/common/input_fake.py:409
↓ 29 callersFunctionfn
(value: Union[Tensor, VDict])
axlearn/common/utils.py:496
↓ 29 callersFunctionmaybe_set_config
Applies **kwargs to the given `cfg` if the keys exist.
axlearn/common/config.py:1182
↓ 29 callersFunctionreplicate_to_local_data
Replicates and converts Tensors in `x` to local DeviceArrays. Args: x: The tensor to replicate. Returns: Replicated tensor.
axlearn/common/utils.py:658
↓ 29 callersMethodsave
()
axlearn/common/checkpointer_test.py:1427
↓ 28 callersMethodbatch
(fn)
axlearn/common/utils_test.py:651
↓ 28 callersFunctionfake_source
( is_training: bool, examples: Sequence[dict[str, tf.Tensor]], repeat: int = 1, spec: Optional
axlearn/common/input_fake.py:177
↓ 28 callersMethodhas_value
Return whether to the bias has a value.
axlearn/common/attention_bias.py:79
↓ 27 callersFunctioncast
(x: Union[Tensor, TensorSpec])
axlearn/common/utils.py:1164
↓ 27 callersMethoddefault_config
(cls)
axlearn/vision/clip.py:551
↓ 26 callersMethod_raise
(self, op: str)
axlearn/common/config.py:148
↓ 26 callersMethodcompile
Compile the function with provided options.
axlearn/common/debug_utils.py:32
↓ 26 callersFunctioncross_entropy
Compute the cross entropy loss between logits and target_labels. Computes a stabilized-gradient version of: -jnp.sum(targets * nn.log_sof
axlearn/common/loss.py:89
↓ 26 callersMethodquery_range
Query operation result over range [left, right] inclusive.
axlearn/common/segment_tree.py:88
↓ 25 callersFunctionget_data_dir
()
axlearn/common/utils.py:1559
↓ 25 callersMethodinitialize
( self, name: str, *, prng_key: Tensor, shape: Shape, dtype: j
axlearn/common/param_init.py:158
↓ 25 callersFunctionvalidate_contains_paths
Raises ValueError if any of the given `paths` are not present in `x`.
axlearn/common/utils.py:2056
↓ 24 callersFunctionconfig_for_class
Returns an instance of ClassConfigBase, which is an object factory for `cls`. In other words, instantiating the config produces an instance of `c
axlearn/common/config.py:1144
↓ 24 callersMethoddebug_string
Returns a debug string for the config. Args: kv_separator: The key-value separator. field_separator: The field separa
axlearn/common/config.py:588
↓ 24 callersMethodexecute
(self)
axlearn/cloud/gcp/k8s_service.py:214
↓ 24 callersMethodis_supported
( self, input_batch: Nested[Tensor | BaseAttentionBias], kv_cache_type: Optional[type[
axlearn/common/flash_attention/common.py:522
↓ 23 callersFunction_mesh
(mesh_shape: Sequence[int])
axlearn/common/checkpointer_test.py:64
↓ 23 callersMethodencode
Tokenizes string to an int sequence.
axlearn/common/input_grain_text.py:34
next →1–100 of 7,799, ranked by callers