Skip to content

CI: share the Qwen3.5-2B tool-calling GGUF cache across Linux, macOS and Windows - #8069

Merged
danielhanchen merged 1 commit into
mainfrom
ci/share-qwen35-tools-cache-cross-os
Aug 7, 2026
Merged

danielhanchen merged 1 commit into
mainfrom
ci/share-qwen35-tools-cache-cross-os

Conversation

@danielhanchen

Copy link
Copy Markdown
Member

What

The same consolidation as #8068, applied to the second cache family that is genuinely
duplicated across OSes: the Qwen3.5-2B-UD-Q4_K_XL.gguf tool-calling model.

Three jobs download the same file from the same repo into the same flat --local-dir layout:

runner workflow / job path before key before
ubuntu-latest studio-inference-smoke / tool-calling gguf-cache Linux-gguf-...-v1
macos-15 studio-mac-inference-smoke / phase 2 gguf-cache-tools macOS-gguf-...-v2
windows-latest studio-windows-inference-smoke / phase 2 gguf-cache-tools Windows-gguf-...-v2

Two things had to change together: the Linux job moves to gguf-cache-tools, and all three
converge on one key with no runner.os, gguf-unsloth/Qwen3.5-2B-GGUF-Qwen3.5-2B-UD-Q4_K_XL.gguf-v3,
plus enableCrossOsArchive: true.

The path and the key must move in the same commit

actions/cache identifies an entry by the key and by a version hash derived from the
path input, while key uniqueness is global per ref. Change path while leaving the key and
you get a permanent restore miss (version mismatch) plus a refused save
("Unable to reserve cache with key ... another job may be creating this cache") - the model
then re-downloads on every run, forever. This was measured on staging during the Mac phase
consolidation: two consecutive runs both logged "Cache not found for input keys" and both
failed to save. That is why the suffix goes to v3 here.

The stale comments in the mac and Windows workflows that described the old v1 -> v2 bump are
rewritten to describe the current state.

Evidence

The flat --local-dir payload is byte-identical on all three runners. Probe inventory of
hf download unsloth/gemma-3-270m-it-GGUF <file> --local-dir on ubuntu-latest, macos-15
and windows-latest (the mechanism is per-directory, not per-model):

FILE  253934624  <model>.gguf                                      sha256=e5420636...  (all 3 OSes)
FILE          1  .cache/huggingface/.gitignore                     sha256=684888c0...  (all 3 OSes)
FILE        191  .cache/huggingface/CACHEDIR.TAG                   Linux/macOS
FILE        195  .cache/huggingface/CACHEDIR.TAG                   Windows (CRLF)
FILE          0  .cache/huggingface/download/<model>.gguf.lock     Linux/macOS only
FILE    124-128  .cache/huggingface/download/<model>.gguf.metadata (per-download timestamp)

WIN_NAME_PROBLEMS=0, CASE_COLLISIONS=0, SYMLINKS=0 on all three: nothing in this layout
is OS-specific in a way that matters. Only the model file is read back.

Cross-OS restore proven end to end on
https://github.com/danielhanchen/unsloth-staging-2/actions/runs/31141007275, including this
exact flat layout:

  • ubuntu-latest save -> macos-15 restore, no flag: Cache restored from key: xosprobe-g1-flat
  • ubuntu-latest save -> windows-latest restore, no flag: Cache not found for input keys
  • ubuntu-latest save -> windows-latest restore, enableCrossOsArchive: true: Cache restored from key: xosprobe-g1-flatx
  • windows-latest save -> ubuntu-latest restore, enableCrossOsArchive: true: Cache restored from key: xosprobe-g1-winsave

In every hit the restored .gguf had the same sha256 as the one the saving OS wrote.

Cost

This is the expensive one and it should be merged with eyes open. The path move makes the new
key genuinely cold on every OS, so the first main run after merge re-downloads 1.22 GiB
per runner, three times total
, before any of them can save. On the runners I measured that is
roughly 15-25 s of download plus one save; the Linux job in studio-inference-smoke will
normally win the race and seed the entry for the other two.

Steady state after that: one 1.22 GiB entry instead of three, and the macOS and Windows phases
restore from whatever Linux seeded rather than each maintaining their own copy. macOS is the
slowest at cache I/O of the three (46-63 MB/s restore versus 89 on Windows and 127 on Linux in
the probe), so moving it from "maintains its own entry" to "consumes Linux's" is a small win
for it too.

If the one-time 3.66 GiB of downloads is unwelcome right now, this PR can wait; #8068 is the
cheap half of the same idea (no path change, 254 MiB per OS) and stands alone.

Also in this change

The Linux and Windows saves gain hashFiles('gguf-cache-tools/**/*.gguf') != '', matching the
guard the mac workflow already had. A shared key means one bad save would poison three OSes.

…and Windows

The Linux, macOS and Windows tool-calling phases download the same file
from the same repo into the same flat --local-dir layout, but the Linux
job used path gguf-cache while the other two used gguf-cache-tools, and
runner.os split the key three ways. Rename the Linux directory to match,
drop runner.os, and set enableCrossOsArchive.

The key goes v1/v2 -> v3 in the same commit as the path move: an entry is
identified by key AND a hash of path, so moving one without the other is
a permanent restore miss plus a refused save.

One-time cost: the first main run after merge re-downloads 1.22 GiB on
each of the three runners. Steady state drops from three copies to one.

Also require hashFiles('gguf-cache-tools/**/*.gguf') != '' before saving:
a shared key means a bad save now poisons three OSes, not one.
@danielhanchen
danielhanchen merged commit 3e4240f into main Aug 7, 2026
19 checks passed
@danielhanchen
danielhanchen deleted the ci/share-qwen35-tools-cache-cross-os branch August 7, 2026 03:45
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.

1 participant