Skip to content

Commit 3641ef2

Browse files
authored
Fix pre-commit checks (#12)
* attempt to fix pre-commit checks * Add types-requests package dependency * remove variable typing
1 parent 39b98a2 commit 3641ef2

25 files changed

+2359
-2148
lines changed

.github/workflows/docs_build.yml

Lines changed: 0 additions & 45 deletions
This file was deleted.

.github/workflows/docs_deploy.yml

Lines changed: 0 additions & 55 deletions
This file was deleted.

.github/workflows/integration_tests.yml

Lines changed: 0 additions & 61 deletions
This file was deleted.

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,4 +154,4 @@ scripts/
154154
collect_env.py
155155

156156
# build files
157-
dist/
157+
dist/

.pre-commit-config.yaml

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.4.0 # Use the ref you want to point at
3+
rev: v4.6.0 # Use the ref you want to point at
44
hooks:
55
- id: trailing-whitespace
66
- id: check-ast
@@ -16,7 +16,7 @@ repos:
1616
- id: check-toml
1717

1818
- repo: https://github.com/charliermarsh/ruff-pre-commit
19-
rev: 'v0.2.2'
19+
rev: 'v0.6.2'
2020
hooks:
2121
- id: ruff
2222
args: [--fix, --exit-non-zero-on-fix]
@@ -25,7 +25,7 @@ repos:
2525
types_or: [python, jupyter]
2626

2727
- repo: https://github.com/pre-commit/mirrors-mypy
28-
rev: v1.8.0
28+
rev: v1.11.1
2929
hooks:
3030
- id: mypy
3131
entry: python3 -m mypy --config-file pyproject.toml
@@ -34,24 +34,7 @@ repos:
3434
exclude: "tests"
3535

3636
- repo: https://github.com/nbQA-dev/nbQA
37-
rev: 1.7.1
37+
rev: 1.8.7
3838
hooks:
3939
- id: nbqa-ruff
4040
args: [--fix, --exit-non-zero-on-fix]
41-
42-
- repo: local
43-
hooks:
44-
- id: doctest
45-
name: doctest
46-
entry: python3 -m doctest -o NORMALIZE_WHITESPACE
47-
files: "^aieng_template/"
48-
language: system
49-
50-
- repo: local
51-
hooks:
52-
- id: pytest
53-
name: pytest
54-
entry: python3 -m pytest -m "not integration_test"
55-
language: system
56-
pass_filenames: false
57-
always_run: true

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ RUN python3.10 -m pip install flash-attn --no-build-isolation
6767

6868
# Move nccl to accessible location
6969
RUN mkdir -p /vec-inf/nccl
70-
RUN mv /root/.config/vllm/nccl/cu12/libnccl.so.2.18.1 /vec-inf/nccl/libnccl.so.2.18.1;
70+
RUN mv /root/.config/vllm/nccl/cu12/libnccl.so.2.18.1 /vec-inf/nccl/libnccl.so.2.18.1;
7171

7272
# Set the default command to start an interactive shell
7373
CMD ["bash"]

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Vector Inference: Easy inference on Slurm clusters
2-
This repository provides an easy-to-use solution to run inference servers on [Slurm](https://slurm.schedmd.com/overview.html)-managed computing clusters using [vLLM](https://docs.vllm.ai/en/latest/). **All scripts in this repository runs natively on the Vector Institute cluster environment**. To adapt to other environments, update [`launch_server.sh`](vec-inf/launch_server.sh), [`vllm.slurm`](vec-inf/vllm.slurm), [`multinode_vllm.slurm`](vec-inf/multinode_vllm.slurm) and [`models.csv`](vec-inf/models/models.csv) accordingly.
2+
This repository provides an easy-to-use solution to run inference servers on [Slurm](https://slurm.schedmd.com/overview.html)-managed computing clusters using [vLLM](https://docs.vllm.ai/en/latest/). **All scripts in this repository runs natively on the Vector Institute cluster environment**. To adapt to other environments, update [`launch_server.sh`](vec-inf/launch_server.sh), [`vllm.slurm`](vec-inf/vllm.slurm), [`multinode_vllm.slurm`](vec-inf/multinode_vllm.slurm) and [`models.csv`](vec-inf/models/models.csv) accordingly.
33

44
## Installation
55
If you are using the Vector cluster environment, and you don't need any customization to the inference server environment, run the following to install package:
@@ -17,7 +17,7 @@ You should see an output like the following:
1717

1818
<img width="400" alt="launch_img" src="https://github.com/user-attachments/assets/557eb421-47db-4810-bccd-c49c526b1b43">
1919

20-
The model would be launched using the [default parameters](vec-inf/models/models.csv), you can override these values by providing additional options, use `--help` to see the full list. You can also launch your own customized model as long as the model architecture is [supported by vLLM](https://docs.vllm.ai/en/stable/models/supported_models.html), you'll need to specify all model launching related options to run a successful run.
20+
The model would be launched using the [default parameters](vec-inf/models/models.csv), you can override these values by providing additional options, use `--help` to see the full list. You can also launch your own customized model as long as the model architecture is [supported by vLLM](https://docs.vllm.ai/en/stable/models/supported_models.html), you'll need to specify all model launching related options to run a successful run.
2121

2222
You can check the inference server status by providing the Slurm job ID to the `status` command:
2323
```bash
@@ -32,7 +32,7 @@ There are 5 possible states:
3232

3333
* **PENDING**: Job submitted to Slurm, but not executed yet. Job pending reason will be shown.
3434
* **LAUNCHING**: Job is running but the server is not ready yet.
35-
* **READY**: Inference server running and ready to take requests.
35+
* **READY**: Inference server running and ready to take requests.
3636
* **FAILED**: Inference server in an unhealthy state. Job failed reason will be shown.
3737
* **SHUTDOWN**: Inference server is shutdown/cancelled.
3838

examples/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@
55
- [`llm/completions.sh`](inference/llm/completions.sh): Bash example of sending completion requests to OpenAI compatible server, supports JSON mode
66
- [`vlm/vision_completions.py`](inference/vlm/vision_completions.py): Python example of sending chat completion requests with image attached to prompt to OpenAI compatible server for vision language models
77
- [`logits`](logits): Example for logits generation
8-
- [`logits.py`](logits/logits.py): Python example of getting logits from hosted model.
8+
- [`logits.py`](logits/logits.py): Python example of getting logits from hosted model.

examples/inference/llm/chat_completions.py

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55

66
# Update the model path accordingly
77
completion = client.chat.completions.create(
8-
model="/model-weights/Meta-Llama-3-8B-Instruct",
9-
messages=[
10-
{"role": "system", "content": "You are a pirate chatbot who always responds in pirate speak!"},
11-
{"role": "user", "content": "Who are you?"},
12-
]
8+
model="/model-weights/Meta-Llama-3-8B-Instruct",
9+
messages=[
10+
{
11+
"role": "system",
12+
"content": "You are a pirate chatbot who always responds in pirate speak!",
13+
},
14+
{"role": "user", "content": "Who are you?"},
15+
],
1316
)
1417

15-
print(completion)
18+
print(completion)

examples/inference/llm/completions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,4 @@
1010
max_tokens=20,
1111
)
1212

13-
print(completion)
13+
print(completion)

0 commit comments

Comments
 (0)