From ae5d60728bdbe95457c39e5922260aa686c9cca1 Mon Sep 17 00:00:00 2001 From: Daniel Han Date: Mon, 1 Jun 2026 08:17:50 -0700 Subject: [PATCH] Studio: cover B300 (sm_103) with the Linux prebuilt bundles (#5930) * Studio: cover B300 (sm_103) with the Linux prebuilt bundles sm_103 (B300 / GB300 Blackwell Ultra) was in no bundle's supported_sms, so those hosts fell through to a slow source compile. The newer and portable bundles already ship base compute_100 PTX, which the driver JIT-compiles forward to sm_103, so list sm_103 alongside sm_100 in those bundles and let B300 install the prebuilt. * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- studio/install_llama_prebuilt.py | 12 ++-- tests/studio/install/test_selection_logic.py | 73 ++++++++++++++++++++ 2 files changed, 81 insertions(+), 4 deletions(-) diff --git a/studio/install_llama_prebuilt.py b/studio/install_llama_prebuilt.py index 9c0a1bd1c1..62b7b2b290 100644 --- a/studio/install_llama_prebuilt.py +++ b/studio/install_llama_prebuilt.py @@ -176,6 +176,10 @@ _PINNED_MACOS_FALLBACK_TAG = "b9415" _PINNED_MACOS_LATEST_FLOOR = (26, 0) FORCE_COMPILE_DEFAULT_REF = os.environ.get("UNSLOTH_LLAMA_FORCE_COMPILE_REF", "master") +# sm_103 (B300 / GB300 Blackwell Ultra) is not built natively but runs on the +# bundled base compute_100 PTX, which the driver JIT-compiles forward to sm_103. +# It is listed in every bundle that ships the sm_100 build (the "newer" and +# "portable" classes) so those hosts get a prebuilt instead of a source compile. DIRECT_LINUX_BUNDLE_PROFILES: dict[str, dict[str, Any]] = { "cuda12-older": { "runtime_line": "cuda12", @@ -188,7 +192,7 @@ DIRECT_LINUX_BUNDLE_PROFILES: dict[str, dict[str, Any]] = { "cuda12-newer": { "runtime_line": "cuda12", "coverage_class": "newer", - "supported_sms": ["86", "89", "90", "100", "120"], + "supported_sms": ["86", "89", "90", "100", "103", "120"], "min_sm": 86, "max_sm": 120, "rank": 20, @@ -196,7 +200,7 @@ DIRECT_LINUX_BUNDLE_PROFILES: dict[str, dict[str, Any]] = { "cuda12-portable": { "runtime_line": "cuda12", "coverage_class": "portable", - "supported_sms": ["70", "75", "80", "86", "89", "90", "100", "120"], + "supported_sms": ["70", "75", "80", "86", "89", "90", "100", "103", "120"], "min_sm": 70, "max_sm": 120, "rank": 30, @@ -212,7 +216,7 @@ DIRECT_LINUX_BUNDLE_PROFILES: dict[str, dict[str, Any]] = { "cuda13-newer": { "runtime_line": "cuda13", "coverage_class": "newer", - "supported_sms": ["86", "89", "90", "100", "120"], + "supported_sms": ["86", "89", "90", "100", "103", "120"], "min_sm": 86, "max_sm": 120, "rank": 50, @@ -220,7 +224,7 @@ DIRECT_LINUX_BUNDLE_PROFILES: dict[str, dict[str, Any]] = { "cuda13-portable": { "runtime_line": "cuda13", "coverage_class": "portable", - "supported_sms": ["75", "80", "86", "89", "90", "100", "120"], + "supported_sms": ["75", "80", "86", "89", "90", "100", "103", "120"], "min_sm": 75, "max_sm": 120, "rank": 60, diff --git a/tests/studio/install/test_selection_logic.py b/tests/studio/install/test_selection_logic.py index 30ad3dd88b..2a94039018 100644 --- a/tests/studio/install/test_selection_logic.py +++ b/tests/studio/install/test_selection_logic.py @@ -1252,6 +1252,79 @@ class TestLinuxCudaChoiceFromRelease: assert result is None +def make_profile_artifact(asset_name, profile_name, **overrides): + profile = INSTALL_LLAMA_PREBUILT.DIRECT_LINUX_BUNDLE_PROFILES[profile_name] + defaults = dict( + runtime_line = profile["runtime_line"], + coverage_class = profile["coverage_class"], + supported_sms = [str(value) for value in profile["supported_sms"]], + min_sm = int(profile["min_sm"]), + max_sm = int(profile["max_sm"]), + bundle_profile = profile_name, + rank = int(profile["rank"]), + ) + defaults.update(overrides) + return make_artifact(asset_name, **defaults) + + +class TestBlackwellUltraSm103Coverage: + """sm_103 (B300 / GB300) runs on the bundled base compute_100 PTX via JIT.""" + + def test_profiles_list_sm103_wherever_sm100_is_shipped(self): + for ( + name, + profile, + ) in INSTALL_LLAMA_PREBUILT.DIRECT_LINUX_BUNDLE_PROFILES.items(): + sms = {str(value) for value in profile["supported_sms"]} + if "100" in sms: + assert "103" in sms, name + else: + assert "103" not in sms, name + + def test_b300_selects_cuda13_newer_prebuilt(self, monkeypatch): + mock_linux_runtime(monkeypatch, ["cuda13"]) + host = make_host(compute_caps = ["103"], driver_cuda_version = (13, 0)) + art = make_profile_artifact("cuda13-newer.tar.gz", "cuda13-newer") + release = make_release([art]) + result = linux_cuda_choice_from_release(host, release) + assert result is not None + assert result.primary.name == "cuda13-newer.tar.gz" + + def test_b300_selects_cuda12_newer_prebuilt(self, monkeypatch): + mock_linux_runtime(monkeypatch, ["cuda12"]) + host = make_host(compute_caps = ["103"], driver_cuda_version = (12, 8)) + art = make_profile_artifact("cuda12-newer.tar.gz", "cuda12-newer") + release = make_release([art]) + result = linux_cuda_choice_from_release(host, release) + assert result is not None + assert result.primary.name == "cuda12-newer.tar.gz" + + def test_b300_reported_as_decimal_normalizes_and_matches(self, monkeypatch): + mock_linux_runtime(monkeypatch, ["cuda13"]) + host = make_host(compute_caps = ["10.3"], driver_cuda_version = (13, 0)) + art = make_profile_artifact("cuda13-portable.tar.gz", "cuda13-portable") + release = make_release([art]) + result = linux_cuda_choice_from_release(host, release) + assert result is not None + + def test_b300_falls_back_to_portable_when_only_portable_present(self, monkeypatch): + mock_linux_runtime(monkeypatch, ["cuda13"]) + host = make_host(compute_caps = ["103"], driver_cuda_version = (13, 0)) + art = make_profile_artifact("cuda13-portable.tar.gz", "cuda13-portable") + release = make_release([art]) + result = linux_cuda_choice_from_release(host, release) + assert result is not None + assert result.primary.name == "cuda13-portable.tar.gz" + + def test_older_bundle_still_rejects_b300(self, monkeypatch): + mock_linux_runtime(monkeypatch, ["cuda13"]) + host = make_host(compute_caps = ["103"], driver_cuda_version = (13, 0)) + art = make_profile_artifact("cuda13-older.tar.gz", "cuda13-older") + release = make_release([art]) + result = linux_cuda_choice_from_release(host, release) + assert result is None + + # =========================================================================== # L. resolve_install_attempts # ===========================================================================