关于 apple-silicon
apple-silicon 是面向 Apple Silicon GPU 计算与数值计算任务的技术参考技能,供开发者查阅 Metal 计算、MPS 和 MLX。它按任务分类组织文档,并提供示例及工具链设置指引。
主要功能
- 01Metal 计算与 MSL 语言参考
- 02MPS 与 MPSGraph 运算指南
- 03MLX 数组及机器学习参考
- 04按任务分类的文档索引
- 05示例与工具链设置指引
适用场景
- 01查询 compute pass 和线程组配置
- 02了解 MSL 类型与函数属性
- 03查找 MPS 图构建或矩阵运算资料
- 04探索 MLX 学习循环与函数变换
安装
复制下面的命令,在终端中运行。
npx skills add https:/ / github.com/ fandhe-ai/ agent-reference-skills --skill apple-silicon安装后在 Claude Code 中输入/apple-silicon确认已加载。
包含的文件
除 SKILL.md 外,安装时一起下载的参考资料和脚本。
references/metal-compute/argument-buffers.mdcompute-pass-encoding.mdcompute-pipeline-configuration.mdcounter-sample-buffers.mdgpu-counters.mdindirect-command-buffers.mdindirect-compute-commands.mdmachine-learning-passes.mdREADME.mdtensors.mdthreadgroup-sizing.mdunified-memory.mdreferences/mlx/array.mdcompilation.mddata-types.mddevices-streams.mddistributed.mdenvironment-variables.mdexport.mdfast-custom-kernels.mdfft.mdfunction-transforms.mdindexing.mdkv-cache.mdlazy-evaluation.mdlinalg.mdmemory-management.mdmetal-backend.mdnn-layers.mdnn-losses-activations.md详细介绍
apple-silicon
Apple Silicon 上的 GPU 计算与数值计算技术栈。涵盖 Metal Shading Language (MSL) 语言规范、 compute dispatch 的编码与 unified memory 优化、基于 MPS/MPSGraph 的矩阵运算和神经网络推理, 以及由 Apple 研究团队推出的数组框架 MLX。
目录结构
skills/apple-silicon/
SKILL.md
references/
metal-compute/
README.md
compute-pass-encoding.md
threadgroup-sizing.md
compute-pipeline-configuration.md
indirect-command-buffers.md
indirect-compute-commands.md
gpu-counters.md
counter-sample-buffers.md
argument-buffers.md
unified-memory.md
tensors.md
machine-learning-passes.md
msl/
README.md
data-types.md
address-spaces.md
function-qualifiers.md
argument-attributes.md
atomic-functions.md
simdgroup-functions.md
math-functions.md
numerical-compliance.md
tensor-types.md
tensor-operations.md
mps/
README.md
mpskernel.md
mpsimage.md
image-filters.md
mpsmatrix.md
matrix-arithmetic.md
matrix-decomposition-solve.md
mpsndarray.md
mpsnngraph.md
cnn-kernels.md
mpsgraph.md
mpsgraph-tensor.md
mpsgraph-executable.md
mpsgraph-operations.md
ray-tracing.md
mlx/
README.md
array.md
lazy-evaluation.md
unified-memory-model.md
function-transforms.md
compilation.md
nn-module.md
optimizers.md
nn-layers.md
nn-losses-activations.md
indexing.md
saving-loading.md
random.md
linalg.md
devices-streams.md
memory-management.md
fast-custom-kernels.md
distributed.md
tree-utils.md
data-types.md
operations.md
fft.md
export.md
kv-cache.md
precision.md
environment-variables.md
metal-backend.md
samples/
README.md
compute-kernel-dispatch.md
nonuniform-threadgroup-dispatch.md
shared-storage-mode-buffer.md
resource-group-argument-buffer.md
cpu-encoded-indirect-compute.md
blit-and-compute-single-pass.md
mpsgraph-matrix-multiplication.md
mpsgraph-training-loop.md
mps-image-filter.md
mlx-array-lazy-evaluation.md
mlx-unified-memory.md
mlx-mlp-training-loop.md
mlx-function-transforms.md
scripts/
README.md
toolchain-setup.md
metal-compile.md
metal-symbols.md
metal-binary-archives.md
metal-dynamic-libraries.md
metal-debug-env.md
metal-performance-hud.md
mlx-install.md
mlx-distributed.md
探索步骤
根据任务查找类别,并在类别的 README.md 中确定目标页面:
- 在下方映射表中查找与任务对应的类别
- 参阅该类别的
references/{category}/README.md(samples/和scripts/请参阅其根目录下的 README.md),确定目标页面 - 阅读相应页面的
.md文件,查看详细信息
Metal 的渲染管线(MTLRenderCommandEncoder / MTLRenderPipelineState)、Core Animation、
Core Graphics、Core Image、SpriteKit、SceneKit 请参阅 apple-graphics。本技能负责 Metal 的计算
(MTLComputeCommandEncoder 及以下内容)、MSL 语言规范、MPS/MPSGraph 和 MLX。
基于 Core ML / Create ML 的 .mlmodel 设备端推理、Vision、Natural Language、Speech 以及 Core AI(iOS 27,NDArray / ComputeUnitKind)请参阅 apple-ml。
Compute Graph (RealityKit) 请参阅 apple-spatial,MetalFX 降噪请参阅 apple-graphics。
请注意,MLX 的资料来源并非 developer.apple.com,而是 Apple 研究团队发布的开源文档
(ml-explore.github.io)。
任务 → 类别映射
| 任务 | 类别 | 参考 README |
|---|---|---|
| 想了解 compute pass 编码、threadgroup/grid 大小计算和 compute pipeline 配置 | metal-compute | references/metal-compute/README.md |
| 想了解 argument buffer、indirect command buffer、GPU counter、unified memory(storage mode) | metal-compute | references/metal-compute/README.md |
| 想了解 MSL 数据类型、address space、kernel 函数属性和参数绑定属性 | msl | references/msl/README.md |
| 想了解 MSL atomic 函数、SIMD-group/quad-group 函数、数学函数和数值精度 (IEEE 754) 符合性 | msl | references/msl/README.md |
| 想了解使用 MPSKernel/MPSImage/MPSMatrix/MPSNDArray 进行图像滤波、矩阵运算和分解 | mps | references/mps/README.md |
| 想了解使用 MPSGraph/MPSNNGraph 构建和执行图、CNN 推理、ray tracing | mps | references/mps/README.md |
| 想了解 Metal 4 中创建 MTLTensor、编码 ML pass (MTL4MachineLearningCommandEncoder) | metal-compute | references/metal-compute/README.md |
| 想了解 MSL 的 tensor / cooperative_tensor / TensorOps (matmul2d, convolution, execution scope) | msl | references/msl/README.md |
| 想了解 MLX 的 array/dtype、lazy evaluation、indexing、保存/加载 | mlx | references/mlx/README.md |
| 想了解 MLX 的 dtype 列表、运算列表、FFT (stft)、函数导出 (.mlxfn) | mlx | references/mlx/README.md |
| 想了解 MLX 的环境变量、数值精度 (TF32, Winograd)、KV cache、Metal capture | mlx | references/mlx/README.md |
| 想了解 MLX 的 grad/vmap 等函数变换、mx.compile、unified memory model、distributed | mlx | references/mlx/README.md |
| 想了解 mlx.nn 的层/损失函数、mlx.optimizers、tree utils | mlx | references/mlx/README.md |
| 想了解典型用法(compute kernel dispatch、argument buffer、MPSGraph 训练循环、MLX 训练循环等) | samples | samples/README.md |
想了解 Metal Toolchain 设置、.metal 编译/链接、调试环境变量、MLX 安装 | scripts | scripts/README.md |