ml-explore / ml-explore/mlx

How to implement custom multi-thread cpu kernels?

Open
#2,185 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement low priority
Dominant language
C++
Stars
28.5k
Forks
2.3k
Avg merge
3d 8h
Merged PRs (30d)
62

Description

I read the document https://ml-explore.github.io/mlx/build/html/dev/extensions.html#implementing-the-cpu-back-end, and I need to develop a new primitive in my project. I found that the example custom cpu kernel is a single thread one, how can we implement a multi thread cpu kernel? Is there any example?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the MLX extensions documentation at dev/extensions.html, especially the “Implementing the CPU backend” section and its single-thread custom CPU kernel example. Determine how multi-threaded kernels should be implemented and documented, then add a representative example or guidance that answers the issue’s question.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
documentation
Issue type
Documentation
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Needs clarification
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.