When will F.scaled_dot_product_attention support conversion to NCNN format using PNNX?
error log | 日志或报错信息 | ログ
ignore Slice unbind_46 param dim=0
ignore F.scaled_dot_product_attention F.scaled_dot_product_attention_3341 param dropout_p=0.0
ignore F.scaled_dot_product_attention F.scaled_dot_product_attention_3341 param is_causal=False
ignore Tensor.expand Tensor.expand_895 param shape=(1,4,144,144)
ignore Slice unbind_47 param dim=0
ignore F.scaled_dot_product_attention F.scaled_dot_product_attention_3342 param dropout_p=0.0
ignore F.scaled_dot_product_attention F.scaled_dot_product_attention_3342 param is_causal=False
and use export ncnn model raise error:
layer F.scaled_dot_product_attention not exists or registered
model | 模型 | モデル
- original model
https://github.com/ZhengPeng7/BiRefNet
how to reproduce | 复现步骤 | 再現方法
Hi @pangxiaobin! I'm Dosu and I’m helping the ncnn team.
F.scaled_dot_product_attention is now supported for conversion to NCNN format using PNNX in ncnn releases after July 18, 2024. This support was added and merged in PR #5589 and further improved in later updates, so if you use ncnn/PNNX from after this date, your model should convert and export without the "layer not exists or registered" error. Make sure you are also using a recent PyTorch version (2.1 or newer is recommended for full compatibility) PR #5748.
If you still see this error, update your ncnn and PNNX to the latest version. The official operator docs may not list it yet, but the codebase and tests confirm support is present.
To reply, just mention @dosu.
How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other
https://github.com/Tencent/ncnn/pull/6397
https://github.com/Tencent/ncnn/pull/6405