Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cache the compiled result #1186

Open
BlurryLight opened this issue Jun 8, 2020 · 2 comments
Open

Cache the compiled result #1186

BlurryLight opened this issue Jun 8, 2020 · 2 comments
Labels
discussion Welcome discussion! feature request Suggest an idea on this project

Comments

@BlurryLight
Copy link

Concisely describe the proposed feature

I have tried to write some short snippnets with Taichi and I have to wait for about 30s ~ 2 mins to re-compile the code (depends on the lines of code). It seems that even if the code is not modified, the taichi compiler will still go to re-compile it.
I have yet tried to sperate functions in single file to multi source files. Will this help alleviate the problem, like the cpp compiler does, the unmodified sources will be cached, or just all sources will be recompiled by taichi?
I'm writing the issue when waitting for compilation:). Is it a intended behaviour, or a trade-off for embedding it into the Python?

@BlurryLight BlurryLight added the feature request Suggest an idea on this project label Jun 8, 2020
@xumingkuan
Copy link
Collaborator

Thanks for proposing this!

I think it's a trade-off for embedding it into Python -- Taichi JIT compiles and doesn't generate executable files like C++. We could cache the compiled result in some files like the .pyc files for Python, but I'm afraid this feature won't be added very soon -- probably not even in 0.7.0.

(Nevertheless, maybe we can add it to #677? Ideally, I want to make Taichi compile fast every time so this will be unnecessary...)

Because we added many advanced optimizations recently and #1059 is not done, compilation can take a long time. You may ti.core.toggle_advanced_optimization(False) to reduce compilation time.

If you'd like to do some benchmarking of compilation time or write some code to contribute to Taichi, that would be great!

@xumingkuan xumingkuan removed their assignment Jun 8, 2020
@xumingkuan xumingkuan added the discussion Welcome discussion! label Jun 8, 2020
@yuanming-hu
Copy link
Member

Thanks for all the discussion here. Here's my thought: caching is definitely doable (LLVM module + options -> binary), but let's first finish the IR passes performance improvements and revisit this item. Maybe by that time caching is no longer necessary since IR passes are fast enough.

@ailzhang ailzhang added this to To do in AOT via automation Feb 12, 2022
@ailzhang ailzhang added this to To Triage in Compiler Frontend & Middle-end via automation Mar 3, 2022
@ailzhang ailzhang removed this from To do in AOT Mar 3, 2022
@strongoier strongoier moved this from To Triage to In progress in Compiler Frontend & Middle-end Mar 11, 2022
@k-ye k-ye removed this from In progress in Compiler Frontend & Middle-end Jun 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discussion Welcome discussion! feature request Suggest an idea on this project
Projects
Status: In Progress
Development

No branches or pull requests

3 participants