Skip to content

Fix ast.metal_kernel typo in the custom Metal kernels guide - #3997

Merged
zcbenz merged 1 commit into
ml-explore:mainfrom
ayaangazali:docs-fix-metal-kernel-verbose-ref
Aug 5, 2026
Merged

Fix ast.metal_kernel typo in the custom Metal kernels guide#3997
zcbenz merged 1 commit into
ml-explore:mainfrom
ayaangazali:docs-fix-metal-kernel-verbose-ref

Conversation

@ayaangazali

Copy link
Copy Markdown
Contributor

Proposed changes

The custom Metal kernels guide refers to ast.metal_kernel.__call__, which does not exist, so the link is dead:

docs/src/dev/custom_metal_kernels.rst:95: WARNING: py:func reference target not found:
ast.metal_kernel.__call__ [ref.func]

Looks like a typo for fast.metal_kernel, which is how the same page refers to it in five other places.

While fixing the name I also adjusted the wording, because verbose is not an argument to fast.metal_kernel itself. It is passed when calling the kernel that metal_kernel returns, which is what the example further up the page does:

kernel = mx.fast.metal_kernel(...)
outputs = kernel(
    inputs=[a],
    grid=(a.size, 1, 1),
    threadgroup=(256, 1, 1),
    verbose=True,
)

So the sentence now says "when calling the kernel returned by :func:fast.metal_kernel" rather than pointing at the factory function.

Checklist

Put an x in the boxes that apply.

  • I have read the CONTRIBUTING document
  • I have run pre-commit run --all-files to format my code / installed pre-commit prior to committing changes
  • I have added tests that prove my fix is effective or that my feature works
  • I have updated the necessary documentation (if needed)

(docs only; the page now builds with no unresolved references)


small disclosure, same as my other PRs: freshman contributor and Claude Code helps me sweep, but i built the docs in nitpick mode to find this, then checked the metal_kernel docstring to confirm where verbose actually belongs before rewording rather than just swapping the typo.

@zcbenz
zcbenz merged commit f99e1dc into ml-explore:main Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants