Skip to content

Native Metal runtime rejects uint4b_format on macOS 26.3 #451

Closed

Description

@omar16100

The native Nemotron server exits with KernelCompile on this Mac. A small probe reproduces the compiler error without model weights.

Environment: M3 Ultra, macOS 26.3 (25D125), Xcode 26.5 (17F42), Metal compiler 32023.883, Zig 0.17.0. TensorFold: zig-flashnext at 88c424e5350a702372771915507bcbed9d513546.

The stock shader is zig/kernels/metal/nemotron/coop_eh_1_0_sk.metal. SHA256: 231d0a1b6abf4051b94ce5fc6aeee2934548a2a07e0aba43abd826b342c2d63f.

Three fresh runtime compiler processes fail with:

program_source:37:17: error: unknown type name 'uint4b_format'

The probe uses Library.fromSource and CompileOptions.mlx(): Metal 4.0, safe math, fast fp32 functions. The offline command succeeds on the same source:

xcrun -sdk macosx metal -std=metal4.0 -fmetal-math-mode=safe -fmetal-math-fp32-functions=fast -c zig/kernels/metal/nemotron/coop_eh_1_0_sk.metal -o compile-probe.air

Expected: the runtime compiler accepts the stock shader. Actual: compilation fails before model inference. No token or decode-speed comparison occurred.

Portable probe, build command, compiler logs, and startup receipt. The precise SDK or driver cause remains unknown. Other macOS versions and Apple chips are untested.

Activity

  1. ashhart commented on Oct 7, 2026

    @ashhart
    Owner

    Thank you, @omar16100. The probe without model weights is what made this diagnosable. On your Mac, macOS 26.3, Metal compiler 32023.883, the runtime compiler rejects uint4b_format in the stock Nemotron shader and the server exits with KernelCompile. The offline metal compile of that same source succeeds. The shader you named is zig/kernels/metal/nemotron/coop_eh_1_0_sk.metal.

    The Zig line will compile a tiny probe at load. If the runtime compiler accepts uint4b_format, the kernels compile as they do now. If it refuses, the packed kernels load from a metallib built ahead of time, and a missing metallib fails with a named error rather than a generic compile failure. That fallback is not in the tree you pinned. We will bring it in before the Zig preview calls Nemotron Metal ready on the compiler you hit.

    Your report matches a compiler-build refusal, not a claim about every Apple chip. Thank you for the pinned compiler version.

  2. ashhart commented on Oct 9, 2026

    @ashhart
    Owner

    Thank you, @omar16100. 1.0.2 compiles tf_uint4b_probe at load, builds the packed kernels from source when uint4b_format is accepted, and loads the prebuilt metallib when it is refused. A missing library fails with PrebuiltMetallibMissing. That is commit 36e0a8b, and I have not re-run it on macOS 26.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions