Skip to content
Closed
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
7 changes: 7 additions & 0 deletions vllm_ascend/quantization/w8a8_dynamic.py
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,13 @@ def process_weights_after_loading(self, layer):
1, 2).contiguous()
layer.w2_weight.data = layer.w2_weight.data.transpose(
1, 2).contiguous()
# This optimization relies on the modifications in torch_npu, otherwise accuracy
# problem will happen. But we can evaluate the inference speed by transforming
# weights to NZ (29)
layer.w13_weight.data = torch_npu.npu_format_cast(
layer.w13_weight.data, 29)
layer.w2_weight.data = torch_npu.npu_format_cast(
layer.w2_weight.data, 29)
layer.w13_weight_scale.data = layer.w13_weight_scale.data.view(
layer.w13_weight_scale.data.shape[0], -1)
layer.w13_weight_offset.data = layer.w13_weight_offset.data.view(
Expand Down