Skip to content

Commit ae0b844

Browse files
authored
Merge pull request deepspeedai#4 from punitkoura/submodule-cleanup
Adding setup.py files to enable building fairseq_v2
2 parents c7ed0b2 + d0628ee commit ae0b844

File tree

3 files changed

+126
-0
lines changed

3 files changed

+126
-0
lines changed

megatron/package_info.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# coding=utf-8
2+
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
MAJOR = 1
17+
MINOR = 1.5
18+
19+
# Use the following formatting: (major, minor)
20+
VERSION = (MAJOR, MINOR)
21+
22+
__version__ = '.'.join(map(str, VERSION))
23+
__package_name__ = 'megatron-lm'
24+
__contact_names__ = 'NVIDIA INC'
25+
__url__ = 'https://github.com/NVIDIA/Megatron-LM'
26+
__download_url__ = 'https://github.com/NVIDIA/Megatron-LM/releases'
27+
__description__ = 'Megatron-LM: Training Multi-Billion Parameter Language Models Using Model Parallelism.'
28+
__license__ = 'See https://github.com/NVIDIA/Megatron-LM/blob/master/LICENSE'
29+
__keywords__ = 'deep learning, Megatron, gpu, NLP, nvidia, pytorch, torch, language'
30+

requirements.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
pybind11
2+
torch
3+
six
4+
regex
5+
numpy

setup.py

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
# coding=utf-8
2+
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
16+
"""Setup for pip package."""
17+
18+
import os
19+
import sys
20+
import setuptools
21+
22+
if sys.version_info < (3,):
23+
raise Exception("Python 2 is not supported by Megatron.")
24+
25+
from megatron.package_info import (
26+
__description__,
27+
__contact_names__,
28+
__url__,
29+
__download_url__,
30+
__keywords__,
31+
__license__,
32+
__package_name__,
33+
__version__,
34+
)
35+
36+
with open("README.md", "r") as fh:
37+
long_description = fh.read()
38+
39+
###############################################################################
40+
# Dependency Loading #
41+
# %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% #
42+
43+
44+
def req_file(filename):
45+
with open(filename) as f:
46+
content = f.readlines()
47+
return [x.strip() for x in content]
48+
49+
50+
install_requires = req_file("requirements.txt")
51+
52+
setuptools.setup(
53+
name=__package_name__,
54+
# Versions should comply with PEP440. For a discussion on single-sourcing
55+
# the version across setup.py and the project code, see
56+
# https://packaging.python.org/en/latest/single_source_version.html
57+
version=__version__,
58+
description=__description__,
59+
long_description=long_description,
60+
long_description_content_type="text/markdown",
61+
# The project's main homepage.
62+
url=__url__,
63+
author=__contact_names__,
64+
maintainer=__contact_names__,
65+
# The licence under which the project is released
66+
license=__license__,
67+
classifiers=[
68+
'Intended Audience :: Developers',
69+
'Intended Audience :: Science/Research',
70+
'Intended Audience :: Information Technology',
71+
# Indicate what your project relates to
72+
'Topic :: Scientific/Engineering :: Artificial Intelligence',
73+
'Topic :: Software Development :: Libraries :: Python Modules',
74+
# Supported python versions
75+
'Programming Language :: Python :: 3.6',
76+
'Programming Language :: Python :: 3.7',
77+
'Programming Language :: Python :: 3.8',
78+
# Additional Setting
79+
'Environment :: Console',
80+
'Natural Language :: English',
81+
'Operating System :: OS Independent',
82+
],
83+
python_requires='>=3.6',
84+
packages=setuptools.find_packages(),
85+
install_requires=install_requires,
86+
# Add in any packaged data.
87+
include_package_data=True,
88+
zip_safe=False,
89+
# PyPI package information.
90+
keywords=__keywords__
91+
)

0 commit comments

Comments
 (0)