add missing license info to top of all source code (#2889)

Co-authored-by: Michael Wyatt <michaelwyatt@microsoft.com>
Co-authored-by: Conglong Li <conglong.li@gmail.com>
Co-authored-by: Olatunji Ruwase <olruwase@microsoft.com>
This commit is contained in:
Jeff Rasley
2023-02-27 11:20:41 -08:00
committed by GitHub
parent 8710f0514e
commit da84e60d98
300 changed files with 658 additions and 5 deletions

View File

@ -42,6 +42,14 @@ repos:
exclude: ^(deepspeed/comm/|docs/|benchmarks/|scripts/check-torchdist.py|deepspeed/moe/sharded_moe.py|deepspeed/runtime/comm/coalesced_collectives.py|deepspeed/elasticity/elastic_agent.py|deepspeed/launcher/launch.py|tests/unit/comm/test_dist.py)
# Specific deepspeed/ files are excluded for now until we wrap ProcessGroup in deepspeed.comm
- repo: local
hooks:
- id: check-license
name: check-license
entry: ./scripts/check-license.py
language: script
files: \.(py|cc|cu|h|cuh|hip)$
- repo: https://github.com/codespell-project/codespell
rev: v2.1.0
hooks:

View File

@ -1,2 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .abstract_accelerator import DeepSpeedAccelerator
from .real_accelerator import get_accelerator, set_accelerator

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import abc
from abc import ABC

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
import pkgutil
import importlib

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
try:
from accelerator.abstract_accelerator import DeepSpeedAccelerator as dsa1
except ImportError as e:

View File

@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''

View File

@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
DEFAULT_WARMUPS = 5
DEFAULT_TRIALS = 50
DEFAULT_TYPE = 'float'

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from benchmarks.communication.utils import *
from benchmarks.communication.all_reduce import run_all_reduce
from benchmarks.communication.all_gather import run_all_gather

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
import os
import math

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
import time
import deepspeed

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
import re
import argparse

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
import torch
import time

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
SCRIPT_PREFIX = '_aio_bench'
WRITE_OP_DESC = 'write'
READ_OP_DESC = 'read'

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "custom_cuda_layers.h"
__global__ void param_update_kernel(const float* input, __half* output, int size)

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#ifdef _WIN32
#include <windows.h>

View File

@ -1,3 +1,6 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#ifndef __TIMER_H__
#define __TIMER_H__

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <ATen/cuda/CUDAContext.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#define NOMINMAX // Windows idiosyncrasy

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#define NOMINMAX // Windows idiosyncrasy

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <assert.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cuda.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cuda_runtime_api.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#ifndef __FEEDFORWARD_H__
#define __FEEDFORWARD_H__

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cuda.h>

View File

@ -1,3 +1,6 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include <cuda.h>
#include <cuda_fp16.h>
#include <stdio.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cuda.h>

View File

@ -1,3 +1,6 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cooperative_groups.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#if (__x86_64__ || __i386__)

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cuda.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#pragma once
#include <cuda.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
/* Taken from NVIDIA/apex commit 855808f3fc268e9715d613f3c2e56469d8c986d8 */
#include <ATen/ATen.h>

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include <math.h>
#include "custom_cuda_layers.h"
#include "memory_access_utils.h"

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "cublas_wrappers.h"
#ifdef __HIP_PLATFORM_HCC__

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "custom_cuda_layers.h"
const int unroll_factor = 4;

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "custom_cuda_layers.h"
inline __device__ float gelu(const float x)

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "general_kernels.h"
namespace cg = cooperative_groups;

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "custom_cuda_layers.h"
namespace cg = cooperative_groups;

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include <math.h>
#include "custom_cuda_layers.h"
#include "general_kernels.h"

View File

@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/
#include "custom_cuda_layers.h"
#define rows_trans 16

View File

@ -1 +1,3 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .autotuner import Autotuner

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import shutil
import subprocess
import time

View File

@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
"""
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

View File

@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
"""
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import copy
from numpy import BUFSIZE

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .index_based_tuner import RandomTuner, GridSearchTuner
# from .ga_tuner import GATuner
from .model_based_tuner import ModelBasedTuner

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import sys
from deepspeed.autotuning.constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .utils import *
try:

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import random
from .base_tuner import BaseTuner

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import hjson
from ..constants import AUTOTUNING, AUTOTUNING_METRIC_PATH

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import numpy as np
import itertools
from ..utils import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import re
import collections.abc
import os

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .reshape_meg_2d import reshape_meg_2d_parallel
from .deepspeed_checkpoint import DeepSpeedCheckpoint

View File

@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
'''
Various symbolic constants used for model checkpointing
'''

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
from typing import Dict
import torch

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .reshape_utils import (get_files,
get_files_with_prefix,
partition_data,

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .reshape_utils import partition_data

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
import torch
from collections import OrderedDict

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
from .constants import (MODEL_FILE_PREFIX,
MODEL_FILE_SUFFIX,

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
from .constants import (BASE_OPTIMIZER_STATE,

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
from .utils import *
from deepspeed import utils

View File

@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
''' DeepSpeed Communication Backend.
In the future, directly use NCCL/MPI/Gloo/etc without requiring torch.distributed. Simply wrap torch.distributed for now.

View File

@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
"""
Copyright (c) Microsoft Corporation
Licensed under the MIT license.

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
NCCL_BACKEND = 'nccl'
MPI_BACKEND = 'mpi'
GLOO_BACKEND = 'gloo'

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
import torch
import inspect

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .compress import init_compression, redundancy_clean
from .scheduler import compression_scheduler
from .helper import convert_conv1d_to_linear

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
import math
from torch import nn

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import re
from .helper import compression_preparation, fix_compression, recursive_getattr, is_module_compressible
from .config import get_compression_config

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .constants import *
import copy
from ..runtime.config_utils import get_scalar_param

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
#########################################
# Compression Methods
# It has several sub-components

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
from .basic_layer import Embedding_Compress, LinearLayer_Compress, Conv2dLayer_Compress, BNLayer_Compress, ColumnParallelLinear_Compress, RowParallelLinear_Compress
from .constants import *

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .compress import get_module_name
from .constants import *
from .helper import recursive_getattr

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
from torch import autograd
import math

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .elasticity import compute_elastic_config, elasticity_enabled, ensure_immutable_elastic_config
from .utils import is_torch_elastic_compatible
from .constants import ENABLED, ENABLED_DEFAULT, ELASTICITY

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from torch.distributed.elastic.agent.server.local_elastic_agent import LocalElasticAgent
from typing import Any, Dict, Optional, Tuple
from datetime import datetime

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
import deepspeed
import subprocess

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
try:
# This is populated by setup.py
from .git_version_info_installed import * # noqa: F401

View File

@ -1 +1,3 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .engine import InferenceEngine

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch
from deepspeed.runtime.config_utils import DeepSpeedConfigModel
from deepspeed.runtime.zero.config import DeepSpeedZeroConfig

View File

@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import os
import sys
import shutil

View File

@ -1,2 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .transformers.ds_transformer import DeepSpeedTransformerInference
from .transformers.clip_encoder import DSClipEncoder

View File

@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''

View File

@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
import torch.nn as nn

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .replace_module import replace_transformer_layer, revert_transformer_layer, ReplaceWithTensorSlicing, GroupQuantizer, generic_injection
from .module_quantize import quantize_transformer_layer
from .replace_policy import HFBertLayerPolicy

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
# Automatic Tensor Parallelism
import re

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .bert import DS_BERTContainer, HFBertLayerPolicy
from .bloom import DS_BloomContainer, BLOOMLayerPolicy, supported_models
from .distil_bert import DS_DistilBERTContainer, HFDistilBertLayerPolicy

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
# Create a container object to save model-specific tensors using the policy file above.
from abc import ABC
import torch

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
# Create a container object to save model-specific tensors using the policy file above.
from .base import *
import torch

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .base import *
from deepspeed.model_implementations.transformers.ds_bert import DeepSpeedBERTInference
import torch

View File

@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''
from .base import *
from .features.meta_tensor import MetaTensorContainer
from deepspeed.model_implementations.transformers.ds_bloom import DeepSpeedBloomInference

Some files were not shown because too many files have changed in this diff Show More