repo stringlengths 7 90 | file_url stringlengths 81 315 | file_path stringlengths 4 228 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 14:38:15 2026-01-05 02:33:18 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/checkpoint_engine/__init__.py | deepspeed/runtime/checkpoint_engine/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
from .fast_checkpoint_engine import FastCheckpointEngine
from .torch_checkpoint_engine import TorchCheckpointEngine
from .decoupled_checkpoint_engine import DecoupledCheckpointEng... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/checkpoint_engine/decoupled_checkpoint_engine.py | deepspeed/runtime/checkpoint_engine/decoupled_checkpoint_engine.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.multiprocessing as mp
from deepspeed.runtime.checkpoint_engine.checkpoint_engine import \
CheckpointEngine, CheckpointCommitInfo
from deepspeed.runtime.checkpoint_engine.fast_checkpoint_engine i... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/offload_states.py | deepspeed/runtime/zero/offload_states.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from typing import Set
import torch
from deepspeed.accelerator import get_accelerator
from deepspeed.runtime.zero.offload_config import OffloadStateTypeEnum
def _make_offload_state_key(key):
return f"{key}_offload_buf... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/stage_1_and_2.py | deepspeed/runtime/zero/stage_1_and_2.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed import comm as dist
from packaging import version as pkg_version
from collections import OrderedDict, defaultdict
from dataclasses import dataclass, field
from typing import List, Dict, Set
from ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/mics.py | deepspeed/runtime/zero/mics.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
from typing import List
import deepspeed
import torch
from deepspeed import comm as dist
from deepspeed.runtime.zer... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/offload_config.py | deepspeed/runtime/zero/offload_config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from enum import Enum
from pathlib import Path
from pydantic import Field, model_validator
from typing import Optional
from deepspeed.runtime.config_utils import DeepSpeedConfigModel, pp_int
class OffloadDeviceEnum(str, E... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/leaf_module_config.py | deepspeed/runtime/zero/leaf_module_config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from typing import List
from pydantic import Field, model_validator
from deepspeed.runtime.config_utils import DeepSpeedConfigModel
DEFAULT_LEAF_MODULE_CLASSES: List[str] = [
"transformers.models.mixtral.modeling_mixtr... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/stage3.py | deepspeed/runtime/zero/stage3.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import sys
import gc
import collections
import itertools
from typing import Deque, Dict, Set, List, Tuple, Container, Optional
from contextlib import contextmanager
from dataclasses import dataclass, field
from deepspeed im... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/parameter_offload.py | deepspeed/runtime/zero/parameter_offload.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import sys
import torch
from collections import OrderedDict
from deepspeed.utils import z3_leaf_module, set_z3_leaf_module
from deepspeed.runtime.utils import see_memory_usage
from deepspeed.runtime.zero.utils import apply_t... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/utils.py | deepspeed/runtime/zero/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import os
from typing import List, Tuple
import torch
from deepspeed import comm as dist
from deepspeed.utils import logger
from deepspeed.ops.adam import DeepSpeedCPUAdam
from deepspeed.ops.adagrad import DeepSpeedCPUAdagr... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/partition_parameters.py | deepspeed/runtime/zero/partition_parameters.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
import os
import types
from typing import Callable, Iterable
from enum import Enum
import functools
import itertools
from typing import List
from collections import defaultdict
import logging
import torch
from to... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/tiling.py | deepspeed/runtime/zero/tiling.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import deepspeed
from deepspeed.runtime.utils import partition_uniform as partition
def split_tensor_along_last_dim(tensor, partitions, contiguous_split_chunks=False):
"""Split a tensor along its last dime... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/config.py | deepspeed/runtime/zero/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import sys
from typing import Optional, Dict, Any
from enum import Enum
from pydantic import Field, model_validator
from deepspeed.runtime.config_utils import get_scalar_param, pp_int, DeepSpeedConfigModel
from deepspeed.uti... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/mics_utils.py | deepspeed/runtime/zero/mics_utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0
import os
from dataclasses import dataclass
from typing import List
import numpy as np
import torch
from torch impo... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/__init__.py | deepspeed/runtime/zero/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .partition_parameters import ZeroParamType
from .partition_parameters import ZeroParamStatus
from .partition_parameters import Init
from .partition_parameters import GatheredParameters
from .partition_parameters import ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/partitioned_param_coordinator.py | deepspeed/runtime/zero/partitioned_param_coordinator.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from dataclasses import dataclass
import collections
from collections import UserDict
from typing import Deque, Set
from deepspeed import comm as dist
from deepspeed.utils import z3_leaf_module
from deepspeed.utils.logging ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/test.py | deepspeed/runtime/zero/test.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.runtime.zero.contiguous_memory_allocator import ContiguousMemoryAllocator
def test1():
mem = ContiguousMemoryAllocator(1024, torch.half, 'cpu')
mem.print_allocation(resolution=100)
a... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/linear.py | deepspeed/runtime/zero/linear.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
#Linear Module to use with ZeRO Stage 3 to allow for parameter memory release
#after the module execution during forward
#Instead of saving variables using save_for_backward, we save variable ids
#Allowing us to retrieve the... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/partitioned_param_profiler.py | deepspeed/runtime/zero/partitioned_param_profiler.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from dataclasses import dataclass
from deepspeed.utils import log_dist
class PartitionedParameterProfiler(object):
@dataclass
class EventCounter:
name: str
count: int
num_elem: int
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/contiguous_memory_allocator.py | deepspeed/runtime/zero/contiguous_memory_allocator.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed import comm as dist
def print_rank_0(message):
if dist.get_rank() == 0:
print(message)
class ContiguousMemoryAllocator(object):
def __init__(self, size, dtype, device):
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/muon/__init__.py | deepspeed/runtime/zero/muon/__init__.py | # Copyright (c) 2025 Peng Du and Zhipeng Wang
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/muon/original_muon.py | deepspeed/runtime/zero/muon/original_muon.py | # Copyright (c) 2024 Keller Jordan
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
MIT License
Copyright (c) 2024 Keller Jordan
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zero/muon/muon_optimizer.py | deepspeed/runtime/zero/muon/muon_optimizer.py | # Copyright (c) 2025 Peng Du and Zhipeng Wang
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
try:
from deepspeed.runtime.zero.muon.original_muon import MuonWithAuxAdam as BaseMuonWithAuxAdam
from deepspeed.runtime.zero.muon.original_muon import adam_update
except ImportError:
pass
c... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/constants.py | deepspeed/runtime/swap_tensor/constants.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
AIO
"""
AIO_FORMAT = '''
"aio": {
"block_size": 1048576,
"queue_depth": 8,
"intra_op_parallelism": 1,
"single_submit": false,
"overlap_events": true,
"use_gds": false
}
'''
AIO = "aio"
AIO_BLOCK_SIZE = "block_... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/partitioned_param_swapper.py | deepspeed/runtime/swap_tensor/partitioned_param_swapper.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping tensors to/from (NVMe) storage devices.
"""
import os
import shutil
from enum import Enum
import torch
from deepspeed import comm as dist
from deepspeed.accelerator import get_accelerator
from d... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/partitioned_optimizer_swapper.py | deepspeed/runtime/swap_tensor/partitioned_optimizer_swapper.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
from deepspeed.utils.logging import logger
from deepspeed.ops.op_builder import AsyncIOBuilder
from deepspeed import comm as dist
from deep... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/utils.py | deepspeed/runtime/swap_tensor/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping tensors to/from (NVMe) storage devices.
"""
import torch
from deepspeed.utils.logging import logger
from deepspeed.accelerator import get_accelerator
from deepspeed import comm as dist
MIN_AIO... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/__init__.py | deepspeed/runtime/swap_tensor/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .utils import MIN_SWAPPABLE_BYTES
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/aio_config.py | deepspeed/runtime/swap_tensor/aio_config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.runtime.config_utils import get_scalar_param
from deepspeed.runtime.swap_tensor.constants import *
from deepspeed.accelerator import get_accelerator
AIO_DEFAULT_DICT = {
AIO_BLOCK_SIZE: AIO_BLOCK_SIZE_DEF... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/pipelined_optimizer_swapper.py | deepspeed/runtime/swap_tensor/pipelined_optimizer_swapper.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
from deepspeed.ops.op_builder import AsyncIOBuilder
from deepspeed import comm as dist
import torch
from deepspeed.runtime.swap_tensor.cons... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/optimizer_utils.py | deepspeed/runtime/swap_tensor/optimizer_utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping tensors to/from (NVMe) storage devices.
"""
import os
import torch
from deepspeed import comm as dist
from deepspeed.utils.logging import logger
from deepspeed.runtime.swap_tensor.constants imp... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/swap_tensor/async_swapper.py | deepspeed/runtime/swap_tensor/async_swapper.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping tensors to/from (NVMe) storage devices.
"""
import torch
from deepspeed import comm as dist
from deepspeed.utils.logging import logger
from deepspeed.runtime.swap_tensor.utils import swap_out_te... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/tensor_parallel/tp_manager.py | deepspeed/runtime/tensor_parallel/tp_manager.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from .config import TPTrainingConfig, TPConfig
from deepspeed.utils import groups
import deepspeed.comm as dist
class TpTrainingManager():
def __init__(self, model, tp_size, dtype):
self.module = ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/tensor_parallel/config.py | deepspeed/runtime/tensor_parallel/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from enum import Enum
from deepspeed.runtime.config_utils import DeepSpeedConfigModel
import torch
from pydantic import Field
from typing import Optional
class AUTOTP_MODE(Enum):
TRAINING = "TRAINING"
INFERENCE = "... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/tensor_parallel/__init__.py | deepspeed/runtime/tensor_parallel/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .config import AUTOTP_MODE, get_tensor_parallel_config
from .tp_manager import TpTrainingManager
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/comm/mpi.py | deepspeed/runtime/comm/mpi.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import cupy
import time
import numpy as np
from mpi4py import MPI
from deepspeed.runtime.compression.cupy import CupyBackend
class MpiBackend(object):
def __init__(self, cuda_aware):
self.comm = ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/comm/hccl.py | deepspeed/runtime/comm/hccl.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import numpy as np
import torch
import torch_npu
import deepspeed.comm as dist
class HcclBackend(object):
def __init__(self, mpu=None):
if mpu is None:
self.world_group = dist.new_group(ranks=range... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/comm/nccl.py | deepspeed/runtime/comm/nccl.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed import comm as dist
import cupy
import numpy as np
from deepspeed.runtime.compression.cupy import CupyBackend
from deepspeed.utils.torch import required_torch_version
from deepspeed.accelerator i... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/comm/__init__.py | deepspeed/runtime/comm/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/comm/coalesced_collectives.py | deepspeed/runtime/comm/coalesced_collectives.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
batched collective operations for overhead amortization and better
bandwidth utilization
"""
import math
from typing import List, Any
import torch
from torch import Tensor
from deepspeed import comm as dist
from deepspee... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/comm/compressed.py | deepspeed/runtime/comm/compressed.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import numpy as np
import torch
import deepspeed.comm as dist
from deepspeed.accelerator import get_accelerator
from deepspeed.ops.op_builder import PackbitsBuilder
class CompressedBackend(object):
def __init__(self, ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/activation_checkpointing/checkpointing.py | deepspeed/runtime/activation_checkpointing/checkpointing.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Use to partition the activations stored for backward propagation
Therefore reduces the memory consumption
Also implements CPU checkpointing and contiguous memory checkpointing
Reduces memory consumption and memory fragmen... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/activation_checkpointing/config.py | deepspeed/runtime/activation_checkpointing/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.runtime.config_utils import get_scalar_param, DeepSpeedConfigObject
#########################################
# DeepSpeed Activation Checkpointing
#########################################
# Activation Check... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/activation_checkpointing/__init__.py | deepspeed/runtime/activation_checkpointing/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/domino/async_linear.py | deepspeed/runtime/domino/async_linear.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# Adapted from https://github.com/NVIDIA/Megatron-LM/blob/23.08/megatron/core/tensor_parallel/layers.py
import torch
from torch.nn.parameter import Parameter
import torch.nn.functional as F
from deepspeed.accelerator import... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/domino/__init__.py | deepspeed/runtime/domino/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/domino/transformer.py | deepspeed/runtime/domino/transformer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
import enum
import deepspeed.comm as dist
from .async_linear import DominoAsyncColumnParallelLinear, RowParallelLinearNoComm
class LayerType(enum.Enum):
encoder = 1
dec... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/compression/cupy.py | deepspeed/runtime/compression/cupy.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import cupy
from torch.utils.dlpack import to_dlpack
from torch.utils.dlpack import from_dlpack
class CupyBackend(object):
def __init__(self):
pass
def torch2cupy(self, tensor):
return cupy.from_d... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/compression/__init__.py | deepspeed/runtime/compression/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zenflow/zenflow_config.py | deepspeed/runtime/zenflow/zenflow_config.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from pydantic import Field, model_validator
from typing import Optional, Union
from deepspeed.runtime.config_utils import DeepSpeedConfigModel
class ZenFlowConfig(DeepSpeedConfigModel):
"""Configuration options for ZenFlow o... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zenflow/engine_stage3.py | deepspeed/runtime/zenflow/engine_stage3.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.runtime.zero.partition_parameters import *
import torch
import math
from deepspeed import comm as dist
from deepspeed.utils import logger
from deepspeed.ops.adam import ZenFlowSelectiveAdamW_stage3
from deepspeed.ru... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zenflow/__init__.py | deepspeed/runtime/zenflow/__init__.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zenflow/zenflow_stage_1_and_2.py | deepspeed/runtime/zenflow/zenflow_stage_1_and_2.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed import comm as dist
from deepspeed.runtime.zero.stage_1_and_2 import DeepSpeedZeroOptimizer
from deepspeed.runtime.zenflow.zenflow_utils import start_optimizer_process
from deepspeed.runtime.utils impor... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zenflow/engine.py | deepspeed/runtime/zenflow/engine.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed import comm as dist
from typing import TYPE_CHECKING
from deepspeed.utils.torch import required_torch_version
if TYPE_CHECKING:
from deepspeed.runtime.engine import DeepSpeedEngine
def configure_zenflow(engine... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/zenflow/zenflow_utils.py | deepspeed/runtime/zenflow/zenflow_utils.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import os
import math
import torch
import psutil
from deepspeed import comm as dist
from deepspeed.accelerator import get_accelerator
def _flatten_dense_tensors(tensors):
"""Flatten dense tensors into a contiguous 1D buffer. ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/curriculum_scheduler.py | deepspeed/runtime/data_pipeline/curriculum_scheduler.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
from deepspeed.utils import logger
from .constants import *
class CurriculumScheduler(object):
def __init__(self, config):
super().__init__()
self.state = {}
assert CURRICULUM_LEARN... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/constants.py | deepspeed/runtime/data_pipeline/constants.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Data efficiency library
See sample config at https://www.deepspeed.ai/docs/config-json/data-efficiency
"""
DATA_EFFICIENCY = "data_efficiency"
DATA_EFFICIENCY_ENABLED = "enabled"
DATA_EFFICIENCY_ENABLED_DEFAULT = False
D... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/config.py | deepspeed/runtime/data_pipeline/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .constants import *
import copy
from ..config_utils import get_scalar_param
# TODO: Reducing config verbosity by returning None or {} when disabled.
# One challenge is that we still need to somehow include the default... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/__init__.py | deepspeed/runtime/data_pipeline/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_sampling/data_analyzer.py | deepspeed/runtime/data_pipeline/data_sampling/data_analyzer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import os
import sys
from collections import defaultdict
import csv
import time
from multiprocessing import Process, Manager
import numpy as np
import torch
from torch.utils.data import BatchSampler, SequentialSampler, DataL... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_sampling/variable_batch_size_and_lr.py | deepspeed/runtime/data_pipeline/data_sampling/variable_batch_size_and_lr.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# support/questions/maintenance: github user @brunomaga or @deepspeedai/deepspeed
import random
import os
import math
import numpy as np
from torch.optim.lr_scheduler import LRScheduler
from torch.optim.optimizer import Opt... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_sampling/data_sampler.py | deepspeed/runtime/data_pipeline/data_sampling/data_sampler.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
coding=utf-8
Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obta... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_sampling/utils.py | deepspeed/runtime/data_pipeline/data_sampling/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import numpy as np
from deepspeed.utils import logger
from .indexed_dataset import MMapIndexedDatasetBuilder
def find_fit_int_dtype(min_value, max_value):
if min_value >= 0:
if max_value <= 255:
re... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_sampling/__init__.py | deepspeed/runtime/data_pipeline/data_sampling/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_sampling/indexed_dataset.py | deepspeed/runtime/data_pipeline/data_sampling/indexed_dataset.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Part of this code was adopted from https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/data/indexed_dataset.py
"""
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT li... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_routing/helper.py | deepspeed/runtime/data_pipeline/data_routing/helper.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .basic_layer import RandomLayerTokenDrop
from collections import OrderedDict
from deepspeed.compression.helper import recursive_getattr, recursive_setattr
def convert_to_random_ltd(model, convert_type):
if hasattr... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_routing/basic_layer.py | deepspeed/runtime/data_pipeline/data_routing/basic_layer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.utils import logger
from torch import Tensor
from torch.nn import Module
from ..constants import *
from deepspeed.ops.random_ltd.dropping_utils import gpt_sample_tokens, bert_sample_tokens, GatherTokens, Scatt... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_routing/utils.py | deepspeed/runtime/data_pipeline/data_routing/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
def bsh_decoder_gather(reserved_length, hidden_states, mask):
# random-layer-token-drop
rand_list = []
part_hidden_states = [] # batch, seq, hidden ## different from megatron
for k in range(h... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_routing/__init__.py | deepspeed/runtime/data_pipeline/data_routing/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/data_pipeline/data_routing/scheduler.py | deepspeed/runtime/data_pipeline/data_routing/scheduler.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
from deepspeed.utils import logger
# from deepspeed.runtime.lr_schedules import WarmupLR
from ..constants import *
#####based on the paper random-ltd: https://arxiv.org/abs/2211.11586
class BaseScheduler(obje... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/sequence_parallel/parallel_state_sp.py | deepspeed/runtime/sequence_parallel/parallel_state_sp.py | # Copyright (c) The DeepSpeed Contributors
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
This is a slimmed-down version of parallel_state.py (mpu) from Megatron-Deepspeed
"""
from deepspeed import comm as dist
# Sequence parallel groups to handle both data and sequence parallelisms.
# These groups are u... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/sequence_parallel/ulysses_sp.py | deepspeed/runtime/sequence_parallel/ulysses_sp.py | # Copyright (c) The DeepSpeed Contributors
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
*** Arctic Long Sequence Training (ALST) components ***
1. Ulysses Sequence Parallelism for HF Transformers implements an efficient way of training on long sequences by employing sequence parallelism and attention he... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/sequence_parallel/__init__.py | deepspeed/runtime/sequence_parallel/__init__.py | # Copyright (c) The DeepSpeed Contributors
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/pipe/topology.py | deepspeed/runtime/pipe/topology.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed import comm as dist
from collections import namedtuple
from itertools import product as cartesian_product
class ProcessTopology:
""" Manages the mapping of n-dimensional Cartesian coordinates to linear
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/pipe/module.py | deepspeed/runtime/pipe/module.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import os
import glob
import re as regex
from functools import partial
import torch
import torch.nn as nn
from deepspeed import comm as dist
from deepspeed.utils import logger
from .. import utils as ds_utils
from ..acti... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/pipe/schedule.py | deepspeed/runtime/pipe/schedule.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from ..utils import call_to_str
from abc import ABC, abstractmethod
class PipeSchedule(ABC):
"""Directs the execution of a pipeline engine by generating sequences of
:class:`PipeInstruction`.
Schedules are ge... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/pipe/__init__.py | deepspeed/runtime/pipe/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .module import PipelineModule, LayerSpec, TiedLayerSpec
from .topology import ProcessTopology
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/pipe/engine.py | deepspeed/runtime/pipe/engine.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from types import MethodType
from collections import OrderedDict
from functools import reduce
from operator import mul
import torch
from deepspeed import comm as dist
from deepspeed.utils import logger
from deepspeed.utils... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/pipe/p2p.py | deepspeed/runtime/pipe/p2p.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import msgpack
import typing
import torch
from deepspeed import comm as dist
from deepspeed.utils.torch import required_torch_version
from deepspeed.accelerator import get_accelerator
_groups = None
_grid = None
_async =... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/fused_optimizer.py | deepspeed/runtime/fp16/fused_optimizer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Copyright NVIDIA/apex
This file is adapted from FP16_Optimizer in NVIDIA/apex
"""
import torch
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
from deepspeed.runtime.base_optimizer import DeepSp... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/unfused_optimizer.py | deepspeed/runtime/fp16/unfused_optimizer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Copyright NVIDIA/apex
This file is adapted from FP16_Optimizer in NVIDIA/apex
"""
from deepspeed.moe.utils import split_params_grads_into_shared_and_expert_params
import torch
from torch._utils import _flatten_dense_tens... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/loss_scaler.py | deepspeed/runtime/fp16/loss_scaler.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of t... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/__init__.py | deepspeed/runtime/fp16/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
'''Copyright The Microsoft DeepSpeed Team'''
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/onebit/adam.py | deepspeed/runtime/fp16/onebit/adam.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import types
import torch
import numpy as np
from deepspeed.accelerator import get_accelerator
from deepspeed.utils.torch import required_torch_version
from deepspeed import comm as dist
class OnebitAdam(torch.optim.Optimi... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/onebit/zoadam.py | deepspeed/runtime/fp16/onebit/zoadam.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import types
import torch
import numpy as np
from deepspeed.accelerator import get_accelerator
from deepspeed.utils.torch import required_torch_version
from deepspeed import comm as dist
class ZeroOneAdam(torch.optim.Optim... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/onebit/__init__.py | deepspeed/runtime/fp16/onebit/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .adam import OnebitAdam
from .lamb import OnebitLamb
from .zoadam import ZeroOneAdam
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/fp16/onebit/lamb.py | deepspeed/runtime/fp16/onebit/lamb.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import types
import torch
import numpy as np
from deepspeed import comm as dist
from deepspeed.utils.torch import required_torch_version
from torch._utils import _flatten_dense_tensors, _unflatten_dense_tensors
from deepspee... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/model_checkpointing/constants.py | deepspeed/runtime/model_checkpointing/constants.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
#########################################
# Validation modes
#########################################
class ValidationMode:
WARN = "WARN"
IGNORE = "IGNORE"
FAIL = "FAIL"
######################################... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/model_checkpointing/utils.py | deepspeed/runtime/model_checkpointing/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import os
from dataclasses import dataclass
from deepspeed import comm as dist
from deepspeed.constants import CROSS_RANK, CROSS_SIZE, LOCAL_RANK
from .data_parallel_writer_factory import DataParallelWriterFactory
# TODO: p... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/model_checkpointing/writer_factory.py | deepspeed/runtime/model_checkpointing/writer_factory.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.ops.op_builder import AsyncIOBuilder, GDSBuilder
from deepspeed.io import MockFileWriter, PyFileWriter, FastFileWriter, FastFileWriterConfig
from deepspeed.runtime.swap_tensor.constants import *
f... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/model_checkpointing/config.py | deepspeed/runtime/model_checkpointing/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.runtime.config_utils import get_scalar_param
from .constants import *
VALID_VALUES = {
CHECKPOINT_TAG_VALIDATION: CHECKPOINT_TAG_VALIDATION_MODES,
CHECKPOINT_WRITER_TYPE: CHECKPOINT_WRITER_TYPES,
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/model_checkpointing/data_parallel_writer_factory.py | deepspeed/runtime/model_checkpointing/data_parallel_writer_factory.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from dataclasses import dataclass
from deepspeed.checkpoint.reshape_utils import partition_data
from deepspeed.runtime.zero.config import ZeroStageEnum
from .constants import *
@dataclass
class DataParallelWriterConfig(obj... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/runtime/model_checkpointing/__init__.py | deepspeed/runtime/model_checkpointing/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .constants import *
from .writer_factory import CheckpointWriterFactory
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/perf_run_sweep.py | deepspeed/nvme/perf_run_sweep.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
import os
import sys
import argparse
import json
import itertools
import shutil
from deepspeed.ops.op_builder import AsyncIOBuilder, GDSBuil... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/io_engine.py | deepspeed/nvme/io_engine.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import time
from multiprocessing import Pool, Barrier
from .ds_aio_constants import AIO_BASIC, TORCH_FAST_IO, TORCH_IO
from .test_ds_aio_utils import report_results, task_log, task_barrier
from .ds_aio_handle import AIOHand... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/ds_aio_constants.py | deepspeed/nvme/ds_aio_constants.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
AIO_HANDLE = 'aio_handle'
AIO_BASIC = 'aio_basic'
TORCH_IO = 'torch_io'
TORCH_FAST_IO = 'torch_fastio'
VALID_ENGINES = [AIO_HANDLE, AIO_BASIC, TORCH_IO, TORCH_FAST_IO]
BUFFER = 'buffer'
BOUNCE_BUFFER = 'bounce_buffer'
NUM_B... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/ds_aio_args.py | deepspeed/nvme/ds_aio_args.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
import argparse
import os
from .test_ds_aio_utils import refine_integer_value
from .ds_aio_constants import AIO_HANDLE, AIO_BASIC, TORCH_FAS... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/test_ds_aio_utils.py | deepspeed/nvme/test_ds_aio_utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
import os
from .ds_aio_job import Job, run_job
import torch
from deepspeed.accelerator import get_accelerator
BYTES_PER_GB = 1024**3
BYTES_... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/perf_sweep_utils.py | deepspeed/nvme/perf_sweep_utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
SCRIPT_PREFIX = '_aio_bench'
WRITE_OP_DESC = 'write'
READ_OP_DESC = 'read'
READ_IO_DIR = f'{SCRIPT_PREFIX}_{READ_OP_DESC}_io'
WRITE_IO_DIR = f'{SCRIPT_PREFIX}_{WRITE_OP_DESC}_io'
BENCH_LOG_DIR = f'{SCRIPT_PREFIX}_logs'
READ_... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nvme/validate_async_io.py | deepspeed/nvme/validate_async_io.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Functionality of swapping optimizer tensors to/from (NVMe) storage devices.
"""
from deepspeed.ops.op_builder import AsyncIOBuilder
assert AsyncIOBuilder().is_compatible()
assert AsyncIOBuilder().load()
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.