Skip to content

Commit afa56ed

Browse files
committed
enable_cuda_graph fix
1 parent a6d6674 commit afa56ed

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

vllm/model_executor/models/deepseek_v2.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -582,12 +582,18 @@ def forward(
582582
) -> torch.Tensor:
583583
# Self Attention
584584
if is_rocm_aiter_fused_rms_quant_enabled():
585-
q_hidden_states, residual, y_scale = aiter_ops.rocm_aiter_rmsnorm2d_fwd_with_add_quant(hidden_states,
586-
residual=residual, weight=self.input_layernorm.weight,
585+
if residual is None:
586+
q_hidden_states, residual_out, y_scale = aiter_ops.rocm_aiter_rmsnorm2d_fwd_with_add_quant(hidden_states,
587+
residual=None, weight=self.input_layernorm.weight,
587588
variance_epsilon=self.input_layernorm.variance_epsilon,
588589
x_scale=None, y_scale_dtype=torch.float32)
589-
if residual is None:
590590
residual = hidden_states
591+
else: # tmp fix for enable cuda graph
592+
q_hidden_states, residual_out, y_scale = aiter_ops.rocm_aiter_rmsnorm2d_fwd_with_add_quant(hidden_states,
593+
residual=residual, weight=self.input_layernorm.weight,
594+
variance_epsilon=self.input_layernorm.variance_epsilon,
595+
x_scale=None, y_scale_dtype=torch.float32)
596+
residual = residual_out
591597
else:
592598
if residual is None:
593599
residual = hidden_states

0 commit comments

Comments
 (0)