Skip to main content

Module msl

Module msl 

Source
Expand description

Metal Shading Language sources for the optimizer kernels.

These mirror super::wgsl line for line in semantics. They exist because scirs2-core 0.6.5 registers its optimizer kernels with an empty metal_source, and because the WebGPU backend’s runtime device detection does not yet enumerate wgpu adapters — on macOS the Metal backend is the path that actually reaches the GPU.

Conventions (see super): buffers are bound to argument-table indices in the order x, y, a, b, result, output, every scalar travels in a buffer, and integer scalars are recovered with as_type<uint>.

scirs2-core’s Metal compiler extracts the entry point with source.find("kernel void ") up to the next (, so the name and the opening parenthesis must stay on one line.

Constants§

ADAGRAD
Adagrad with learning-rate decay. See super::wgsl::ADAGRAD.
ADAM
Adam with coupled L2 weight decay. See super::wgsl::ADAM for bindings.
ADAMW
AdamW with decoupled weight decay. See super::wgsl::ADAMW.
ALL_REDUCE_MEAN
Local reduction step for multi-GPU all-reduce-mean. See super::wgsl::ALL_REDUCE_MEAN.
LAMB
Two-phase LAMB with a threadgroup norm reduction. See super::wgsl::LAMB.
RMSPROP
RMSprop with centering and momentum. See super::wgsl::RMSPROP.
SGD
SGD with momentum / dampening / Nesterov. See super::wgsl::SGD.