Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
bitsandbytes
Commits
d731fc42
Unverified
Commit
d731fc42
authored
Sep 08, 2025
by
Matthew Douglas
Committed by
GitHub
Sep 08, 2025
Browse files
Adjust 4bit test tolerance on CPU for larger blocksizes (#1749)
parent
27549fb0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
tests/test_functional.py
tests/test_functional.py
+6
-2
No files found.
tests/test_functional.py
View file @
d731fc42
...
@@ -1169,8 +1169,12 @@ class TestQuantize4BitFunctional:
...
@@ -1169,8 +1169,12 @@ class TestQuantize4BitFunctional:
4096
:
0.262457
,
4096
:
0.262457
,
}
}
assert
err
<
error_dict
[
quant_type
][
"err"
][
blocksize
]
+
1e-3
# Allow higher tolerance for fp32 on CPU with larger block sizes
assert
relerr
<
error_dict
[
quant_type
][
"rel_err"
][
blocksize
]
+
1e-3
reltol
=
2.8e-3
if
dtype
==
torch
.
float32
and
blocksize
>=
128
and
device
==
"cpu"
else
1e-3
errtol
=
1.2e-3
if
dtype
==
torch
.
float32
and
blocksize
>=
1024
and
device
==
"cpu"
else
1e-3
assert
err
<
error_dict
[
quant_type
][
"err"
][
blocksize
]
+
errtol
assert
relerr
<
error_dict
[
quant_type
][
"rel_err"
][
blocksize
]
+
reltol
@
pytest
.
mark
.
parametrize
(
"device"
,
get_available_devices
())
@
pytest
.
mark
.
parametrize
(
"device"
,
get_available_devices
())
@
pytest
.
mark
.
parametrize
(
"quant_type"
,
[
"fp4"
,
"nf4"
])
@
pytest
.
mark
.
parametrize
(
"quant_type"
,
[
"fp4"
,
"nf4"
])
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment