Skip to content

CI: cache the tiny Stack Overflow dataset with its vectors in the examples jobs - #565

Merged
tae898 merged 1 commit into
mainfrom
ci/cache-stackoverflow-tiny-vectors
Dec 2, 2026
Merged

tae898 merged 1 commit into
mainfrom
ci/cache-stackoverflow-tiny-vectors

Conversation

@tae898

@tae898 tae898 commented Dec 2, 2026

Copy link
Copy Markdown
Collaborator

What does this PR do?

The examples jobs spend more than half of each leg on the Download datasets step, and almost all of that is embedding the tiny Stack Overflow dataset (about 9,600 texts with all-MiniLM-L6-v2) on a CPU runner. The input is a pinned dump and a pinned model, so every night produces the same bytes. This PR caches examples/data/stackoverflow-tiny per OS and architecture, keyed on examples/download_data.py, in test-python-examples.yml and test-native.yml. scripts/run_examples.sh datasets skips both Stack Overflow downloads when the directory holds the marker file .ci-vectors-complete, which it writes only after a complete download with vectors (not when the host was unreachable).

Measured on the nightly of 2026-12-02 (run 46806951762), step Download datasets against Run all examples:

Leg Download datasets Run all examples
linux/amd64, Python 3.14 474 s 449 s
windows/amd64, Python 3.12 771 s 718 s
darwin/arm64, Python 3.12 1015 s 982 s

The [VECTORS] embedding is 985 s of the 1015 s on macOS. The cache is saved by the first successful leg of a key and restored by the rest, so the saving starts from the second run after this merges. Required checks are unchanged.

How was it checked?

bash -n scripts/run_examples.sh, both workflow files parsed as YAML. The after-time comes from this PR's examples leg on its second run (the first one saves the cache); I will add it as a comment.

…mples jobs

The datasets step embeds about 9,600 texts on every leg of every run: 474 s on linux/amd64, 771 s on windows, 1015 s on macOS (nightly 2026-12-02, run 46806951762), more than half of each leg and the longest step of the nightly run. The bytes are the same every night (pinned dump, pinned model). The directory is cached per OS and architecture, keyed on download_data.py, and run_examples.sh reuses it when it holds the marker written after a complete download.
@tae898 tae898 added github_actions Pull requests that update GitHub Actions code performance Speed or memory of the bindings, with a measurement labels Dec 2, 2026
@tae898
tae898 merged commit 4601f52 into main Dec 2, 2026
27 checks passed
@tae898
tae898 deleted the ci/cache-stackoverflow-tiny-vectors branch December 2, 2026 15:23
@github-actions github-actions Bot added this to the 26.12.1 milestone Dec 2, 2026
@tae898

tae898 commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator Author

The cache from this PR works: the Download datasets step now takes about one second on every leg, and the nightly job time roughly halved.

I compared the nightly Test Python Examples run of 2026-12-02 (before the merge, run 46806951762) with the nightly of 2026-12-03 (after, run 47032157673). Each cell is the median over the legs of that OS (8 Linux, 4 Windows, 4 macOS).

Leg Download datasets before after Job before after
Linux 662 s 1 s 23.1 min 11.5 min
Windows 823 s 1 s 27.5 min 13.7 min
macOS 1068 s 1 s 36.0 min 20.0 min

The first main run after the merge (2026-12-02 15:23Z) still downloaded and saved the cache. Every main and nightly run since then restored it, and no run saved it again. The nightly of 2026-12-04 has not run yet, so I will add it here if it differs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

github_actions Pull requests that update GitHub Actions code performance Speed or memory of the bindings, with a measurement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant