Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions csrc/ops.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,8 +130,8 @@ void silu_and_mul(torch::Tensor& out, torch::Tensor& input);
void silu_and_mul_quant(torch::Tensor& out, torch::Tensor& input,
torch::Tensor& scale);

#ifndef USE_ROCM

#if (defined(ENABLE_NVFP4_SM100) && ENABLE_NVFP4_SM100) || \
(defined(ENABLE_NVFP4_SM120) && ENABLE_NVFP4_SM120)
void silu_and_mul_nvfp4_quant(torch::Tensor& out,
torch::Tensor& output_block_scale,
torch::Tensor& input,
Expand Down
3 changes: 2 additions & 1 deletion csrc/torch_bindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ TORCH_LIBRARY_EXPAND(TORCH_EXTENSION_NAME, ops) {
"silu_and_mul_quant(Tensor! result, Tensor input, Tensor scale) -> ()");
ops.impl("silu_and_mul_quant", torch::kCUDA, &silu_and_mul_quant);

#ifndef USE_ROCM
#if (defined(ENABLE_NVFP4_SM100) && ENABLE_NVFP4_SM100) || \
(defined(ENABLE_NVFP4_SM120) && ENABLE_NVFP4_SM120)
ops.def(
"silu_and_mul_nvfp4_quant(Tensor! result, Tensor! result_block_scale, "
"Tensor input, Tensor input_global_scale) -> ()");
Expand Down
4 changes: 3 additions & 1 deletion vllm/compilation/fix_functionalization.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ def __call__(self, graph: torch.fx.Graph):
node,
mutated_args,
args=('result', 'input', 'scale'))
elif at_target == torch.ops._C.silu_and_mul_nvfp4_quant.default:
elif current_platform.has_device_capability(
100
) and at_target == torch.ops._C.silu_and_mul_nvfp4_quant.default:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The check current_platform.has_device_capability(100) is incorrect. The has_device_capability method compares its integer argument with the major version of the CUDA compute capability. For Blackwell GPUs (SM 10.0), the major version is 10. Therefore, the check 10 >= 100 will always evaluate to false, preventing this code path from ever being taken on the intended hardware. This should be has_device_capability(10) to correctly target devices with compute capability 10.x and above.

Suggested change
elif current_platform.has_device_capability(
100
) and at_target == torch.ops._C.silu_and_mul_nvfp4_quant.default:
elif current_platform.has_device_capability(
10
) and at_target == torch.ops._C.silu_and_mul_nvfp4_quant.default:

@zou3519 zou3519 Aug 29, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Easier way to check here is "if hasattr(torch.ops._C, silu_and_mul_nvfp4_quant)"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i feel if hasattr(torch.ops._C, silu_and_mul_nvfp4_quant) makes more sense.

mutated_args = {1: 'result', 2: 'result_block_scale'}
self.defunctionalize(graph,
node,
Expand Down