Add static module extension target (#2904)
Summary: Add an module extension target always built as a static library. This is a hacky workaround to the fact that the llama runner currently relies on some fragile linking behavior and requires consuming the module extension as a static lib. However, the nanogpt_runner needs to consume it as a static lib to avoid duplicate primitive op registration. I'm not 100% clear on why llama runner doesn't hit this yet. Maybe something to do with the primitive op -> executorch -> llama_runner -> llama_main chain having a top level target that doesn't reference the core executorch dependency leading to it not being pulled in at the top level? Anyway, this new target will be removed once we refactor the CMake build post-alpha. Note that by adding a completely new target, this should cause no regressions and should be safe to land. Pull Request resolved: https://github.com/pytorch/executorch/pull/2904 Test Plan: Internal + external CI. Built and ran nanogpt_runner on linux and mac linking against extension_module_static. Reviewed By: mikekgfb Differential Revision: D55834574 Pulled By: GregoryComer fbshipit-source-id: 4f340e133b9cdc8ef40f154342b396143d78e84f
G
Gregory Comer committed
fd266660cb36d8a807a5d8249d7f851a5dfc1cde
Parent: 81a7e88
Committed by Facebook GitHub Bot <facebook-github-bot@users.noreply.github.com>
on 4/6/2024, 4:06:38 PM