forked from FlagOpen/FlagScale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
81 lines (72 loc) · 2.45 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
import os
import subprocess
from setuptools import find_packages, setup
from setuptools.command.install import install
def is_nvidia_chip():
try:
result = subprocess.run(
["nvidia-smi"], stdout=subprocess.PIPE, stderr=subprocess.PIPE
)
if result.returncode == 0:
return True
except Exception as e:
pass
return False
class InstallRequirement(install):
def run(self):
if is_nvidia_chip():
# TODO: At present, it is assumed that the relevant dependencies have been installed,
# and automatic installation of the relevant dependencies is supported in the future.
# After verification, open the comment.
"""
print("In NVIDIA chip, install train and inference dependencies automatically...")
# Install train requirements
print("Install train dependencies...")
env_param = '--env train'
subprocess.check_call(['bash', './install/install-requirements.sh', env_param])
# Install vllm requirements
print("Install inference dependencies...")
env_param = "--env inference"
subprocess.check_call(
["bash", "./install/install-requirements.sh", env_param]
)
"""
pass
# Continue to install
install.run(self)
setup(
name="flag_scale",
version="0.6.0",
description="FlagScale is a comprehensive toolkit designed to support the entire lifecycle of large models, developed with the backing of the Beijing Academy of Artificial Intelligence (BAAI). ",
url="https://github.com/FlagOpen/FlagScale",
packages=[
"flag_scale",
"flag_scale.megatron",
"flag_scale.flagscale",
"flag_scale.examples",
],
package_dir={
"flag_scale": "",
"flag_scale.megatron": "megatron",
"flag_scale.flagscale": "flagscale",
"flag_scale.examples": "examples",
},
package_data={
"flag_scale.megatron": ["**/*"],
"flag_scale.flagscale": ["**/*"],
"flag_scale.examples": ["**/*"],
},
install_requires=[
"click",
"cryptography",
"setuptools>=75.1.0",
"packaging>=24.1",
"importlib_metadata>=8.5.0"
],
entry_points={
"console_scripts": [
"flagscale=flag_scale.flagscale.cli:flagscale",
],
},
cmdclass={"install": InstallRequirement},
)