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/ops/compile/__init__.py | deepspeed/ops/compile/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from ..op_builder import DeepCompileBuilder
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/softmax.py | deepspeed/ops/sparse_attention/softmax.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# DeepSpeed note, code taken & adapted from commit 9aa94789f13ada713af36cfd8cca2fc9a7f6b79a
# https://github.com/ptillet/torch-blocksparse/blob/master/torch_blocksparse/matmul.py
import torch
import triton
import triton.la... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/sparse_attention_utils.py | deepspeed/ops/sparse_attention/sparse_attention_utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from torch.nn import functional as F
from deepspeed.ops.sparse_attention import BertSparseSelfAttention, SparsityConfig
'''
This file contains few utility functions to handle adapting pretrained model with spars... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/bert_sparse_self_attention.py | deepspeed/ops/sparse_attention/bert_sparse_self_attention.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from torch import nn
from deepspeed.ops.sparse_attention import SparseSelfAttention, FixedSparsityConfig
class BertSparseSelfAttention(nn.Module):
"""Implements Sparse Self Attention layer of Bert model based on https:... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/__init__.py | deepspeed/ops/sparse_attention/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .sparsity_config import SparsityConfig, DenseSparsityConfig, FixedSparsityConfig, VariableSparsityConfig, BigBirdSparsityConfig, BSLongformerSparsityConfig, LocalSlidingWindowSparsityConfig
from .sparse_self_attention i... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/sparsity_config.py | deepspeed/ops/sparse_attention/sparsity_config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import random
class SparsityConfig:
"""Abstract Configuration class to store `sparsity configuration of a self attention layer`.
It contains shared property of different block-sparse sparsity patterns.... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/sparse_self_attention.py | deepspeed/ops/sparse_attention/sparse_self_attention.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch.nn as nn
import torch
from torch import distributed as dist
from deepspeed.ops.sparse_attention import SparsityConfig
class SparseSelfAttention(nn.Module):
"""Implements an efficient Sparse Self Attention ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/matmul.py | deepspeed/ops/sparse_attention/matmul.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# DeepSpeed note, code taken & adapted from commit 9aa94789f13ada713af36cfd8cca2fc9a7f6b79a
# https://github.com/ptillet/torch-blocksparse/blob/master/torch_blocksparse/matmul.py
import importlib
import torch
import triton
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/sparse_attention/trsrc/__init__.py | deepspeed/ops/sparse_attention/trsrc/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import sys
import os
def _build_file_index(directory, suffix='.tr'):
"""Build an index of source files and their basenames in a given directory.
Args:
directory (string): the directory to index
suf... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/deepspeed4science/__init__.py | deepspeed/ops/deepspeed4science/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .evoformer_attn import DS4Sci_EvoformerAttention, EvoformerFusedAttention
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/deepspeed4science/evoformer_attn.py | deepspeed/ops/deepspeed4science/evoformer_attn.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import numpy as np
from deepspeed.ops.op_builder import EvoformerAttnBuilder
from deepspeed.accelerator import get_accelerator
kernel_ = None
def _attention(Q, K, V, bias1, bias2):
assert Q.shape[-3] > 16... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adam/zenflow_torch_adam.py | deepspeed/ops/adam/zenflow_torch_adam.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from typing import cast, List, Optional, Tuple, Union
from torch import Tensor
from deepspeed.utils.torch import required_torch_version
# Check if we have PyTorch >= 2.0 for ZenFlow features
_ZENFLOW_AVAILABLE = requ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adam/fused_adam.py | deepspeed/ops/adam/fused_adam.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Copyright NVIDIA/apex
This file is adapted from fused adam in NVIDIA/apex, commit 6bd01c4
"""
import torch
from .multi_tensor_apply import MultiTensorApply
multi_tensor_applier = MultiTensorApply(2048 * 32)
from deepspe... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adam/__init__.py | deepspeed/ops/adam/__init__.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .cpu_adam import DeepSpeedCPUAdam
from .fused_adam import FusedAdam
from .zenflow_cpu_adam import ZenFlowCPUAdam
from .zenflow_torch_adam import ZenFlowSelectiveAdamW, ZenFlowSelectiveAdamW_stage3
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adam/multi_tensor_apply.py | deepspeed/ops/adam/multi_tensor_apply.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Copyright NVIDIA/apex
This file is adapted from NVIDIA/apex, commit a109f85
"""
class MultiTensorApply(object):
def __init__(self, chunk_size):
self.chunk_size = chunk_size
def __call__(self, op, noop_... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adam/zenflow_cpu_adam.py | deepspeed/ops/adam/zenflow_cpu_adam.py | # Copyright (c) DeepSpeed Team.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.ops.adam import DeepSpeedCPUAdam
import torch
class ZenFlowCPUAdam(DeepSpeedCPUAdam):
def __init__(self, *args, overlap_step=False, **kwargs):
super(ZenFlowCPUAdam, self).__init__(*args, **kwargs)
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adam/cpu_adam.py | deepspeed/ops/adam/cpu_adam.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from cpuinfo import get_cpu_info
from deepspeed.utils import logger
from deepspeed.utils.logging import should_log_le
from deepspeed.ops.op_builder import CPUAdamBuilder
class DeepSpeedCPUAdam(torch.optim.Opti... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/lamb/fused_lamb.py | deepspeed/ops/lamb/fused_lamb.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Copyright NVIDIA/apex
This file is adapted from NVIDIA/apex/optimizer/fused_adam and implements the LAMB optimizer
"""
import types
import torch
from deepspeed.ops.op_builder import FusedLambBuilder
class FusedLamb(torc... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/lamb/__init__.py | deepspeed/ops/lamb/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .fused_lamb import FusedLamb
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/gds/__init__.py | deepspeed/ops/gds/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from ..op_builder import GDSBuilder
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/quantizer/__init__.py | deepspeed/ops/quantizer/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .quantizer import ds_quantizer
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/quantizer/quantizer.py | deepspeed/ops/quantizer/quantizer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.ops.op_builder import QuantizerBuilder
# Cuda modules will be imported if needed
quantizer_cuda_module = None
def ds_quantizer(input, groups=1, bit_num=8, sr=False, asym=False):
# Load cud... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/fp_quantizer/quantize.py | deepspeed/ops/fp_quantizer/quantize.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import abc
from abc import ABC
import gc
from deepspeed.ops.op_builder import FPQuantizerBuilder
from deepspeed.accelerator import get_accelerator
fp_quant_module = None
class Quantizer(ABC):
"""
Abs... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/fp_quantizer/fp8_gemm_triton.py | deepspeed/ops/fp_quantizer/fp8_gemm_triton.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
######## Fused MoE kernel #########
# These kernels are implemented for
# fusing GeMM with dequantization of
# fp8 weight data when using bit-16
# activation.
###################################
import torch
import triton
i... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/fp_quantizer/fp8_gemm.py | deepspeed/ops/fp_quantizer/fp8_gemm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
######## Fused MoE kernel #########
# These kernels are implemented for
# fusing GeMM with dequantization of
# fp8 weight data when using bit-16
# activation.
###################################
import torch
def matmul_fp... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/fp_quantizer/__init__.py | deepspeed/ops/fp_quantizer/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .quantize import FP_Quantize, Quantizer
from .fp8_gemm import matmul_fp8
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/random_ltd/dropping_utils.py | deepspeed/ops/random_ltd/dropping_utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.ops.op_builder import RandomLTDBuilder
"""
Returns:
sampled_indices: [layers, batch_size, reserved_length]
new_mask: [batch_size, 1, reserved_length, reserved_length]
"""
random_ltd_modu... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/random_ltd/__init__.py | deepspeed/ops/random_ltd/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .dropping_utils import gpt_sample_tokens, bert_sample_tokens, GatherTokens, ScatterTokens
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/__init__.py | deepspeed/ops/transformer/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .transformer import DeepSpeedTransformerLayer, DeepSpeedTransformerConfig
from .inference.config import DeepSpeedInferenceConfig
from ...model_implementations.transformers.ds_transformer import DeepSpeedTransformerInfer... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/transformer.py | deepspeed/ops/transformer/transformer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import json
import math
import torch
from torch import nn
from torch.autograd import Function
from deepspeed.accelerator import get_accelerator
from deepspeed.ops.op_builder import TransformerBuilder, StochasticTransformerBu... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/diffusers_attention.py | deepspeed/ops/transformer/inference/diffusers_attention.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
import torch
from torch.autograd import Function
import torch.nn as nn
from packaging import version as pkg_version
from deepspeed.utils.logging import log_dist
from deepspeed.accelerator import get_accelerator
f... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/moe_inference.py | deepspeed/ops/transformer/inference/moe_inference.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import json
import math
import torch
from torch.autograd import Function
import torch.nn as nn
from .ds_attention import DeepSpeedSelfAttention
from .config import DeepSpeedInferenceConfig
from .op_binding import SoftmaxOp, ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/bias_add.py | deepspeed/ops/transformer/inference/bias_add.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from typing import Optional
import torch
from deepspeed.ops.op_builder import SpatialInferenceBuilder
spatial_cuda_module = None
def nhwc_bias_add(activation: torch.Tensor,
bias: torch.Tensor,
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton_ops.py | deepspeed/ops/transformer/inference/triton_ops.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
Inspired by original Triton implementation:
https://github.com/openai/triton/blob/release/2.1.x/python/tutorials/06-fused-attention.py
"""
import torch
import triton
import triton.language as tl
@triton.jit
def _fwd_ke... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/ds_mlp.py | deepspeed/ops/transformer/inference/ds_mlp.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
import torch
import torch.nn as nn
from deepspeed import comm as dist
from deepspeed.utils.types import GATED_ACTIVATION_TYPES
from deepspeed.accelerator import get_accelerator
from .op_binding import MLPGemmOp, ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/diffusers_2d_transformer.py | deepspeed/ops/transformer/inference/diffusers_2d_transformer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
class Diffusers2DTransformerConfig():
def __init__(self, int8_quantization=False):
self.int8_quantization = int8_quantization
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/ds_attention.py | deepspeed/ops/transformer/inference/ds_attention.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
import torch
import torch.nn as nn
from deepspeed import comm as dist
from deepspeed.accelerator import get_accelerator
from .op_binding import LinearOp, VectorMatMulOp, SoftmaxContextOp, QKVGemmOp, SoftmaxOp
mi... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/config.py | deepspeed/ops/transformer/inference/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import json
import torch
from deepspeed.utils.types import ActivationFuncType, NormType
class TransformerConfig():
def __init__(self, hidden_size, intermediate_size, heads, num_hidden_layers):
self.layer_id = ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/__init__.py | deepspeed/ops/transformer/inference/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .config import DeepSpeedInferenceConfig
from ....model_implementations.transformers.ds_transformer import DeepSpeedTransformerInference
from .moe_inference import DeepSpeedMoEInferenceConfig, DeepSpeedMoEInference
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/diffusers_transformer_block.py | deepspeed/ops/transformer/inference/diffusers_transformer_block.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn as nn
from deepspeed import module_inject
from .diffusers_attention import DeepSpeedDiffusersAttention
from .bias_add import nhwc_bias_add
from .diffusers_2d_transformer import Diffusers2DTransf... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/qkv_gemm.py | deepspeed/ops/transformer/inference/op_binding/qkv_gemm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
from .rms_norm import RMSNormOp
import deepspeed
from deepspeed.utils.types import NormType
class QKVGemmO... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/gated_activation.py | deepspeed/ops/transformer/inference/op_binding/gated_activation.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from deepspeed.utils.types import ActivationFuncType
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class GatedActivationOp(BaseOp):
def __init__(se... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/bias_residual.py | deepspeed/ops/transformer/inference/op_binding/bias_residual.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class BiasResidualOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(BiasResidualOp, self).__init__(conf... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/residual_add.py | deepspeed/ops/transformer/inference/op_binding/residual_add.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from typing import Optional
from .vector_add import VectorAddOp
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class ResidualAddOp(BaseOp):
def __init__(self, config: DeepSpeedInf... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/gelu_gemm.py | deepspeed/ops/transformer/inference/op_binding/gelu_gemm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
import deepspeed
class GELUGemmOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/softmax.py | deepspeed/ops/transformer/inference/op_binding/softmax.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
from deepspeed.ops.transformer.inference.op_binding.workspace import InferenceContext
class SoftmaxOp(Base... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/pad_transform.py | deepspeed/ops/transformer/inference/op_binding/pad_transform.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class PadTransformOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig = None):
if config is None:
config = DeepSpe... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/softmax_context.py | deepspeed/ops/transformer/inference/op_binding/softmax_context.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed import comm as dist
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
from .softmax import SoftmaxOp
from deepspeed.ops.transformer.inference.op_binding.workspace import Infer... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/bias_gelu.py | deepspeed/ops/transformer/inference/op_binding/bias_gelu.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class BiasGeluOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(BiasGel... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/bias_add.py | deepspeed/ops/transformer/inference/op_binding/bias_add.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class BiasAddOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(BiasAddOp, self).__init__(config)
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/mlp_gemm.py | deepspeed/ops/transformer/inference/op_binding/mlp_gemm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from typing import Optional
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
from deepspeed.utils.types import NormType
from .pre_rms_norm import PreRMSNorm... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/moe_res_matmul.py | deepspeed/ops/transformer/inference/op_binding/moe_res_matmul.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class MoEResMatmulOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig = None):
if config is None:
con... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/layer_norm.py | deepspeed/ops/transformer/inference/op_binding/layer_norm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class LayerNormOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig = None):
super... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/einsum_sec_sm_ecm.py | deepspeed/ops/transformer/inference/op_binding/einsum_sec_sm_ecm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class EinsumSecSmEcmOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(EinsumSecSmEcmOp, self).__init__(... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/workspace.py | deepspeed/ops/transformer/inference/op_binding/workspace.py | # Copyright (c) 2023 Habana Labs, Ltd. an Intel Company
# Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
minus_inf = -10000.0
key_idx = 0
value_idx = 1
class InferenceContext:
__ins... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/pre_rms_norm.py | deepspeed/ops/transformer/inference/op_binding/pre_rms_norm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
from .rms_norm import RMSNormOp
class PreRMSNormOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig = None):
if c... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/__init__.py | deepspeed/ops/transformer/inference/op_binding/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .linear import LinearOp
from .vector_matmul import VectorMatMulOp
from .softmax_context import SoftmaxContextOp
from .qkv_gemm import QKVGemmOp
from .softmax import SoftmaxOp
from .mlp_gemm import MLPGemmOp
from .gelu_g... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/rms_norm.py | deepspeed/ops/transformer/inference/op_binding/rms_norm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class RMSNormOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig = None):
if config is None:
config =... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/vector_add.py | deepspeed/ops/transformer/inference/op_binding/vector_add.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class VectorAddOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig = None):
if config is None:
config = DeepSpeedI... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/base.py | deepspeed/ops/transformer/inference/op_binding/base.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from deepspeed.ops.op_builder import InferenceBuilder
class BaseOp(torch.nn.Module):
inference_module = None
def __init__(self, config: DeepSpeedInferenc... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/linear.py | deepspeed/ops/transformer/inference/op_binding/linear.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
import deepspeed
class LinearOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(LinearOp, self).__init__... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/bias_relu.py | deepspeed/ops/transformer/inference/op_binding/bias_relu.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import torch.nn.functional as F
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
class BiasReluOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(BiasRel... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/op_binding/vector_matmul.py | deepspeed/ops/transformer/inference/op_binding/vector_matmul.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from ..config import DeepSpeedInferenceConfig
from .base import BaseOp
import deepspeed
class VectorMatMulOp(BaseOp):
def __init__(self, config: DeepSpeedInferenceConfig):
super(VectorMatMulOp, se... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/matmul_ext.py | deepspeed/ops/transformer/inference/triton/matmul_ext.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import triton
import os
from filelock import FileLock
import deepspeed.ops.transformer.inference.triton.triton_matmul_kernel as triton_matmul_kernel
import pickle
from io import open
import deepspeed
from pathli... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/residual_add.py | deepspeed/ops/transformer/inference/triton/residual_add.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import triton
import triton.language as tl
from deepspeed.accelerator import get_accelerator
@triton.jit
def residual_add_bias_kernel(
hidden_state_ptr,
residual_ptr,
attn_output_ptr,
hidden_st... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/softmax.py | deepspeed/ops/transformer/inference/triton/softmax.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import triton
import triton.language as tl
'''
softmax
modified the triton kernel in
https://github.com/openai/triton/blob/34817ecc954a6f4ca7b4dfb352fdde1f8bd49ca5/python/tutorials/02-fused-softmax.py
'''
@tri... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/triton_matmul_kernel.py | deepspeed/ops/transformer/inference/triton/triton_matmul_kernel.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import triton
import triton.language as tl
from .gelu import gelu_functor
import torch
AUTOTUNE_TOP_K = 10
SKIP_AUTOTUNE = False
def _triton_ops_matmul_early_config_prune(configs, named_args):
device = torch.cuda.curr... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/mlp.py | deepspeed/ops/transformer/inference/triton/mlp.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import math
import torch.nn as nn
from deepspeed.accelerator import get_accelerator
from deepspeed import comm as dist
from ..op_binding import MLPGemmOp, VectorMatMulOp, GELUGemmOp, ResidualAddOp
class Triton... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/ops.py | deepspeed/ops/transformer/inference/triton/ops.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import deepspeed.ops.transformer.inference.triton.matmul_ext as matmul_ext
from deepspeed.ops.transformer.inference.op_binding.layer_norm import LayerNormOp
from deepspeed.ops.transformer.inference.triton.layer_norm import l... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/layer_norm.py | deepspeed/ops/transformer/inference/triton/layer_norm.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import triton
import triton.language as tl
'''
layer-normalization
modified the triton kernel in
https://github.com/openai/triton/blob/34817ecc954a6f4ca7b4dfb352fdde1f8bd49ca5/python/tutorials/05-layer-norm.py
'... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/gelu.py | deepspeed/ops/transformer/inference/triton/gelu.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
import triton
import triton.language as tl
from deepspeed.accelerator import get_accelerator
@triton.jit
def gelu_functor(x):
# Using approximation introduces greater parity errors.
# return tl.sigmoid... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/__init__.py | deepspeed/ops/transformer/inference/triton/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .residual_add import residual_add_bias
from .layer_norm import layer_norm, layer_norm_residual
from .gelu import gelu
from .softmax import softmax
from .ops import *
from .matmul_ext import fp16_matmul, matmul_4d, score... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/transformer/inference/triton/attention.py | deepspeed/ops/transformer/inference/triton/attention.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import math
import torch
import torch.nn as nn
import triton
import triton.language as tl
from deepspeed.accelerator import get_accelerator
from deepspeed import comm as dist
from deepspeed.ops.transformer.inference.op_bindi... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adagrad/cpu_adagrad.py | deepspeed/ops/adagrad/cpu_adagrad.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import torch
from deepspeed.ops.op_builder import CPUAdagradBuilder
from deepspeed.utils.logging import should_log_le
class DeepSpeedCPUAdagrad(torch.optim.Optimizer):
optimizer_id = 0
def __init__(self, model_par... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/ops/adagrad/__init__.py | deepspeed/ops/adagrad/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .cpu_adagrad import DeepSpeedCPUAdagrad
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/constants.py | deepspeed/autotuning/constants.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
#########################################
# autotuner implementation constants
#########################################
import os
DEFAULT_TEMPLATE_PATH_ZERO_0 = os.path.join(os.path.dirname(os.path.realpath(__file__)), "c... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/autotuner.py | deepspeed/autotuning/autotuner.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import shutil
import subprocess
import time
import datetime
import math
import hjson
from ..runtime.config_utils import dict_raise_error_on_duplicate_keys
from ..runtime.constants import *
from ..runtime.zero.config import... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | true |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/utils.py | deepspeed/autotuning/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import re
import collections.abc
import os
import json
from deepspeed.runtime.constants import GRADIENT_ACCUMULATION_STEPS, TRAIN_MICRO_BATCH_SIZE_PER_GPU
import itertools
import copy
from ..utils import logger
def search... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/config.py | deepspeed/autotuning/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.runtime.config_utils import get_scalar_param, get_dict_param, DeepSpeedConfigObject
from deepspeed.autotuning.constants import *
class DeepSpeedAutotuningConfig(DeepSpeedConfigObject):
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/autotuning/__init__.py | deepspeed/autotuning/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .autotuner import Autotuner
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/scheduler.py | deepspeed/autotuning/scheduler.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import copy
import json
import subprocess
import sys
import threading
import time
import base64
import os
import hjson
from tqdm import tqdm
from ..utils import logger
from .constants import AUTOTUNING, AUTOTUNING_METRIC_... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/tuner/model_based_tuner.py | deepspeed/autotuning/tuner/model_based_tuner.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import hjson
from ..constants import AUTOTUNING, AUTOTUNING_METRIC_PATH
from .base_tuner import BaseTuner
from .cost_model import XGBoostCostModel
from .utils import *
from ..utils import *
import numbers
from ..constants i... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/tuner/cost_model.py | deepspeed/autotuning/tuner/cost_model.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .utils import *
try:
import xgboost as xgb
except ImportError:
xgb = None
class XGBoostCostModel():
def __init__(self, loss_type, num_threads=None, log_interval=25, upper_model=None):
assert xgb... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/tuner/base_tuner.py | deepspeed/autotuning/tuner/base_tuner.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import sys
from deepspeed.autotuning.constants import *
from deepspeed.autotuning.utils import write_experiments
from deepspeed.utils import logger
class BaseTuner:
def __init__(self, exps, resource_manager, metric):... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/tuner/utils.py | deepspeed/autotuning/tuner/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import numpy as np
import itertools
from ..utils import *
import collections.abc
def index_to_feature(p, dims):
"""convert index form (single integer) to feature form (vector)"""
feature = []
for dim in dims:
... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/tuner/__init__.py | deepspeed/autotuning/tuner/__init__.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from .index_based_tuner import RandomTuner, GridSearchTuner
# from .ga_tuner import GATuner
from .model_based_tuner import ModelBasedTuner
| python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/autotuning/tuner/index_based_tuner.py | deepspeed/autotuning/tuner/index_based_tuner.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import random
from .base_tuner import BaseTuner
class RandomTuner(BaseTuner):
"""Explore the search space in random order"""
def __init__(self, exps: list, resource_manager, metric):
super().__init__(exps... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/moe/layer.py | deepspeed/moe/layer.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from typing import Optional, Tuple
import torch
from torch import nn
from torch.nn import functional as F
from deepspeed.utils import groups, log_dist
from .experts import Experts
from .sharded_moe import MOELayer, TopKGat... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/moe/mappings.py | deepspeed/moe/mappings.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
# The file has been adapted from the following Megatron-LM file:
# https://github.com/NVIDIA/Megatron-LM/blob/main/megatron/mpu/mappings.py
# Git commit hash: 9dc3c42a84aa656f583703cf8b6b4f79f712b796
# We retain the followin... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/moe/experts.py | deepspeed/moe/experts.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
import copy
from typing import List, Optional
import torch
from torch import nn
class Experts(nn.Module):
def __init__(self, expert: nn.Module, num_local_experts: int = 1, expert_group_name: Optional[str] = None) -> ... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/moe/utils.py | deepspeed/moe/utils.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from collections import defaultdict
from typing import Any, Dict, List, Set, Tuple, Union, cast
import torch
from torch import nn
from .layer import MoE
def has_moe_layers(m: nn.Module) -> Tuple[bool, int]:
has_moe =... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/moe/sharded_moe.py | deepspeed/moe/sharded_moe.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
"""
The file has been adapted from two fairscale files:
(1) https://github.com/facebookresearch/fairscale/blob/master/fairscale/nn/moe/moe_layer.py
(2) https://github.com/facebookresearch/fairscale/blob/master/fairscale/nn/... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/moe/__init__.py | deepspeed/moe/__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/nebula/constants.py | deepspeed/nebula/constants.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
#########################################
# nebula
#########################################
# Nebula. By default, this feature is not enabled.
# Users can configure in ds_config.json as below example:
NEBULA_FORMAT = '''
ne... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nebula/config.py | deepspeed/nebula/config.py | # Copyright (c) Microsoft Corporation.
# SPDX-License-Identifier: Apache-2.0
# DeepSpeed Team
from deepspeed.runtime.config_utils import get_scalar_param, DeepSpeedConfigObject
from deepspeed.nebula.constants import *
class DeepSpeedNebulaConfig(DeepSpeedConfigObject):
def __init__(self, param_dict):
s... | python | Apache-2.0 | 2390bc5c4128b4c347be522a2b2d0f109c7879f3 | 2026-01-04T14:40:27.668296Z | false |
deepspeedai/DeepSpeed | https://github.com/deepspeedai/DeepSpeed/blob/2390bc5c4128b4c347be522a2b2d0f109c7879f3/deepspeed/nebula/__init__.py | deepspeed/nebula/__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 |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/scripts/integration_health_check.py | scripts/integration_health_check.py | """
Calculate the relative health of a package compared to llama-index-core.
Output is a score between 0 and 1.
At the time of writing, llama-index-llms-openai has a score of 0.38.
Example usage:
python ./integration_health_check.py llama-index-integrations/llms/llama-index-llms-openai
"""
import git
import json
im... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/node_parser/llama-index-node-parser-slide/tests/test_node_parser_slide.py | llama-index-integrations/node_parser/llama-index-node-parser-slide/tests/test_node_parser_slide.py | """
Unit tests for SlideNodeParser.
Covers:
- Synchronous parsing (`get_nodes_from_documents`) under various chunk_size, window_size, and llm_workers.
- Asynchronous parsing (`aget_nodes_from_documents`) under the same parameter sets.
- Parallelism of async LLM calls (`achat`) via run_jobs, ensuring overlap when llm_w... | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/node_parser/llama-index-node-parser-slide/tests/__init__.py | llama-index-integrations/node_parser/llama-index-node-parser-slide/tests/__init__.py | python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false | |
run-llama/llama_index | https://github.com/run-llama/llama_index/blob/dd5b31109cc8eb64411caf9fc1fa0f51e584c325/llama-index-integrations/node_parser/llama-index-node-parser-slide/llama_index/node_parser/slide/__init__.py | llama-index-integrations/node_parser/llama-index-node-parser-slide/llama_index/node_parser/slide/__init__.py | from llama_index.node_parser.slide.base import (
SlideNodeParser,
)
__all__ = ["SlideNodeParser"]
| python | MIT | dd5b31109cc8eb64411caf9fc1fa0f51e584c325 | 2026-01-04T14:39:40.052063Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.