Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 2 additions & 0 deletions accelerator/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''

from .abstract_accelerator import DeepSpeedAccelerator
from .real_accelerator import get_accelerator, set_accelerator
2 changes: 2 additions & 0 deletions accelerator/abstract_accelerator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import abc
from abc import ABC

Expand Down
2 changes: 2 additions & 0 deletions accelerator/cuda_accelerator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import os
import pkgutil
import importlib
Expand Down
2 changes: 2 additions & 0 deletions accelerator/real_accelerator.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

try:
from accelerator.abstract_accelerator import DeepSpeedAccelerator as dsa1
except ImportError as e:
Expand Down
1 change: 1 addition & 0 deletions benchmarks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''
1 change: 1 addition & 0 deletions benchmarks/communication/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
'''Copyright The Microsoft DeepSpeed Team'''
2 changes: 2 additions & 0 deletions benchmarks/communication/all_gather.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/all_reduce.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/all_to_all.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/broadcast.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import torch
from benchmarks.communication.utils import *
from benchmarks.communication.constants import *
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

DEFAULT_WARMUPS = 5
DEFAULT_TRIALS = 50
DEFAULT_TYPE = 'float'
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/pt2pt.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

from benchmarks.communication.utils import *
from benchmarks.communication.constants import *

Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/run_all.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/communication/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import torch
import os
import math
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/inference/bert-bench.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import torch
import time
import deepspeed
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/inference/collect_results.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import os
import re
import argparse
Expand Down
2 changes: 2 additions & 0 deletions benchmarks/inference/gpt-bench.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import os
import torch
import time
Expand Down
2 changes: 2 additions & 0 deletions csrc/aio/py_test/perf_sweep_utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

SCRIPT_PREFIX = '_aio_bench'
WRITE_OP_DESC = 'write'
READ_OP_DESC = 'read'
Expand Down
4 changes: 4 additions & 0 deletions csrc/common/custom_cuda_kernel.cu
Original file line number Diff line number Diff line change
@@ -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)
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/StopWatch.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once
#ifdef _WIN32
#include <windows.h>
Expand Down
3 changes: 3 additions & 0 deletions csrc/includes/Timer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#ifndef __TIMER_H__
#define __TIMER_H__
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/context.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <ATen/cuda/CUDAContext.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/cpu_adagrad.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#define NOMINMAX // Windows idiosyncrasy
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/cpu_adam.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#define NOMINMAX // Windows idiosyncrasy
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/cublas_wrappers.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <assert.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/dropout.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cuda.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/ds_transformer_cuda.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cuda_runtime_api.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/feed_forward.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#ifndef __FEEDFORWARD_H__
#define __FEEDFORWARD_H__

Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/gelu.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cuda.h>
Expand Down
3 changes: 3 additions & 0 deletions csrc/includes/gemm_test.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/general_kernels.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include <cuda.h>
#include <cuda_fp16.h>
#include <stdio.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/normalize_layer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cuda.h>
Expand Down
3 changes: 3 additions & 0 deletions csrc/includes/quantization.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/quantizer.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cooperative_groups.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/simd.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#if (__x86_64__ || __i386__)
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/softmax.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cuda.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/strided_batch_gemm.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#pragma once

#include <cuda.h>
Expand Down
4 changes: 4 additions & 0 deletions csrc/includes/type_shim.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

/* Taken from NVIDIA/apex commit 855808f3fc268e9715d613f3c2e56469d8c986d8 */
#include <ATen/ATen.h>

Expand Down
4 changes: 4 additions & 0 deletions csrc/quantization/fake_quantizer.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include <math.h>
#include "custom_cuda_layers.h"
#include "memory_access_utils.h"
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/cublas_wrappers.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include "cublas_wrappers.h"

#ifdef __HIP_PLATFORM_HCC__
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/dropout_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include "custom_cuda_layers.h"

const int unroll_factor = 4;
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/gelu_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include "custom_cuda_layers.h"

inline __device__ float gelu(const float x)
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/general_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include "general_kernels.h"

namespace cg = cooperative_groups;
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/normalize_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include "custom_cuda_layers.h"

namespace cg = cooperative_groups;
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/softmax_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include <math.h>
#include "custom_cuda_layers.h"
#include "general_kernels.h"
Expand Down
4 changes: 4 additions & 0 deletions csrc/transformer/transform_kernels.cu
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
/*
Copyright The Microsoft DeepSpeed Team
*/

#include "custom_cuda_layers.h"

#define rows_trans 16
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
'''Copyright The Microsoft DeepSpeed Team'''

from .autotuner import Autotuner
2 changes: 2 additions & 0 deletions deepspeed/autotuning/autotuner.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import shutil
import subprocess
import time
Expand Down
1 change: 1 addition & 0 deletions deepspeed/autotuning/config.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
"""
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Expand Down
1 change: 1 addition & 0 deletions deepspeed/autotuning/constants.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'''Copyright The Microsoft DeepSpeed Team'''
"""
Copyright (c) Microsoft Corporation
Licensed under the MIT license.
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/scheduler.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import copy

from numpy import BUFSIZE
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/tuner/__init__.py
Original file line number Diff line number Diff line change
@@ -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
2 changes: 2 additions & 0 deletions deepspeed/autotuning/tuner/base_tuner.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import sys

from deepspeed.autotuning.constants import *
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/tuner/cost_model.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

from .utils import *

try:
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/tuner/index_based_tuner.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import random

from .base_tuner import BaseTuner
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/tuner/model_based_tuner.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import hjson

from ..constants import AUTOTUNING, AUTOTUNING_METRIC_PATH
Expand Down
2 changes: 2 additions & 0 deletions deepspeed/autotuning/tuner/utils.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
'''Copyright The Microsoft DeepSpeed Team'''

import numpy as np
import itertools
from ..utils import *
Expand Down
Loading