Run GPU tests on Metal on Apple silicon and in a macos-15 job - #307
Merged
Merged
Conversation
test/metal/ checks the PoissonTensor products with a wrapped device array, which ext/GPUArraysCoreExt.jl carries, and the tensor_mat_mul! kernel on MetalBackend(). runtests.jl includes it on every Apple-silicon Mac; it skips where Metal.functional() is false, and fails there when asked for with test_args = ["metal"]. Metal.yml runs it that way on macos-15. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A failing top-level testset ends runtests.jl, so Metal now runs after Aqua; test_args = ["metal"] still runs it alone and stops. Two comments said the suite or CI has no GPU. Also from the branch verifier: a re-wrap and a present-tense comment in test/metal/metal.jl. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
michakraus
enabled auto-merge
September 24, 2026 09:16
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #307 +/- ##
=======================================
Coverage 86.07% 86.07%
=======================================
Files 76 76
Lines 3016 3016
=======================================
Hits 2596 2596
Misses 420 420 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The test suite now runs GPU tests on a real Apple GPU.
test/metal/checks the two device paths that were measured by hand and not tested before: the products of aPoissonTensorwith a wrapped device array,𝕁 * view(A, [1, 2, 3, 4], :)and𝕁 * B', whichext/GPUArraysCoreExt.jlcarries; and thetensor_mat_mul!kernel onMetalBackend(). Each result must stay on the device and match the host inFloat32, with scalar indexing off.test/runtests.jlruns them last on every Apple-silicon Mac, so a failure on the device hides no host result. WhereMetal.functional()isfalse(a Mac without a usable device, or a sandbox) they skip themselves.Pkg.test(test_args = ["metal"])runs them after the reachability and exports checks, and stops. Asked for that way, a missing device fails the run instead of skipping..github/workflows/Metal.ymlruns them that way onmacos-15, for Juliaminand1. GitHub's macOS runners have Apple's paravirtual GPU, which Metal.jl supports from 1.10 on macOS 15 or later (JuliaGPU/Metal.jl#789). The job is not a required check.1.10) joinstest/Project.tomlon every platform. Its precompile workload is guarded bySys.isapple() && Sys.ARCH === :aarch64, and nothing loads it off Apple silicon.docs/src/index.mdthat said the suite or CI has no GPU test now name whattest/metal/covers.Note for the required checks. CI's
macOS-latestentry (macOS 26, arm64) is required and runs the full suite, so it now runs the Metal tests too.The sibling change is JuliaGNI/GeometricOptimizers.jl#117. Its
Metaljob already passed on themacos-15runner ("Apple Paravirtual device"): 817/817 in 2m46s, under--check-bounds=yes.Verification
test/metal/metal.jlpasses 5/5.Pkg.test(test_args = ["metal"])passes the reachability and exports checks, fails on@test Metal.functional(), and runs nothing else. Checked before and after the reorder.Pre-PR verification
Fixed
test/runtests.jl: a full run on Apple silicon ran Metal before the subjects, against the ordering rule in the file's header; a Metal failure would have hidden every subject result. Metal now runs last in a full run; only thetest_args = ["metal"]path runs it early, and then stops.src/layers/positional_encoding.jl:75("the suite has no GPU test") andtest/parameters/map_to_cpu_tests.jl:2("There is no GPU in CI") were made false by this change. Both now say thattest/metal/does not cover them.test/runtests.jl: re-wrapped an overlong comment line.test/metal/metal.jl: a comment that told the bug's history is now in the present tense.Unresolved
Pre-existing
ext/GPUArraysCoreExt.jl:10–12tells history in the past tense (nit). Not in this PR.Checked and clean
using Metal, so the== 1gate holds.GPUArraysCore = "= 0.2.0". The only difference isneutral_element, which this package does not use.docs/src/index.mdclaims no more thantest/metal/asserts.macOS-latestis a required check, as the CHANGELOG states.fatou lintis clean on the changed files apart from an intendedduplicate-includeadvisory:metal/runtests.jlis included on two mutually exclusive paths. No method definition changed.Not checked
minjobs will show it.🤖 Generated with Claude Code