unsloth/.github/workflows
Daniel Han 7e90cae345
ci: compiler-cache-shim must mutate live module globals + skip rerun (#5452)
The shim test pinned UNSLOTH_COMPILE_LOCATION via env before
importing unsloth_zoo.compiler, but tests/conftest.py runs
`import unsloth` first, which transitively imports
unsloth_zoo.compiler with the default cache path. The shim's later
env-set never took effect on the captured module global, so the
compiler silently wrote artefacts to the default cache and the
per-model file assertion failed under Core (HF=4.57.6 + TRL<1).

Two fixes:

1) After import, mutate the live module globals directly
   (UNSLOTH_COMPILE_LOCATION, UNSLOTH_COMPILE_USE_TEMP) so they
   reflect the hermetic tmp dir regardless of who imported the
   module first. The same pattern is already used in
   _compiler_cache_invariants_shim._isolate_cache.

2) test_compile_real_modeling_module no longer re-runs
   unsloth_compile_transformers after a sweep already patched the
   module. The compile is not idempotent in-process: re-running on
   a module whose class forwards were already rewritten corrupts
   the inspect source/line cache and the second-pass emitted file
   raises IndentationError / OSError "lineno is out of bounds" on
   import. The sweep already emitted a valid cache file for every
   non-KNOWN_BROKEN model_type, so verify that artefact directly;
   trigger a compile only when running this test in isolation.

Verified locally:
  pytest -q tests/_zoo_compiler_cache_shim.py            (5 passed, 1 skipped)
  pytest -q tests/.._real_modeling_module                (3 passed)
2026-05-15 07:46:36 -07:00
..
consolidated-tests-ci.yml ci: compiler-cache-shim must mutate live module globals + skip rerun (#5452) 2026-05-15 07:46:36 -07:00
lint-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
mlx-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
notebooks-ci.yml ci: merge duplicate with: keys in workflow checkout steps (#5447) 2026-05-15 16:05:14 +04:00
release-desktop.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
security-audit.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
stale.yml CI: scope GITHUB_TOKEN permissions, add MLX CI, unblock ~60 skipped tests (#5312) 2026-05-11 03:19:13 -07:00
studio-api-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-backend-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-frontend-ci.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-inference-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-mac-api-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-mac-inference-smoke.yml studio/ci: flat GGUF+mmproj cache for Mac json-images smoke, save partial caches on cancel (#5417) 2026-05-14 04:27:45 -07:00
studio-mac-ui-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-mac-update-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-tauri-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-ui-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-update-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-api-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-inference-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-ui-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
studio-windows-update-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00
version-compat-ci.yml Update version-compat-ci.yml (#5445) 2026-05-15 15:49:08 +04:00
wheel-smoke.yml security: persist-credentials:false on every actions/checkout (org-wide sweep) (#5413) 2026-05-13 22:02:35 -07:00