Skip to content

Commit 57f2da9

Browse files
authored
[CI] Enable CI (#2)
* add ci files Signed-off-by: Kunshang Ji <[email protected]> * update Signed-off-by: Kunshang Ji <[email protected]> * move pre commit to self-hosted Signed-off-by: Kunshang Ji <[email protected]> * fix format Signed-off-by: Kunshang Ji <[email protected]> * use python 3.10 Signed-off-by: Kunshang Ji <[email protected]> * skip register_ops.py for isort Signed-off-by: Kunshang Ji <[email protected]> * add PR template Signed-off-by: Kunshang Ji <[email protected]> --------- Signed-off-by: Kunshang Ji <[email protected]>
1 parent e244659 commit 57f2da9

File tree

9 files changed

+127
-11
lines changed

9 files changed

+127
-11
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Essential Elements of an Effective PR Description Checklist
2+
3+
- [ ] The purpose of the PR, such as "Fix some issue (link existing issues this PR will resolve)".
4+
- [ ] The test plan, such as providing test command.
5+
- [ ] The test results, such as pasting the results comparison before and after, or e2e results
6+
- [ ] (Optional) The necessary documentation update, such as updating `supported_models.md` and `examples` for a new model.
7+
8+
PLEASE FILL IN THE PR DESCRIPTION HERE ENSURING ALL CHECKLIST ITEMS ABOVE HAVE BEEN CONSIDERED.
9+
10+
## Purpose
11+
12+
## Test Plan
13+
14+
## Test Result
15+
16+
## (Optional) Documentation Update
17+
18+
**BEFORE SUBMITTING, PLEASE READ <https://docs.vllm.ai/en/latest/contributing>** (anything written below this line will be removed by GitHub Actions)
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "actionlint",
5+
"pattern": [
6+
{
7+
"regexp": "^(?:\\x1b\\[\\d+m)?(.+?)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*:(?:\\x1b\\[\\d+m)*(\\d+)(?:\\x1b\\[\\d+m)*: (?:\\x1b\\[\\d+m)*(.+?)(?:\\x1b\\[\\d+m)* \\[(.+?)\\]$",
8+
"file": 1,
9+
"line": 2,
10+
"column": 3,
11+
"message": 4,
12+
"code": 5
13+
}
14+
]
15+
}
16+
]
17+
}

.github/workflows/matchers/mypy.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"problemMatcher": [
3+
{
4+
"owner": "mypy",
5+
"pattern": [
6+
{
7+
"regexp": "^(.+):(\\d+):\\s(error|warning):\\s(.+)$",
8+
"file": 1,
9+
"line": 2,
10+
"severity": 3,
11+
"message": 4
12+
}
13+
]
14+
}
15+
]
16+
}

.github/workflows/pre-commit.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: pre-commit
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
pre-commit:
13+
runs-on: self-hosted
14+
steps:
15+
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
16+
- uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
17+
with:
18+
python-version: "3.10"
19+
- run: echo "::add-matcher::.github/workflows/matchers/actionlint.json"
20+
- run: echo "::add-matcher::.github/workflows/matchers/mypy.json"
21+
- uses: pre-commit/action@2c7b3805fd2a0fd8c1884dcaebf91fc102a13ecd # v3.0.1
22+
with:
23+
extra_args: --all-files --hook-stage manual

.github/workflows/ut.yaml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: run unit tests on Intel PVC 1100.
2+
3+
on:
4+
pull_request:
5+
push:
6+
branches: [main]
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
run-unit-tests:
13+
runs-on: self-hosted
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
17+
with:
18+
fetch-depth: 0
19+
20+
- name: Set up Python
21+
uses: actions/setup-python@42375524e23c412d93fb67b49958b491fce71c38 # v5.4.0
22+
with:
23+
python-version: '3.10'
24+
25+
- name: Install dependencies
26+
run: |
27+
python -m pip install --upgrade pip
28+
pip install -r requirements.txt
29+
30+
- name: build library
31+
run: |
32+
source /opt/oneapi/2025.1.2/setvars.sh --force
33+
python setup.py develop
34+
35+
- name: Run unit tests
36+
run: |
37+
source /opt/oneapi/2025.1.2/setvars.sh --force
38+
pytest -v -s tests/

csrc/core/registration.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
// A version of the TORCH_LIBRARY_IMPL macro that expands the NAME, i.e. so NAME
1616
// could be a macro instead of a literal token.
17-
#define TORCH_LIBRARY_IMPL_EXPAND(NAME, DEVICE, MODULE) \
17+
#define TORCH_LIBRARY_IMPL_EXPAND(NAME, DEVICE, MODULE) \
1818
TORCH_LIBRARY_IMPL(NAME, DEVICE, MODULE)
1919

2020
// REGISTER_EXTENSION allows the shared library to be loaded and initialized

csrc/xpu/ops.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
#include <torch/all.h>
44

5-
void rms_norm(torch::Tensor &out, torch::Tensor &input, torch::Tensor &weight,
5+
void rms_norm(torch::Tensor& out, torch::Tensor& input, torch::Tensor& weight,
66
double epsilon);
77

8-
void fused_add_rms_norm(torch::Tensor &input, torch::Tensor &residual,
9-
torch::Tensor &weight, double epsilon);
8+
void fused_add_rms_norm(torch::Tensor& input, torch::Tensor& residual,
9+
torch::Tensor& weight, double epsilon);

csrc/xpu/utils.h

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,27 @@
88
namespace vllm {
99
namespace xpu {
1010

11-
static inline sycl::queue &vllmGetQueue() {
11+
static inline sycl::queue& vllmGetQueue() {
1212
auto current_stream = c10::xpu::getCurrentXPUStream();
13-
auto &queue = current_stream.queue();
13+
auto& queue = current_stream.queue();
1414
return queue;
1515
}
1616

17-
template <typename T> struct SyclTypeTrait {
17+
template <typename T>
18+
struct SyclTypeTrait {
1819
using Type = T;
1920
};
2021

21-
template <> struct SyclTypeTrait<c10::Half> {
22+
template <>
23+
struct SyclTypeTrait<c10::Half> {
2224
using Type = sycl::half;
2325
};
2426

25-
template <> struct SyclTypeTrait<c10::BFloat16> {
27+
template <>
28+
struct SyclTypeTrait<c10::BFloat16> {
2629
using Type = sycl::ext::oneapi::bfloat16;
2730
};
2831

29-
} // namespace xpu
32+
} // namespace xpu
3033

31-
} // namespace vllm
34+
} // namespace vllm

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ skip_glob = [
128128
".buildkite/*",
129129
"benchmarks/*",
130130
"examples/*",
131+
"tests/register_ops.py"
131132
]
132133
use_parentheses = true
133134
skip_gitignore = true

0 commit comments

Comments
 (0)