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

Fix cache bug with Bazel builds in CI #1593

Merged
merged 2 commits into from
Nov 16, 2022

Conversation

sjain-stanford
Copy link
Member

@sjain-stanford sjain-stanford commented Nov 15, 2022

Some time ago, bazel builds in CI were being sped up fine with caching. However, over time the cache got stale because actions/cache@v3 apparently doesn't update caches when it "hits" unless it is configured to do so specifically. This requires using a uniqued per-commit key (to force it to update cache after each successful run) and a relaxed restore-keys which is not unique per-commit so newer commits can restore from the nearest hit.

Test GHA run 1 (no cache hit): 1h 1m 52s
Test GHA run 2 (cache hit, same commit): 5m 14s
Test GHA run 3 (cache hit, different commit): 6m 6s

@sjain-stanford sjain-stanford merged commit 4aa1e90 into llvm:main Nov 16, 2022
@sjain-stanford sjain-stanford deleted the sambhav/bazel_cache branch November 16, 2022 02:48
pashu123 pushed a commit to pashu123/torch-mlir that referenced this pull request Nov 18, 2022
Some time ago, bazel builds in CI were being sped up fine with caching. However, over time the cache got stale because `actions/cache@v3` apparently doesn't update caches when it "hits" unless it is configured to do so specifically. This requires using a uniqued per-commit `key` (to force it to update cache after each successful run) and a relaxed `restore-keys` which is not unique per-commit so newer commits can restore from the nearest hit.

Test GHA run 1 (no cache hit): [1h 1m 52s](https://github.com/sjain-stanford/torch-mlir/actions/runs/3474770334/usage)
Test GHA run 2 (cache hit, same commit): [5m 14s](https://github.com/sjain-stanford/torch-mlir/actions/runs/3475132135/usage)
Test GHA run 3 (cache hit, different commit): [6m 6s](https://github.com/sjain-stanford/torch-mlir/actions/runs/3475161009/usage)
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.

2 participants