Repository navigation
Upstream PR: macOS tests build without Xcode's Metal compiler - #3923
plotarmordev wants to merge 8 commits into
Conversation
Without xcrun's metal the test graph embeds empty offline metallibs and warns once; the Metal device checks still run. zig build native stops with install Xcode, and the release archive still compiles its shaders. (cherry picked from commit 81ea8e3)
metalTargets compiles and installs drama3.metallib once and hands the test graph the real or empty library, as it does for the others; dist passes the real one. (cherry picked from commit 141ddc1)
native, drama3-generate, tf-metal-tests, tf-dispatch-bench and tf-kernel-exact embed the empty metallibs, so each depends on one fail step instead of building broken. The Nemotron packed checks skip with a reason when no prebuilt metallib is embedded. (cherry picked from commit 0db612f)
…l compiler Kimi K3 landed on main after the fork change: without xcrun's metal its tests embed the empty metallib, and tf-k3-check, tf-k3-serve-check, tf-k3-bench, tf-k3-cluster and drama3-metal-quant-check stop with install Xcode like the other shader programs.
zig/build/metal_targets.zig passed the lean check's 600 lines; the tensorfold-native step and its host tests move to zig/build/metal_server.zig, as cuda.zig owns its own nativeServer. The function moves unchanged.
|
Fixed the |
|
Thanks @plotarmordev. The file split resolves the lean failure cleanly, and the no-Xcode runs read well. Two small things before it can ride a train:
We were unable to run any macOS build on our side, so the head CI is the deciding check. Nothing else is open.
|
…t/98-upstream-pr-macos-tests-build-without-xc
|
Thanks — done both. I merged your current main in rather than rebasing (my flow doesn't rebase a pushed branch), so the whole head applies cleanly now: the drifted I also re-ran the no-Xcode check on this head, with |
|
Thanks @plotarmordev. The merged head applies cleanly, the file split is within the limit, and the updated no-Xcode results separate the expected native refusal from the test-suite result. The checks on
|
…t/98-upstream-pr-macos-tests-build-without-xc # Conflicts: # zig/build/drama3_metal.zig
…-macos-tests-build-without-xc
|
@plotarmordev @ashhart I checked the Command Line Tools path on a clean export of My one failure was The exact head also test-merged cleanly against current main Igor Lessio - AIFLOW LABS |
|
Thanks @AIFlowML, that's a useful independent check, especially the clean test-merge against |
The Metal native server gets its own build file, Drama's metallib is passed in and reuses metal_targets.embedded, and the shader, Kimi K3 and Drama quant programs stop cleanly without Xcode's Metal compiler, so the macOS host tests build with the Command Line Tools alone. #3923's six commits and its merges of main, as one commit on today's main.
The Metal native server gets its own build file, Drama's metallib is passed in and reuses metal_targets.embedded, and the shader, Kimi K3 and Drama quant programs stop cleanly without Xcode's Metal compiler, so the macOS host tests build with the Command Line Tools alone. #3923's six commits and its merges of main, as one commit on today's main.
|
@plotarmordev, thank you: this is on main now. #4218 landed it at 498761d under your name, with its changelog line, so macOS tests build without Xcode's Metal compiler. Closing this one in favour of that landing; it will be in the next release's notes with your handle.
|
What this changes
zig build test test-goldennow builds and runs on a Mac without Xcode's offline Metal compiler (Command Line Tools only). It warns once withskipping offline Metal shader checksand embeds empty offline metallibs, so the CPU tests run and the Metal device checks still run against them;zig build nativeand every program that embeds those libraries (drama3-generate,drama3-metal-quant-check,tf-metal-tests,tf-dispatch-bench,tf-kernel-exact,tf-k3-check,tf-k3-serve-check,tf-k3-bench,tf-k3-cluster) stops withinstall Xcodeinstead of building a broken binary. The release archive path still compiles the real shaders, and Linux is unchanged — everything is insidemetalTargets, which runs only for macOS. Nemotron's packed-metallib checks skip with a one-line reason when no prebuilt library is embedded.atc overlap --json: reports sharedzig/build/metal_targets.zigwith open Idol PRs idol: the FLUX.2 VAE image encoder on CUDA (stacked on #1774, #1767; not yet run on a GPU) #1859 and idol: the DINOv3 ViT-H+/16 image encoder on CUDA (stacked on #1775, #1767; not yet run on a GPU) #1860 (one file each); my edits are inmetalTargets' metallib wiring, theirs add Idol's build entries — merge order may need a small rebase either way.How to check
e3fb56cb09061a979cb02080601fc6f7870d3362(yourmain;git merge-baseof this head andmain).88663a13cb20a08d9fab1a1862888d98e4e77a39. Since76a0b85fthe only new commit movesnativeServerunchanged fromzig/build/metal_targets.ziginto a newzig/build/metal_server.zig(507 and 122 lines), so the lean checker is clean against the base again.88663a13, on that machine:python3 tools/zig/lean_check.py: 221 problems, the same 221 as on the base; nothing new.zig build test test-golden --summary all: 888/891 steps, 15099/15220 tests passed, 120 skipped, 1 failed. The failure isstage net: an unknown host is refused(zig/src/fabric/stage/net.zig:195), the resolver quirk described below; it fails the same way on the base.xcrunrun and the Command-Line-Tools-only Mac) were run at76a0b85f; the only change since is the file split above.Checks on this head
76a0b85f3760fb60c956ea6a910644d488d9f83c(the current head88663a13adds only the file split; see How to check)python3 tools/zig/lean_check.py, on the base and on this head: 222 problems on this head, 221 on the base. The one new finding iszig/build/metal_targets.zig: 624 lines (split past 600)— the file was exactly 600 lines on the base and this change adds 24.76a0b85f:zig build test test-golden, macOS 27 arm64 with the Metal toolchain present: 888/891 steps, 15099/15220 tests passed, 120 skipped, 1 failed —stage net: an unknown host is refusedexpectsAddressUnresolvedand getsAddressInUsebecause this machine's resolver (Tailscale 100.100.100.100) answersno-such-host.invalidwith a fake 198.18 address.zig/src/fabric/stage/net.zigis untouched by this branch; this is a resolver quirk, not this change.76a0b85f: same command withxcrunshadowed so-f metalfails (the Command-Line-Tools-only condition): warns once,zig build nativestops withthis program embeds compiled Metal shaders: install Xcode, and the suite runs 831/834 steps, 2329/2377 executed tests passed, 47 skipped (the extra skips are the Nemotron packed checks printingno prebuilt nemotron_packed.metallib (built without Xcode's Metal compiler)), same single DNS failure. Most steps reused the earlier run's cache; what re-ran is the graph whose inputs changed.76a0b85f: the same change, run on a Mac with only the Command Line Tools (macOS 27, M5 Ultra):zig build test test-goldenexits 0 with 391/391 steps and 5 skips, each printing its reason; each of the shader-embedding program steps exits 1 withinstall Xcode..invalid).Receipt
This change cannot reach inference — it only decides which metallib the build embeds and which steps refuse to build without the offline compiler — so the inference checklist is n/a.
xcrunfor the no-compiler runs); the Command-Line-Tools-only run was on an M5 Ultra, macOS 27, no Xcode.zig/build/metal_targets.zig,zig/build/drama3_metal.zig(both macOS-only in effect —metalTargetsreturns early off macOS) andzig/src/families/nemotron/kernels.zigtest helpers; all exercised by the runs above. Linux and Windows paths are untouched.Checklist
No visible change: nothing this PR changes shows on screen.
How to check
9e2a9bd7a93d3c6cd333d6db10a1bd05d747814592347ab6fe62be2f9de3ba5deafec47739a6c940Test results:
DEVELOPER_DIR=/Library/Developer/CommandLineTools zig build test test-goldenat8e5d8c996481(older head): 15510 passed, 2 failed, 137 skippedDEVELOPER_DIR=/Library/Developer/CommandLineTools zig build nativeat8e5d8c996481(older head): 12 passed, 1 failed, 0 skippedDEVELOPER_DIR=/Library/Developer/CommandLineTools zig build test test-golden --summary allat92347ab6fe62: 931 passed, 1 failed, 18 skippedFailures named (counts in the block above):
92347ab6fe62,test test-golden --summary all, 1 failed:stage net: an unknown host is refused(zig/src/fabric/stage/net.zig:195), the resolver quirk described above; this PR doesn't touchnet.zig.8e5d8c996481,test test-golden, 2 failed: the samestage nettest and its parent step.8e5d8c996481,zig build native, 1 failed: the intended refusal,this program embeds compiled Metal shaders: install Xcode.