Skip to content

Commit ad21728

Browse files
hmellorrasmith
authored andcommitted
Update pre-commit hooks (vllm-project#12475)
Signed-off-by: Harry Mellor <[email protected]>
1 parent 8d3f87c commit ad21728

File tree

64 files changed

+322
-288
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+322
-288
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,18 +3,18 @@ default_stages:
33
- manual # Run in CI
44
repos:
55
- repo: https://github.com/google/yapf
6-
rev: v0.32.0
6+
rev: v0.43.0
77
hooks:
88
- id: yapf
99
args: [--in-place, --verbose]
1010
additional_dependencies: [toml] # TODO: Remove when yapf is upgraded
1111
- repo: https://github.com/astral-sh/ruff-pre-commit
12-
rev: v0.6.5
12+
rev: v0.9.3
1313
hooks:
1414
- id: ruff
1515
args: [--output-format, github]
1616
- repo: https://github.com/codespell-project/codespell
17-
rev: v2.3.0
17+
rev: v2.4.0
1818
hooks:
1919
- id: codespell
2020
exclude: 'benchmarks/sonnet.txt|(build|tests/(lora/data|models/fixtures|prompts))/.*'
@@ -23,7 +23,7 @@ repos:
2323
hooks:
2424
- id: isort
2525
- repo: https://github.com/pre-commit/mirrors-clang-format
26-
rev: v18.1.5
26+
rev: v19.1.7
2727
hooks:
2828
- id: clang-format
2929
exclude: 'csrc/(moe/topk_softmax_kernels.cu|quantization/gguf/(ggml-common.h|dequantize.cuh|vecdotq.cuh|mmq.cuh|mmvq.cuh))'
@@ -35,7 +35,7 @@ repos:
3535
- id: pymarkdown
3636
files: docs/.*
3737
- repo: https://github.com/rhysd/actionlint
38-
rev: v1.7.6
38+
rev: v1.7.7
3939
hooks:
4040
- id: actionlint
4141
- repo: local

benchmarks/benchmark_serving.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,8 @@ def main(args: argparse.Namespace):
926926
)
927927

928928
# Traffic
929-
result_json["request_rate"] = (
930-
args.request_rate if args.request_rate < float("inf") else "inf")
929+
result_json["request_rate"] = (args.request_rate if args.request_rate
930+
< float("inf") else "inf")
931931
result_json["burstiness"] = args.burstiness
932932
result_json["max_concurrency"] = args.max_concurrency
933933

csrc/custom_all_reduce.cuh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,13 @@ struct Signal {
3838
alignas(128) FlagType peer_counter[2][kMaxBlocks][8];
3939
};
4040

41-
struct __align__(16) RankData { const void* __restrict__ ptrs[8]; };
41+
struct __align__(16) RankData {
42+
const void* __restrict__ ptrs[8];
43+
};
4244

43-
struct __align__(16) RankSignals { Signal* signals[8]; };
45+
struct __align__(16) RankSignals {
46+
Signal* signals[8];
47+
};
4448

4549
// like std::array, but aligned
4650
template <typename T, int sz>

csrc/moe/marlin_kernels/marlin_moe_kernel.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,8 @@ __device__ inline FragB dequant<vllm::kU4B8.id()>(int q) {
138138
const int HI = 0x00f000f0;
139139
const int EX = 0x64006400;
140140
// Guarantee that the `(a & b) | c` operations are LOP3s.
141-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
142-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
141+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
142+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
143143
// We want signed int4 outputs, hence we fuse the `-8` symmetric zero point
144144
// directly into `SUB` and `ADD`.
145145
const int SUB = 0x64086408;
@@ -182,8 +182,8 @@ __device__ inline FragB dequant<vllm::kU4.id()>(int q) {
182182
const int HI = 0x00f000f0;
183183
const int EX = 0x64006400;
184184
// Guarantee that the `(a & b) | c` operations are LOP3s.
185-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
186-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
185+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
186+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
187187

188188
const int SUB = 0x64006400;
189189
const int MUL = 0x2c002c00;

csrc/quantization/gptq_marlin/gptq_marlin.cu

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -173,8 +173,8 @@ dequant<half, vllm::kU4B8.id()>(int q) {
173173
const int HI = 0x00f000f0;
174174
const int EX = 0x64006400;
175175
// Guarantee that the `(a & b) | c` operations are LOP3s.
176-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
177-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
176+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
177+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
178178
// We want signed int4 outputs, hence we fuse the `-8` symmetric zero point
179179
// directly into `SUB` and `ADD`.
180180
const int SUB = 0x64086408;
@@ -197,9 +197,9 @@ dequant<nv_bfloat16, vllm::kU4B8.id()>(int q) {
197197

198198
// Guarantee that the `(a & b) | c` operations are LOP3s.
199199

200-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, MASK, EX);
200+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, MASK, EX);
201201
q >>= 4;
202-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, MASK, EX);
202+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, MASK, EX);
203203

