forked from thu-pacman/chitu
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathget_requires.py
More file actions
121 lines (115 loc) · 4.03 KB
/
get_requires.py
File metadata and controls
121 lines (115 loc) · 4.03 KB
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
# SPDX-FileCopyrightText: 2025 Qingcheng.AI
#
# SPDX-License-Identifier: Apache-2.0
import os
import packaging.version
import torch
import csrc.setup_build as operators
setup_dir = os.path.dirname(os.path.abspath(__file__))
install_requires = [
# Special notes on torch:
# 1. Users should not expect the installing of chitu to automatically
# install torch, because different variants of torch should be used
# on different platforms.
# 2. For the same reason, we don't set specific torch version here.
# 3. In order to prevent `pip` from upgrading your platform-specifc
# torch back to the official version, please use `-c` on `pip`.
"torch",
"torchvision",
"transformers[torch]>=4.57.3", # >=4.57.3 required by qwen3-vl-235b
"safetensors",
"fire",
"tiktoken>=0.7.0", # Required by glm4
"blobfile",
"faker",
"hydra-core",
"fastapi",
"uvicorn[standard]",
"tqdm",
"einops",
"typing-extensions",
"pyzmq>=27.0.0",
"msgpack",
"plum-dispatch",
"netifaces",
"prometheus-client>=0.19.0",
"prometheus-api-client>=0.7.0",
"xgrammar>=0.1.31",
"openai",
"anthropic",
]
extras_require = {
"quant": [
"optimum",
"bitsandbytes",
"autoawq-kernels==0.0.9",
"autoawq[kernels]",
"gptqmodel>=2.2.0,<4.0.0", # <4.0.0: gptqmodel 4.x requires torch>=2.7.1 and numpy>=2.2.6, incompatible with base image torch==2.7.0
"tokenizers>=0.20.3",
],
##########################################################################
# Our own kernels for various architectures
"muxi_layout_kernels": [
"muxi_layout_kernels @ file://localhost"
+ os.path.join(setup_dir, "third_party/muxi_layout_kernels"),
],
"muxi_w8a8_kernels": [
"tbsgemm @ file://localhost"
+ os.path.join(setup_dir, "third_party/muxi_w8a8_kernels/w8a8"),
],
"ascend_kernels": [
"cinfer_ascendc @ file://localhost"
+ os.path.join(setup_dir, "third_party/ascend-kernel"),
],
"sugon_mixq4_kernels": [
"sugon_mixq4_kernels @ file://localhost"
+ os.path.join(setup_dir, "third_party/sugon_mixq4_kernels"),
],
##########################################################################
# Really third-party kernels
"flash_attn": [
"flash_attn @ file://localhost"
+ os.path.join(setup_dir, "third_party/flash-attention"),
# Although `flash-attn` is available in PyPI, don't make it a required
# dependency, because its installation runs forever on some platforms.
],
"flash_attn_interface": [
"flash_attn_3 @ file://localhost"
+ os.path.join(setup_dir, "third_party/flash-attention/hopper"),
],
# TODO: Upgrade to latest flashInfer version and resolve environment compatibility issues
"flashinfer": [
(
"flashinfer-python<=0.2.5"
if packaging.version.parse(torch.__version__)
< packaging.version.parse("2.7.0")
else "flashinfer-python<=0.2.7.post1,!=0.2.6"
# !=0.2.6: https://github.com/flashinfer-ai/flashinfer/issues/1139
),
],
"flash_linear_attention": [
"flash-linear-attention",
],
"flash_mla": [
"flash_mla @ file://localhost"
+ os.path.join(setup_dir, "third_party/FlashMLA"),
],
"deep_gemm": [
"deep_gemm @ file://localhost"
+ os.path.join(setup_dir, "third_party/DeepGEMM"),
],
"deep_ep": [
"deep_ep @ file://localhost" + os.path.join(setup_dir, "third_party/DeepEP"),
], # Please make sure `requirements-build-deep_ep-cu12.txt` is installed at BUILD TIME
"hard_fp4_kernels": [
"hard_fp4_kernels @ file://localhost"
+ os.path.join(setup_dir, "third_party/hard_fp4_kernels"),
],
"scipy": ["scipy"],
"fast_hadamard_transform": [
"fast-hadamard-transform @ file://localhost"
+ os.path.join(setup_dir, "third_party/fast-hadamard-transform")
],
"numa": ["numa"],
**operators.get_extras_require(),
}