Skip to content

Commit 2e3ad79

Browse files
authored
feat(autogptq): add a separate conda environment for autogptq (#1137)
**Description** This PR related to #1117 **Notes for Reviewers** Here we lock down the version of the dependencies. Make sure it can be used all the time without failed if the version of dependencies were upgraded. I change the order of importing packages according to the pylint, and no change the logic of code. It should be ok. I will do more investigate on writing some test cases for every backend. I can run the service in my environment, but there is not exist a way to test it. So, I am not confident on it. Add a README.md in the `grpc` root. This is the common commands for creating `conda` environment. And it can be used to the reference file for creating extral gRPC backend document. Signed-off-by: GitHub <[email protected]>
1 parent d793b5a commit 2e3ad79

File tree

5 files changed

+140
-6
lines changed

5 files changed

+140
-6
lines changed

extra/grpc/README.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Common commands about conda environment
2+
3+
## Create a new empty conda environment
4+
5+
```
6+
conda create --name <env-name> python=<your version> -y
7+
8+
conda create --name autogptq python=3.11 -y
9+
```
10+
11+
## To activate the environment
12+
13+
As of conda 4.4
14+
```
15+
conda activate autogptq
16+
```
17+
18+
The conda version older than 4.4
19+
20+
```
21+
source activate autogptq
22+
```
23+
24+
## Install the packages to your environment
25+
26+
Sometimes you need to install the packages from the conda-forge channel
27+
28+
By using `conda`
29+
```
30+
conda install <your-package-name>
31+
32+
conda install -c conda-forge <your package-name>
33+
```
34+
35+
Or by using `pip`
36+
```
37+
pip install <your-package-name>
38+
```

extra/grpc/autogptq/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.PONY: autogptq
2+
autogptq:
3+
@echo "Creating virtual environment..."
4+
@conda env create --name autogptq --file autogptq.yml
5+
@echo "Virtual environment created."

extra/grpc/autogptq/README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Creating a separate environment for the autogptq project
2+
3+
```
4+
make autogptq
5+
```

extra/grpc/autogptq/autogptq.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
#!/usr/bin/env python3
2-
import grpc
32
from concurrent import futures
4-
import time
5-
import backend_pb2
6-
import backend_pb2_grpc
73
import argparse
84
import signal
95
import sys
106
import os
11-
from auto_gptq import AutoGPTQForCausalLM, BaseQuantizeConfig
12-
from pathlib import Path
7+
import time
8+
9+
import grpc
10+
import backend_pb2
11+
import backend_pb2_grpc
12+
from auto_gptq import AutoGPTQForCausalLM
1313
from transformers import AutoTokenizer
1414
from transformers import TextGenerationPipeline
1515

extra/grpc/autogptq/autogptq.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: autogptq
2+
channels:
3+
- defaults
4+
dependencies:
5+
- _libgcc_mutex=0.1=main
6+
- _openmp_mutex=5.1=1_gnu
7+
- bzip2=1.0.8=h7b6447c_0
8+
- ca-certificates=2023.08.22=h06a4308_0
9+
- ld_impl_linux-64=2.38=h1181459_1
10+
- libffi=3.4.4=h6a678d5_0
11+
- libgcc-ng=11.2.0=h1234567_1
12+
- libgomp=11.2.0=h1234567_1
13+
- libstdcxx-ng=11.2.0=h1234567_1
14+
- libuuid=1.41.5=h5eee18b_0
15+
- ncurses=6.4=h6a678d5_0
16+
- openssl=3.0.11=h7f8727e_2
17+
- pip=23.2.1=py311h06a4308_0
18+
- python=3.11.5=h955ad1f_0
19+
- readline=8.2=h5eee18b_0
20+
- setuptools=68.0.0=py311h06a4308_0
21+
- sqlite=3.41.2=h5eee18b_0
22+
- tk=8.6.12=h1ccaba5_0
23+
- wheel=0.41.2=py311h06a4308_0
24+
- xz=5.4.2=h5eee18b_0
25+
- zlib=1.2.13=h5eee18b_0
26+
- pip:
27+
- accelerate==0.23.0
28+
- aiohttp==3.8.5
29+
- aiosignal==1.3.1
30+
- async-timeout==4.0.3
31+
- attrs==23.1.0
32+
- auto-gptq==0.4.2
33+
- certifi==2023.7.22
34+
- charset-normalizer==3.3.0
35+
- datasets==2.14.5
36+
- dill==0.3.7
37+
- filelock==3.12.4
38+
- frozenlist==1.4.0
39+
- fsspec==2023.6.0
40+
- grpcio==1.59.0
41+
- huggingface-hub==0.16.4
42+
- idna==3.4
43+
- jinja2==3.1.2
44+
- markupsafe==2.1.3
45+
- mpmath==1.3.0
46+
- multidict==6.0.4
47+
- multiprocess==0.70.15
48+
- networkx==3.1
49+
- numpy==1.26.0
50+
- nvidia-cublas-cu12==12.1.3.1
51+
- nvidia-cuda-cupti-cu12==12.1.105
52+
- nvidia-cuda-nvrtc-cu12==12.1.105
53+
- nvidia-cuda-runtime-cu12==12.1.105
54+
- nvidia-cudnn-cu12==8.9.2.26
55+
- nvidia-cufft-cu12==11.0.2.54
56+
- nvidia-curand-cu12==10.3.2.106
57+
- nvidia-cusolver-cu12==11.4.5.107
58+
- nvidia-cusparse-cu12==12.1.0.106
59+
- nvidia-nccl-cu12==2.18.1
60+
- nvidia-nvjitlink-cu12==12.2.140
61+
- nvidia-nvtx-cu12==12.1.105
62+
- packaging==23.2
63+
- pandas==2.1.1
64+
- peft==0.5.0
65+
- protobuf==4.24.4
66+
- psutil==5.9.5
67+
- pyarrow==13.0.0
68+
- python-dateutil==2.8.2
69+
- pytz==2023.3.post1
70+
- pyyaml==6.0.1
71+
- regex==2023.10.3
72+
- requests==2.31.0
73+
- rouge==1.0.1
74+
- safetensors==0.3.3
75+
- six==1.16.0
76+
- sympy==1.12
77+
- tokenizers==0.14.0
78+
- torch==2.1.0
79+
- tqdm==4.66.1
80+
- transformers==4.34.0
81+
- triton==2.1.0
82+
- typing-extensions==4.8.0
83+
- tzdata==2023.3
84+
- urllib3==2.0.6
85+
- xxhash==3.4.1
86+
- yarl==1.9.2

0 commit comments

Comments
 (0)