Skip to content

Commit 116ebff

Browse files
committed
Remove vLLM test dependency
vLLM can only currently be run on GPU (unless you want to go to extreme lengths to make it work on CPU), and we thus cannot run the tests in CI. We thus separate the test dependencies in "with GPU" and "without GPU" (a subset of "with GPU") that the user has to pick manually.
1 parent 9c27efb commit 116ebff

File tree

2 files changed

+30
-16
lines changed

2 files changed

+30
-16
lines changed

docs/community/contribute.md

Lines changed: 29 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Note that the [issue tracker][issues] is only intended for actionable items. In
1818

1919
First, [fork the repository on GitHub](https://github.com/dottxt-ai/outlines/fork) and clone the fork locally:
2020

21-
```bash
21+
```shell
2222
git clone [email protected]/YourUserName/outlines.git
2323
cd outlines
2424
```
@@ -27,35 +27,49 @@ Create a new virtual environment:
2727

2828
*If you are using `uv`*:
2929

30-
```bash
30+
```shell
3131
uv venv
3232
source .venv/bin/activate
3333
alias pip="uv pip" # ... or just remember to prepend any pip command with uv in the rest of this guide
3434
```
3535

3636
*If you are using `venv`*:
3737

38-
```bash
38+
```shell
3939
python -m venv .venv
4040
source .venv/bin/activate
4141
```
4242

4343
*If you are using `conda`*:
4444

45-
```bash
45+
```shell
4646
conda env create -f environment.yml
4747
```
4848

4949
Then install the dependencies in editable mode, and install the `pre-commit` hooks:
5050

51-
```bash
51+
```shell
52+
python -m venv .venv
53+
source .venv/bin/activate
54+
```
55+
56+
Then install the dependencies in editable mode, and install the pre-commit hooks:
57+
58+
```shell
5259
pip install -e ".[test]"
5360
pre-commit install
5461
```
62+
If you own a GPU and want to run the vLLM tests you will have to run:
63+
64+
```shell
65+
pip install -e ".[test-gpu]"
66+
```
67+
68+
instead.
5569

5670
Outlines provides optional dependencies for different supported backends, which you can install with
5771

58-
```bash
72+
```shell
5973
pip install ".[vllm]"
6074
```
6175

@@ -85,13 +99,13 @@ You will not have access to a GPU, but you'll be able to make basic contribution
8599

86100
Run the tests:
87101

88-
```bash
102+
```shell
89103
pytest
90104
```
91105

92106
And run the code style checks:
93107

94-
```bash
108+
```shell
95109
pre-commit run --all-files
96110
```
97111

@@ -101,7 +115,7 @@ Outlines uses [asv](https://asv.readthedocs.io) for automated benchmark testing.
101115

102116
You can run the benchmark test suite locally with the following command:
103117

104-
```bash
118+
```shell
105119
asv run --config benchmarks/asv.conf.json
106120
```
107121

@@ -112,19 +126,19 @@ Caveats:
112126

113127
#### Run a specific test:
114128

115-
```bash
129+
```shell
116130
asv run --config benchmarks/asv.conf.json -b bench_json_schema.JsonSchemaBenchmark.time_json_schema_to_fsm
117131
```
118132

119133
#### Profile a specific test:
120134

121-
```bash
135+
```shell
122136
asv run --config benchmarks/asv.conf.json --profile -b bench_json_schema.JsonSchemaBenchmark.time_json_schema_to_fsm
123137
```
124138

125139
#### Compare to `origin/main`
126140

127-
```bash
141+
```shell
128142
get fetch origin
129143
asv continuous origin/main HEAD --config benchmarks/asv.conf.json
130144
```
@@ -140,13 +154,13 @@ asv continuous origin/main HEAD --config benchmarks/asv.conf.json
140154

141155
To work on the *documentation* you will need to install the related dependencies:
142156

143-
```bash
157+
```shell
144158
pip install -r requirements-doc.txt
145159
```
146160

147161
To build the documentation and serve it locally, run the following command in the repository's root folder:
148162

149-
```bash
163+
```shell
150164
mkdocs serve
151165
```
152166

@@ -157,7 +171,7 @@ It will be updated every time you make a change.
157171

158172
Create a new branch on your fork, commit and push the changes:
159173

160-
```bash
174+
```shell
161175
git checkout -b new-branch
162176
git add .
163177
git commit -m "Changes I made"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,12 @@ test = [
6969
"huggingface_hub",
7070
"openai>=1.0.0",
7171
"datasets",
72-
"vllm; sys_platform == 'linux'",
7372
"transformers",
7473
"pillow",
7574
"exllamav2",
7675
"jax",
7776
]
77+
test-gpu=["outlines[test]", "vllm; sys_platform == 'linux'"]
7878
serve = [
7979
"vllm>=0.3.0",
8080
"uvicorn",

0 commit comments

Comments
 (0)