You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix experimental build failure with ExecuTorch enabled (#2526)
After pytorch/executorch#12320 we started to add `--whole-archive` to libraries in `executorch-config.cmake`. This means when we `find_packages(executoch)` and link `${EXECUTORCH_LIBRARIES}`, we started to actually link portable libs: `portable_ops_lib`. This behavior change is breaking because outside of experimental when we build the `llama_runner` library we are linking `optimized_native_cpu_ops_lib` (which contains exactly the same ops but different kernels) as well: https://github.com/pytorch/executorch/blob/main/examples/models/llama/CMakeLists.txt#L95-L101
This results in runtime error:
```
+ ./cmake-out/examples/models/llama/llama_main --model_path=model.pte --tokenizer_path=tokenizer.bin '--prompt=Once upon a time,'
I tokenizers:regex.cpp:27] Registering override fallback regex
E 00:00:00.000453 executorch:operator_registry.cpp:89] Re-registering aten::_cdist_forward.out, from NOT_SUPPORTED
I 00:00:00.000494 executorch:operator_registry.cpp:90] key: (null), is_fallback: true
F 00:00:00.000497 executorch:operator_registry.cpp:114] In function register_kernels(), assert failed (false): Kernel registration failed with error 18, see error log for details.
```
Like in this job: https://github.com/pytorch/executorch/actions/runs/16207706949/job/45761626062
In order to fix this, we change the logic of linking `${EXECUTORCH_LIBRARIES}` which includes both core and kernel ops lib into only linking `executorch_core`, because the kernel ops lib will be linked outside anyways.
0 commit comments