Skip to content

Conversation

@DrRyanHuang
Copy link
Contributor

@DrRyanHuang DrRyanHuang commented Oct 31, 2025

PR Category

Execute Infrastructure

PR Types

Bug fixes

Description

修复 flash_attn_v3_varlen 参数不支持 pir.Value 的问题,由于输入中存在 0 维 Tensor,所以提升一下类型 int -> Scalar

# FastDeploy 运行 DeepseekV3 转静报错:
File "/workspace/Paddle/build/python/paddle/nn/functional/flash_attention.py", line 1150, in flash_attn_varlen_func
    out, softmax_lse = _C_ops.flash_attn_v3_varlen(
TypeError: (InvalidType) flash_attn_v3_varlen(): argument (position 12) must be int, 
but got paddle.base.libpaddle.pir.Value (at /workspace/Paddle/paddle/fluid/pybind/op_function_common.cc:311)

以及 python/paddle/utils/decorator_utils.py 中的 typo:

_is_in_or_scalar_tensor -> _is_int_or_scalar_tensor

@paddle-bot
Copy link

paddle-bot bot commented Oct 31, 2025

你的PR提交成功,感谢你对开源项目的贡献!
请关注后续CI自动化测试结果,详情请参考Paddle-CI手册
Your PR has been submitted. Thanks for your contribution!
Please wait for the result of CI firstly. See Paddle CI Manual for details.

@SigureMo
Copy link
Member

flash_attn_v3_varlen api support pir

之前不支持吗?

@DrRyanHuang DrRyanHuang changed the title [PIR] flash_attn_v3_varlen api support pir and max_seqlen_q/k use Scalar(Tensor) [PIR] Promote flash_attn_v3_varlen argument (position 12) from int to Scalar to support pir.Value Oct 31, 2025
@codecov-commenter
Copy link

Codecov Report

✅ All modified and coverable lines are covered by tests.
⚠️ Please upload report for BASE (develop@f07eb72). Learn more about missing BASE report.

Additional details and impacted files
@@             Coverage Diff             @@
##             develop    #76151   +/-   ##
===========================================
  Coverage           ?   100.00%           
===========================================
  Files              ?         1           
  Lines              ?         7           
  Branches           ?         0           
===========================================
  Hits               ?         7           
  Misses             ?         0           
  Partials           ?         0           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@DrRyanHuang DrRyanHuang merged commit fecfacd into PaddlePaddle:develop Nov 3, 2025
76 of 78 checks passed
@DrRyanHuang DrRyanHuang deleted the flash_attn_v3_int2scalar branch November 3, 2025 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants