-
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
[OpTest] support prim test in OpTest #50509
Merged
Charles-hit
merged 29 commits into
PaddlePaddle:develop
from
Charles-hit:prim_test_frame
Feb 21, 2023
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
0324a82
support prim test in OpTest
Charles-hit 2f4b577
fix cmake
Charles-hit f8c067e
fix op test
Charles-hit 92705f5
fix test_input_spec
Charles-hit 10aa52f
disable cinn in reduce_sum unit test
Charles-hit 739e146
add bfloat16 dtype for sum
Charles-hit 71fc6a3
polish code
Charles-hit 82f2057
add clear jit program function
Charles-hit eaf8176
convert grad out from tensor to numpy
Charles-hit f8e4fa2
remove unnecessary code
Charles-hit 0ed31a1
add only_prim flag
Charles-hit 596b77c
fix flag
Charles-hit db1ba08
fix op test
Charles-hit 5b141d3
fix optest comp inplace error
Charles-hit c04cbf2
fix op test
Charles-hit 23d978f
fix op test with guard
Charles-hit 016ee35
add initialization of check_comp flag
Charles-hit 12ab8cb
fix comp inplace error in op test
Charles-hit 4b2d222
rename check_comp with check_prim and add bfloat16 dtype convert
Charles-hit 8b6dda7
rename comp_op_type to prim_op_type
Charles-hit 889146c
rename comp to prim
Charles-hit 7913e27
remove useless code
Charles-hit a0210f3
skip ci check for only prim
Charles-hit c3ffa48
add no_grad_vars and grad_outputs in prim test
Charles-hit e48efee
fix var_dict
Charles-hit 0d375a0
Merge branch 'develop' of https://github.com/PaddlePaddle/Paddle into…
Charles-hit dbddace
fix op test for only_prim
Charles-hit e825902
fix dy2static bugs
Charles-hit d19cf71
polish some code
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# Copyright (c) 2023 PaddlePaddle Authors. All Rights Reserved. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
import numpy as np | ||
|
||
TOLERANCE = { | ||
np.dtype('float64'): { | ||
"jit_comp": {"rtol": 1e-15, "atol": 1e-15}, | ||
"fw_comp": {"rtol": 1e-15, "atol": 1e-15}, | ||
"rev_comp": {"rtol": 1e-15, "atol": 1e-15}, | ||
"cinn": {"rtol": 1e-14, "atol": 1e-14}, | ||
}, | ||
np.dtype('float32'): { | ||
"jit_comp": {"rtol": 1e-6, "atol": 1e-6}, | ||
"fw_comp": {"rtol": 1e-6, "atol": 1e-6}, | ||
"rev_comp": {"rtol": 1e-6, "atol": 1e-6}, | ||
"cinn": {"rtol": 1e-5, "atol": 1e-5}, | ||
}, | ||
np.dtype('float16'): { | ||
"jit_comp": {"rtol": 1e-3, "atol": 1e-3}, | ||
"fw_comp": {"rtol": 1e-3, "atol": 1e-3}, | ||
"rev_comp": {"rtol": 1e-3, "atol": 1e-3}, | ||
"cinn": {"rtol": 1e-2, "atol": 1e-2}, | ||
}, | ||
np.dtype('uint16'): { | ||
"jit_comp": {"rtol": 1e-2, "atol": 1e-2}, | ||
"fw_comp": {"rtol": 1e-2, "atol": 1e-2}, | ||
"rev_comp": {"rtol": 1e-2, "atol": 1e-2}, | ||
"cinn": {"rtol": 1e-1, "atol": 1e-1}, | ||
}, | ||
} | ||
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. 是否需要支持bfloat16? 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. numpy没有bfloat16数据类型,这儿用unit16来表示bfloat16,目前python api都是这样做的 |
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.
dose this config used only for op test?