MCPcopy Create free account

hub / github.com/apple/axlearn / functions

Functions7,799 in github.com/apple/axlearn

↓ 5 callersMethod_input_config
( self, source_ds: Dataset, *, per_process: Optional[_PerProcessFn] = None,
axlearn/common/input_grain_test.py:443
↓ 5 callersFunction_insert_flags
Insert a sequence of --flag=value into argv, ensuring they are inserted before `--`.
axlearn/cli/utils.py:272
↓ 5 callersFunction_is_proc_complete
Returns True iff proc exited with returncode.
axlearn/cloud/common/bastion.py:475
↓ 5 callersFunction_is_valid_ctc_seq
Returns whether each input sequence passes validity check. Note that `optax.ctc_loss` returns -logeps (default to 1e5) if the input length is
axlearn/audio/decoder_asr.py:45
↓ 5 callersMethod_job_config
( self, *, command: str, bundler_cls: type[Bundler], **kwargs, )
axlearn/cloud/gcp/job_test.py:338
↓ 5 callersMethod_linear1_activation
(self, x: Tensor)
axlearn/common/attention.py:3360
↓ 5 callersFunction_list_builds_in_region
Lists all builds for a given combination of region, project, image name, and tags. Args: project_id: The GCP project ID. image_na
axlearn/cloud/gcp/cloud_build.py:111
↓ 5 callersFunction_load_runtime_options
Loads runtime option(s) from file, or returns {} on failure.
axlearn/cloud/common/bastion.py:758
↓ 5 callersMethod_logit_biases_spec
(self, attention_logit_biases: BaseAttentionBias)
axlearn/common/flash_attention/layer.py:133
↓ 5 callersFunction_map_label_sequences
Removes blanks, paddings, and repeats from the input sequences, as used in CTC or RNN-T. Note that unless pad_id is the same as blank_id, pad_id
axlearn/audio/decoder_asr.py:650
↓ 5 callersMethod_mask_fn
(self, example: dict[str, Tensor], **kwargs)
axlearn/common/input_mlm_test.py:499
↓ 5 callersFunction_mock_config
()
axlearn/cloud/gcp/jobs/cpu_runner_test.py:87
↓ 5 callersMethod_mock_configs
(self, *, enable_tpu_smart_repair: bool = False, **kwargs)
axlearn/cloud/gcp/node_pool_provisioner_test.py:39
↓ 5 callersFunction_mock_credentials
()
axlearn/cloud/gcp/jobs/cpu_runner_test.py:82
↓ 5 callersMethod_non_copyable_proxy
Returns a proxy which cannot be copied.
axlearn/common/config_test.py:276
↓ 5 callersMethod_padded_gmm
(self, lhs, rhs, tokens_per_expert)
axlearn/common/mixture_of_experts.py:2321
↓ 5 callersFunction_prepare_layers
( *, num_heads, num_kv_heads, per_head_dim, mesh_axis_names, mask, kv_cache=KVCach
axlearn/common/flash_attention/layer_test.py:104
↓ 5 callersFunction_reduce_loss
Reduces loss tensor. Args: loss: A [...] float tensor of arbitrary shape. reduction: The reduction method. sample_weight:
axlearn/common/loss.py:52
↓ 5 callersFunction_router_z_loss
Loss that encourages router logits to remain small and improves stability. Reference: https://github.com/tensorflow/mesh/blob/fbf7b1e547e8b8c
axlearn/common/mixture_of_experts.py:157
↓ 5 callersMethod_score
Computes scores from logits using configured score_fn or default softmax.
axlearn/common/mixture_of_experts.py:772
↓ 5 callersFunction_softplus
(x)
axlearn/common/loss_test.py:214
↓ 5 callersFunction_source_cfg
( examples: Sequence[dict[str, tf.Tensor]], output_signature: dict[str, tf.TensorShape] )
axlearn/common/input_glue_test.py:22
↓ 5 callersFunction_static_hash_table
Convert a list of keys and values to a static lookup table.
axlearn/common/vocabulary_bpe.py:361
↓ 5 callersMethod_test_decode
Test beam search and sample decoding from a randomly initialized decoder.
axlearn/common/decoder_test.py:618
↓ 5 callersFunction_test_forward_and_backward
( q: Tensor, k: Tensor, v: Tensor, bias, *, ref_fn: TestFn, test_fn: TestFn, f
axlearn/common/flash_attention/gpu_attention_test.py:59
↓ 5 callersMethod_test_logit_sink
Shared logit sink test: compares TPU splash attention against reference.
axlearn/common/flash_attention/tpu_attention_test.py:442
↓ 5 callersMethod_test_optimizer
(self, optimizer)
axlearn/common/optimizers_test.py:383
↓ 5 callersMethod_time_to_write
(self, step: int, kind: SummaryKind)
axlearn/common/summary_writer.py:270
↓ 5 callersMethod_time_to_write
(self, step: int, kind: SummaryKind)
axlearn/common/summary_writer.py:511
↓ 5 callersFunction_update
Equivalent to `x.update(updates)` but raises upon key conflicts.
axlearn/common/causal_lm.py:226
↓ 5 callersMethod_validate_role
Validate worker role for operation. Args: required_role: Required role ('replica_manager' or 'global_manager') operat
axlearn/ft/manager_server.py:86
↓ 5 callersFunctionareas
Computes area. Args: boxes: An N-d float tensor of shape [..., N, 4] with boxes in corner representation [ymin, xmin, ymax, x
axlearn/vision/similarity_ops.py:12
↓ 5 callersFunctionaverage_precision_at_k
Computes Average Precision@K (AP@K) metrics. AP@K = sum_{k=1}^{K}(Precision@k * rel(k)) / min(K, total_num_relevant_items) where rel(k) = 1 i
axlearn/common/metrics_retrieval.py:295
↓ 5 callersFunctionbatch_norm
()
axlearn/vision/resnet.py:48
↓ 5 callersFunctionbert_model_config
Builds configs for BERT model. Defaults are from the BERT-BASE model. Args: vocab_size: Vocab size. hidden_dim: Hidden dim.
axlearn/common/bert.py:463
↓ 5 callersFunctionbool_to_bias
Converts a bool mask tensor to a bias mask tensor. Maps: 0 -> -NEG_INF 1 -> 0.
axlearn/common/attention_bias.py:862
↓ 5 callersMethodbuild_depends_on
Returns the jobset dependsOn entry dict.
axlearn/cloud/gcp/jobset_utils.py:319
↓ 5 callersFunctioncheck_jax_type
Checks that the supplied arguments are valid JAX types and raise ValueError if not. Args: args: Positional arguments of a function call t
axlearn/common/utils.py:1371
↓ 5 callersMethodcheckpoint_paths
See `BaseCheckpointer.checkpointer_paths`.
axlearn/common/checkpointer.py:1006
↓ 5 callersMethodcleanup
Terminate the upload process.
axlearn/cloud/common/uploader.py:99
↓ 5 callersMethodclose
Closes the RabbitMQ connection.
axlearn/cloud/common/event_queue.py:186
↓ 5 callersFunctioncomplete_partition_spec_tree
Adapted from flatten_axes(), but with a simplified API and more error logging and messages. Original: https://github.com/google/jax/blob/cdf4
axlearn/common/utils.py:670
↓ 5 callersMethodcompute
Computes the merge matrix. Args: state: As returned by `init_state` or `update`. Each tensor must be either a scalar or
axlearn/common/decoding.py:313
↓ 5 callersFunctionconfigure_logging
Configures the logging level and adds FilterDiscoveryLogging. Args: level: Logging verbosity.
axlearn/cloud/common/utils.py:38
↓ 5 callersMethoddefault_config
(cls)
axlearn/cloud/gcp/pathways_utils.py:454
↓ 5 callersMethoddefault_config
(cls)
axlearn/common/decoder.py:924
↓ 5 callersMethoddefine_flags
(cls, fv: flags.FlagValues)
axlearn/cloud/gcp/job.py:72
↓ 5 callersMethoddefine_flags
(cls, fv: flags.FlagValues)
axlearn/cloud/gcp/jobs/dataflow.py:141
↓ 5 callersFunctiondelete_node_pools
Delete node pools. See also: https://googleapis.github.io/google-api-python-client/docs/dyn/container_v1.projects.locations.clusters.nodePool
axlearn/cloud/gcp/node_pool.py:324
↓ 5 callersFunctiondownload_job_batch
Downloads a batch of jobs. Args: spec_dir: Directory to look for job specs. state_dir: Directory to look for job states.
axlearn/cloud/common/bastion.py:601
↓ 5 callersFunctionevent_queue_from_config
Create config for EventQueue. Args: flag_values: Flag configurations defined in gcp_settings. Returns: A configured `RabbitM
axlearn/cloud/gcp/event_queue.py:24
↓ 5 callersFunctionexpand_dim
(x: tf.Tensor)
axlearn/common/input_glue.py:222
↓ 5 callersMethodfake_tpu_metrics_v2
Create a fake libtpu server for testing.
axlearn/cloud/gcp/monitoring/tpu_client_test.py:265
↓ 5 callersMethodfans
Returns a dictionary with keys 'fan_in', 'fan_out', and 'fan_avg' containing the fan values for this parameter. The calculation is co
axlearn/common/base_layer.py:208
↓ 5 callersFunctionflatten_decoding_dim
Flattens the first two dimensions of a non-scalar array.
axlearn/common/decoding.py:57
↓ 5 callersFunctionfn
(*, action: str, flag_values: flags.FlagValues)
axlearn/cloud/gcp/jobs/launch_utils.py:81
↓ 5 callersFunctionfn
(fft: Tensor, *, dtype: jnp.dtype)
axlearn/audio/frontend.py:116
↓ 5 callersFunctionformat_project_utilization
Returns a human-readable per-resource utilization string. Args: utilization: Mapping from resource type to ProjectResourceUtilization.
axlearn/cloud/common/bastion.py:821
↓ 5 callersMethodforward
Computes projects for the given query. Uses {k,v}_proj from `kv_state`. See parent class for full docstring.
axlearn/common/attention.py:844
↓ 5 callersMethodforward
The forward function of DiTBlock. Args: input: input tensor with shape [batch_size, num_length, input_dim]. condition
axlearn/common/dit.py:585
↓ 5 callersFunctionfrom_state_dict
Restores the state of the given target using a state dict. Equivalent to `flax.serialization.from_state_dict`. Args: target: The obj
axlearn/common/serialization.py:84
↓ 5 callersFunctionget_devices_for_topology
Returns a list of XLA devices for the given topology. Args: topology: A string representing the TPU topology, e.g., "v4-8". Must be a key
axlearn/common/aot_compilation.py:295
↓ 5 callersFunctionget_gpu_dot_precision
Get the suitable DotAlgorithmPreset for the given dtype.
axlearn/common/flash_attention/common.py:555
↓ 5 callersFunctionget_gs_client
Creates or retrieves the GCS client.
axlearn/cloud/gcp/storage.py:25
↓ 5 callersMethodget_module_outputs
(self)
axlearn/common/module.py:1130
↓ 5 callersFunctionget_replica_head_hostname
Build replica manager hostname for given replica_id. Args: replica_id: The replica ID to build hostname for Returns: Hostnam
axlearn/ft/utils.py:381
↓ 5 callersMethodget_shared_module
Gets the shared module and state with the given name from a nearest ancestor. Shared modules should be registered via `_share_with_descendant
axlearn/common/module.py:1026
↓ 5 callersFunctionget_stochastic_depth_linear_rate
Get stochastic depth rate for the ith stage. Reference: Equation (4) in paper: https://arxiv.org/pdf/1603.09382.pdf Args: peak_r
axlearn/common/layers.py:1257
↓ 5 callersMethodinc
(self, x: Tensor)
axlearn/common/module_test.py:365
↓ 5 callersFunctioninfer_tpu_cores
Infer the number of TPU cores from the TPU type. Args: tpu_type: A string of the format {version}-{cores}[-{variant}]. -variant i
axlearn/cloud/gcp/tpu.py:34
↓ 5 callersFunctioninfer_tpu_workers
Infer the number of worker processes for the given TPU type. Args: tpu_type: A string of the format {version}-{cores}[-{variant}].
axlearn/cloud/gcp/tpu.py:49
↓ 5 callersMethodinit_forward_state
(self, batch_size)
axlearn/common/pipeline_test.py:63
↓ 5 callersMethodinit_forward_state
(self, batch_size)
axlearn/common/repeat_test.py:43
↓ 5 callersMethodinit_state
Initializes prefix merger state. Args: tokens: The initial live sequences, of shape [batch_size, num_decodes, max_decode_len].
axlearn/common/decoding.py:300
↓ 5 callersMethodis_host_idle
Check if the TPU device on the host are idle.
axlearn/common/monitoring/device_monitor.py:80
↓ 5 callersMethodis_kv_sharing
(cls, cfg: Config)
axlearn/common/attention.py:832
↓ 5 callersMethodlatest_checkpoint_path
Returns the most recent (highest step count) complete checkpoint under base dir. Args: base_dir: Path to checkpoints dir.
axlearn/common/checkpointer.py:839
↓ 5 callersFunctionmain
(argv: Sequence[str], *, flag_values: flags.FlagValues = FLAGS)
axlearn/cloud/gcp/jobs/cpu_runner.py:324
↓ 5 callersMethodmask
Return a copy of this instance where the values of the field have been masked using `optax.MaskedNode()` according to the leaves of `keep(sel
axlearn/common/update_transformation.py:254
↓ 5 callersFunctionmaybe_pad_inputs
Pads query, key, value, and segment_id tensors to align with block_size requirements. This function ensures that the sequence length dimension of
axlearn/common/flash_attention/common.py:573
↓ 5 callersFunctionmeasure
Measures the time it takes to execute the function on the GPU. This function is modified from https://github.com/jax-ml/jax/blob/978d35f69704
axlearn/common/flash_attention/gpu_attention_benchmark.py:163
↓ 5 callersFunctionmock_updates
Create an updates object with various semi-reasonable values.
axlearn/common/update_transformation_test.py:183
↓ 5 callersFunctionnegative_cosine_similarity_loss
Compute the negative cross similarity loss between predictions and targets. Args: predictions: A float Tensor of shape [..., dim].
axlearn/common/loss.py:1007
↓ 5 callersMethodpad_id
PAD token ID.
axlearn/common/input_grain_text.py:23
↓ 5 callersFunctionparse_step_from_dir
(step_dir: str)
axlearn/common/checkpointer.py:117
↓ 5 callersMethodpredict
Computes logits. Args: input_batch: A dict containing: inputs: A Tensor of shape [batch_size, num_frames, dim].
axlearn/audio/decoder_asr.py:302
↓ 5 callersFunctionprune_empty
Returns a shallow copy of the input tree with empty subtrees pruned. If a tree would be made empty by removal of its subtrees, it will also be pr
axlearn/common/utils.py:2068
↓ 5 callersFunctionreadfile
(path: str)
axlearn/common/file_system.py:165
↓ 5 callersFunctionregister_serialization_state
Register a type for serialization. Equivalent to `flax.serialization.from_state_dict`. Args: ty: The type to be registered.
axlearn/common/serialization.py:108
↓ 5 callersFunctionreshape_devices
Reshape device list based on mesh_shape. Args: devices: A list of devices. mesh_shape: Mesh shape of the devices. Missing specifi
axlearn/common/aot_compilation.py:331
↓ 5 callersMethodresnet18_config
(cls)
axlearn/vision/resnet.py:471
↓ 5 callersMethodresnet50_config
(cls)
axlearn/vision/resnet.py:483
↓ 5 callersMethodrestore
See `BaseCheckpointer.restore` docstring for details. A complete checkpoint is one with an "index" file, which is only written after the enti
axlearn/common/checkpointer.py:1218
↓ 5 callersMethodsetUp
(self)
axlearn/audio/aligner/ctc_aligner_test.py:300
↓ 5 callersMethodset_state
Sets checkpoint state. The input is a `msgpack`-deserialized object corresponding to restored checkpoint state.
axlearn/common/checkpointer.py:269
↓ 5 callersMethodsubmit_job
(self, job_name: str, *, job_spec_file: str)
axlearn/cloud/common/bastion.py:1685
↓ 5 callersMethodsweep
(self, jobs: dict[str, JobSpec])
axlearn/cloud/common/cleaner_test.py:30
↓ 5 callersFunctiontemp_chdir
Changes into a temp CWD only within the context.
axlearn/common/test_utils.py:761
↓ 5 callersFunctionto_state_dict
Returns a dictionary with the state of the given target. Equivalent to `flax.serialization.to_state_dict`. Args: target: The target
axlearn/common/serialization.py:54
↓ 5 callersFunctiontokenize
Tokenizes features. Args: ds: A Dataset. vocab: A vocab or a mapping from field to vocab. If a mapping is provided, f
axlearn/common/input_grain_text.py:100
← previousnext →501–600 of 7,799, ranked by callers