MCPcopy Create free account

hub / github.com/deepspeedai/DeepSpeed / functions

Functions15,767 in github.com/deepspeedai/DeepSpeed

↓ 3 callersMethodmake_attn_out_layer
Instantiates the linear projection layer for the attention output linear layer. This sets the `self.attn_out` attribute.
deepspeed/inference/v2/model_implementations/inference_transformer_base.py:476
↓ 3 callersFunctionmake_graph_from_schedule
(scheduled: List[Node])
deepspeed/compile/list_schedule.py:24
↓ 3 callersMethodmake_layer
(self, log, skip, score_apply)
tests/unit/module_inject/test_auto_ep_comm.py:1410
↓ 3 callersFunctionmake_metadata_filename
Make a filename for a metadata file. Arguments: rank: Rank of the file. n_ranks: Total number of ranks. Returns:
deepspeed/inference/v2/model_implementations/flat_model_helpers.py:73
↓ 3 callersMethodmake_qkv_layer
Instantiates the linear projection layer for the QKV linear layer. This sets the `self.qkv` attribute.
deepspeed/inference/v2/model_implementations/inference_transformer_base.py:363
↓ 3 callersMethodmake_unembedding_layer
Performs setup and creates an unembedding layer. This implementation assumes normalization prior to the LM head projection. If this d
deepspeed/inference/v2/model_implementations/inference_transformer_base.py:325
↓ 3 callersMethodmax_memory_cached
(self, device_index=None)
accelerator/hpu_accelerator.py:135
↓ 3 callersFunctionmaybe_copy_geglu
(module, sd, weight_quantizer, mp_replace, dst_name, src_names)
deepspeed/module_inject/policy.py:189
↓ 3 callersMethodmemory_cached
(self, device_index=None)
accelerator/hpu_accelerator.py:132
↓ 3 callersMethodmemory_reserved
(self, device_index=None)
accelerator/hpu_accelerator.py:147
↓ 3 callersMethodmodule_state_dict
(self, destination=None, prefix="", keep_vars=False, exclude_frozen_parameters=False)
deepspeed/runtime/engine.py:4217
↓ 3 callersFunctionmoe_test_helper
Helper function for validating the GEMM kernel for a single expert.
tests/unit/inference/v2/kernels/cutlass_ops/test_moe_gemm.py:53
↓ 3 callersFunctionnew_exchange_scope
A fresh sharing scope, normally one per model AutoEP converts. Layers sharing a scope share a buffer. Two models do not, even on one expert-p
deepspeed/module_inject/auto_ep_comm.py:79
↓ 3 callersFunctionnode_path_of
Classify by node, for processes numbered node by node.
deepspeed/checkpoint/affine_transfer_calibration.py:53
↓ 3 callersMethodnum_tensors
(self)
deepspeed/runtime/swap_tensor/optimizer_utils.py:74
↓ 3 callersFunctionoffload_adam_states_sync
()
deepspeed/compile/passes/offload_adam_states.py:156
↓ 3 callersFunctionoffload_optimizer_states
(optimizer, device, pin_memory=False, non_blocking=False)
deepspeed/runtime/zero/offload_states.py:17
↓ 3 callersMethodoperand_B_ref
Returns a TensorRef to the B operand
csrc/deepspeed4science/evoformer_attn/gemm/mma_from_smem.h:214
↓ 3 callersMethodoverlapping_partition_gradients_reduce_epilogue
(self)
deepspeed/runtime/zero/stage3.py:1679
↓ 3 callersFunctionparse_range_list
(range_str)
deepspeed/utils/numa.py:89
↓ 3 callersFunctionpatch_fake_tensor
()
deepspeed/compile/patch_fake_tensor.py:78
↓ 3 callersFunctionphysical_cpu_groups
Group available CPU IDs by the Linux package/core topology, without adding unavailable siblings.
deepspeed/runtime/reflow/reflow_utils.py:188
↓ 3 callersFunctionpinned_memory_summary
(tag: str = "")
deepspeed/utils/pin_memory_tracker.py:66
↓ 3 callersMethodplan_expert_transfer
Plan the copies that move the live expert parameters to ``target_placement``. ``target_placement`` is an AutoEP placement descriptor in the t
deepspeed/module_inject/auto_ep_layer.py:941
↓ 3 callersMethodpostscale_gradients
(self)
deepspeed/runtime/engine.py:1851
↓ 3 callersMethodprefer_triton_grouped_mm
(self)
accelerator/cuda_accelerator.py:275
↓ 3 callersFunctionprepare_tp_model
(hidden_dim, nlayers, linear_indices, allreduce_indices, group, return_global_copy=False)
tests/unit/v1/autotp/test_autotp_training.py:1932
↓ 3 callersFunctionpreset_name_for_hf_model_type
Return the AutoEP preset name for a supported HF model_type.
deepspeed/module_inject/auto_ep_presets/registry.py:86
↓ 3 callersMethodprint_model_profile
Prints the model graph with the measured profile attached to each module. Args: profile_step (int, optional): The global training
deepspeed/profiling/flops_profiler/profiler.py:286
↓ 3 callersMethodpwrite
csrc/aio/py_lib/deepspeed_py_io_handle.cpp:349
↓ 3 callersFunctionpytest_hack
This is an ugly hack to get the unittest suites to play nicely with pytest. Otherwise failed tests are not reported by pytest for some reason.
tests/model/run_sanity_check.py:20
↓ 3 callersFunctionqtorch_quantize
(input, exp_bits=4, man_bits=3, rounding="nearest", group_size=1024)
tests/unit/ops/fp_quantizer/test_fp_quant.py:23
↓ 3 callersMethodquantize
(self, param, groups, num_bits, quant_type)
tests/unit/runtime/zero/test_zeropp.py:54
↓ 3 callersMethodquantize
(self, tensor: Tensor)
deepspeed/inference/quantization/utils.py:56
↓ 3 callersMethodrange_pop
(self)
tests/unit/utils/test_nvtx.py:124
↓ 3 callersMethodrange_push
(self, msg)
tests/unit/utils/test_nvtx.py:120
↓ 3 callersMethodreduce_scatter_tensor
(self, output_tensor, input_tensor, op, group=None, async_op=False)
deepspeed/comm/ccl.py:104
↓ 3 callersMethodreenter_backward_if_needed
Re-enter backward context for subsequent phases in reentrant checkpointing.
deepspeed/runtime/base_optimizer.py:503
↓ 3 callersFunctionreflow_get_available_cpu_count
Affinity-aware available-core count (falls back to omp_get_num_procs()).
csrc/adam/reflow_cpu_adam_impl.cpp:36
↓ 3 callersMethodrefresh_fp32_params
(self)
deepspeed/runtime/zero/stage3.py:3953
↓ 3 callersMethodregister
(self, module)
deepspeed/runtime/rollout/hybrid_engine_rollout.py:85
↓ 3 callersMethodregisterGatheredParam
csrc/includes/deepcompile.h:419
↓ 3 callersFunctionregister_all_to_all_group
Make ``group`` reachable by name from inside the exchange operator, and return that name. Call this outside any compiled region, before the first
deepspeed/sequence/layer.py:322
↓ 3 callersMethodrelease_unswapped_gradients
(self)
deepspeed/runtime/swap_tensor/optimizer_utils.py:151
↓ 3 callersMethodrelease_workspace
(self)
deepspeed/ops/transformer/inference/op_binding/workspace.py:189
↓ 3 callersMethodreload
csrc/includes/deepcompile.h:330
↓ 3 callersFunctionremove_random_ltd_state_dict
(state_dict)
deepspeed/runtime/data_pipeline/data_routing/helper.py:38
↓ 3 callersFunctionreplace_dict
Replaces values in dict d with values in dict u. Args: d (dict): the target dict to overwrite u (dict): the dict containing the v
deepspeed/autotuning/utils.py:110
↓ 3 callersFunctionreplace_reduce_outputs_with_none
(graph: Graph)
deepspeed/compile/fx.py:50
↓ 3 callersFunctionreplicated_kv_shard_heads
Number of attention heads that bound one rank's shard, or None when unspecified.
deepspeed/module_inject/fusedqkv_utils.py:88
↓ 3 callersFunctionreplicated_kv_shard_meta
Metadata whose shard unit is query heads for replicated K/V, otherwise K/V heads. ``get_shard_size`` always reads ``num_kv_heads`` as the shard u
deepspeed/module_inject/fusedqkv_utils.py:76
↓ 3 callersFunctionreport_to_dict
A JSON-ready summary; ``include_messages`` adds the full per-round message list.
deepspeed/checkpoint/affine_transfer_analysis.py:232
↓ 3 callersFunctionrequires_offset
csrc/includes/quantization.h:20
↓ 3 callersMethodreserve
csrc/includes/deepcompile.h:149
↓ 3 callersMethodreset_peak_memory_stats
(self)
tests/unit/v1/compile/test_graph_profile.py:39
↓ 3 callersMethodreset_rss
(self)
accelerator/cpu_accelerator.py:287
↓ 3 callersFunctionresolve_preset_candidates
Resolve ordered preset candidates for AutoEP detection.
deepspeed/module_inject/auto_ep_presets/registry.py:157
↓ 3 callersFunctionrestore
()
tests/unit/v1/ops/triton_ops/test_autoep_fused_token_ops.py:108
↓ 3 callersFunctionrestore_combined_fused
``restore_combined`` with the weighted top-k reduction done by the fused kernel. The rows and the routing weights go through the same differentia
deepspeed/moe/ep_tp_dispatch.py:485
↓ 3 callersMethodrestore_slots
(self, slots: list)
deepspeed/autotuning/scheduler.py:271
↓ 3 callersMethodrun
(reflow)
tests/unit/v1/zero/test_reflow.py:1371
↓ 3 callersMethodrun
(self, class_tmpdir, val1, val2)
tests/unit/comm/test_dist.py:97
↓ 3 callersFunctionrun_forward
(ds_config, seq_len, atol=1e-2, verbose=False, test_bsz=None)
tests/unit/ops/accelerators/test_accelerator_forward.py:165
↓ 3 callersMethodrun_training_distributed
(self, config_dict)
tests/unit/runtime/zenflow/test_zf.py:125
↓ 3 callersFunctionsafe_get_local_optimizer_state
Get the local optimizer state partition of ZeRO-3 partitioned parameter in fp32 precision. Args: param (``torch.nn.Parameter``):
deepspeed/utils/tensor_fragment.py:302
↓ 3 callersFunctionsafe_update_full_grad_vectorized
Vectorized update of the partitioned gradients of a list of low-precision (e.g., fp16) parameters. To avoid precision issues, the upd
deepspeed/utils/tensor_fragment.py:343
↓ 3 callersMethodset_checkpoint_interval
(self, interval)
deepspeed/runtime/pipe/module.py:550
↓ 3 callersMethodset_module
(self, sd, module)
deepspeed/runtime/state_dict_factory.py:156
↓ 3 callersFunctionset_optimizer_flags
(config_class: DeepSpeedConfig, model: torch.nn.Module)
deepspeed/__init__.py:357
↓ 3 callersMethodset_state
(self, state)
deepspeed/runtime/data_pipeline/data_routing/scheduler.py:80
↓ 3 callersFunctionset_z3_leaf_modules_by_name
Sets a leaf flag for modules referenced by their names in ``model.named_modules()``. Args: model (torch.nn.Module): The model cont
deepspeed/utils/z3_leaf_module.py:89
↓ 3 callersFunctionset_z3_leaf_modules_by_suffix
Sets a leaf flag for modules referenced by suffixes of ``model.named_modules()`` names.
deepspeed/utils/z3_leaf_module.py:120
↓ 3 callersMethodsetup_buckets
(self)
deepspeed/runtime/zero/stage_1_and_2.py:3383
↓ 3 callersMethodshould_refresh_expected_hook_count
Return True when count_used_parameters_in_backward() should be re-evaluated.
deepspeed/runtime/base_optimizer.py:499
↓ 3 callersMethodshutdown
Release the captured decode graphs and their static caches. The rollout stays usable and captures again on the next graph rollout. Un
deepspeed/runtime/rollout/hybrid_engine_rollout.py:2481
↓ 3 callersMethodsimd_width
(self)
op_builder/builder.py:447
↓ 3 callersMethodskip_autotune
(self)
deepspeed/ops/transformer/inference/triton/matmul_ext.py:225
↓ 3 callersFunctionskip_on_device
()
tests/unit/v1/autotp/test_tp_plan_e2e.py:20
↓ 3 callersFunctionsoftmax
(input: torch.Tensor, mask: torch.Tensor = None, dim=-1)
deepspeed/ops/transformer/inference/triton/softmax.py:52
↓ 3 callersFunctionsparse_mla
Attention of every query over its selected latent keys, in the absorbed MLA form. Args: q: ``[tokens, heads, d_v + rope_dim]`` bf16, the
deepspeed/models/glm_moe_dsa/kernels/sparse_mla.py:31
↓ 3 callersMethodstep
Updates the optimizer with the learning rate for the last batch index. `self.last_batch_iteration` is treated as the last batch index.
deepspeed/runtime/lr_schedules.py:679
↓ 3 callersMethodstep
Not supporting closure.
deepspeed/runtime/zero/stage3.py:3199
↓ 3 callersMethodstore_with_byte_offset
Store a fragment to memory
csrc/deepspeed4science/evoformer_attn/iterators/predicated_tile_iterator_residual_last.h:837
↓ 3 callersFunctionstub_route_layer
A stand-in layer with only what _deepep_route reads, and staging off as in a default config.
tests/unit/module_inject/test_auto_ep_comm.py:339
↓ 3 callersFunctionsubchannel_linear
``F.linear`` with quantized forward and backward GEMMs.
deepspeed/runtime/quantization/subchannel.py:306
↓ 3 callersMethodswap_out_optimizer_state
(self, parameter, async_swap)
deepspeed/runtime/swap_tensor/pipelined_optimizer_swapper.py:129
↓ 3 callersFunctionswiglu_backward
The gradients of :func:`swiglu` with respect to ``gate`` and ``up``, as its own backward computes them. For callers that run the forward inside t
deepspeed/ops/triton_ops/swiglu_triton.py:239
↓ 3 callersFunctionswiglu_clamped_packed
:func:`swiglu_clamped` of ``gate`` and ``up`` packed side by side in one ``[..., 2 * I]`` tensor, the output of one gate+up GEMM, read in place as
deepspeed/ops/triton_ops/swiglu_triton.py:504
↓ 3 callersFunctionswiglu_packed_backward
The gradient of :func:`swiglu_packed` with respect to ``gate_up``, as its own backward computes it.
deepspeed/ops/triton_ops/swiglu_triton.py:252
↓ 3 callersMethodsynchronize_reads
(self)
deepspeed/runtime/swap_tensor/partitioned_param_swapper.py:213
↓ 3 callersFunctiontensors_to_keep_in_fp32
(full name, tensor, is_buffer) for every floating parameter and buffer whose full name matches.
deepspeed/runtime/keep_in_fp32.py:65
↓ 3 callersMethodto_meta
Returns a torch.LongTensor that encodes partitioning information. Can be used along with ``data()`` to serialize a ``PartitionedTensor`` for
deepspeed/runtime/utils.py:810
↓ 3 callersMethodtrain
(buffer_bytes)
tests/unit/v1/ops/muon/test_muon.py:237
↓ 3 callersMethodtrain
(engine, data_loader, steps)
tests/unit/runtime/test_data_efficiency.py:243
↓ 3 callersMethodtrain
r
deepspeed/runtime/engine.py:3058
↓ 3 callersMethodtransform_gate_param
Perform any necessary transformations of the gate parameter. Args: param (torch.Tensor): gate_w (shape: [num_experts, mo
deepspeed/inference/v2/modules/interfaces/moe_base.py:35
↓ 3 callersMethodtransform_mlp_1_param
Shards the first MLP parameter and passes it to the underlying implementation for any necessary transformations. Args:
deepspeed/inference/v2/model_implementations/inference_transformer_base.py:531
↓ 3 callersFunctiontrim_mean
Compute the trimmed mean of a list of numbers. Args: data (list): List of numbers. trim_percent (float): Percentage of data to tr
deepspeed/utils/timer.py:321
↓ 3 callersFunctiontriton_backend_available
()
deepspeed/runtime/chunked_cross_entropy.py:70
↓ 3 callersMethodunregisterGatheredParam
csrc/includes/deepcompile.h:424
← previousnext →1,901–2,000 of 15,767, ranked by callers