Local UI to run and train LLMs and diffusion models. Supports GGUF, MLX, Qwen3.8, DeepSeek-V4.1, MiniMax-H3, Gemma 4, FLUX and more.
Python agentaichatgptdeepseekfine-tuninggemmaimage-generationllamallmllmsopenaipythonqwenreinforcement-learningself-hostedstable-diffusiontext-to-speechttsuiunsloth
Compare Kaggle reference repo ids without case and prefetch the Qwen3 4bit repo under its new spelling (#12411)
Daniel Haneba095f0fd06
diff --git a/.github/scripts/kaggle_t4_ci/legs.py b/.github/scripts/kaggle_t4_ci/legs.pyindex 1861f768f95..00056f5288b 100644--- a/.github/scripts/kaggle_t4_ci/legs.py+++ b/.github/scripts/kaggle_t4_ci/legs.py@@ -466,7 +466,7 @@ PREFETCH_REPOS: tuple[str, ...] = ("unsloth/Qwen3.5-2B",# Default's model and the 4bit sibling `load_in_4bit=True` actually resolves to. Both, because FLOAT_TO_INT_MAPPER redirects at load time and warming only the name in the args warms a cache the leg never reads."unsloth/Qwen3-0.6B",- "unsloth/qwen3-0.6b-unsloth-bnb-4bit",+ "unsloth/Qwen3-0.6B-unsloth-bnb-4bit","unsloth/Qwen2.5-0.5B-Instruct",# Last now rather than first: gptoss is admitted only once a card empties, around t~500 on the measured schedule, so it has the most slack of anything here."unsloth/gpt-oss-20b-unsloth-bnb-4bit",@@ -475,8 +475,8 @@ PREFETCH_REPOS: tuple[str, ...] = (# Declared name -> what actually gets loaded on an sm_75 card. Kept beside the list it corrects so the two cannot drift apart silently.LOAD_REDIRECTS: dict[str, str] = {"unsloth/gpt-oss-20b": "unsloth/gpt-oss-20b-unsloth-bnb-4bit",- # CASE MATTERS HERE, and it is not a typo: two runs report `resolved_checkpoint: unsloth/qwen3-0.6b-unsloth-bnb-4bit` in lower case while gpt-oss above resolves with its capitals intact. The HF cache keys on the literal string, so prefetching the pretty spelling warms a directory the leg never reads and the download happens twice. Copied from the report rather than typed.- "unsloth/Qwen3-0.6B": "unsloth/qwen3-0.6b-unsloth-bnb-4bit",+ # CASE MATTERS HERE: the HF cache keys on the literal string, so prefetching another spelling warms a directory the leg never reads and the download happens twice. Copied from the report rather than typed. Runs before #8058 reported `unsloth/qwen3-0.6b-unsloth-bnb-4bit` in lower case; since #8058 the loader keeps the canonical case, and kernel unsloth-t4-ci-n361d0b65ec92-0d7d reports `resolved_checkpoint: unsloth/Qwen3-0.6B-unsloth-bnb-4bit`.+ "unsloth/Qwen3-0.6B": "unsloth/Qwen3-0.6B-unsloth-bnb-4bit",}diff --git a/tests/kaggle/t4_smoke/run_t4_smoke.py b/tests/kaggle/t4_smoke/run_t4_smoke.pyindex 3a8e9fc27b7..71aeee410eb 100644--- a/tests/kaggle/t4_smoke/run_t4_smoke.py+++ b/tests/kaggle/t4_smoke/run_t4_smoke.py@@ -66,6 +66,7 @@ import hashlibimport jsonimport osimport platform+import reimport subprocessimport tempfileimport sys@@ -1397,6 +1398,21 @@ def reference_step_count(ref: dict):# what is in the file, and canary_dataset.jsonl is inside the workflow's paths# filter, so a run triggered BY editing it is exactly the run that would# otherwise be band-checked against a trace of the old rows.+# Hub repo ids among the reference-defining fields, compared without case.+_REPO_ID_KEYS = frozenset({"model", "resolved_checkpoint"})+_HUB_REPO_ID_RE = re.compile(r"[A-Za-z0-9][A-Za-z0-9._-]*/[A-Za-z0-9._-]+")+++def _is_hub_repo_id(value: Any) -> bool:+ """``owner/name`` and not a directory here. A local checkpoint path keeps its case:+ on a case-sensitive filesystem /models/Foo and /models/foo are different weights."""+ return (+ isinstance(value, str)+ and _HUB_REPO_ID_RE.fullmatch(value) is not None+ and not os.path.exists(value)+ )++REFERENCE_DEFINING_SETTINGS = ("max_steps","dataset_digest",@@ -1602,6 +1618,12 @@ def check_reference(continueobserved_pairs.append((key, ref[key], observed))for key, expected, observed in observed_pairs:+ if key in _REPO_ID_KEYS and _is_hub_repo_id(expected) and _is_hub_repo_id(observed):+ # Hub repo ids are case-insensitive: unsloth/qwen2.5-0.5b-instruct-unsloth-bnb-4bit and+ # unsloth/Qwen2.5-0.5B-Instruct-unsloth-bnb-4bit are one repo, and which spelling+ # the loader reports changed in #8058. The revision below still pins the weights.+ if expected.casefold() == observed.casefold():+ continueif expected != observed:verdict["config_differences"].append({"key": key, "reference": expected, "observed": observed}diff --git a/tests/kaggle/test_prefetch_covers_the_wired_legs.py b/tests/kaggle/test_prefetch_covers_the_wired_legs.pyindex 5c5eebd0538..0bbf5fda8f0 100644--- a/tests/kaggle/test_prefetch_covers_the_wired_legs.py+++ b/tests/kaggle/test_prefetch_covers_the_wired_legs.py@@ -120,7 +120,7 @@ def test_every_redirect_target_is_prefetched_under_its_EXACT_name():`models--unsloth--qwen3-0.6b-unsloth-bnb-4bit` and`models--unsloth--Qwen3-0.6B-unsloth-bnb-4bit` are different directories, so- prefetching the pretty spelling of a repo the loader asks for in lower case+ prefetching a spelling other than the one the loader asks forwarms a cache nobody reads and the session downloads it twice -- at fullcost, with no error and nothing red. Two hardware reports give the exactstrings; this asserts the lists agree with them character for character.@@ -142,10 +142,12 @@ def test_every_redirect_target_is_prefetched_under_its_EXACT_name():)-def test_the_lower_case_qwen3_redirect_is_not_tidied_away():- """It looks like a typo and it is a measurement. Written down so the next- reader corrects the capitals in the report, not in this file."""- assert legs.LOAD_REDIRECTS["unsloth/Qwen3-0.6B"] == "unsloth/qwen3-0.6b-unsloth-bnb-4bit"+def test_the_qwen3_redirect_matches_the_measured_case():+ """A measurement, not a style choice. Before #8058 the loader reported this repo in+ lower case; since #8058 it keeps the canonical capitals, and the kernel report cited in+ legs.py shows exactly this string. If the loader's spelling moves again, correct it here+ from a report, not by hand."""+ assert legs.LOAD_REDIRECTS["unsloth/Qwen3-0.6B"] == "unsloth/Qwen3-0.6B-unsloth-bnb-4bit"def test_a_blob_is_counted_once_not_once_per_symlink(tmp_path, monkeypatch):diff --git a/tests/kaggle/test_t4_payload_assertions.py b/tests/kaggle/test_t4_payload_assertions.pyindex 12eca6310f1..8e82743c85d 100644--- a/tests/kaggle/test_t4_payload_assertions.py+++ b/tests/kaggle/test_t4_payload_assertions.py@@ -825,6 +825,96 @@ def test_the_model_revision_travels_with_the_reference(tmp_path):assert reference_failures(moved, 0.10)+def test_a_repo_id_that_differs_only_in_case_is_the_same_reference(tmp_path):+ """The Hub treats repo ids case-insensitively, and #8058 changed the loader from reporting+ the lower-case spelling to the canonical one. The committed reference still carries the+ old spelling; that is the same checkpoint, and the revision pin is what moves with weights."""+ check_reference, ref, reference_failures = _shared_setup_2(tmp_path)+ payload = json.loads(ref.read_text())+ payload["model"] = "unsloth/qwen2.5-0.5b-instruct"+ payload["resolved_checkpoint"] = "unsloth/qwen2.5-0.5b-instruct-unsloth-bnb-4bit"+ payload["resolved_revision"] = "10413c288cb9629acdf60b3e0229f3ba75efe413"+ ref.write_text(json.dumps(payload))+ observed = [{"step": s, "loss": 1.0 / s, "grad_norm": 3.0} for s in (1, 2, 3)]++ recased = check_reference(+ observed,+ ref,+ 0.10,+ 0.05,+ max_steps = 3,+ model = "unsloth/Qwen2.5-0.5B-Instruct",+ resolved_checkpoint = "unsloth/Qwen2.5-0.5B-Instruct-unsloth-bnb-4bit",+ resolved_revision = "10413c288cb9629acdf60b3e0229f3ba75efe413",+ )+ assert recased["status"] == "ok", recased+ assert not reference_failures(recased, 0.10)++ # Case is the only thing forgiven: another checkpoint, or a revision with different+ # capitals, is still a different experiment.+ other = check_reference(+ observed,+ ref,+ 0.10,+ 0.05,+ max_steps = 3,+ resolved_checkpoint = "unsloth/Qwen2.5-1.5B-Instruct-unsloth-bnb-4bit",+ resolved_revision = "10413c288cb9629acdf60b3e0229f3ba75efe413",+ )+ assert other["status"] == "config_mismatch"+ revision = check_reference(+ observed,+ ref,+ 0.10,+ 0.05,+ max_steps = 3,+ resolved_checkpoint = "unsloth/qwen2.5-0.5b-instruct-unsloth-bnb-4bit",+ resolved_revision = "10413C288CB9629ACDF60B3E0229F3BA75EFE413",+ )+ assert revision["status"] == "config_mismatch"+++def test_a_local_checkpoint_path_keeps_its_case(tmp_path):+ """Only Hub repo ids are case-insensitive. A local directory is a path, and on a+ case-sensitive filesystem another capitalisation can hold other weights."""+ check_reference, ref, reference_failures = _shared_setup_2(tmp_path)+ upper = tmp_path / "models" / "Foo"+ lower = tmp_path / "models" / "foo"+ upper.mkdir(parents = True)+ if lower.exists():+ pytest.skip("case-insensitive filesystem: the two paths are one directory here")+ lower.mkdir()+ payload = json.loads(ref.read_text())+ payload["resolved_checkpoint"] = str(upper)+ ref.write_text(json.dumps(payload))+ observed = [{"step": s, "loss": 1.0 / s, "grad_norm": 3.0} for s in (1, 2, 3)]++ verdict = check_reference(+ observed, ref, 0.10, 0.05, max_steps = 3, resolved_checkpoint = str(lower)+ )+ assert verdict["status"] == "config_mismatch", verdict+ assert reference_failures(verdict, 0.10)++ # A relative "owner/name" that exists here is a directory too, not a repo id.+ rel_upper = tmp_path / "Owner" / "Model"+ rel_lower = tmp_path / "owner" / "model"+ rel_upper.mkdir(parents = True)+ rel_lower.mkdir(parents = True)+ payload["resolved_checkpoint"] = "Owner/Model"+ ref.write_text(json.dumps(payload))+ import os++ cwd = os.getcwd()+ os.chdir(tmp_path)+ try:+ relative = check_reference(+ observed, ref, 0.10, 0.05, max_steps = 3, resolved_checkpoint = "owner/model"+ )+ finally:+ os.chdir(cwd)+ assert relative["status"] == "config_mismatch", relative++def test_a_reference_with_no_recorded_revision_does_not_refuse(tmp_path):"""The committed file predates this; unknown is unknown, not a mismatch."""check_reference, ref = _shared_setup_3(tmp_path)