Skip to content

Conversation

@lshpku
Copy link
Contributor

@lshpku lshpku commented Jan 1, 2025

PR Category

CINN

PR Types

Performance

Description

解除EliminateInvariantLoop对inplace操作的限制,仅保留对reduce的限制,可以提升动态shape下含有此类inplace操作的算子性能10%

解释:inplace操作可以分为两种:

  • reduce,比如a[0] = a[0] + b[k]
  • 单次inplace assign,比如a[0] = rsqrt(a[0])

之前担心正确性问题,所以两种inplace都不允许,现在发现第二种没必要限制,因为它总是只执行一次,所以for循环是没必要的


Pcard-85711

@lshpku lshpku merged commit 2306ba6 into PaddlePaddle:develop Jan 2, 2025
33 of 34 checks passed
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.

2 participants