Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Make cpu binary_op easily accessible#2733

Merged
angeloskath merged 2 commits intomainfrom
refactor-binary-cpu
Nov 5, 2025
Merged

Make cpu binary_op easily accessible#2733
angeloskath merged 2 commits intomainfrom
refactor-binary-cpu

Conversation

@angeloskath
Copy link
Member

Similar to the GPU side of things this moves the high level binary(...) into mlx::core renamed as binary_op_cpu and comparison_op_cpu etc.

The point is to simplify things like the one in matmul.cpp. Not many around so maybe we don't want to merge if we thing this pollutes the namespace (but we have all the lower-level stuff in mlx::core 🤷‍♂️ )

@angeloskath angeloskath requested review from awni and zcbenz November 4, 2025 18:41
Copy link
Member

@awni awni left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice. I like the consistency.

Seems like we are converging on a scheme like ``op_{cpu|gpu}{_inplace}( ...)` for back end ops that need to be used during eval.

@angeloskath
Copy link
Member Author

Seems like we are converging on a scheme like ``op_{cpu|gpu}{_inplace}( ...)` for back end ops that need to be used during eval.

Yeah exactly. On that note, I should have asked on the main one. Should I rename binary_float_cpu to binary_float_op_cpu ? Which one do you like best. Rethinking it I think I should ...

@awni
Copy link
Member

awni commented Nov 4, 2025

I would vote for consistency for sure. I kind of prefer just binary as opposed to binary_op (which is what we have for unary for CPU. But then for metal it's all unary_op, binary_op, etc.

@angeloskath angeloskath merged commit 6ece97f into main Nov 5, 2025
7 checks passed
@angeloskath angeloskath deleted the refactor-binary-cpu branch November 5, 2025 09:08
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