Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
OpenDAS
vllm_cscc
Commits
4069db3f
Unverified
Commit
4069db3f
authored
Oct 09, 2025
by
roikoren755
Committed by
GitHub
Oct 09, 2025
Browse files
[Bugfix] Enable padded FP4 quantization (#25947)
Signed-off-by:
Roi Koren
<
roik@nvidia.com
>
parent
0d37450e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
3 deletions
+1
-3
vllm/_custom_ops.py
vllm/_custom_ops.py
+1
-1
vllm/utils/flashinfer.py
vllm/utils/flashinfer.py
+0
-2
No files found.
vllm/_custom_ops.py
View file @
4069db3f
...
@@ -1384,7 +1384,7 @@ def scaled_fp4_quant(
...
@@ -1384,7 +1384,7 @@ def scaled_fp4_quant(
rounded_m
=
round_up
(
m
,
128
)
rounded_m
=
round_up
(
m
,
128
)
scale_n
=
n
//
block_size
scale_n
=
n
//
block_size
rounded_n
=
round_up
(
scale_n
,
4
)
rounded_n
=
round_up
(
scale_n
,
4
)
output_scale
=
torch
.
empty
(
output_scale
=
torch
.
zeros
(
(
rounded_m
,
rounded_n
//
4
),
device
=
device
,
dtype
=
torch
.
int32
(
rounded_m
,
rounded_n
//
4
),
device
=
device
,
dtype
=
torch
.
int32
)
)
...
...
vllm/utils/flashinfer.py
View file @
4069db3f
...
@@ -386,8 +386,6 @@ def flashinfer_scaled_fp4_mm(
...
@@ -386,8 +386,6 @@ def flashinfer_scaled_fp4_mm(
assert
block_scale_a
.
ndim
==
2
and
block_scale_b
.
ndim
==
2
assert
block_scale_a
.
ndim
==
2
and
block_scale_b
.
ndim
==
2
assert
a
.
stride
(
-
1
)
==
1
and
b
.
stride
(
-
1
)
==
1
assert
a
.
stride
(
-
1
)
==
1
and
b
.
stride
(
-
1
)
==
1
assert
a
.
shape
[
1
]
==
b
.
shape
[
1
]
assert
a
.
shape
[
1
]
==
b
.
shape
[
1
]
assert
block_scale_a
.
shape
[
1
]
==
a
.
shape
[
1
]
//
8
assert
block_scale_b
.
shape
[
1
]
==
b
.
shape
[
1
]
//
8
if
backend
==
"cutlass"
:
if
backend
==
"cutlass"
:
block_scale_a
=
block_scale_a
.
view
(
torch
.
uint8
)
block_scale_a
=
block_scale_a
.
view
(
torch
.
uint8
)
...
...
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