ci(matrix): enable and persist SPYRE_KERNEL_CACHE across CI runs - #812
Open
prashantgupta24 wants to merge 9 commits into
Open
ci(matrix): enable and persist SPYRE_KERNEL_CACHE across CI runs#812prashantgupta24 wants to merge 9 commits into
prashantgupta24 wants to merge 9 commits into
Conversation
Contributor
|
👋 Hi! Thank you for contributing. We also recommend installing prek and configuring it to check your code before every local commit. |
Collaborator
Author
|
/claude-review |
prashantgupta24
marked this pull request as ready for review
September 8, 2026 20:45
prashantgupta24
requested review from
a team,
HarikrishnanBalagopal,
anubhavjana,
ashokponkumar and
kmehant
as code owners
September 8, 2026 20:45
prashantgupta24
added a commit
to prashantgupta24/spyre-inference
that referenced
this pull request
Sep 9, 2026
Temporary no-op commit to trigger CI run for PR torch-spyre#812. This change only adds a comment and will be reverted. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
prashantgupta24
marked this pull request as draft
September 9, 2026 01:28
5 tasks
prashantgupta24
commented
Sep 9, 2026
Set SPYRE_KERNEL_CACHE=1 alongside the job-scoped TORCHINDUCTOR_CACHE_DIR. The persistent Spyre kernel cache lives under the same per-job path, so it stays isolated from concurrent matrix legs while allowing compiled kernels to be reused across runs. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
Rename the cache-dir step and extend its comment to make clear that it also enables the persistent Spyre kernel cache. The cache path is job-scoped, so the kernel cache benefits from intra-job reuse without cross-job races. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
Temporary no-op commit to trigger CI run for PR torch-spyre#812. This change only adds a comment and will be reverted. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
Persist TORCHINDUCTOR_CACHE_DIR (which contains the Spyre kernel cache under inductor-spyre-cache) across CI runs via actions/cache/restore and actions/cache/save. Set SPYRE_KERNEL_CACHE=1 so compiled kernels are written to the on-disk cache. Key the cache by runner OS/arch, job slot, lockfile hashes, and runner labels to balance reuse and invalidation. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
actions/cache keys cannot contain commas. inputs.runner_labels is a JSON array string like '["x86_64","spyre_pf_x1","linux","image_torch_spyre"]', which embeds commas. Use hashFromJSON to collapse it into a stable, comma-free hash for the cache key. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
hashFromJSON is not a valid GitHub Actions expression function, so the previous fix failed template validation. Instead, write inputs.runner_labels to a file and include it in hashFiles, which keeps the key stable and free of commas. Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
prashantgupta24
force-pushed
the
feat/spyre-kernel-cache-ci
branch
2 times, most recently
from
September 10, 2026 20:23
d261f43 to
f150d11
Compare
Signed-off-by: Prashant Gupta <prashantgupta24@gmail.com>
prashantgupta24
force-pushed
the
feat/spyre-kernel-cache-ci
branch
from
September 10, 2026 23:53
ed14ed7 to
8ac4b5b
Compare
Signed-off-by: Prashant Gupta <prashantgupta@us.ibm.com>
prashantgupta24
marked this pull request as ready for review
September 11, 2026 00:09
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Persist the Spyre kernel compile cache across CI runs by saving and restoring
TORCHINDUCTOR_CACHE_DIRwithactions/cache. The persistent Spyre kernel cache added intorch-spyre@76978116cb44020b50c8df1a1822d5178629922alives under the sameTORCHINDUCTOR_CACHE_DIRroot, so caching that directory reuses compiled kernels between runs while keeping each matrix job scoped to its own path to avoid races or stale cross-job reuse.Changes in
.github/actions/run-matrix-config/action.yml:pyproject.toml,uv.lock,spyre-rpms.lock), and runner labels, with fallback restore keys for partial matches.SPYRE_KERNEL_CACHE=1alongside a per-jobTORCHINDUCTOR_CACHE_DIR.if: always()so the cache is persisted even when tests fail.${RUNNER_TEMP}/inductor-cache-${{ inputs.job_slot }}) so the restore key can match artifacts saved by previous runs. The original path included${{ github.run_id }}, which changed every run and prevented cache reuse.Cache Reuse Results
Verified on
test_each_commitrun 2827 (34542654984) — every matrix job restored the Spyre kernel compile cache on its second run with the stable path:Spyre attention tests (shard 1/10)Cache hit for: spyre-kernel-cache-Linux-X64-8-...(~7 MB restored)Non-distributed spyre tests (shard 1/8)Cache hit for: spyre-kernel-cache-Linux-X64-0-...(~7 MB restored)Upstream vLLM tests (shard 1/7)Cache hit for: spyre-kernel-cache-Linux-X64-24-...(~9 MB restored)Distributed spyre tests (shard 1/3)Cache hit for: spyre-kernel-cache-Linux-X64-19-...(~7 MB restored)Spyre attention tests (shard 5/10)Cache hit for: spyre-kernel-cache-Linux-X64-12-...(~5 MB restored)All representative slots across attention, non-distributed, upstream, and distributed test groups showed
Cache restored from key: ..., and the save step reportedFailed to save: Unable to reserve cache with key ...because the cache already existed from the prior run.Test Plan
bash format.sh— passedChecklist
🤖 Generated with Claude Code