# Trial of a Commercial Julia AOT Compiler with Offline License Checking

**URL:** <https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050>\
**Category:** Tooling\
**Tags:** aot, staticcompiler\
**Created:** [June 1, 2024, 9:48am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050 "2024-06-01T09:48:25Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [June 1, 2024, 9:48am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/1 "2024-06-01T09:48:25Z")

</div>

The leadership team at [Suzhou-Tongyuan](https://github.com/Suzhou-Tongyuan/) has confirmed that we can provide an offline license checker and a standalone installation of the AOT compiler, independent of the full Syslab package, if there is potential for future commercial cooperation.

( **EDIT** : ) You might see this post for more details: [SyslabCC: Suzhou-Tongyuan’s proprietary Julia AOT compiler is now available for free use (personal & educational license only) - Community - Julia Programming Language](https://discourse.julialang.org/t/syslabcc-suzhou-tongyuans-proprietary-julia-aot-compiler-is-now-available-for-free-use-personal-educational-license-only/114633)

If you are interested in the AOT compiler, please DM me.

We look forward to hearing from you regarding:

1. The specific scenarios and needs for using Julia’s AOT compiler, so we can assess how well our technology meets your requirements.
2. Basic information about your company, such as the email address or a brief description of your company.

Thank you, and we look forward to your response.

We’d also announce that our latest AOT compiler is now capable of producing standalone CMake project with generated pure C++ code and shared libraries copied from the local Julia installation. The libraries and executables compiled from the generated CMake project have recently been verified to slightly outperform the execution of the same code in vanilla Julia, based on well-known benchmarks such as [Julia performance measurements (Benchmarks Game) (pages.debian.net)](https://benchmarksgame-team.pages.debian.net/benchmarksgame/measurements/julia.html).

Suzhou-Tongyuan has consistently contributed to the Julia ecosystem with various open-source projects, including, but not limited to:

1. [Suzhou-Tongyuan/JNumPy: Writing Python C extensions in Julia within 5 minutes.](https://github.com/Suzhou-Tongyuan/jnumpy)
2. [Suzhou-Tongyuan/ObjectOriented.jl: Conventional object-oriented programming in Julia without breaking Julia’s core design ideas.](https://github.com/Suzhou-Tongyuan/ObjectOriented.jl)
3. [Suzhou-Tongyuan/UnzipLoops.jl: broadcast and unzip it!](https://github.com/Suzhou-Tongyuan/UnzipLoops.jl)
4. [Suzhou-Tongyuan/GaloisFieldNumbers.jl: JuliaCN 2022 archived demo repo: How Julia beats MATLAB’s C codes by 1000x.](https://github.com/Suzhou-Tongyuan/GaloisFieldNumbers.jl)

---

<div class="post-metadata">

**Author:** ![photor](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/photor/32/14343_2.png) [@photor](https://discourse.julialang.org/u/photor)\
**Post date:** [June 1, 2024, 10:13am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/2 "2024-06-01T10:13:50Z")

</div>

You guys did a great job!

---

<div class="post-metadata">

**Author:** ![liuyxpp](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/liuyxpp/32/9870_2.png) [@liuyxpp](https://discourse.julialang.org/u/liuyxpp)\
**Post date:** [June 1, 2024, 10:36am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/3 "2024-06-01T10:36:01Z")

</div>

How well does this compiler cooperate with Lux.jl? Is it practical to generate the inference code for Lux Models? Do you have any experience with this use case?

---

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [June 1, 2024, 10:39am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/4 "2024-06-01T10:39:10Z")

</div>

@liuyxpp How type-stable is the code? If the code is totally type-stable, things should mostly work. However, strict type stability is hard and we only see this property in lower-level packages such as DataStructures.jl, StaticArrays.jl and so on. I’ll have a try for `Lux.jl` on Monday. Do you have any specific downstream example for us to test?

---

<div class="post-metadata">

**Author:** ![RoyiAvital](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/royiavital/32/571_2.png) [@RoyiAvital](https://discourse.julialang.org/u/RoyiAvital)\
**Post date:** [June 1, 2024, 2:30pm UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/5 "2024-06-01T14:30:07Z")

</div>

Will it work with [`LoopVectorization.jl`](https://github.com/JuliaSIMD/LoopVectorization.jl)?

Does it generate and links to BLAS / LAPACK?  
If so, will it work with [`FastLapackInterface.jl`](https://github.com/DynareJulia/FastLapackInterface.jl)?

The code is purely based on basic arrays of primitive types (`Intxx`, `Uintxx`, `Floatxx`).

---

<div class="post-metadata">

**Author:** ![Elrod](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/elrod/32/22461_2.png) [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Post date:** [June 1, 2024, 2:40pm UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/6 "2024-06-01T14:40:37Z")

</div>

> [@RoyiAvital](#):
>
> Will it work with [`LoopVectorization.jl`](https://github.com/JuliaSIMD/LoopVectorization.jl)?

`llvmcall` is not supported according to this announcement:

> [@SyslabCC: Suzhou-Tongyuan's proprietary Julia AOT compiler is now available for free use (personal & educational license only)](https://discourse.julialang.org/t/syslabcc-suzhou-tongyuans-proprietary-julia-aot-compiler-is-now-available-for-free-use-personal-educational-license-only/114633/1):
>
> several special language constructs are not supported, including but not limited to self-recursive `struct`s and `llvmcall`.

---

<div class="post-metadata">

**Author:** ![avikpal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avikpal/32/6550_2.png) [@avikpal](https://discourse.julialang.org/u/avikpal)\
**Post date:** [June 1, 2024, 7:42pm UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/7 "2024-06-01T19:42:26Z")

</div>

[Lux.jl/test/enzyme\_tests.jl at ca23485e6e50c8b4f4ae7aa6ac76fcf92b040195 · LuxDL/Lux.jl · GitHub](https://github.com/LuxDL/Lux.jl/blob/ca23485e6e50c8b4f4ae7aa6ac76fcf92b040195/test/enzyme_tests.jl#L35-L71) would be nice to try out. These already work with Enzyme which requires a relatively high degree of type stability.

---

<div class="post-metadata">

**Author:** ![wsmoses](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/wsmoses/32/26497_2.png) [@wsmoses](https://discourse.julialang.org/u/wsmoses)\
**Post date:** [June 1, 2024, 11:04pm UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/8 "2024-06-01T23:04:59Z")

</div>

FYI Enzyme actually presently works fairly well with type unstable code. There’s still a few todos, but generally things work. I haven’t checked that recently but if memory serves those tests did require type unstable support.

---

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [July 9, 2024, 9:06am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/9 "2024-07-09T09:06:22Z")

</div>

We have recently uploaded the GH repo ([github.com/Suzhou-Tongyuan/JuliaCon2024-JuliaAOT](https://github.com/Suzhou-Tongyuan/JuliaCon2024-JuliaAOT/tree/main)) holding the examples for the talk.

See the folder `features/compile-time`, the recent version of SyslabCC would work with Flux CPU inference mode. The example trains the model at compile-time with Flux.jl & CUDA.jl, and exports the model object and an inference function into C++.

---

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [July 9, 2024, 9:33am UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/10 "2024-07-09T09:33:19Z")

</div>

I tried exporting Lux’s model inference to C++/standalone executable with SyslabCC, but didn’t get a good luck.

 ![image](https://global.discourse-cdn.com/julialang/original/3X/f/b/fbe26feab69521fde66cd5cb43421024890f7fff.png)

It seems that `LuxCore.apply` is not type-stable, maybe mainly due to `Statistics.mean`’s type-unstability for high dimensional cases.

Things like `Base.sum(sequence; dims)` or `Statistics.mean(sequence; dims)` are not type-stable when `sequence` has 2 or more dimensions. Stdlib uses dynamic dispatch as well for this, but it is totally doable for us to make a type-stable implementation for `sum`, `mean` or similar stuffs. We have already patched `Base.sum`.

---

<div class="post-metadata">

**Author:** ![avikpal](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/avikpal/32/6550_2.png) [@avikpal](https://discourse.julialang.org/u/avikpal)\
**Post date:** [July 9, 2024, 2:03pm UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/11 "2024-07-09T14:03:36Z")

</div>

> [@thautwarm](#):
>
> It seems that `LuxCore.apply` is not type-stable, maybe mainly due to `Statistics.mean`’s type-unstability for high dimensional cases.

That seems to hit the `training=Val(true)` dispatches for normalization. You might have missed adding a testmode call [LuxCore | Lux.jl Docs](https://lux.csail.mit.edu/stable/api/Building_Blocks/LuxCore#LuxCore.testmode) before running inference?

---

<div class="post-metadata">

**Author:** ![thautwarm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/thautwarm/32/37760_2.png) [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Post date:** [July 9, 2024, 4:35pm UTC](https://discourse.julialang.org/t/trial-of-a-commercial-julia-aot-compiler-with-offline-license-checking/115050/12 "2024-07-09T16:35:57Z")

</div>

Thanks, I’d have a try again tomorrow.
