repo
stringlengths
1
99
file
stringlengths
13
215
code
stringlengths
12
59.2M
file_length
int64
12
59.2M
avg_line_length
float64
3.82
1.48M
max_line_length
int64
12
2.51M
extension_type
stringclasses
1 value
AMP
AMP-main/DeepSpeed/tests/onebit/test_nccl_backend.py
import time import torch import torch.distributed as dist import numpy as np import argparse import deepspeed import os from deepspeed.runtime.comm.nccl import NcclBackend parser = argparse.ArgumentParser() parser.add_argument('--local_rank', type=int, default=-1) args = parser.parse_args() deepspeed.init_distribute...
3,340
35.714286
109
py
AMP
AMP-main/DeepSpeed/tests/onebit/test_mpi_backend.py
from mpi4py import MPI import time import torch import torch.distributed as dist import numpy as np import deepspeed from deepspeed.runtime.comm.mpi import MpiBackend comm = MPI.COMM_WORLD size = comm.Get_size() rank = comm.Get_rank() deepspeed.init_distributed(dist_backend='nccl') # Change cuda_aware to True to te...
3,242
37.152941
109
py
AMP
AMP-main/DeepSpeed/tests/onebit/test_nccl_perf.py
import time import torch import torch.distributed as dist import numpy as np import argparse import deepspeed import os from deepspeed.runtime.comm.nccl import NcclBackend from deepspeed.utils.timer import SynchronizedWallClockTimer from statistics import mean timers = SynchronizedWallClockTimer() parser = argparse....
2,977
30.347368
89
py
AMP
AMP-main/DeepSpeed/tests/onebit/test_mpi_perf.py
from mpi4py import MPI import time import torch import torch.distributed as dist import numpy as np import deepspeed from deepspeed.runtime.comm.mpi import MpiBackend # Configure wall clock timer from deepspeed.utils.timer import SynchronizedWallClockTimer from statistics import mean timers = SynchronizedWallClockT...
2,150
27.68
83
py
AMP
AMP-main/DeepSpeed/tests/model/Megatron_GPT2/run_func_test.py
# coding=utf-8 # Copyright (c) 2019, The Microsoft DeepSpeed Team. All rights reserved. # # Note: please copy webtext data to "Megatron-LM" folder, before running this script. import unittest import subprocess import os import time import re from .test_common import BaseTestCase LAYERS = 2 HIDDEN_SIZE = 128 ATTN_HEAD...
19,290
30.78089
92
py
AMP
AMP-main/DeepSpeed/docs/code-docs/source/conf.py
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html # -- Path setup -------------------------------------------------------------- # If ex...
2,601
30.349398
83
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/pretrain_transgan.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,573
32.578313
101
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/het_model.py
# Script to reproduce homogeneous setting results import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa impo...
4,173
30.383459
137
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/homogeneous.py
# Script to reproduce homogeneous setting results import math import time from collections import defaultdict import operator import shutil import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F...
4,209
30.893939
137
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/het_cluster.py
# Script to reproduce homogeneous setting results import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa impo...
4,308
31.643939
137
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/pipe.py
import copy import time import torch import numpy as np def pipe_ast(L, cost_e, cost_c, k, B): time_dp_s = time.time() possible = [0] for i in range(1, L+1): ptr = 0 while ptr + i <= L: possible.append(sum(cost_e[ptr:ptr+i])) ptr += 1 possible = sorted...
4,564
30.054422
97
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/homogeneous_sa.py
import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa import * from cost_homo import AMP from amp_utils impo...
6,549
32.762887
149
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/amp_utils.py
import torch import os import subprocess import json import torch import spur # returns the rank to axis. If pp_deg=dp_deg=mp_deg=2, rank 3 gives (0,1,1). # This is deepspeed method def rank2axis(rank, mp_deg, dp_deg, pp_deg): pp = rank // (mp_deg * dp_deg) remainder = rank % (mp_deg * dp_deg) dp = remain...
6,218
34.537143
155
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/cost_homo.py
from collections import defaultdict import time import json import copy import subprocess import sys import os import torch import torch.nn as nn import numpy as np from amp_utils import rank2axis, axis2rank, get_host from pipe import pipe_ds, pipe_ast, pipe_cost, pipe_uniform, pipe_gpt2 home_dir = os.environ['HOME...
14,692
39.144809
135
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/pretrain_gpt2.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,197
30.889571
102
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/cost_het_cluster.py
from collections import defaultdict import time import json import copy import subprocess import sys import os import torch import torch.nn as nn import numpy as np from amp_utils import rank2axis, axis2rank, get_host from pipe import pipe_ds, pipe_ast, pipe_cost, pipe_uniform, pipe_gpt2 home_dir = os.environ['HOME...
13,302
38.829341
131
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/cost_het_model.py
from collections import defaultdict import time import json import copy import subprocess import sys import os import torch import torch.nn as nn import numpy as np from amp_utils import rank2axis, axis2rank, get_host from pipe import pipe_ds, pipe_ast, pipe_cost, pipe_uniform, pipe_gpt2 home_dir = os.environ['HOME...
15,712
39.919271
131
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/sa.py
import copy import time import os from collections import defaultdict import torch import numpy as np from amp_utils import factor class SymDict(dict): def __getitem__(self, key): return dict.__getitem__(self, key if key[0] < key[1] else (key[1],key[0])) def __setitem__(self, key, value): di...
13,429
30.378505
121
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/test.py
from collections import defaultdict import torch import torch.nn as nn import numpy as np from amp_utils import rank2axis, axis2rank from pipe import pipe_ds, pipe_dp import subprocess import sys sys.path.append("/users/dacheng2/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/examples/") sys.path.appen...
3,205
35.022472
136
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/amp_fix_rank.py
import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa import generate_initial, neighbor, cool_down, candidate...
1,824
27.076923
103
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/amp_transgan_pipe_test.py
import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa import generate_initial, neighbor, cool_down, candidate...
2,870
28.90625
136
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/amp_gpt2_pipe_test.py
import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa import generate_initial, neighbor, cool_down, candidate...
2,508
27.191011
127
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/measure_latency.py
import torch import time a = torch.randn(128, 1000, 64).cuda() time_s = time.time() a = a ** 2 time_e = time.time() torch.cuda.synchronize() time_sync = time.time() print(time_e - time_s, time_sync - time_e)
211
15.307692
42
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/estimate_bandwidth.py
import torch import torch.distributed as dist import sys import os init_method = 'tcp://' master_ip = "172.31.46.201" master_port = os.getenv('MASTER_PORT', '6001') init_method += master_ip + ':' + master_port rank = int(sys.argv[1]) torch.cuda.set_device(rank) torch.distributed.init_process_group( backend="nccl...
669
21.333333
46
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/test_linear.py
import time import torch import torch.nn.functional as F import torch.nn.init as init from torch.nn.parameter import Parameter class test1(torch.nn.Module): def __init__(self): super(test1, self).__init__() self.weight = Parameter(torch.empty( 128, 32,dtype=torch.float16, ...
2,189
27.815789
155
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/test_large.py
import time import torch import torch.nn.functional as F import torch.nn.init as init from torch.nn.parameter import Parameter class test1(torch.nn.Module): def __init__(self): super(test1, self).__init__() self.weight = Parameter(torch.empty( 4096, 1024,dtype=torch.float16, ...
1,113
26.85
152
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/preprocess_data.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
7,754
37.58209
94
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/amp_gpt2_pipe_single.py
import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa import generate_initial, neighbor, cool_down, candidate...
2,364
26.5
124
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/merge_mp_partitions.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
10,931
37.090592
80
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/tools/amp_transgan_pipe_single.py
import math import time from collections import defaultdict import operator import random import os import copy from tqdm import tqdm import numpy as np import torch from torch import optim as optim import torch.nn as nn import torch.nn.functional as F from sa import generate_initial, neighbor, cool_down, candidate...
2,357
26.418605
124
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/custom_ops.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
5,644
43.448819
146
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/training_stats.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
10,707
38.806691
118
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/persistence.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
9,708
37.527778
144
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/misc.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and re...
10,992
40.798479
133
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/ops/bias_act.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
10,047
46.173709
185
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/ops/grid_sample_gradfix.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
3,299
38.285714
138
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/ops/conv2d_gradfix.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
7,677
43.900585
197
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/ops/upfirdn2d.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
16,287
41.306494
157
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/ops/conv2d_resample.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
7,591
47.356688
130
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/torch_utils/ops/fma.py
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved. # # NVIDIA CORPORATION and its licensors retain all intellectual property # and proprietary rights in and to this software, related documentation # and any modifications thereto. Any use, reproduction, disclosure or # distribution of this software and rel...
2,034
32.360656
105
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/indexer.py
import torch import torch.distributed as dist from megatron import get_args from megatron import mpu from megatron.checkpointing import load_ict_checkpoint from megatron.data.ict_dataset import get_ict_dataset from megatron.data.realm_dataset_utils import get_one_epoch_dataloader from megatron.data.realm_index import ...
4,091
43.478261
111
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/package_info.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
1,219
38.354839
106
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/arguments_amp.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
26,766
48.02381
113
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/arguments.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
37,607
45.718012
107
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/memory.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,043
33.547945
78
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/initialize.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
8,763
36.452991
101
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/text_generation_utils.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
15,909
37.523002
81
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/training.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
49,697
38.318038
132
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/utils.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
7,765
37.068627
86
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/module.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
1,117
33.9375
74
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/global_vars.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
7,983
30.066148
85
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/torch_test.py
import torch import time for i in range(10000000000000): a = torch.ones((1024,)).cuda() a = a**2 time.sleep(1)
124
14.625
34
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/__init__.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
1,383
31.186047
74
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/checkpointing.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
12,728
36.328446
103
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/fp16/fp16util.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
8,115
36.400922
337
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/fp16/loss_scaler.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
10,248
38.879377
325
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/fp16/fp16.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
32,260
48.480061
435
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/lazy_loader.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
6,938
33.182266
94
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/tf_dl.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,506
41.361538
121
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/wordpiece.py
# coding=utf-8 # Copyright 2018 The Google AI Language Team Authors and The HuggingFace Inc. team. # # 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 the License at # # http://www.apache.org/licenses/LICEN...
15,634
38.885204
154
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/tokenization.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
35,935
37.933911
121
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/datasets.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
32,704
35.996606
134
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/file_utils.py
# This file is provided as is from: # https://github.com/huggingface/pytorch-pretrained-BERT # Please refer to their repository for copyright. """ Utilities for working with the local dataset cache. This file is adapted from the AllenNLP library at https://github.com/allenai/allennlp Copyright by the AllenNLP author...
8,442
32.240157
112
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/__init__.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,939
40.830986
146
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/samplers.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,814
39.381944
96
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/deprecated_data_utils/configure_data.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
9,227
35.474308
81
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/mappings.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,174
28.237288
104
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/initialize.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
8,872
34.071146
90
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/cross_entropy.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
5,065
42.299145
80
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/utils.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
2,711
37.197183
80
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/data.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
6,113
34.754386
89
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/grads.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
4,898
37.273438
88
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/layers.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
15,977
40.718016
95
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/random.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
12,484
38.015625
79
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/tests/test_layers.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
19,247
35.248588
80
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/tests/test_data.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
2,915
31.764045
79
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/tests/test_cross_entropy.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
3,868
34.495413
74
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/tests/commons.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
2,620
30.202381
75
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/tests/test_random.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
6,695
31.663415
80
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/mpu/tests/test_initialize.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
3,495
35.416667
78
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/fused_kernels/__init__.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
4,010
38.712871
81
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/ict_dataset.py
import itertools import random import numpy as np from torch.utils.data import Dataset from megatron import get_tokenizer from megatron import get_args from megatron.data.dataset_utils import get_indexed_dataset_ from megatron.data.realm_dataset_utils import get_block_samples_mapping def get_ict_dataset(use_titles=...
5,555
38.404255
103
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/realm_dataset_utils.py
import os import time import numpy as np import torch from megatron import mpu, print_rank_0 from megatron.data.dataset_utils import create_masked_lm_predictions, pad_and_convert_to_numpy from megatron.data.samplers import DistributedBatchSampler from megatron import get_args, get_tokenizer, print_rank_0, mpu def g...
7,520
36.232673
104
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/realm_index.py
import itertools import os import pickle import shutil import numpy as np import torch from megatron import get_args from megatron import mpu def detach(tensor): return tensor.detach().cpu().numpy() class BlockData(object): """Serializable data structure for holding data for blocks -- embeddings and neces...
8,822
39.658986
112
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/bert_dataset.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
9,609
40.244635
82
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/gpt2_dataset.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
13,427
40.9625
81
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/indexed_dataset.py
# Copyright (c) Facebook, Inc. and its affiliates. # # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. # copied from fairseq/fairseq/data/indexed_dataset.py # Removed IndexedRawTextDataset since it relied on Fairseq dictionary # other slight mo...
18,535
31.462347
105
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/samplers.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
6,055
39.644295
79
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/trans_gan_dataset.py
# -*- coding: utf-8 -*- # @Date : 2019-07-25 # @Author : Xinyu Gong (xy_gong@tamu.edu) # @Link : None # @Version : 0.0 from functools import partial import torch import os import PIL from torchvision.datasets.vision import VisionDataset from torchvision.datasets.utils import download_file_from_google_drive, che...
1,418
28.5625
105
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/data/test/test_indexed_dataset.py
# This file isn't really a formal automated test, it's just a place to # put some code used during development and manual testing of # indexed_dataset. from megatron.data import indexed_dataset from megatron.tokenizer import build_tokenizer import argparse import os import sys import torch script_dir = os.path.dirna...
4,619
35.666667
77
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/classification.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
4,185
41.282828
111
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/ada.py
import torch import numpy as np _constant_cache = dict() def constant(value, shape=None, dtype=None, device=None, memory_format=None): value = np.asarray(value) if shape is not None: shape = tuple(shape) if dtype is None: dtype = torch.get_default_dtype() if device is None: dev...
2,886
30.380435
120
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/multiple_choice.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
4,642
40.828829
111
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/realm_model.py
import os import torch from megatron import get_args, print_rank_0 from megatron.checkpointing import get_checkpoint_tracker_filename, get_checkpoint_name from megatron.model import BertModel from megatron.module import MegatronModule from megatron import mpu from megatron.model.utils import get_linear_layer from mega...
8,670
41.297561
111
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/bert_model.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
7,670
37.164179
83
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/gpt2_model.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
8,810
36.815451
114
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/fused_bias_gelu.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
2,091
33.295082
107
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/diff_aug.py
# Code Heavily borrowed from Differentiable Augmentation and StyleGAN-ADA import torch import torch.nn.functional as F import numpy as np import random from .ada import * # from models_search import conv2d_gradfix import scipy.signal from torch_utils import persistence from torch_utils import misc from torch_utils.ops...
31,409
51.613065
366
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/utils.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
11,858
32.882857
105
py
AMP
AMP-main/DeepSpeed/DeepSpeedExamples/Megatron-LM-v1.1.5-3D_parallelism/megatron/model/transformer.py
# 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 obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless re...
24,215
36.896714
91
py