Skip to content

Commit 81dba6a

Browse files
committed
Move quality check to separate workflow file and fix error msg
Signed-off-by: Fynn Schmitt-Ulms <[email protected]>
1 parent a4e3b48 commit 81dba6a

File tree

3 files changed

+38
-24
lines changed

3 files changed

+38
-24
lines changed

.github/workflows/quality-check.yaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
name: Quality Checks
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
branches:
8+
- main
9+
10+
jobs:
11+
quality-check:
12+
runs-on: ubuntu-24.04
13+
steps:
14+
- uses: actions/setup-python@v5
15+
with:
16+
python-version: '3.10'
17+
- uses: actions/checkout@v4
18+
with:
19+
fetch-depth: 0
20+
fetch-tags: true
21+
- name: Set Env
22+
run: |
23+
pip3 install --upgrade pip && pip3 install --upgrade setuptools
24+
- name: "⚙️ Install dependencies"
25+
run: pip3 install .[dev]
26+
- name: "🧹 Running quality checks"
27+
run: make quality

.github/workflows/test-check.yaml

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -27,20 +27,3 @@ jobs:
2727
- name: "🔬 Running tests"
2828
run: make test
2929

30-
python-style:
31-
runs-on: ubuntu-24.04
32-
steps:
33-
- uses: actions/setup-python@v5
34-
with:
35-
python-version: '3.10'
36-
- uses: actions/checkout@v4
37-
with:
38-
fetch-depth: 0
39-
fetch-tags: true
40-
- name: Set Env
41-
run: |
42-
pip3 install --upgrade pip && pip3 install --upgrade setuptools
43-
- name: "⚙️ Install dependencies"
44-
run: pip3 install .[dev]
45-
- name: "🔬 Running quality checks"
46-
run: make quality

src/compressed_tensors/quantization/quant_args.py

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -211,21 +211,25 @@ def validate_group(cls, value) -> Union[int, None]:
211211
def validate_block_structure(cls, value) -> Optional[List[int]]:
212212
if value is None:
213213
return value
214-
invalid_block_structure_msg = (
215-
f"Invalid block_structure '{value}'. Must be a list of two ints"
216-
" [rows, cols]."
217-
)
218214
# For backward compatibility, allow string format "2x4", "8x16", etc.
219215
if isinstance(value, str):
220216
try:
221217
return [int(x) for x in value.split("x")]
222218
except Exception:
223-
raise ValueError(invalid_block_structure_msg)
219+
raise ValueError(
220+
f"Invalid block_structure '{value}'. Must be a list of ints "
221+
"[rows, cols]."
222+
)
224223
if isinstance(value, (list, tuple)):
225224
if len(value) != 2 or not all(isinstance(v, int) for v in value):
226-
raise ValueError(invalid_block_structure_msg)
225+
raise ValueError(
226+
f"Invalid block_structure '{value}'. Must be a list of ints "
227+
"[rows, cols]."
228+
)
227229
return list(value)
228-
raise ValueError(invalid_block_structure_msg)
230+
raise ValueError(
231+
f"Invalid block_structure '{value}'. Must be a list of ints [rows, cols]."
232+
)
229233

230234
@field_validator("strategy", mode="before")
231235
def validate_strategy(cls, value) -> Union[QuantizationStrategy, None]:

0 commit comments

Comments
 (0)