Skip to content

fix[next]: cache dir construction and translation_cache lifetime#2604

Merged
havogt merged 3 commits into
GridTools:mainfrom
havogt:construction_of_cache_dir
May 20, 2026
Merged

fix[next]: cache dir construction and translation_cache lifetime#2604
havogt merged 3 commits into
GridTools:mainfrom
havogt:construction_of_cache_dir

Conversation

@havogt
Copy link
Copy Markdown
Contributor

@havogt havogt commented May 20, 2026

  • Before the .gt4py_cache dir is constructed on import time of gt4py. Now the directory is created on first write.
  • Respect BUILD_CACHE_LIFETIME for the translation_cache.

@havogt havogt requested review from edopao and tehrengruber May 20, 2026 05:49
Copy link
Copy Markdown
Contributor

@edopao edopao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am approving this PR because it fixes a problem. My comment is just a discussion point, how we want to setup the persistent cache for different backends.

cache=filecache.FileCache(
str(
cache.get_cache_base_path(config.BUILD_CACHE_LIFETIME)
/ "translation_cache"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need to use dace_cache (similarly to what the gtfn backend does, gtfn_cache) to be able to share the cache directory across backends?

Or, I believe, the backend key is already part of the translation hash and therefore different backends can coexist in the same translation folder?

@havogt havogt merged commit 664a88f into GridTools:main May 20, 2026
28 checks passed
@havogt havogt deleted the construction_of_cache_dir branch May 20, 2026 14:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants