Commit b4df9a3
Error out if registering prim ops
Summary:
Using `executorch_ops_check` should error out if the dependencies includes 2 libraries of `prim_op_registry`. For example:
The target `//arvr/libraries/wristband/tsn/transformers:TorchstreamTransformerTest` depends on both `prim_ops_registry` and `prim_ops_registry_aten`. BUCK query:
```
buck2 uquery "filter('prim_ops_registry(?:_static|_aten)?$', deps(//arvr/libraries/wristband/tsn/transformers:
TorchstreamTransformerTest))"
Buck UI: https://www.internalfb.com/buck2/1401c12c-0ef2-4ba8-8d4e-6b86871d708f
Network: Up: 0B Down: 0B
Command: uquery.
Time elapsed: 3.6s
fbcode//executorch/kernels/prim_ops:prim_ops_registry
fbcode//executorch/kernels/prim_ops:prim_ops_registry_aten
fbsource//xplat/executorch/kernels/prim_ops:prim_ops_registry
fbsource//xplat/executorch/kernels/prim_ops:prim_ops_registry_aten
```
This will cause the error like this:
```
E 00:00:00.032942 executorch:operator_registry.cpp:86] Re-registering aten::sym_size.int, from /data/users/larryliu/fbsource/buck-out/v2/gen/fbsource/cfdc20bd56300721/arvr/libraries/wristband/tsn/transformers/__TorchstreamTransformerTest__/./__TorchstreamTransformerTest__shared_libs_symlink_tree/libexecutorc$
E 00:00:00.033022 executorch:operator_registry.cpp:87] key: (null), is_fallback: true
F 00:00:00.033033 executorch:operator_registry.cpp:111] In function register_kernels(), assert failed (false): Kernel registration failed with error 18, see error log for details.
```
To catch issues like this, we should error out when user uses `executorch_ops_check` to debug.
```
executorch_ops_check(
name = "my_executorch_test_check",
deps = [":TorchstreamTransformerTest"],
)
```
Fixing the internal portion of [#8171](#8171)
Differential Revision: D690908501 parent 0a936e0 commit b4df9a3
File tree
2 files changed
+35
-4
lines changed- codegen/tools
- shim/xplat/executorch/codegen
2 files changed
+35
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
95 | 95 | | |
96 | 96 | | |
97 | 97 | | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
98 | 106 | | |
99 | 107 | | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
100 | 127 | | |
101 | 128 | | |
102 | 129 | | |
| |||
153 | 180 | | |
154 | 181 | | |
155 | 182 | | |
156 | | - | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
157 | 187 | | |
158 | 188 | | |
159 | 189 | | |
160 | 190 | | |
161 | 191 | | |
162 | | - | |
163 | | - | |
| 192 | + | |
| 193 | + | |
164 | 194 | | |
165 | 195 | | |
166 | 196 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
689 | 689 | | |
690 | 690 | | |
691 | 691 | | |
692 | | - | |
| 692 | + | |
693 | 693 | | |
694 | 694 | | |
| 695 | + | |
695 | 696 | | |
696 | 697 | | |
697 | 698 | | |
| |||
0 commit comments