-
Notifications
You must be signed in to change notification settings - Fork 5.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[PRIM][IR]Complete IR vjp code gen for more vjp code gen #56798
Merged
Charles-hit
merged 7 commits into
PaddlePaddle:develop
from
Charles-hit:support_mutable_attributes
Sep 1, 2023
Merged
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
3ebef77
Fix attr type error like concat axis
0x45f b68ad4e
Fix None input error
0x45f 0d9f929
Fix intermediate output
0x45f 5705c69
support vjp code gen
Charles-hit 7c675fc
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Charles-hit 8bb28a3
Merge commit 'refs/pull/56712/head' of https://github.com/PaddlePaddl…
Charles-hit 033acf4
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Charles-hit File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -84,3 +84,21 @@ def supports_no_need_buffer(op): | |
|
||
def is_tensor_list(s): | ||
return s == 'Tensor[]' | ||
|
||
|
||
def exist_mutable_attribute(attrs): | ||
for attr in attrs: | ||
if ( | ||
attr['typename'] in ['Scalar', 'IntArray'] | ||
and attr['support_tensor'] is True | ||
): | ||
return True | ||
else: | ||
return False | ||
|
||
|
||
def is_mutable_attribute(attr): | ||
return ( | ||
attr['typename'] in ['Scalar', 'IntArray'] | ||
and attr['support_tensor'] is True | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 属于这两类'Scalar', 'IntArray',但是没有support_tensor属性的算子怎样处理的? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 会变成常量处理 |
||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Scalar
的类型不仅仅是Scalar
还可能是Scalar(int)
Scalar(int64_t)
等,这个函数可以借助tests_utils.py
中的进行判断。
2. 新IR下可变attribute是否需要对:
进行判断。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
感谢提醒,第一个点我理解有明确类型数据类型应该不需要修改了,第二点已经在
gen.py
中进行处理了。