Skip to content
Open
Show file tree
Hide file tree
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
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
##### 1.modeling_qwen2_vl.py对VisionAttention 模块的 Softmax 优化

修改前

```python
attn_weights = nn.functional.softmax(attn_weights, dim=-1, dtype=mindspore.float32).to(q.dtype)
```

修改后

```
attn_weights = nn.functional.softmax(attn_weights, dim=-1)
```

##### 2.vq_model.py

修改前代码中包含了一段针对不同硬件(Orange Pi vs A2)的条件判断逻辑。它会检查输入是否为 `float32`,如果不是,会先转为 `float32` 进行插值,再根据硬件标志位 (`ON_ORANGE_PI`) 转回 `float16` 或 `bfloat16`。

修改后

```
# 现在的逻辑非常直接:
x = F.interpolate(x, scale_factor=2.0, mode="nearest", recompute_scale_factor=True)
```

整体优化显存116分,prefill 106分,decoder103分