Skip to content

compile and vmap can produce Sendable closures from Sendable inputs - #469

Open
davidkoski wants to merge 4 commits into
mainfrom
compile-sendable
Open

davidkoski wants to merge 4 commits into
mainfrom
compile-sendable

Conversation

@davidkoski

Copy link
Copy Markdown
Member

Proposed changes

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)

- this idea comes from ml-explore/mlx-swift-lm#589 (@aleroot)
- breaking change for compile calls that capture state without using inputs:
) -> (
[MLXArray]
) -> MLXArray {
) -> ([MLXArray]) -> MLXArray {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Cleaner formatting. I was going to change grad in the same way, but it typically needs a model and I am not sure I can pass that through the most-inner closure that this uses. Keep as not-Sendable.

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.

1 participant