diff --git a/.github/workflows/provider-plan.yml b/.github/workflows/provider-plan.yml index b8303e11aa..7b0f3c1732 100644 --- a/.github/workflows/provider-plan.yml +++ b/.github/workflows/provider-plan.yml @@ -144,9 +144,6 @@ jobs: # shards share one lane with a count of 2: the two Cluster Focused Checks # shards, Cluster Runtime Tests shards 2 and 3 (test-cluster-2) and shards # 4 and 5 (test-cluster-3). A lane asks for a job only when the job runs. - # Cluster GPU Tests shards 1 and 3 have a lane each. Shard 2 has none: it - # uses 42 GiB, more than any signed size, so it runs on - # blacksmith-12vcpu-macos-27 without asking. # # Sizes (x) are sent only while DARKBLOOM_JOB_SHAPES is `on` # (darkbloom-route.yml). A job asks for the smallest signed size (4x16, @@ -185,4 +182,5 @@ jobs: build-provider macos_arm64 blacksmith-12vcpu-macos-27 ${{ (needs.components.outputs.provider == 'true' || (github.event_name == 'push' && needs.tested.outputs.skip == 'true' && needs.components.outputs.changed_provider == 'true')) && 1 || 0 }} 12x32 cluster-release-checks macos_arm64 blacksmith-12vcpu-macos-27 ${{ needs.components.outputs.cluster == 'true' && 1 || 0 }} 8x16 test-cluster-gpu-1 macos_arm64 blacksmith-12vcpu-macos-27 ${{ needs.components.outputs.cluster == 'true' && 1 || 0 }} 4x24 + test-cluster-gpu-2 macos_arm64 blacksmith-12vcpu-macos-27 ${{ needs.components.outputs.cluster == 'true' && 1 || 0 }} 4x24 test-cluster-gpu-3 macos_arm64 blacksmith-12vcpu-macos-27 ${{ needs.components.outputs.cluster == 'true' && 1 || 0 }} 4x24 diff --git a/.github/workflows/provider-tests.yml b/.github/workflows/provider-tests.yml index e866365402..72f276548e 100644 --- a/.github/workflows/provider-tests.yml +++ b/.github/workflows/provider-tests.yml @@ -768,13 +768,11 @@ jobs: # ones and the benchmarks (scripts/cluster-test-plan.py). They run and # report whenever the cluster jobs run; a failure does not fail the # workflow. Shards 1 and 3 each run one half of the real-geometry rows - # check and read a lane of their own (provider-plan.yml). Shard 2 uses - # 42 GiB, more than any signed Darkbloom size, so it runs on Blacksmith - # without asking the route. + # check. Each shard reads a lane of its own (provider-plan.yml). name: Cluster GPU Tests (non-blocking, shard ${{ matrix.shard }}) needs: build-cluster if: ${{ inputs.cluster == 'true' }} - runs-on: ${{ matrix.shard == 2 && 'blacksmith-12vcpu-macos-27' || fromJSON(inputs.routes)[format('test-cluster-gpu-{0}', matrix.shard)] }} + runs-on: ${{ fromJSON(inputs.routes)[format('test-cluster-gpu-{0}', matrix.shard)] }} timeout-minutes: 60 strategy: fail-fast: false diff --git a/changelog.d/ci-gpu-shards-darkbloom.md b/changelog.d/ci-gpu-shards-darkbloom.md index 917e67f8ab..83d3833cf4 100644 --- a/changelog.d/ci-gpu-shards-darkbloom.md +++ b/changelog.d/ci-gpu-shards-darkbloom.md @@ -1,5 +1,5 @@ -### CI: Cluster GPU Tests shards 1 and 3 ask Darkbloom first +### CI: every Cluster GPU Tests shard asks Darkbloom first -- Cluster GPU Tests shards 1 and 3 now ask the Darkbloom plane for a sandbox, each on a lane of its own (`test-cluster-gpu-1`, `test-cluster-gpu-3`; 4x24 while sizes are on: 14.33 and 14.72 GiB used in run 42737118357). Each falls back alone to `blacksmith-12vcpu-macos-27` when the plane does not grant it. -- Shard 2 still runs on `blacksmith-12vcpu-macos-27` without asking: it uses 42 GiB, which no signed size holds. -- A full CI run now asks for 14 macOS jobs instead of 12. The two GPU lanes come last in the lane table, so the `DARKBLOOM_MACOS_LANES` cap drops them first. +- Each of the 3 Cluster GPU Tests shards now asks the Darkbloom plane for a sandbox on a lane of its own (`test-cluster-gpu-1`, `test-cluster-gpu-2`, `test-cluster-gpu-3`; 4x24 while sizes are on). Each falls back alone to `blacksmith-12vcpu-macos-27` when the plane does not grant it. A lane routes only when the approval's `lanes` names it; on 2026-11-10 it named `test-cluster-gpu-1` and `test-cluster-gpu-2` but not `test-cluster-gpu-3`. +- Shard 2 no longer needs 42 GiB. The paged verify/prefill attention bench (`paged-verify-bench`) bounds MLX's freed-buffer cache to 1 GiB, as a ready Qwen tensor-parallel rank does. Before, the cache kept every prompt chunk's attention temporaries, and the bench's process reached 34.26 GiB. The bench also prints its peak active memory and cache size for each run. +- A full CI run now asks for 15 macOS jobs instead of 14. The GPU lanes come last in the lane table, so the `DARKBLOOM_MACOS_LANES` cap drops them first. diff --git a/docs/developer/build.md b/docs/developer/build.md index ba17150367..7005692a4f 100644 --- a/docs/developer/build.md +++ b/docs/developer/build.md @@ -1,6 +1,6 @@ # Build The Provider And Landing -> Last updated: 2026-11-08 +> Last updated: 2026-11-10 Build the provider, its source-matched native resources, and the independent landing site from this repository. Backend, sidecar, console and admin builds @@ -378,17 +378,16 @@ again; the next failure opens a new one. A full run takes about 13 minutes and 110 macOS job-minutes: about 31 for the build jobs, Cluster Release Build Checks and Cluster GPU Tests, and about 79 -for the 9 blocking test shards. Every macOS job but Cluster GPU Tests shard 2 -is routed, and falls back to Blacksmith when the plane grants no Mac. +for the 9 blocking test shards. Every macOS job is routed, and falls back to +Blacksmith when the plane grants no Mac. ### Build Once Each lane builds its debug test products once, on a large runner, and its test jobs run them with `swift test --skip-build`. No test job compiles the provider or the cluster packages. Every job below reads its runner from the -route ([CI Runner Routing](#ci-runner-routing)), except shard 2 of -`test-cluster-gpu`. Its fallback is `blacksmith-12vcpu-macos-27`. While job sizes are off, every job -asks without a size ([Job sizes](#job-sizes)). +route ([CI Runner Routing](#ci-runner-routing)). While job sizes are off, +every job asks without a size ([Job sizes](#job-sizes)). | Job | Runner | Needs | Does | |---|---|---|---| @@ -397,7 +396,7 @@ asks without a size ([Job sizes](#job-sizes)). | `cluster-release-checks` (Cluster Release Build Checks) | routed | - | Compiles the release build of the worker capability and prefill schedule checks, and runs them | | `test-provider`, shards 1 and 2 | routed | `build-provider` | The provider selections, Prompt Parity, the native gates, the audit and coverage | | `test-cluster`, shards 1 to 5 | routed | `build-cluster` | The blocking cluster selections | -| `test-cluster-gpu`, shards 1 to 3 | shards 1 and 3 routed; shard 2 `blacksmith-12vcpu-macos-27`, not routed | `build-cluster` | The non-blocking cluster GPU selections | +| `test-cluster-gpu`, shards 1 to 3 | routed, a lane per shard | `build-cluster` | The non-blocking cluster GPU selections | | `test-cluster-focused`, shards 1 and 2 | routed | - | The focused runner scripts and the pairing, diagnostics and placement flow runners (shard 1); the stage metadata, provisioning, onboarding and console runners (shard 2) | The cluster lane builds in a job of its own, so the cluster tests start as soon @@ -490,7 +489,7 @@ shard the lane its matrix entry names, `matrix.lane`. | Workflow | Routed jobs | Fallback | |---|---|---| -| `provider-tests.yml` (lanes requested by `provider-plan.yml`) | `test-provider` (lanes `test-provider-1` and `test-provider-2`, one per shard), `test-cluster` (lanes `test-cluster-1` for shard 1, `test-cluster-2` for shards 2 and 3, and `test-cluster-3` for shards 4 and 5), `test-cluster-focused` (one lane, `test-cluster-focused`, requested for both shards), `build-cluster`, `build-provider`, `cluster-release-checks`, `test-cluster-gpu` (lanes `test-cluster-gpu-1` and `test-cluster-gpu-3`, one per shard; shard 2 is not routed) | `blacksmith-12vcpu-macos-27` | +| `provider-tests.yml` (lanes requested by `provider-plan.yml`) | `test-provider` (lanes `test-provider-1` and `test-provider-2`, one per shard), `test-cluster` (lanes `test-cluster-1` for shard 1, `test-cluster-2` for shards 2 and 3, and `test-cluster-3` for shards 4 and 5), `test-cluster-focused` (one lane, `test-cluster-focused`, requested for both shards), `build-cluster`, `build-provider`, `cluster-release-checks`, `test-cluster-gpu` (lanes `test-cluster-gpu-1`, `test-cluster-gpu-2` and `test-cluster-gpu-3`, one per shard) | `blacksmith-12vcpu-macos-27` | | `ci-master.yml` (lanes requested by `provider-plan.yml`) | `release-integrity`, `docs` | `blacksmith-4vcpu-ubuntu-2404` | | `docs-impact.yml` | `commit-signatures`, `docs-impact` | `blacksmith-4vcpu-ubuntu-2404` | | `landing.yml`, `desktop.yml`, `nightly-linear-package.yml` | `check`, `frontend`, `test` | `blacksmith-4vcpu-ubuntu-2404` | @@ -559,11 +558,10 @@ keep their fallback, so a push saves caches on Darkbloom only from an admitted branch and only in routed lanes ([CI Caching](#ci-caching)). Release, signing, publication, model registration, review automation and `master` or dispatched cache warming keep literal Blacksmith labels. In CI, -every macOS job but Cluster GPU Tests shard 2 reads its lane of the plan's one -route request (the plane routes a run attempt once); the plan's own bookkeeping -(the tree lookup, the component choice), the CI plan checks and the -`Provider Tests` gate run on `ubuntu-24.04`. Cluster GPU Tests shard 2 runs on -`blacksmith-12vcpu-macos-27` and is not routed ([Job sizes](#job-sizes)). A lane without a size gets the +every macOS job reads its lane of the plan's one route request (the plane +routes a run attempt once); the plan's own bookkeeping (the tree lookup, the +component choice), the CI plan checks and the `Provider Tests` gate run on +`ubuntu-24.04`. A lane without a size gets the approval's pinned image size for its profile (one for macOS, one for Linux). The macOS one measured 12 vCPU / 32 GiB on 2026-11-05 (run 42105290034, attempt 1), the class of the Blacksmith 12-vCPU fallback; it is not a fixed @@ -588,7 +586,7 @@ repository variable `DARKBLOOM_JOB_SHAPES` is exactly `on`. While it is off: without sizes. - Every lane asks without a size and gets the approval's pinned macOS size ([CI Runner Routing](#ci-runner-routing)): the 9 blocking test jobs, the - build jobs and Cluster Release Build Checks. + build jobs, Cluster Release Build Checks and the 3 GPU shards. - Risk: the build jobs need a large Mac. If the approval pins a smaller macOS size, they get that smaller size, and a cold build takes longer. - A lane marked `required` keeps its fallback without asking. It takes no @@ -597,7 +595,8 @@ repository variable `DARKBLOOM_JOB_SHAPES` is exactly `on`. While it is off: The lane table in the `route` job of `provider-plan.yml` is the one place that names each job's lane and size. The lanes are in cap order: the critical-path -test shards first, then the build jobs and Cluster Release Build Checks. +test shards first, then the build jobs and Cluster Release Build Checks, then +the GPU shards. Each size is the smallest signed size (4x16, 4x24, 8x16, 12x32) that holds the job's used memory times 1.25, on which the job takes at most 5% longer than on @@ -624,14 +623,21 @@ and memory pressure stayed normal. | `build-provider` | 1 | 12x32 | 17.50; 8x24 is not signed, and a cold build takes 20% longer on 8 vCPUs | asks without a size | | `cluster-release-checks` | 1 | 8x16 | 9.65 with a reused build; a cold release compile (run 42041608780: 11.33 GiB, 11.4 busy vCPUs at p95 of 12) takes 26% longer on 4 vCPUs and 5.5% on 8 | asks without a size | | `test-cluster-gpu-1` (GPU shard 1) | 1 | 4x24 | 14.33 in run 42737118357, on Blacksmith with 48 GiB; at most 2.6 busy vCPUs | asks without a size | +| `test-cluster-gpu-2` (GPU shard 2) | 1 | 4x24 | 17.42 in run 42924487818, on Darkbloom with 32 GiB, during `glm53-depth-invariance-widths` (one process of 10.23); 40.99 before the bench's cache bound (run 42917194201) | asks without a size | | `test-cluster-gpu-3` (GPU shard 3) | 1 | 4x24 | 14.72 in run 42737118357, on Blacksmith with 48 GiB | asks without a size | -A run that tests every component asks for 14 macOS jobs, while sizes are on -or off. Cluster GPU Tests shard 2 is not routed: it runs on -`blacksmith-12vcpu-macos-27` (12 vCPU, 48 GiB). It uses 41.99 GiB (41.63 in -run 42737118357, 34.26 of it in the one process of `paged-verify-bench`), which -no signed size holds. Shards 1 and 3, which each run half of the real-geometry -rows check, have a lane each and fall back alone. +A run that tests every component asks for 15 macOS jobs, while sizes are on +or off. Each GPU shard has a lane of its own and falls back alone; shards 1 +and 3 each run half of the real-geometry rows check. GPU shard 2 used 40.99 +GiB in run 42917194201, 34.26 GiB of it in the one process of +`paged-verify-bench`. That bench attends random K/V of 4 layers at 30,720 +tokens (0.5 GiB of KV), but MLX's freed-buffer cache kept every prompt chunk's +attention temporaries: they grow with the history, so the cache reuses none +of them, and its default limit is MLX's memory limit. The bench now bounds +the cache as a ready Qwen tensor-parallel rank does (1 GiB, +`QwenTensorParallelLaunch.freedBufferCacheBytes`). In run 42924487818 its +process peaked at 3.75 GiB (2.78 GiB active, at most 1.05 GiB cached) and the +shard at 17.42 GiB used. A lane sent with a size uses a grant only when the grant's labels are its profile's labels with the last one qualified by the size, such as @@ -641,8 +647,12 @@ fallback. The plane names its reason, for example `shape_not_signed` (no signed image of that size), `unavailable` (the plane cannot read its image catalog), `unsupported_runner_class` (the size has no price), `image_not_available` (the image is not staged) or `lane_not_enabled` (the approval does not name the -lane). For each lane, the route job's log and step summary show the size -asked, the runner, and the decision with its reason. +lane). A new lane routes only after the operator adds it to the approval's +`lanes`; until then it keeps its fallback. On 2026-11-10 the approval named +`test-cluster-gpu-1` and `test-cluster-gpu-2` but not `test-cluster-gpu-3` +(run 42924487818). +For each lane, the route job's log and step summary show the size asked, the +runner, and the decision with its reason. ## CI Caching diff --git a/docs/developer/test.md b/docs/developer/test.md index 95374ab82f..8571888103 100644 --- a/docs/developer/test.md +++ b/docs/developer/test.md @@ -1,6 +1,6 @@ # Test Provider And Native Contracts -> Last updated: 2026-11-09 +> Last updated: 2026-11-10 Run isolated Swift, native-resource, public-fixture and landing tests here. Backend integration and cross-implementation qualification are platform-owned. @@ -1472,9 +1472,8 @@ shared build recipe. The selected. A provider-only change runs 3 Macs (the provider build and the 2 provider shards). A cluster change adds 12 Macs (the cluster build, the release build checks, 5 runtime shards, 2 focused shards and 3 GPU shards). Every -Mac job but GPU shard 2 is routed; GPU shard 2 runs on Blacksmith -([job sizes](build.md#job-sizes)). A change whose tree a successful run of the -same workflow already tested runs no test job at all +Mac job is routed ([job sizes](build.md#job-sizes)). A change whose tree a +successful run of the same workflow already tested runs no test job at all (`scripts/ci-tested-tree.py`). CI runs the runtime test target (`DarkbloomClusterRuntimeTests`) on the @@ -2101,8 +2100,8 @@ only the labels of that size. It also covers bad sizes, the macOS cap order and a `required` lane, which keeps its fallback without asking while sizes are off. It also pins each routed job's lanes (one per provider or cluster shard, matching the job's matrix), size, fallback, timeout and read-only permissions, -and keeps release workflows and Cluster GPU Tests shard 2 on literal Blacksmith -runners. No check contacts the real plane. +and keeps release workflows on literal Blacksmith runners. No check contacts +the real plane. Docs-impact tests retain provider, protocol, privacy, native capacity, cache, release/model publication and fixture mappings. Historical links need exact diff --git a/libs/darkbloom-cluster/Tests/DarkbloomClusterRuntimeTests/CBv2PagedVerifyBench.swift b/libs/darkbloom-cluster/Tests/DarkbloomClusterRuntimeTests/CBv2PagedVerifyBench.swift index 5cd14f8234..3fcfe346c6 100644 --- a/libs/darkbloom-cluster/Tests/DarkbloomClusterRuntimeTests/CBv2PagedVerifyBench.swift +++ b/libs/darkbloom-cluster/Tests/DarkbloomClusterRuntimeTests/CBv2PagedVerifyBench.swift @@ -95,12 +95,27 @@ struct CBv2PagedVerifyBench { } @Test(.enabled(if: enabled)) func verifyAndPrefillAttention() throws { + // The freed-buffer cache of a ready Qwen tensor-parallel rank + // (`QwenTensorParallelLaunch.freedBufferCacheBytes`). MLX's default + // cache limit is its memory limit, and it reuses a freed buffer only + // for a request of about the same size. A prompt chunk's attention + // temporaries grow with the history, so the cache kept every one of + // them: the process reached 34.26 GiB on a 48 GiB runner (run + // 42917194201), almost all of it freed buffers. + let previousCacheLimit = Memory.cacheLimit + Memory.cacheLimit = QwenTensorParallelLaunch.freedBufferCacheBytes( + allocatorHeadroomBytes: QwenDenseStageLoadPolicy.allocatorHeadroomBytes) + defer { Memory.cacheLimit = previousCacheLimit; Memory.clearCache() } + let gib = Double(1 << 30) for paged in [true, false, true, false] { + Memory.peakMemory = 0 let r = try Self.run(paged: paged) print("darkbloom-paged-bench \(paged ? "paged" : "contiguous") ctx=\(Self.context) layers=\(Self.layers)" + " width=\(Self.width) prefill_s=\(String(format: "%.3f", r.prefill))" + " window_ms=\(String(format: "%.3f", r.window * 1000))" - + " mq=\(ProcessInfo.processInfo.environment["DARKBLOOM_PAGED_MTP_MULTI_QUERY"] ?? "default")") + + " mq=\(ProcessInfo.processInfo.environment["DARKBLOOM_PAGED_MTP_MULTI_QUERY"] ?? "default")" + + " peak_active_gib=\(String(format: "%.2f", Double(Memory.peakMemory) / gib))" + + " cache_gib=\(String(format: "%.2f", Double(Memory.cacheMemory) / gib))") } } } diff --git a/scripts/test-cluster-test-plan.py b/scripts/test-cluster-test-plan.py index 9d6b376208..06e39f4628 100755 --- a/scripts/test-cluster-test-plan.py +++ b/scripts/test-cluster-test-plan.py @@ -298,16 +298,13 @@ def test_jobs_run_every_shard_of_their_lane(self): for _, route_lane in entries: self.assertIn(f" {route_lane} macos_arm64 ", self.jobs["route"]) else: - # GPU shards 1 and 3 each read a lane of their own. Shard 2 - # needs more memory than any signed Darkbloom size: it has - # no lane and keeps Blacksmith. + # Each GPU shard reads a lane of its own. matrix = re.search(r"(?m)^ shard: \[([0-9, ]+)\]$", job).group(1) self.assertEqual([int(shard) for shard in matrix.split(",")], plan.shards(lane)) - self.assertIn(f" runs-on: ${{{{ matrix.shard == 2 && '{workflow.BLACKSMITH_MAC}' || " - f"fromJSON(inputs.routes)[format('{job_id}-{{0}}', matrix.shard)] }}}}\n", job) - for shard in (1, 3): + routed = f"fromJSON(inputs.routes)[format('{job_id}-{{0}}', matrix.shard)]" + self.assertIn(f" runs-on: ${{{{ {routed} }}}}\n", job) + for shard in plan.shards(lane): self.assertIn(f" {job_id}-{shard} macos_arm64 ", self.jobs["route"]) - self.assertNotIn(f" {job_id}-2 ", self.jobs["route"]) steps = {workflow.field(step, "name", indent=6): step for step in workflow.step_blocks(job)} products = steps["Download cluster test products"] self.assertEqual(workflow.field(products, "uses"), workflow.PRODUCTS_ACTION) diff --git a/scripts/test-darkbloom-route.py b/scripts/test-darkbloom-route.py index 81003ba30e..8bf3553023 100755 --- a/scripts/test-darkbloom-route.py +++ b/scripts/test-darkbloom-route.py @@ -95,9 +95,8 @@ def built(component): # come first, critical path first. Two shards share each of the lanes # test-cluster-2 (runtime shards 2 and 3), test-cluster-3 (runtime shards 4 # and 5) and test-cluster-focused, lanes the approval names. Then the build -# jobs and the release build checks, then the non-blocking GPU shards 1 and -# 3. No lane is `required`: while sizes are off, every lane asks without a -# size. +# jobs and the release build checks, then the 3 non-blocking GPU shards. No +# lane is `required`: while sizes are off, every lane asks without a size. PLAN_LANES = { "test-cluster-2": (requested("cluster", 2), "12x32", False), "test-cluster-3": (requested("cluster", 2), "4x24", False), @@ -109,6 +108,7 @@ def built(component): "build-provider": (built("provider"), "12x32", False), "cluster-release-checks": (requested("cluster"), "8x16", False), "test-cluster-gpu-1": (requested("cluster"), "4x24", False), + "test-cluster-gpu-2": (requested("cluster"), "4x24", False), "test-cluster-gpu-3": (requested("cluster"), "4x24", False), } # The lanes of the blocking test jobs, which the cap keeps first. @@ -125,11 +125,8 @@ def built(component): {"lane": "build-provider", "profile": "macos_arm64", "count": 1}, {"lane": "cluster-release-checks", "profile": "macos_arm64", "count": 1}, {"lane": "test-cluster-gpu-1", "profile": "macos_arm64", "count": 1}, + {"lane": "test-cluster-gpu-2", "profile": "macos_arm64", "count": 1}, {"lane": "test-cluster-gpu-3", "profile": "macos_arm64", "count": 1}] -# A shard that keeps a literal runner in a job whose other shards each read a -# lane of their own: Cluster GPU Tests shard 2 uses more memory than any -# signed size. -LITERAL_SHARD = {"test-cluster-gpu": "2"} MASTER_LINUX_LANES = (f"release-integrity linux_arm64 {LINUX_FALLBACK}", f"docs linux_arm64 {LINUX_FALLBACK}") # (workflow, job): the expression its runs-on reads. CI_ROUTED = { @@ -231,7 +228,7 @@ def job_lanes(name, job): if name in LANE_MATRIX: return list(dict.fromkeys(matrix_lanes(job))) if name in SHARDED: - return [f"{name}-{shard}" for shard in matrix_shards(job) if shard != LITERAL_SHARD.get(name)] + return [f"{name}-{shard}" for shard in matrix_shards(job)] return [name] @@ -687,14 +684,14 @@ def grant(labels): def test_macos_cap_keeps_the_test_lanes_first_with_sizes_on_or_off(self): lanes = plan_lanes_text() every, tests = list(PLAN_LANES), BLOCKING_TESTS - cases = (("on", "", every), ("on", "14", every), + cases = (("on", "", every), ("on", "15", every), # The non-blocking GPU shards are the first to keep their fallback. - ("on", "13", every[:-1]), ("on", "12", every[:-2]), + ("on", "14", every[:-1]), ("on", "13", every[:-2]), ("on", "12", every[:-3]), ("on", "11", [*tests, "build-cluster", "build-provider"]), ("on", "10", [*tests, "build-cluster"]), ("on", "9", tests), # A lane that does not fit is passed over; a later, smaller one can still fit. ("on", "3", ["test-cluster-2", "test-provider-2"]), - ("", "", every), ("", "12", every[:-2]), ("", "11", [*tests, "build-cluster", "build-provider"]), + ("", "", every), ("", "12", every[:-3]), ("", "11", [*tests, "build-cluster", "build-provider"]), ("", "9", tests)) self.assert_cap_cases(lanes, cases, held=()) @@ -897,9 +894,6 @@ def test_ci_routes_every_job_that_runs_code_through_one_plan(self): lane = f"'{name}'" read |= set(job_lanes(name, job)) routed = f"fromJSON({source})[{lane}]" - if name in LITERAL_SHARD: - self.assertIn(LITERAL_SHARD[name], matrix_shards(job)) - routed = f"matrix.shard == {LITERAL_SHARD[name]} && '{MACOS_FALLBACK}' || {routed}" self.assertEqual(job_field(job, "runs-on"), f"${{{{ {routed} }}}}") # A lane is requested exactly when its job runs; a shared lane # for every job of its matrix that reads it. @@ -941,18 +935,18 @@ def test_ci_routes_every_job_that_runs_code_through_one_plan(self): def test_ci_sizes_every_routed_macos_job_and_asks_for_the_test_lanes_first(self): sizes = {size for _, size, _ in PLAN_LANES.values()} self.assertLessEqual(sizes, VALID_SIZES) - # 14 macOS jobs ask, with sizes on or off: the 9 blocking test jobs, - # then the 2 build jobs and the release build checks, then GPU shards - # 1 and 3. No lane is `required`, so none keeps Blacksmith while sizes + # 15 macOS jobs ask, with sizes on or off: the 9 blocking test jobs, + # then the 2 build jobs and the release build checks, then the 3 GPU + # shards. No lane is `required`, so none keeps Blacksmith while sizes # are off. tests = BLOCKING_TESTS self.assertFalse(any(required for _, _, required in PLAN_LANES.values())) - self.assertEqual(sum(lane_jobs(count) for count, _, _ in PLAN_LANES.values()), 14) + self.assertEqual(sum(lane_jobs(count) for count, _, _ in PLAN_LANES.values()), 15) self.assertEqual(sum(lane_jobs(PLAN_LANES[lane][0]) for lane in tests), 9) # The cap keeps lanes in table order: the blocking test lanes, the # build lanes, then the non-blocking GPU shards. self.assertEqual(list(PLAN_LANES)[:len(tests)], tests) - self.assertEqual(list(PLAN_LANES)[-2:], ["test-cluster-gpu-1", "test-cluster-gpu-3"]) + self.assertEqual(list(PLAN_LANES)[-3:], ["test-cluster-gpu-1", "test-cluster-gpu-2", "test-cluster-gpu-3"]) def test_release_and_credentialed_workflows_keep_literal_runners(self): for filename in UNROUTED: