-
Notifications
You must be signed in to change notification settings - Fork 5.6k
It's recommend to set no_grad_set to be None (English Version)
Specification summary:
- Section 1, Explanations Of The Specification
- Section 2, Check Of The Specification
- Section 3, Check Of CI
- Section 4, Suggestions Of Check Failure
Supplementary note:
- You may find some aspects that are not taken into account in the existing specifications, which need to be continuously supplemented and improved during the implementation process. Please feel free to give your feedback.
While running a test and adding the certain variable to the no_grad_set, he finds that the reverse of this variable is wrong, the test will not check and the error will not be found.
In order to avoid the indiscriminate use of the no_grad_set value, the specification that the value of no_grad_set must be None is proposed. The corresponding detections are added to Op tests, and CI will check the white list of this specification.
Op tests requirements:
- The value of no_grad_set should be None.
- That the value of no_grad_set is the all input of OP is not advisable
- The white list of this specification will skip specific OPs with value of no_grad_set and OPs to be repaired. White list path: python/paddle/fluid/tests/unittests/white_list/no_grad_set_white_list.py
- The whitelist will be checked in CI. If you need to modify it, please contact one of specific people for approval.
-
Error example File_path:
python/paddle/fluid/tests/unittests/sequence/test_sequence_conv.py
The value of no_grad_set is the all input of sequence_conv(X
,Filter
), this is not advisable(Detailed Information:PR22571).
self.inputs = { 'X': (x, self.lod), 'Filter': w, }
def test_check_grad_padding_data(self): if self.padding_trainable: self.check_grad( ['PaddingData'], 'Out', no_grad_set=set(['X', 'Filter']))
- The value of nno_grad_set must be None
- If the value of no_grad_set is not None, please contact one of specific people for approval. If it is passing, you can put this op in NO_CHECK_LIST of no_grad_set_white_list to skip no_grad_set check
If you encounter other problems, please contact @chenjiao