PaddleOCR icon indicating copy to clipboard operation
PaddleOCR copied to clipboard

PaddleOCRVL Exception from the 'vlm' worker: (Unimplemented) FlashAttention 2 is unsupported

Open 221349632 opened this issue 1 month ago • 11 comments

🔎 Search before asking

  • [x] I have searched the PaddleOCR Docs and found no similar bug report.
  • [x] I have searched the PaddleOCR Issues and found no similar bug report.
  • [x] I have searched the PaddleOCR Discussions and found no similar bug report.

🐛 Bug (问题描述)

RuntimeError: Exception from the 'vlm' worker: (Unimplemented) FlashAttention 2 is unsupported, please check the GPU compatibility and CUDA Version. (at ../paddle/phi/kernels/gpu/flash_attn_utils.h:393)

是我版本太低了吗

🏃‍♂️ Environment (运行环境)

nvidia-cublas-cu12 12.6.4.1 nvidia-cuda-runtime-cu12 12.6.77 nvidia-cudnn-cu12 9.5.1.17 nvidia-cufft-cu12 11.3.0.4 nvidia-curand-cu12 10.3.7.77 nvidia-cusolver-cu12 11.7.1.2 nvidia-cusparse-cu12 12.5.4.2 nvidia-nvjitlink-cu12 12.9.86

🌰 Minimal Reproducible Example (最小可复现问题的Demo)

from paddleocr import PaddleOCRVL

pipeline = PaddleOCRVL()

pipeline = PaddleOCRVL(use_doc_orientation_classify=True) # 通过 use_doc_orientation_classify 指定是否使用文档方向分类模型

pipeline = PaddleOCRVL(use_doc_unwarping=True) # 通过 use_doc_unwarping 指定是否使用文本图像矫正模块

pipeline = PaddleOCRVL(use_layout_detection=False) # 通过 use_layout_detection 指定是否使用版面区域检测排序模块

output = pipeline.predict("./paddleocr_vl_demo.png") for res in output: res.print() ## 打印预测的结构化输出 res.save_to_json(save_path="output") ## 保存当前图像的结构化json结果 res.save_to_markdown(save_path="output") ## 保存当前图像的markdown格式的结果

221349632 avatar Dec 10 '25 06:12 221349632

不会现在只兼容 50系列的显卡吧

221349632 avatar Dec 10 '25 06:12 221349632

请问你使用的是什么型号的显卡呀?

Bobholamovic avatar Dec 10 '25 06:12 Bobholamovic

NVIDIA GeForce RTX 4060 Laptop GPU

221349632 avatar Dec 10 '25 06:12 221349632

我们在4090上做过测试,没有遇到这个问题。请问你安装的paddlepaddle-gpu、paddlex、paddleocr版本分别是多少?可以在pip list结果中找到这些信息。

Bobholamovic avatar Dec 10 '25 06:12 Bobholamovic

paddleocr 3.3.2 paddlepaddle-gpu 3.2.1 paddlex 3.3.11

221349632 avatar Dec 10 '25 06:12 221349632

paddlepaddle-gpu是如何安装的?

Bobholamovic avatar Dec 10 '25 06:12 Bobholamovic

python -m pip install paddlepaddle-gpu==3.2.1 -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ 官网文档这个链接太慢了

我是通过浏览器下载到本地 paddlepaddle_gpu-3.2.1-cp311-cp311-win_amd64.whl 然后 pip install paddlepaddle_gpu-3.2.1-cp311-cp311-win_amd64.whl

221349632 avatar Dec 10 '25 06:12 221349632

可以先尝试将paddlex降级到3.3.9版本,看看问题是否还存在:pip install paddlex==3.3.9;我们也将同步排查问题产生的原因。

Bobholamovic avatar Dec 10 '25 07:12 Bobholamovic

你好,我们排查到这是因为Paddle框架在Windows系统不支持FlashAttention,我们将在paddlex(paddleocr依赖的底层库)的下个patch版本增加自动检查,并在windows系统fall back到非FA方案。当前,请您暂时使用3.3.9版本的paddlex以绕过此问题,或者使用WSL/Docker部署。

Bobholamovic avatar Dec 11 '25 02:12 Bobholamovic

好的我用 paddlex 3.3.9 试试,

下个patch版本大约什么时候能发布

221349632 avatar Dec 12 '25 05:12 221349632

pip install paddlex==3.3.9 可以用

221349632 avatar Dec 12 '25 05:12 221349632