g-apple 0.1.0

Apple Metal/MPS GPU backend for the g tensor library
docs.rs failed to build g-apple-0.1.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.

Optional Metal GPU cells. v1: FP32 GEMM via MPSGraph when the work is large.

This backend works on Apple Silicon and on Intel Macs with Metal devices (for example the Intel UHD 630 iGPU and the AMD Radeon Pro 5300M dGPU). It scores the visible devices and prefers a discrete GPU for the single-device path, and it can also split a large GEMM across several Metal devices in parallel.

Enabling this crate does not change default placement for small/medium ops.

Device policy

When a discrete GPU exists, integrated Intel GPUs are excluded by default because they are slower and MPSGraph on UHD-class iGPUs can be unstable when driven concurrently with the dGPU. Opt them back in with [set_include_integrated]. On Intel-only machines they are used automatically. Query the effective set with [gpu_device_names].

Multi-device execution

[matmul_multi_device] partitions batched GEMMs along the batch axis and rank-2 GEMMs along their rows, then runs one MPSGraph executable per device in parallel. Execution on each device is serialized by an internal lock, which is what makes concurrent multi-device runs safe.

CPU + GPU

g-ad's matmul backend calls [should_offload_matmul] to decide whether to use Metal, and when the shape splits cleanly it runs the CPU and every eligible GPU in the same std::thread::scope. See g_ad::matmul.