204204
typename ScalarType<nv_bfloat16>::FragB frag_b;
205205
static constexpr uint32_t MUL = 0x3F803F80;
@@ -221,8 +221,8 @@ dequant<half, vllm::kU4.id()>(int q) {
221221
const int HI = 0x00f000f0;
222222
const int EX = 0x64006400;
223223
// Guarantee that the `(a & b) | c` operations are LOP3s.
224-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
225-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
224+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
225+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
226226

227227
const int SUB = 0x64006400;
228228
const int MUL = 0x2c002c00;
@@ -244,9 +244,9 @@ dequant<nv_bfloat16, vllm::kU4.id()>(int q) {
244244

245245
// Guarantee that the `(a & b) | c` operations are LOP3s.
246246

247-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, MASK, EX);
247+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, MASK, EX);
248248
q >>= 4;
249-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, MASK, EX);
249+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, MASK, EX);
250250

251251
typename ScalarType<nv_bfloat16>::FragB frag_b;
252252
static constexpr uint32_t MUL = 0x3F803F80;

csrc/quantization/marlin/dense/marlin_cuda_kernel.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ __device__ inline FragB dequant(int q) {
9696
const int HI = 0x00f000f0;
9797
const int EX = 0x64006400;
9898
// Guarantee that the `(a & b) | c` operations are LOP3s.
99-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
100-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
99+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
100+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
101101
// We want signed int4 outputs, hence we fuse the `-8` symmetric zero point
102102
// directly into `SUB` and `ADD`.
103103
const int SUB = 0x64086408;

csrc/quantization/marlin/qqq/marlin_qqq_gemm_kernel.cu

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ __device__ inline FragB dequant_per_group(int q, FragS_GROUP& frag_s, int i) {
141141
static constexpr uint32_t HI = 0x00f000f0;
142142
static constexpr uint32_t EX = 0x64006400;
143143
// Guarantee that the `(a & b) | c` operations are LOP3s.
144-
uint32_t t0 = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
145-
uint32_t t1 = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
144+
uint32_t t0 = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
145+
uint32_t t1 = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
146146
// We want signed int4 outputs, hence we fuse the `-8` symmetric zero point
147147
// directly into `SUB` and `ADD`.
148148
static constexpr uint32_t SUB = 0x64086408;

csrc/quantization/marlin/sparse/common/mma.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,8 @@ __device__ inline FragB dequant_4bit(int q) {
127127
const int HI = 0x00f000f0;
128128
const int EX = 0x64006400;
129129
// Guarantee that the `(a & b) | c` operations are LOP3s.
130-
int lo = lop3<(0xf0 & 0xcc) | 0xaa>(q, LO, EX);
131-
int hi = lop3<(0xf0 & 0xcc) | 0xaa>(q, HI, EX);
130+
int lo = lop3 < (0xf0 & 0xcc) | 0xaa > (q, LO, EX);
131+
int hi = lop3 < (0xf0 & 0xcc) | 0xaa > (q, HI, EX);
132132
// We want signed int4 outputs, hence we fuse the `-8` symmetric zero point
133133
// directly into `SUB` and `ADD`.
134134
const int SUB = 0x64086408;

csrc/rocm/attention.cu

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -907,7 +907,9 @@ __launch_bounds__(NUM_THREADS) void paged_attention_ll4mi_reduce_kernel(
907907
const scalar_t* __restrict__ tmp_out, // [num_seqs, num_heads,
908908
// max_num_partitions, head_size]
909909
const int* __restrict__ context_lens, // [num_seqs]
910-
const int max_num_partitions){UNREACHABLE_CODE}
910+
const int max_num_partitions) {
911+
UNREACHABLE_CODE
912+
}
911913

912914
#endif // defined(__HIP__MI300_MI250__) TODO: Add NAVI support
913915

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ def get_rocm_version():
417417

418418
if (get_rocm_core_version(ctypes.byref(major), ctypes.byref(minor),
419419
ctypes.byref(patch)) == 0):
420-
return "%d.%d.%d" % (major.value, minor.value, patch.value)
420+
return f"{major.value}.{minor.value}.{patch.value}"
421421
return None
422422
except Exception:
423423
return None

0 commit comments

Comments
 (0)