CARVIEW |
Select Language
HTTP/2 200
date: Fri, 25 Jul 2025 10:05:42 GMT
content-type: text/html; charset=utf-8
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With,Accept-Encoding, Accept, X-Requested-With
x-robots-tag: none
etag: W/"3346d3035152144ccc022b787152e1cc"
cache-control: max-age=0, private, must-revalidate
strict-transport-security: max-age=31536000; includeSubdomains; preload
x-frame-options: deny
x-content-type-options: nosniff
x-xss-protection: 0
referrer-policy: no-referrer-when-downgrade
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net/ productionresultssa1.blob.core.windows.net/ productionresultssa2.blob.core.windows.net/ productionresultssa3.blob.core.windows.net/ productionresultssa4.blob.core.windows.net/ productionresultssa5.blob.core.windows.net/ productionresultssa6.blob.core.windows.net/ productionresultssa7.blob.core.windows.net/ productionresultssa8.blob.core.windows.net/ productionresultssa9.blob.core.windows.net/ productionresultssa10.blob.core.windows.net/ productionresultssa11.blob.core.windows.net/ productionresultssa12.blob.core.windows.net/ productionresultssa13.blob.core.windows.net/ productionresultssa14.blob.core.windows.net/ productionresultssa15.blob.core.windows.net/ productionresultssa16.blob.core.windows.net/ productionresultssa17.blob.core.windows.net/ productionresultssa18.blob.core.windows.net/ productionresultssa19.blob.core.windows.net/ github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com api.githubcopilot.com api.individual.githubcopilot.com api.business.githubcopilot.com api.enterprise.githubcopilot.com; font-src github.githubassets.com; form-action 'self' github.com gist.github.com copilot-workspace.githubnext.com objects-origin.githubusercontent.com; frame-ancestors 'none'; frame-src viewscreen.githubusercontent.com notebooks.githubusercontent.com; img-src 'self' data: blob: github.githubassets.com media.githubusercontent.com camo.githubusercontent.com identicons.github.com avatars.githubusercontent.com private-avatars.githubusercontent.com github-cloud.s3.amazonaws.com objects.githubusercontent.com release-assets.githubusercontent.com secured-user-images.githubusercontent.com/ user-images.githubusercontent.com/ private-user-images.githubusercontent.com opengraph.githubassets.com copilotprodattachments.blob.core.windows.net/github-production-copilot-attachments/ github-production-user-asset-6210df.s3.amazonaws.com customer-stories-feed.github.com spotlights-feed.github.com objects-origin.githubusercontent.com *.githubusercontent.com; manifest-src 'self'; media-src github.com user-images.githubusercontent.com/ secured-user-images.githubusercontent.com/ private-user-images.githubusercontent.com github-production-user-asset-6210df.s3.amazonaws.com gist.github.com; script-src github.githubassets.com; style-src 'unsafe-inline' github.githubassets.com; upgrade-insecure-requests; worker-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/
server: github.com
content-encoding: gzip
accept-ranges: bytes
set-cookie: _gh_sess=a6IbuB1C3Ti7V83jO%2B4xxFEP%2BpTgLYy8tYvpw%2Fi%2FzMNHp6GB32uQh22bJCHlvpv%2FIlc2Y3kb69TTYGW%2BFmMG1UxRFH3yHSMIxw9C%2BUzek9UoT6a0Hegamcqaey1PcDhI5JK1yYSiLxeHbiN84DYDXd3qcZt5q3ibbTzNkX2qW1yO6Rm5Pcxs2fO8iE6fC3ADVHrus1M0LqsqwUOmh9w4PV3XoK5tK5mMeFdhaRTRjArMFbHFyJGsNnKZcYmt%2FBt8CRsO3Qxi236aruOUafo70g%3D%3D--krRYZDW2nmnVB6ZB--XafEHEjKsSk%2B7nfxP1klag%3D%3D; Path=/; HttpOnly; Secure; SameSite=Lax
set-cookie: _octo=GH1.1.1565420788.1753437942; Path=/; Domain=github.com; Expires=Sat, 25 Jul 2026 10:05:42 GMT; Secure; SameSite=Lax
set-cookie: logged_in=no; Path=/; Domain=github.com; Expires=Sat, 25 Jul 2026 10:05:42 GMT; HttpOnly; Secure; SameSite=Lax
x-github-request-id: E28A:3C1FBC:29FFF0:2F46C6:688356F6
Gradient Check Is Required for Op Test · PaddlePaddle/Paddle Wiki · GitHub
Skip to content
Navigation Menu
{{ message }}
-
Notifications
You must be signed in to change notification settings - Fork 5.8k
Gradient Check Is Required for Op Test
Tao Luo edited this page Dec 24, 2019
·
1 revision
Gradient Check Is Required for Op Test (English Version)
规范概要:
- 第1节,背景
- 第2节,本规范检查内容
- 第3节,CI检查方法
- 第4节,未通过检查的修改建议
补充说明:
此规范在执行过程中,可能存在未考虑周全的地方。请大家积极反馈意见,在实施过程中不断补充与完善。
目前,OP单测中存在未做梯度检查或者禁用梯度检查的问题。为了保证所有反向Op实现的正确性,提出了本条规范,并在CI中添加了相应的检查。除特殊情况外,所有Op单测都需要调用check_grad方法。
检查范围:Op的单测脚本中,所有继承了OpTest的测试样例,都需要调用check_grad方法进行梯度检查。
特殊情况:
序号 | 类别 | 原因 |
---|---|---|
1 | 未注册Grad Op | 无需进行梯度检查 |
2 | Python API的单测 | 不要求进行梯度检查 |
3 | 其他特殊的单测 | 因特定原因,无需进行梯度检查 |
- 对于情况1:监控机制会通过白名单EMPTY_GRAD_OP_LIST将其豁免
- 对于情况2:单测需继承unittest.TestCase
- 对于情况3:使用skip_check_grad_ci装饰器,描述需跳过check_grad监控的原因。
除特殊情况外,其他的单测均被要求进行梯度检查。
当单测被skip_check_grad_ci装饰时,会为测试样例增加no_need_check_grad成员变量。当单测调用check_grad或check_grad_with_place方法时,会为测试样例增加成员变量exist_check_grad。在单测执行结束后,以下情况,check_grad的监控会被豁免:
- 如果单测有成员变量no_need_check_grad,或者op_type在EMPTY_GRAD_OP_LIST白名单中
- 输入为int8、bool类型时
当单测未通过check_grad的监控,可以参考以下建议进行修改:
- 如果是非Op单测,例如:Python API测试,相应单测需继承unittest.TestCase
- 如果有特殊原因不需要进行梯度检查,需使用skip_check_grad_ci装饰器,并描述原因。使用该装饰器需要特定人员审核。
若遇到其他问题,请联系 @zhangting2020
You can’t perform that action at this time.