You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

condition_list.py 29 kB

5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741
  1. # Copyright 2020 Huawei Technologies Co., Ltd
  2. #
  3. # Licensed under the Apache License, Version 2.0 (the "License");
  4. # you may not use this file except in compliance with the License.
  5. # You may obtain a copy of the License at
  6. #
  7. # http://www.apache.org/licenses/LICENSE-2.0
  8. #
  9. # Unless required by applicable law or agreed to in writing, software
  10. # distributed under the License is distributed on an "AS IS" BASIS,
  11. # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. # See the License for the specific language governing permissions and
  13. # limitations under the License.
  14. # ============================================================================
  15. """
  16. Condition list.
  17. This module provide the detail conditions list.
  18. """
  19. from mindinsight.conditionmgr.condition import Condition
  20. from mindinsight.conditionmgr.condition import OptimizePhaseEnum
  21. from mindinsight.conditionmgr.condition import ConditionParameter
  22. from mindinsight.conditionmgr.condition import ValueTypeEnum
  23. from mindinsight.conditionmgr.condition import TargetTypeEnum
  24. from mindinsight.conditionmgr.condition import PlatformEnum
  25. from mindinsight.conditionmgr.condition import ParamTypeEnum
  26. from mindinsight.conditionmgr.condition import ConditionIdEnum
  27. from mindinsight.conditionmgr.condition import check_initialization_available
  28. from mindinsight.conditionmgr.condition import check_normal_param_range
  29. from mindinsight.conditionmgr.condition import check_percentage_param_range
  30. from mindinsight.conditionmgr.condition import check_abs_param_range
  31. from mindinsight.conditionmgr.condition import check_not_nan
  32. CONDITION_LIST = [
  33. Condition(
  34. condition_id=ConditionIdEnum.WEIGHT_INITIALIZATION,
  35. abbr="WI",
  36. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_initialization
  37. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  38. parameters=[
  39. ConditionParameter(
  40. name="zero_percentage_ge",
  41. value_type=ValueTypeEnum.FLOAT64,
  42. valid_test_func=check_percentage_param_range,
  43. default_value=100
  44. ),
  45. ConditionParameter(
  46. name="max_gt",
  47. value_type=ValueTypeEnum.FLOAT64,
  48. valid_test_func=check_normal_param_range
  49. ),
  50. ConditionParameter(
  51. name="min_lt",
  52. value_type=ValueTypeEnum.FLOAT64,
  53. valid_test_func=check_normal_param_range
  54. )
  55. ],
  56. supported_target_type=TargetTypeEnum.WEIGHT,
  57. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  58. minimum_debugger_capability=(1, 1),
  59. availability_test_func=check_initialization_available
  60. ),
  61. Condition(
  62. condition_id=ConditionIdEnum.WEIGHT_OVERFLOW,
  63. abbr="WO",
  64. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_general_overflow
  65. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  66. parameters=[],
  67. supported_target_type=TargetTypeEnum.TENSOR,
  68. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  69. minimum_debugger_capability=(1, 1)
  70. ),
  71. Condition(
  72. condition_id=ConditionIdEnum.WEIGHT_TOO_LARGE,
  73. abbr="WL",
  74. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_large
  75. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  76. parameters=[
  77. ConditionParameter(
  78. name="abs_mean_gt",
  79. value_type=ValueTypeEnum.FLOAT64,
  80. valid_test_func=check_abs_param_range
  81. ),
  82. ConditionParameter(
  83. name="max_gt",
  84. value_type=ValueTypeEnum.FLOAT64,
  85. valid_test_func=check_normal_param_range
  86. ),
  87. ConditionParameter(
  88. name="min_gt",
  89. value_type=ValueTypeEnum.FLOAT64,
  90. valid_test_func=check_normal_param_range
  91. ),
  92. ConditionParameter(
  93. name="mean_gt",
  94. value_type=ValueTypeEnum.FLOAT64,
  95. valid_test_func=check_normal_param_range
  96. )
  97. ],
  98. supported_target_type=TargetTypeEnum.WEIGHT,
  99. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  100. minimum_debugger_capability=(1, 1)
  101. ),
  102. Condition(
  103. condition_id=ConditionIdEnum.WEIGHT_TOO_SMALL,
  104. abbr="WS",
  105. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_small
  106. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  107. parameters=[
  108. ConditionParameter(
  109. name="abs_mean_lt",
  110. value_type=ValueTypeEnum.FLOAT64,
  111. valid_test_func=check_abs_param_range
  112. ),
  113. ConditionParameter(
  114. name="max_lt",
  115. value_type=ValueTypeEnum.FLOAT64,
  116. valid_test_func=check_normal_param_range
  117. ),
  118. ConditionParameter(
  119. name="min_lt",
  120. value_type=ValueTypeEnum.FLOAT64,
  121. valid_test_func=check_normal_param_range
  122. ),
  123. ConditionParameter(
  124. name="mean_lt",
  125. value_type=ValueTypeEnum.FLOAT64,
  126. valid_test_func=check_normal_param_range
  127. )
  128. ],
  129. supported_target_type=TargetTypeEnum.WEIGHT,
  130. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  131. minimum_debugger_capability=(1, 1)
  132. ),
  133. Condition(
  134. condition_id=ConditionIdEnum.GRADIENT_VANISHING,
  135. abbr="GV",
  136. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_small
  137. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  138. parameters=[
  139. ConditionParameter(
  140. name="abs_mean_lt",
  141. value_type=ValueTypeEnum.FLOAT64,
  142. valid_test_func=check_abs_param_range
  143. ),
  144. ConditionParameter(
  145. name="max_lt",
  146. value_type=ValueTypeEnum.FLOAT64,
  147. valid_test_func=check_normal_param_range
  148. ),
  149. ConditionParameter(
  150. name="min_lt",
  151. value_type=ValueTypeEnum.FLOAT64,
  152. valid_test_func=check_normal_param_range
  153. ),
  154. ConditionParameter(
  155. name="mean_lt",
  156. value_type=ValueTypeEnum.FLOAT64,
  157. valid_test_func=check_normal_param_range
  158. )
  159. ],
  160. supported_target_type=TargetTypeEnum.GRADIENT,
  161. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  162. minimum_debugger_capability=(1, 1)
  163. ),
  164. Condition(
  165. condition_id=ConditionIdEnum.GRADIENT_TOO_LARGE,
  166. abbr="GL",
  167. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_large
  168. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  169. parameters=[
  170. ConditionParameter(
  171. name="abs_mean_gt",
  172. value_type=ValueTypeEnum.FLOAT64,
  173. valid_test_func=check_abs_param_range
  174. ),
  175. ConditionParameter(
  176. name="max_gt",
  177. value_type=ValueTypeEnum.FLOAT64,
  178. valid_test_func=check_normal_param_range
  179. ),
  180. ConditionParameter(
  181. name="min_gt",
  182. value_type=ValueTypeEnum.FLOAT64,
  183. valid_test_func=check_normal_param_range
  184. ),
  185. ConditionParameter(
  186. name="mean_gt",
  187. value_type=ValueTypeEnum.FLOAT64,
  188. valid_test_func=check_normal_param_range
  189. )
  190. ],
  191. supported_target_type=TargetTypeEnum.GRADIENT,
  192. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  193. minimum_debugger_capability=(1, 1)
  194. ),
  195. Condition(
  196. condition_id=ConditionIdEnum.GRADIENT_EXPLODING,
  197. abbr="GE",
  198. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_general_overflow
  199. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  200. parameters=[],
  201. supported_target_type=TargetTypeEnum.GRADIENT,
  202. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  203. minimum_debugger_capability=(1, 1)
  204. ),
  205. Condition(
  206. condition_id=ConditionIdEnum.TENSOR_OVERFLOW,
  207. abbr="TO",
  208. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_general_overflow
  209. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  210. parameters=[],
  211. supported_target_type=TargetTypeEnum.TENSOR,
  212. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  213. minimum_debugger_capability=(1, 1)
  214. ),
  215. Condition(
  216. condition_id=ConditionIdEnum.OPERATOR_OVERFLOW,
  217. abbr="OO",
  218. # Send this condition to MindSpore will use WatchCondition.Condition.overflow
  219. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  220. parameters=[],
  221. supported_target_type=TargetTypeEnum.TENSOR,
  222. supported_platforms=(PlatformEnum.ASCEND,),
  223. minimum_debugger_capability=(1, 1)
  224. ),
  225. Condition(
  226. condition_id=ConditionIdEnum.NAN,
  227. abbr="NAN",
  228. # Send this condition to MindSpore will use WatchCondition.Condition.nan
  229. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  230. parameters=[],
  231. supported_target_type=TargetTypeEnum.TENSOR,
  232. supported_platforms=(PlatformEnum.GPU,),
  233. minimum_debugger_capability=(1, 0)
  234. ),
  235. Condition(
  236. condition_id=ConditionIdEnum.OVERFLOW_ASCEND_CHIP,
  237. abbr="OVERFLOW",
  238. # Send this condition to MindSpore will use WatchCondition.Condition.overflow
  239. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  240. parameters=[],
  241. supported_target_type=TargetTypeEnum.TENSOR,
  242. supported_platforms=(PlatformEnum.ASCEND,),
  243. minimum_debugger_capability=(1, 0)
  244. ),
  245. Condition(
  246. condition_id=ConditionIdEnum.INF,
  247. abbr="INF",
  248. # Send this condition to MindSpore will use WatchCondition.Condition.inf
  249. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  250. parameters=[],
  251. supported_target_type=TargetTypeEnum.TENSOR,
  252. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  253. minimum_debugger_capability=(1, 0)
  254. ),
  255. Condition(
  256. condition_id=ConditionIdEnum.MAX_GT,
  257. abbr="MAX>",
  258. # Send this condition to MindSpore will use WatchCondition.Condition.max_gt
  259. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  260. parameters=[
  261. ConditionParameter(
  262. name="param",
  263. value_type=ValueTypeEnum.FLOAT64,
  264. valid_test_func=check_normal_param_range
  265. )
  266. ],
  267. supported_target_type=TargetTypeEnum.TENSOR,
  268. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  269. minimum_debugger_capability=(1, 0)
  270. ),
  271. Condition(
  272. condition_id=ConditionIdEnum.MAX_LT,
  273. abbr="MAX<",
  274. # Send this condition to MindSpore will use WatchCondition.Condition.max_lt
  275. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  276. parameters=[
  277. ConditionParameter(
  278. name="param",
  279. value_type=ValueTypeEnum.FLOAT64,
  280. valid_test_func=check_normal_param_range
  281. )
  282. ],
  283. supported_target_type=TargetTypeEnum.TENSOR,
  284. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  285. minimum_debugger_capability=(1, 0)
  286. ),
  287. Condition(
  288. condition_id=ConditionIdEnum.MIN_GT,
  289. abbr="MIN>",
  290. # Send this condition to MindSpore will use WatchCondition.Condition.min_gt
  291. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  292. parameters=[
  293. ConditionParameter(
  294. name="param",
  295. value_type=ValueTypeEnum.FLOAT64,
  296. valid_test_func=check_normal_param_range
  297. )
  298. ],
  299. supported_target_type=TargetTypeEnum.TENSOR,
  300. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  301. minimum_debugger_capability=(1, 0)
  302. ),
  303. Condition(
  304. condition_id=ConditionIdEnum.MIN_LT,
  305. abbr="MIN<",
  306. # Send this condition to MindSpore will use WatchCondition.Condition.min_lt
  307. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  308. parameters=[
  309. ConditionParameter(
  310. name="param",
  311. value_type=ValueTypeEnum.FLOAT64,
  312. valid_test_func=check_normal_param_range
  313. )
  314. ],
  315. supported_target_type=TargetTypeEnum.TENSOR,
  316. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  317. minimum_debugger_capability=(1, 0)
  318. ),
  319. Condition(
  320. condition_id=ConditionIdEnum.MAX_MIN_GT,
  321. abbr="MAX-MIN>",
  322. # Send this condition to MindSpore will use WatchCondition.Condition.max_min_gt
  323. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  324. parameters=[
  325. ConditionParameter(
  326. name="param",
  327. value_type=ValueTypeEnum.FLOAT64,
  328. valid_test_func=check_normal_param_range
  329. )
  330. ],
  331. supported_target_type=TargetTypeEnum.TENSOR,
  332. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  333. minimum_debugger_capability=(1, 0)
  334. ),
  335. Condition(
  336. condition_id=ConditionIdEnum.MAX_MIN_LT,
  337. abbr="MAX-Min<",
  338. # Send this condition to MindSpore will use WatchCondition.Condition.max_min_lt
  339. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  340. parameters=[
  341. ConditionParameter(
  342. name="param",
  343. value_type=ValueTypeEnum.FLOAT64,
  344. valid_test_func=check_normal_param_range
  345. )
  346. ],
  347. supported_target_type=TargetTypeEnum.TENSOR,
  348. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  349. minimum_debugger_capability=(1, 0)
  350. ),
  351. Condition(
  352. condition_id=ConditionIdEnum.MEAN_GT,
  353. abbr="MEAN>",
  354. # Send this condition to MindSpore will use WatchCondition.Condition.mean_gt
  355. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  356. parameters=[
  357. ConditionParameter(
  358. name="param",
  359. value_type=ValueTypeEnum.FLOAT64,
  360. valid_test_func=check_normal_param_range
  361. )
  362. ],
  363. supported_target_type=TargetTypeEnum.TENSOR,
  364. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  365. minimum_debugger_capability=(1, 0)
  366. ),
  367. Condition(
  368. condition_id=ConditionIdEnum.MEAN_LT,
  369. abbr="MEAN<",
  370. # Send this condition to MindSpore will use WatchCondition.Condition.mean_lt
  371. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  372. parameters=[
  373. ConditionParameter(
  374. name="param",
  375. value_type=ValueTypeEnum.FLOAT64,
  376. valid_test_func=check_normal_param_range
  377. )
  378. ],
  379. supported_target_type=TargetTypeEnum.TENSOR,
  380. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  381. minimum_debugger_capability=(1, 0)
  382. ),
  383. Condition(
  384. condition_id=ConditionIdEnum.TENSOR_INITIALIZATION,
  385. abbr="TI",
  386. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_initialization
  387. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  388. parameters=[
  389. ConditionParameter(
  390. name="zero_percentage_ge",
  391. value_type=ValueTypeEnum.FLOAT64,
  392. valid_test_func=check_percentage_param_range,
  393. default_value=100
  394. ),
  395. ConditionParameter(
  396. name="max_gt",
  397. value_type=ValueTypeEnum.FLOAT64,
  398. valid_test_func=check_normal_param_range
  399. ),
  400. ConditionParameter(
  401. name="min_lt",
  402. value_type=ValueTypeEnum.FLOAT64,
  403. valid_test_func=check_normal_param_range
  404. )
  405. ],
  406. supported_target_type=TargetTypeEnum.TENSOR,
  407. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  408. minimum_debugger_capability=(1, 1),
  409. availability_test_func=check_initialization_available
  410. ),
  411. Condition(
  412. condition_id=ConditionIdEnum.TENSOR_TOO_LARGE,
  413. abbr="TL",
  414. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_large
  415. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  416. parameters=[
  417. ConditionParameter(
  418. name="abs_mean_gt",
  419. value_type=ValueTypeEnum.FLOAT64,
  420. valid_test_func=check_abs_param_range
  421. ),
  422. ConditionParameter(
  423. name="max_gt",
  424. value_type=ValueTypeEnum.FLOAT64,
  425. valid_test_func=check_normal_param_range
  426. ),
  427. ConditionParameter(
  428. name="min_gt",
  429. value_type=ValueTypeEnum.FLOAT64,
  430. valid_test_func=check_normal_param_range
  431. ),
  432. ConditionParameter(
  433. name="mean_gt",
  434. value_type=ValueTypeEnum.FLOAT64,
  435. valid_test_func=check_normal_param_range
  436. )
  437. ],
  438. supported_target_type=TargetTypeEnum.TENSOR,
  439. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  440. minimum_debugger_capability=(1, 1)
  441. ),
  442. Condition(
  443. condition_id=ConditionIdEnum.TENSOR_TOO_SMALL,
  444. abbr="TS",
  445. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_too_small
  446. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  447. parameters=[
  448. ConditionParameter(
  449. name="abs_mean_lt",
  450. value_type=ValueTypeEnum.FLOAT64,
  451. valid_test_func=check_abs_param_range
  452. ),
  453. ConditionParameter(
  454. name="max_lt",
  455. value_type=ValueTypeEnum.FLOAT64,
  456. valid_test_func=check_normal_param_range
  457. ),
  458. ConditionParameter(
  459. name="min_lt",
  460. value_type=ValueTypeEnum.FLOAT64,
  461. valid_test_func=check_normal_param_range
  462. ),
  463. ConditionParameter(
  464. name="mean_lt",
  465. value_type=ValueTypeEnum.FLOAT64,
  466. valid_test_func=check_normal_param_range
  467. )
  468. ],
  469. supported_target_type=TargetTypeEnum.TENSOR,
  470. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  471. minimum_debugger_capability=(1, 1)
  472. ),
  473. Condition(
  474. condition_id=ConditionIdEnum.TENSOR_ALL_ZERO,
  475. abbr="TZ",
  476. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_all_zero
  477. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  478. parameters=[
  479. ConditionParameter(
  480. name="zero_percentage_ge",
  481. value_type=ValueTypeEnum.FLOAT64,
  482. valid_test_func=check_percentage_param_range,
  483. default_value=100
  484. )
  485. ],
  486. supported_target_type=TargetTypeEnum.TENSOR,
  487. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  488. minimum_debugger_capability=(1, 1)
  489. ),
  490. Condition(
  491. condition_id=ConditionIdEnum.WEIGHT_NOT_CHANGED,
  492. abbr="WNC",
  493. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_not_changed
  494. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  495. parameters=[
  496. ConditionParameter(
  497. name="rtol",
  498. value_type=ValueTypeEnum.FLOAT64,
  499. valid_test_func=check_abs_param_range,
  500. default_value=1e-5
  501. ),
  502. ConditionParameter(
  503. name="atol",
  504. value_type=ValueTypeEnum.FLOAT64,
  505. support_disable=False,
  506. default_value=1e-8,
  507. visible_on_ui=False
  508. ),
  509. ConditionParameter(
  510. name="equal_nan",
  511. value_type=ValueTypeEnum.BOOL,
  512. support_disable=False,
  513. default_value=False,
  514. visible_on_ui=False
  515. )
  516. ],
  517. supported_target_type=TargetTypeEnum.WEIGHT,
  518. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  519. minimum_debugger_capability=(1, 1)
  520. ),
  521. Condition(
  522. condition_id=ConditionIdEnum.WEIGHT_CHANGE_TOO_LARGE,
  523. abbr="WCL",
  524. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_change_too_large
  525. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  526. parameters=[
  527. ConditionParameter(
  528. name="abs_update_ratio_mean_gt",
  529. value_type=ValueTypeEnum.FLOAT64,
  530. valid_test_func=check_abs_param_range,
  531. default_value=1e-1
  532. ),
  533. ConditionParameter(
  534. name="epsilon",
  535. value_type=ValueTypeEnum.FLOAT64,
  536. support_disable=False,
  537. default_value=1e-9,
  538. visible_on_ui=False
  539. )
  540. ],
  541. supported_target_type=TargetTypeEnum.WEIGHT,
  542. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  543. minimum_debugger_capability=(1, 1)
  544. ),
  545. Condition(
  546. condition_id=ConditionIdEnum.WEIGHT_CHANGE_TOO_SMALL,
  547. abbr="WCS",
  548. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_change_too_small
  549. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  550. parameters=[
  551. ConditionParameter(
  552. name="abs_update_ratio_mean_lt",
  553. value_type=ValueTypeEnum.FLOAT64,
  554. valid_test_func=check_abs_param_range,
  555. default_value=1e-4
  556. ),
  557. ConditionParameter(
  558. name="epsilon",
  559. value_type=ValueTypeEnum.FLOAT64,
  560. support_disable=False,
  561. default_value=1e-9,
  562. visible_on_ui=False
  563. )
  564. ],
  565. supported_target_type=TargetTypeEnum.WEIGHT,
  566. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  567. minimum_debugger_capability=(1, 1)
  568. ),
  569. Condition(
  570. condition_id=ConditionIdEnum.TENSOR_CHANGE_TOO_LARGE,
  571. abbr="TCL",
  572. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_change_too_large
  573. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  574. parameters=[
  575. ConditionParameter(
  576. name="abs_update_ratio_mean_gt",
  577. value_type=ValueTypeEnum.FLOAT64,
  578. valid_test_func=check_abs_param_range,
  579. default_value=1e-1
  580. ),
  581. ConditionParameter(
  582. name="epsilon",
  583. value_type=ValueTypeEnum.FLOAT64,
  584. support_disable=False,
  585. default_value=1e-9,
  586. visible_on_ui=False
  587. )
  588. ],
  589. supported_target_type=TargetTypeEnum.TENSOR,
  590. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  591. minimum_debugger_capability=(1, 1)
  592. ),
  593. Condition(
  594. condition_id=ConditionIdEnum.TENSOR_CHANGE_TOO_SMALL,
  595. abbr="TCS",
  596. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_change_too_small
  597. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  598. parameters=[
  599. ConditionParameter(
  600. name="abs_update_ratio_mean_lt",
  601. value_type=ValueTypeEnum.FLOAT64,
  602. valid_test_func=check_abs_param_range,
  603. default_value=1e-4
  604. ),
  605. ConditionParameter(
  606. name="epsilon",
  607. value_type=ValueTypeEnum.FLOAT64,
  608. support_disable=False,
  609. default_value=1e-9,
  610. visible_on_ui=False
  611. )
  612. ],
  613. supported_target_type=TargetTypeEnum.TENSOR,
  614. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  615. minimum_debugger_capability=(1, 1)
  616. ),
  617. Condition(
  618. condition_id=ConditionIdEnum.TENSOR_NOT_CHANGED,
  619. abbr="TNC",
  620. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_not_changed
  621. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  622. parameters=[
  623. ConditionParameter(
  624. name="rtol",
  625. value_type=ValueTypeEnum.FLOAT64,
  626. valid_test_func=check_abs_param_range,
  627. default_value=1e-5
  628. ),
  629. ConditionParameter(
  630. name="atol",
  631. value_type=ValueTypeEnum.FLOAT64,
  632. support_disable=False,
  633. default_value=1e-8,
  634. visible_on_ui=False
  635. ),
  636. ConditionParameter(
  637. name="equal_nan",
  638. value_type=ValueTypeEnum.BOOL,
  639. support_disable=False,
  640. default_value=False,
  641. visible_on_ui=False
  642. )
  643. ],
  644. supported_target_type=TargetTypeEnum.TENSOR,
  645. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  646. minimum_debugger_capability=(1, 1)
  647. ),
  648. Condition(
  649. condition_id=ConditionIdEnum.ACTIVATION_RANGE,
  650. abbr="AR",
  651. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_not_changed
  652. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  653. parameters=[
  654. ConditionParameter(
  655. name="range_start_inclusive",
  656. value_type=ValueTypeEnum.FLOAT64,
  657. valid_test_func=check_not_nan,
  658. param_type=ParamTypeEnum.SUPPORT_PARAM
  659. ),
  660. ConditionParameter(
  661. name="range_end_inclusive",
  662. value_type=ValueTypeEnum.FLOAT64,
  663. valid_test_func=check_not_nan,
  664. param_type=ParamTypeEnum.SUPPORT_PARAM
  665. ),
  666. ConditionParameter(
  667. name="range_percentage_lt",
  668. value_type=ValueTypeEnum.FLOAT64,
  669. valid_test_func=check_percentage_param_range,
  670. required_params=["range_start_inclusive", "range_end_inclusive"]
  671. ),
  672. ConditionParameter(
  673. name="range_percentage_gt",
  674. value_type=ValueTypeEnum.FLOAT64,
  675. valid_test_func=check_percentage_param_range,
  676. required_params=["range_start_inclusive", "range_end_inclusive"]
  677. ),
  678. ConditionParameter(
  679. name="max_min_lt",
  680. value_type=ValueTypeEnum.FLOAT64,
  681. valid_test_func=check_normal_param_range
  682. ),
  683. ConditionParameter(
  684. name="max_min_gt",
  685. value_type=ValueTypeEnum.FLOAT64,
  686. valid_test_func=check_normal_param_range
  687. )
  688. ],
  689. supported_target_type=TargetTypeEnum.ACTIVATION,
  690. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  691. minimum_debugger_capability=(1, 1)
  692. ),
  693. Condition(
  694. condition_id=ConditionIdEnum.TENSOR_RANGE,
  695. abbr="TR",
  696. # Send this condition to MindSpore will use WatchCondition.Condition.tensor_not_changed
  697. optimize_phase=OptimizePhaseEnum.TENSOR_CHECK,
  698. parameters=[
  699. ConditionParameter(
  700. name="range_start_inclusive",
  701. value_type=ValueTypeEnum.FLOAT64,
  702. valid_test_func=check_not_nan,
  703. param_type=ParamTypeEnum.SUPPORT_PARAM
  704. ),
  705. ConditionParameter(
  706. name="range_end_inclusive",
  707. value_type=ValueTypeEnum.FLOAT64,
  708. valid_test_func=check_not_nan,
  709. param_type=ParamTypeEnum.SUPPORT_PARAM
  710. ),
  711. ConditionParameter(
  712. name="range_percentage_lt",
  713. value_type=ValueTypeEnum.FLOAT64,
  714. valid_test_func=check_percentage_param_range,
  715. required_params=["range_start_inclusive", "range_end_inclusive"]
  716. ),
  717. ConditionParameter(
  718. name="range_percentage_gt",
  719. value_type=ValueTypeEnum.FLOAT64,
  720. valid_test_func=check_percentage_param_range,
  721. required_params=["range_start_inclusive", "range_end_inclusive"]
  722. ),
  723. ConditionParameter(
  724. name="max_min_lt",
  725. value_type=ValueTypeEnum.FLOAT64,
  726. valid_test_func=check_normal_param_range
  727. ),
  728. ConditionParameter(
  729. name="max_min_gt",
  730. value_type=ValueTypeEnum.FLOAT64,
  731. valid_test_func=check_normal_param_range
  732. )
  733. ],
  734. supported_target_type=TargetTypeEnum.TENSOR,
  735. supported_platforms=(PlatformEnum.ASCEND, PlatformEnum.GPU),
  736. minimum_debugger_capability=(1, 1)
  737. )
  738. ]