Skip to content

support 32K model len on deepseek r1 W8A8 #728

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
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
9 changes: 3 additions & 6 deletions vllm_ascend/quantization/w8a8_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,8 +276,7 @@ def fused_experts(hidden_states: torch.Tensor,
group_list_type=group_list_type)

if expert_map is not None:
weighted_down_out = down_out_list * sorted_weights.unsqueeze(1)

down_out_list.mul_(sorted_weights.unsqueeze(1))
final_hidden_states = torch.zeros(*original_shape,
device=hidden_states.device,
dtype=dtype)
Expand All @@ -286,10 +285,8 @@ def fused_experts(hidden_states: torch.Tensor,
valid_token_mask = torch.arange(
0, sorted_token_indices.shape[0],
device=device).unsqueeze(1) < num_valid_tokens
valid_output = torch.where(
valid_token_mask, weighted_down_out,
torch.zeros_like(weighted_down_out)).to(dtype)
final_hidden_states.index_add_(0, sorted_token_indices, valid_output)
down_out_list.mul_(valid_token_mask)
final_hidden_states.index_add_(0, sorted_token_indices, down_out_list)
else:
# TODO: Reorder device memory 2 times here, replace the current
# implementation here when suitable operators become available.
Expand Down