# Could I static link a model using pytorch as an elf?

**URL:** <https://dev-discuss.pytorch.org/t/could-i-static-link-a-model-using-pytorch-as-an-elf/3250>\
**Category:** compiler\
**Created:** [October 10, 2025, 10:26am UTC](https://dev-discuss.pytorch.org/t/could-i-static-link-a-model-using-pytorch-as-an-elf/3250 "2025-10-10T10:26:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ZenusZhang](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/zenuszhang/32/2986_2.png) [@ZenusZhang](https://dev-discuss.pytorch.org/u/ZenusZhang)\
**Post date:** [October 10, 2025, 10:26am UTC](https://dev-discuss.pytorch.org/t/could-i-static-link-a-model-using-pytorch-as-an-elf/3250/1 "2025-10-10T10:26:49Z")

</div>

Hello everyone. I want to write aten kernel for a new riscv-vector cpu which haven’t taped out and only have scmodel.

The cost of dynamic link is fairly high both on time and space, which is hard to be handled.

I’ve known that we can use AOTInductor to build an .so file to run the model. But it is still too large for the scmodel env.

---

<div class="post-metadata">

**Author:** ![ZenusZhang](https://yyz2.discourse-cdn.com/flex036/user_avatar/dev-discuss.pytorch.org/zenuszhang/32/2986_2.png) [@ZenusZhang](https://dev-discuss.pytorch.org/u/ZenusZhang)\
**Post date:** [October 11, 2025, 6:26am UTC](https://dev-discuss.pytorch.org/t/could-i-static-link-a-model-using-pytorch-as-an-elf/3250/2 "2025-10-11T06:26:16Z")

</div>

Now, I’ve known that maybe I can try to use the AOTInductor or Executorch ways.  
But here still have some questions:

1. Could I built a static elf using any of these two methods?
2. Could I still use the Aten ops by using the method choosen in “1”

I’ll build pytorch to identify these two questions.
