_rules.py 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727
  1. """
  2. GENERATED CODE - DO NOT EDIT DIRECTLY
  3. This file is generated by gen_diagnostics.py.
  4. See tools/onnx/gen_diagnostics.py for more information.
  5. Diagnostic rules for PyTorch ONNX export.
  6. """
  7. import dataclasses
  8. from typing import Tuple
  9. # flake8: noqa
  10. from torch.onnx._internal.diagnostics import infra
  11. """
  12. GENERATED CODE - DO NOT EDIT DIRECTLY
  13. The purpose of generating a class for each rule is to override the `format_message`
  14. method to provide more details in the signature about the format arguments.
  15. """
  16. class _NodeMissingOnnxShapeInference(infra.Rule):
  17. """Node is missing ONNX shape inference."""
  18. def format_message(self, op_name) -> str: # type: ignore[override]
  19. """Returns the formatted default message of this Rule.
  20. Message template: 'The shape inference of {op_name} type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.'
  21. """
  22. return self.message_default_template.format(op_name=op_name)
  23. def format( # type: ignore[override]
  24. self, level: infra.Level, op_name
  25. ) -> Tuple[infra.Rule, infra.Level, str]:
  26. """Returns a tuple of (Rule, Level, message) for this Rule.
  27. Message template: 'The shape inference of {op_name} type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function.'
  28. """
  29. return self, level, self.format_message(op_name=op_name)
  30. class _MissingCustomSymbolicFunction(infra.Rule):
  31. """Missing symbolic function for custom PyTorch operator, cannot translate node to ONNX."""
  32. def format_message(self, op_name) -> str: # type: ignore[override]
  33. """Returns the formatted default message of this Rule.
  34. Message template: 'ONNX export failed on an operator with unrecognized namespace {op_name}. If you are trying to export a custom operator, make sure you registered it with the right domain and version.'
  35. """
  36. return self.message_default_template.format(op_name=op_name)
  37. def format( # type: ignore[override]
  38. self, level: infra.Level, op_name
  39. ) -> Tuple[infra.Rule, infra.Level, str]:
  40. """Returns a tuple of (Rule, Level, message) for this Rule.
  41. Message template: 'ONNX export failed on an operator with unrecognized namespace {op_name}. If you are trying to export a custom operator, make sure you registered it with the right domain and version.'
  42. """
  43. return self, level, self.format_message(op_name=op_name)
  44. class _MissingStandardSymbolicFunction(infra.Rule):
  45. """Missing symbolic function for standard PyTorch operator, cannot translate node to ONNX."""
  46. def format_message( # type: ignore[override]
  47. self, op_name, opset_version, issue_url
  48. ) -> str:
  49. """Returns the formatted default message of this Rule.
  50. Message template: "Exporting the operator '{op_name}' to ONNX opset version {opset_version} is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: {issue_url}."
  51. """
  52. return self.message_default_template.format(
  53. op_name=op_name, opset_version=opset_version, issue_url=issue_url
  54. )
  55. def format( # type: ignore[override]
  56. self, level: infra.Level, op_name, opset_version, issue_url
  57. ) -> Tuple[infra.Rule, infra.Level, str]:
  58. """Returns a tuple of (Rule, Level, message) for this Rule.
  59. Message template: "Exporting the operator '{op_name}' to ONNX opset version {opset_version} is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: {issue_url}."
  60. """
  61. return (
  62. self,
  63. level,
  64. self.format_message(
  65. op_name=op_name, opset_version=opset_version, issue_url=issue_url
  66. ),
  67. )
  68. class _OperatorSupportedInNewerOpsetVersion(infra.Rule):
  69. """Operator is supported in newer opset version."""
  70. def format_message( # type: ignore[override]
  71. self, op_name, opset_version, supported_opset_version
  72. ) -> str:
  73. """Returns the formatted default message of this Rule.
  74. Message template: "Exporting the operator '{op_name}' to ONNX opset version {opset_version} is not supported. Support for this operator was added in version {supported_opset_version}, try exporting with this version."
  75. """
  76. return self.message_default_template.format(
  77. op_name=op_name,
  78. opset_version=opset_version,
  79. supported_opset_version=supported_opset_version,
  80. )
  81. def format( # type: ignore[override]
  82. self, level: infra.Level, op_name, opset_version, supported_opset_version
  83. ) -> Tuple[infra.Rule, infra.Level, str]:
  84. """Returns a tuple of (Rule, Level, message) for this Rule.
  85. Message template: "Exporting the operator '{op_name}' to ONNX opset version {opset_version} is not supported. Support for this operator was added in version {supported_opset_version}, try exporting with this version."
  86. """
  87. return (
  88. self,
  89. level,
  90. self.format_message(
  91. op_name=op_name,
  92. opset_version=opset_version,
  93. supported_opset_version=supported_opset_version,
  94. ),
  95. )
  96. class _FxTracerSuccess(infra.Rule):
  97. """FX Tracer succeeded."""
  98. def format_message(self, fn_name, tracer_name) -> str: # type: ignore[override]
  99. """Returns the formatted default message of this Rule.
  100. Message template: "The callable '{fn_name}' is successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'."
  101. """
  102. return self.message_default_template.format(
  103. fn_name=fn_name, tracer_name=tracer_name
  104. )
  105. def format( # type: ignore[override]
  106. self, level: infra.Level, fn_name, tracer_name
  107. ) -> Tuple[infra.Rule, infra.Level, str]:
  108. """Returns a tuple of (Rule, Level, message) for this Rule.
  109. Message template: "The callable '{fn_name}' is successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'."
  110. """
  111. return (
  112. self,
  113. level,
  114. self.format_message(fn_name=fn_name, tracer_name=tracer_name),
  115. )
  116. class _FxTracerFailure(infra.Rule):
  117. """FX Tracer failed."""
  118. def format_message( # type: ignore[override]
  119. self, fn_name, tracer_name, explanation
  120. ) -> str:
  121. """Returns the formatted default message of this Rule.
  122. Message template: "The callable '{fn_name}' is not successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'.\n{explanation}"
  123. """
  124. return self.message_default_template.format(
  125. fn_name=fn_name, tracer_name=tracer_name, explanation=explanation
  126. )
  127. def format( # type: ignore[override]
  128. self, level: infra.Level, fn_name, tracer_name, explanation
  129. ) -> Tuple[infra.Rule, infra.Level, str]:
  130. """Returns a tuple of (Rule, Level, message) for this Rule.
  131. Message template: "The callable '{fn_name}' is not successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'.\n{explanation}"
  132. """
  133. return (
  134. self,
  135. level,
  136. self.format_message(
  137. fn_name=fn_name, tracer_name=tracer_name, explanation=explanation
  138. ),
  139. )
  140. class _FxFrontendAotautograd(infra.Rule):
  141. """FX Tracer succeeded."""
  142. def format_message(self, fn_name, tracer_name) -> str: # type: ignore[override]
  143. """Returns the formatted default message of this Rule.
  144. Message template: "The callable '{fn_name}' is successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'."
  145. """
  146. return self.message_default_template.format(
  147. fn_name=fn_name, tracer_name=tracer_name
  148. )
  149. def format( # type: ignore[override]
  150. self, level: infra.Level, fn_name, tracer_name
  151. ) -> Tuple[infra.Rule, infra.Level, str]:
  152. """Returns a tuple of (Rule, Level, message) for this Rule.
  153. Message template: "The callable '{fn_name}' is successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'."
  154. """
  155. return (
  156. self,
  157. level,
  158. self.format_message(fn_name=fn_name, tracer_name=tracer_name),
  159. )
  160. class _FxPassConvertNegToSigmoid(infra.Rule):
  161. """FX pass converting torch.neg to torch.sigmoid."""
  162. def format_message( # type: ignore[override]
  163. self,
  164. ) -> str:
  165. """Returns the formatted default message of this Rule.
  166. Message template: "Running 'convert-neg-to-sigmoid' pass on 'torch.fx.GraphModule'."
  167. """
  168. return self.message_default_template.format()
  169. def format( # type: ignore[override]
  170. self,
  171. level: infra.Level,
  172. ) -> Tuple[infra.Rule, infra.Level, str]:
  173. """Returns a tuple of (Rule, Level, message) for this Rule.
  174. Message template: "Running 'convert-neg-to-sigmoid' pass on 'torch.fx.GraphModule'."
  175. """
  176. return self, level, self.format_message()
  177. class _FxIrAddNode(infra.Rule):
  178. """ToDo, experimenting diagnostics, placeholder text."""
  179. def format_message( # type: ignore[override]
  180. self,
  181. ) -> str:
  182. """Returns the formatted default message of this Rule.
  183. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  184. """
  185. return self.message_default_template.format()
  186. def format( # type: ignore[override]
  187. self,
  188. level: infra.Level,
  189. ) -> Tuple[infra.Rule, infra.Level, str]:
  190. """Returns a tuple of (Rule, Level, message) for this Rule.
  191. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  192. """
  193. return self, level, self.format_message()
  194. class _AtenlibSymbolicFunction(infra.Rule):
  195. """Op level tracking. ToDo, experimenting diagnostics, placeholder text."""
  196. def format_message( # type: ignore[override]
  197. self,
  198. ) -> str:
  199. """Returns the formatted default message of this Rule.
  200. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  201. """
  202. return self.message_default_template.format()
  203. def format( # type: ignore[override]
  204. self,
  205. level: infra.Level,
  206. ) -> Tuple[infra.Rule, infra.Level, str]:
  207. """Returns a tuple of (Rule, Level, message) for this Rule.
  208. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  209. """
  210. return self, level, self.format_message()
  211. class _AtenlibFxToOnnx(infra.Rule):
  212. """Graph level tracking. Each op is a step. ToDo, experimenting diagnostics, placeholder text."""
  213. def format_message( # type: ignore[override]
  214. self,
  215. ) -> str:
  216. """Returns the formatted default message of this Rule.
  217. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  218. """
  219. return self.message_default_template.format()
  220. def format( # type: ignore[override]
  221. self,
  222. level: infra.Level,
  223. ) -> Tuple[infra.Rule, infra.Level, str]:
  224. """Returns a tuple of (Rule, Level, message) for this Rule.
  225. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  226. """
  227. return self, level, self.format_message()
  228. class _FxNodeToOnnx(infra.Rule):
  229. """Node level tracking. ToDo, experimenting diagnostics, placeholder text."""
  230. def format_message( # type: ignore[override]
  231. self,
  232. ) -> str:
  233. """Returns the formatted default message of this Rule.
  234. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  235. """
  236. return self.message_default_template.format()
  237. def format( # type: ignore[override]
  238. self,
  239. level: infra.Level,
  240. ) -> Tuple[infra.Rule, infra.Level, str]:
  241. """Returns a tuple of (Rule, Level, message) for this Rule.
  242. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  243. """
  244. return self, level, self.format_message()
  245. class _FxFrontendDynamoMakeFx(infra.Rule):
  246. """The make_fx + decomposition pass on fx graph produced from Dynamo, before ONNX export."""
  247. def format_message( # type: ignore[override]
  248. self,
  249. ) -> str:
  250. """Returns the formatted default message of this Rule.
  251. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  252. """
  253. return self.message_default_template.format()
  254. def format( # type: ignore[override]
  255. self,
  256. level: infra.Level,
  257. ) -> Tuple[infra.Rule, infra.Level, str]:
  258. """Returns a tuple of (Rule, Level, message) for this Rule.
  259. Message template: 'ToDo, experimenting diagnostics, placeholder text.'
  260. """
  261. return self, level, self.format_message()
  262. class _ArgFormatTooVerbose(infra.Rule):
  263. """The formatted str for argument to display is too verbose."""
  264. def format_message( # type: ignore[override]
  265. self, length, length_limit, argument_type, formatter_type
  266. ) -> str:
  267. """Returns the formatted default message of this Rule.
  268. Message template: 'Too verbose ({length} > {length_limit}). Argument type {argument_type} for formatter {formatter_type}.'
  269. """
  270. return self.message_default_template.format(
  271. length=length,
  272. length_limit=length_limit,
  273. argument_type=argument_type,
  274. formatter_type=formatter_type,
  275. )
  276. def format( # type: ignore[override]
  277. self, level: infra.Level, length, length_limit, argument_type, formatter_type
  278. ) -> Tuple[infra.Rule, infra.Level, str]:
  279. """Returns a tuple of (Rule, Level, message) for this Rule.
  280. Message template: 'Too verbose ({length} > {length_limit}). Argument type {argument_type} for formatter {formatter_type}.'
  281. """
  282. return (
  283. self,
  284. level,
  285. self.format_message(
  286. length=length,
  287. length_limit=length_limit,
  288. argument_type=argument_type,
  289. formatter_type=formatter_type,
  290. ),
  291. )
  292. @dataclasses.dataclass
  293. class _POERules(infra.RuleCollection):
  294. node_missing_onnx_shape_inference: _NodeMissingOnnxShapeInference = dataclasses.field(
  295. default=_NodeMissingOnnxShapeInference.from_sarif(
  296. **{
  297. "id": "POE0001",
  298. "name": "node-missing-onnx-shape-inference",
  299. "short_description": {"text": "Node is missing ONNX shape inference."},
  300. "full_description": {
  301. "text": "Node is missing ONNX shape inference. This usually happens when the node is not valid under standard ONNX operator spec.",
  302. "markdown": "Node is missing ONNX shape inference.\nThis usually happens when the node is not valid under standard ONNX operator spec.\n",
  303. },
  304. "message_strings": {
  305. "default": {
  306. "text": "The shape inference of {op_name} type is missing, so it may result in wrong shape inference for the exported graph. Please consider adding it in symbolic function."
  307. }
  308. },
  309. "help_uri": None,
  310. "properties": {"deprecated": False, "tags": []},
  311. }
  312. ),
  313. init=False,
  314. )
  315. """Node is missing ONNX shape inference."""
  316. missing_custom_symbolic_function: _MissingCustomSymbolicFunction = dataclasses.field(
  317. default=_MissingCustomSymbolicFunction.from_sarif(
  318. **{
  319. "id": "POE0002",
  320. "name": "missing-custom-symbolic-function",
  321. "short_description": {
  322. "text": "Missing symbolic function for custom PyTorch operator, cannot translate node to ONNX."
  323. },
  324. "full_description": {
  325. "text": "Missing symbolic function for custom PyTorch operator, cannot translate node to ONNX.",
  326. "markdown": "Missing symbolic function for custom PyTorch operator, cannot translate node to ONNX.\n",
  327. },
  328. "message_strings": {
  329. "default": {
  330. "text": "ONNX export failed on an operator with unrecognized namespace {op_name}. If you are trying to export a custom operator, make sure you registered it with the right domain and version."
  331. }
  332. },
  333. "help_uri": None,
  334. "properties": {"deprecated": False, "tags": []},
  335. }
  336. ),
  337. init=False,
  338. )
  339. """Missing symbolic function for custom PyTorch operator, cannot translate node to ONNX."""
  340. missing_standard_symbolic_function: _MissingStandardSymbolicFunction = dataclasses.field(
  341. default=_MissingStandardSymbolicFunction.from_sarif(
  342. **{
  343. "id": "POE0003",
  344. "name": "missing-standard-symbolic-function",
  345. "short_description": {
  346. "text": "Missing symbolic function for standard PyTorch operator, cannot translate node to ONNX."
  347. },
  348. "full_description": {
  349. "text": "Missing symbolic function for standard PyTorch operator, cannot translate node to ONNX.",
  350. "markdown": "Missing symbolic function for standard PyTorch operator, cannot translate node to ONNX.\n",
  351. },
  352. "message_strings": {
  353. "default": {
  354. "text": "Exporting the operator '{op_name}' to ONNX opset version {opset_version} is not supported. Please feel free to request support or submit a pull request on PyTorch GitHub: {issue_url}."
  355. }
  356. },
  357. "help_uri": None,
  358. "properties": {"deprecated": False, "tags": []},
  359. }
  360. ),
  361. init=False,
  362. )
  363. """Missing symbolic function for standard PyTorch operator, cannot translate node to ONNX."""
  364. operator_supported_in_newer_opset_version: _OperatorSupportedInNewerOpsetVersion = dataclasses.field(
  365. default=_OperatorSupportedInNewerOpsetVersion.from_sarif(
  366. **{
  367. "id": "POE0004",
  368. "name": "operator-supported-in-newer-opset-version",
  369. "short_description": {
  370. "text": "Operator is supported in newer opset version."
  371. },
  372. "full_description": {
  373. "text": "Operator is supported in newer opset version.",
  374. "markdown": "Operator is supported in newer opset version.\n\nExample:\n```python\ntorch.onnx.export(model, args, ..., opset_version=9)\n```\n",
  375. },
  376. "message_strings": {
  377. "default": {
  378. "text": "Exporting the operator '{op_name}' to ONNX opset version {opset_version} is not supported. Support for this operator was added in version {supported_opset_version}, try exporting with this version."
  379. }
  380. },
  381. "help_uri": None,
  382. "properties": {"deprecated": False, "tags": []},
  383. }
  384. ),
  385. init=False,
  386. )
  387. """Operator is supported in newer opset version."""
  388. fx_tracer_success: _FxTracerSuccess = dataclasses.field(
  389. default=_FxTracerSuccess.from_sarif(
  390. **{
  391. "id": "FXE0001",
  392. "name": "fx-tracer-success",
  393. "short_description": {"text": "FX Tracer succeeded."},
  394. "full_description": {
  395. "text": "FX Tracer succeeded. The callable is successfully traced as a 'torch.fx.GraphModule' by one of the fx tracers.",
  396. "markdown": "FX Tracer succeeded.\nThe callable is successfully traced as a 'torch.fx.GraphModule' by one of the fx tracers.\n",
  397. },
  398. "message_strings": {
  399. "default": {
  400. "text": "The callable '{fn_name}' is successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'."
  401. }
  402. },
  403. "help_uri": None,
  404. "properties": {"deprecated": False, "tags": []},
  405. }
  406. ),
  407. init=False,
  408. )
  409. """FX Tracer succeeded."""
  410. fx_tracer_failure: _FxTracerFailure = dataclasses.field(
  411. default=_FxTracerFailure.from_sarif(
  412. **{
  413. "id": "FXE0002",
  414. "name": "fx-tracer-failure",
  415. "short_description": {"text": "FX Tracer failed."},
  416. "full_description": {
  417. "text": "FX Tracer failed. The callable is not successfully traced as a 'torch.fx.GraphModule'.",
  418. "markdown": "FX Tracer failed.\nThe callable is not successfully traced as a 'torch.fx.GraphModule'.\n",
  419. },
  420. "message_strings": {
  421. "default": {
  422. "text": "The callable '{fn_name}' is not successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'.\n{explanation}"
  423. }
  424. },
  425. "help_uri": None,
  426. "properties": {"deprecated": False, "tags": []},
  427. }
  428. ),
  429. init=False,
  430. )
  431. """FX Tracer failed."""
  432. fx_frontend_aotautograd: _FxFrontendAotautograd = dataclasses.field(
  433. default=_FxFrontendAotautograd.from_sarif(
  434. **{
  435. "id": "FXE0003",
  436. "name": "fx-frontend-aotautograd",
  437. "short_description": {"text": "FX Tracer succeeded."},
  438. "full_description": {
  439. "text": "FX Tracer succeeded. The callable is successfully traced as a 'torch.fx.GraphModule' by one of the fx tracers.",
  440. "markdown": "FX Tracer succeeded.\nThe callable is successfully traced as a 'torch.fx.GraphModule' by one of the fx tracers.\n",
  441. },
  442. "message_strings": {
  443. "default": {
  444. "text": "The callable '{fn_name}' is successfully traced as a 'torch.fx.GraphModule' by '{tracer_name}'."
  445. }
  446. },
  447. "help_uri": None,
  448. "properties": {"deprecated": False, "tags": []},
  449. }
  450. ),
  451. init=False,
  452. )
  453. """FX Tracer succeeded."""
  454. fx_pass_convert_neg_to_sigmoid: _FxPassConvertNegToSigmoid = dataclasses.field(
  455. default=_FxPassConvertNegToSigmoid.from_sarif(
  456. **{
  457. "id": "FXE0004",
  458. "name": "fx-pass-convert-neg-to-sigmoid",
  459. "short_description": {
  460. "text": "FX pass converting torch.neg to torch.sigmoid."
  461. },
  462. "full_description": {
  463. "text": "A 'fx.Interpreter' based pass to convert all 'torch.neg' calls to 'torch.sigmoid' for a given 'torch.fx.GraphModule' object.",
  464. "markdown": "A 'fx.Interpreter' based pass to convert all 'torch.neg' calls to 'torch.sigmoid' for\na given 'torch.fx.GraphModule' object.\n",
  465. },
  466. "message_strings": {
  467. "default": {
  468. "text": "Running 'convert-neg-to-sigmoid' pass on 'torch.fx.GraphModule'."
  469. }
  470. },
  471. "help_uri": None,
  472. "properties": {"deprecated": False, "tags": []},
  473. }
  474. ),
  475. init=False,
  476. )
  477. """FX pass converting torch.neg to torch.sigmoid."""
  478. fx_ir_add_node: _FxIrAddNode = dataclasses.field(
  479. default=_FxIrAddNode.from_sarif(
  480. **{
  481. "id": "FXE0005",
  482. "name": "fx-ir-add-node",
  483. "short_description": {
  484. "text": "ToDo, experimenting diagnostics, placeholder text."
  485. },
  486. "full_description": {
  487. "text": "ToDo, experimenting diagnostics, placeholder text.",
  488. "markdown": "ToDo, experimenting diagnostics, placeholder text.\n",
  489. },
  490. "message_strings": {
  491. "default": {
  492. "text": "ToDo, experimenting diagnostics, placeholder text."
  493. }
  494. },
  495. "help_uri": None,
  496. "properties": {"deprecated": False, "tags": []},
  497. }
  498. ),
  499. init=False,
  500. )
  501. """ToDo, experimenting diagnostics, placeholder text."""
  502. atenlib_symbolic_function: _AtenlibSymbolicFunction = dataclasses.field(
  503. default=_AtenlibSymbolicFunction.from_sarif(
  504. **{
  505. "id": "FXE0006",
  506. "name": "atenlib-symbolic-function",
  507. "short_description": {
  508. "text": "Op level tracking. ToDo, experimenting diagnostics, placeholder text."
  509. },
  510. "full_description": {
  511. "text": "ToDo, experimenting diagnostics, placeholder text.",
  512. "markdown": "ToDo, experimenting diagnostics, placeholder text.\n",
  513. },
  514. "message_strings": {
  515. "default": {
  516. "text": "ToDo, experimenting diagnostics, placeholder text."
  517. }
  518. },
  519. "help_uri": None,
  520. "properties": {"deprecated": False, "tags": []},
  521. }
  522. ),
  523. init=False,
  524. )
  525. """Op level tracking. ToDo, experimenting diagnostics, placeholder text."""
  526. atenlib_fx_to_onnx: _AtenlibFxToOnnx = dataclasses.field(
  527. default=_AtenlibFxToOnnx.from_sarif(
  528. **{
  529. "id": "FXE0007",
  530. "name": "atenlib-fx-to-onnx",
  531. "short_description": {
  532. "text": "Graph level tracking. Each op is a step. ToDo, experimenting diagnostics, placeholder text."
  533. },
  534. "full_description": {
  535. "text": "ToDo, experimenting diagnostics, placeholder text.",
  536. "markdown": "ToDo, experimenting diagnostics, placeholder text.\n",
  537. },
  538. "message_strings": {
  539. "default": {
  540. "text": "ToDo, experimenting diagnostics, placeholder text."
  541. }
  542. },
  543. "help_uri": None,
  544. "properties": {"deprecated": False, "tags": []},
  545. }
  546. ),
  547. init=False,
  548. )
  549. """Graph level tracking. Each op is a step. ToDo, experimenting diagnostics, placeholder text."""
  550. fx_node_to_onnx: _FxNodeToOnnx = dataclasses.field(
  551. default=_FxNodeToOnnx.from_sarif(
  552. **{
  553. "id": "FXE0008",
  554. "name": "fx-node-to-onnx",
  555. "short_description": {
  556. "text": "Node level tracking. ToDo, experimenting diagnostics, placeholder text."
  557. },
  558. "full_description": {
  559. "text": "ToDo, experimenting diagnostics, placeholder text.",
  560. "markdown": "ToDo, experimenting diagnostics, placeholder text.\n",
  561. },
  562. "message_strings": {
  563. "default": {
  564. "text": "ToDo, experimenting diagnostics, placeholder text."
  565. }
  566. },
  567. "help_uri": None,
  568. "properties": {"deprecated": False, "tags": []},
  569. }
  570. ),
  571. init=False,
  572. )
  573. """Node level tracking. ToDo, experimenting diagnostics, placeholder text."""
  574. fx_frontend_dynamo_make_fx: _FxFrontendDynamoMakeFx = dataclasses.field(
  575. default=_FxFrontendDynamoMakeFx.from_sarif(
  576. **{
  577. "id": "FXE0009",
  578. "name": "fx-frontend-dynamo-make-fx",
  579. "short_description": {
  580. "text": "The make_fx + decomposition pass on fx graph produced from Dynamo, before ONNX export."
  581. },
  582. "full_description": {
  583. "text": "ToDo, experimenting diagnostics, placeholder text.",
  584. "markdown": "ToDo, experimenting diagnostics, placeholder text.\n",
  585. },
  586. "message_strings": {
  587. "default": {
  588. "text": "ToDo, experimenting diagnostics, placeholder text."
  589. }
  590. },
  591. "help_uri": None,
  592. "properties": {"deprecated": False, "tags": []},
  593. }
  594. ),
  595. init=False,
  596. )
  597. """The make_fx + decomposition pass on fx graph produced from Dynamo, before ONNX export."""
  598. arg_format_too_verbose: _ArgFormatTooVerbose = dataclasses.field(
  599. default=_ArgFormatTooVerbose.from_sarif(
  600. **{
  601. "id": "DIAGSYS0001",
  602. "name": "arg-format-too-verbose",
  603. "short_description": {
  604. "text": "The formatted str for argument to display is too verbose."
  605. },
  606. "full_description": {
  607. "text": "ToDo, experimenting diagnostics, placeholder text.",
  608. "markdown": "ToDo, experimenting diagnostics, placeholder text.\n",
  609. },
  610. "message_strings": {
  611. "default": {
  612. "text": "Too verbose ({length} > {length_limit}). Argument type {argument_type} for formatter {formatter_type}."
  613. }
  614. },
  615. "help_uri": None,
  616. "properties": {"deprecated": False, "tags": []},
  617. }
  618. ),
  619. init=False,
  620. )
  621. """The formatted str for argument to display is too verbose."""
  622. rules = _POERules()