-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update: Update to revamped c binding #147
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Collaborator
minghuaw
commented
Nov 18, 2024
•
edited
Loading
edited
- mlx-explore/mlx-c#45
dcvz
reviewed
Nov 19, 2024
dcvz
reviewed
Nov 19, 2024
minghuaw
commented
Nov 20, 2024
@minghuaw Feels great and quite clean ✨ |
dcvz
reviewed
Nov 20, 2024
@dcvz somehow it's requiring metal3.2 and only macos 15 is supported. Would there be macos 15 support in blaze soon? |
@minghuaw set it to |
Didn't realize this is already available since it was not shown on your website lol |
minghuaw
added a commit
that referenced
this pull request
Dec 11, 2024
* update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 11, 2024
* update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 11, 2024
* update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 11, 2024
* update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 11, 2024
* update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 13, 2024
* add InstanceNorm * fix wrong reduction_axes * add LayerNorm * added RmsNorm * add GroupNorm * partial impl batch norm * change forward to take &mut self * add BatchNorm * clippy and fmt * Revamp internal macro `generate_builder!{}` (#150) * initial impl of Buildable macro * test generate_builder and Buildable macro on AdaDelta * clippy * update adafactor * fix missing doc in generated code * update current use of generate_builder macro * always auto impl Builder when derive Builder * added impl Into for new() args * update mod linear * clippy and fmt * update docs * update doc for generated builder * Add generic type `Args` in `Module` trait to allow binary modules (#146) * add unary module * update module_value_and_grad impl * update doc for UnaryModule and BinaryModule * clippy and fmt * change trait bound to ModuleParameters * added marker trait TernaryModule * fixed typo * remove two unused marker traits * added associated type Output in trait Module * update norm to use Builder and Buildable macros * update: Update to revamped c binding (#147) * update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]> * fix error handling * clippy and fmt --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 14, 2024
* add ConvTranspose1d * add ConvTranspose* * feat: Allow recursive freeze/unfreeze (#143) * clippy and fmt * rename to test_optimizers * update Parameter and ModuleParameter traits * add test cases for recursive freeze/unfreeze * fix error in unit test * fix: Fix error with checking if parameter is frozen on empty module (#144) * fix *_frozen() error with empty module * clippy and fmt * add freeze/unfreeze test cases for empty module * feat: Change `Module::forward` to take `&mut self` (#145) * change Module::forward to take &mut self * clippy and fmt * update Module impl * update to latest Builder and Buildable macros * update: Update to revamped c binding (#147) * update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]> * clippy and fmt * rename conv_transposed to conv_transpose --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Dec 14, 2024
* add MultiHeadAttention * add more conversion into Input * encoder layer requires layernorm * replace deep_clone with regular clone * impl transformer encoder layer * impl transformer encoder * impl TransformerDecoderLayer * impl TransformerDecoder * impl Transformer * clippy and fmt * clippy and fmt * update: Update to revamped c binding (#147) * update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]> * replace placefolder with actual LayerNorm --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Jan 2, 2025
* add QuantizedEmbedding * add QuantizedLinear * clippy and fmt * feat: Allow recursive freeze/unfreeze (#143) * clippy and fmt * rename to test_optimizers * update Parameter and ModuleParameter traits * add test cases for recursive freeze/unfreeze * fix error in unit test * update to latest change in ModuleParameter * fix: Fix error with checking if parameter is frozen on empty module (#144) * fix *_frozen() error with empty module * clippy and fmt * add freeze/unfreeze test cases for empty module * feat: Change `Module::forward` to take `&mut self` (#145) * change Module::forward to take &mut self * clippy and fmt * update Module impl * update quantized to use Bulider and Buildable macro * update: Update to revamped c binding (#147) * update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]> * derive Clone for Embedding * derive Clone --------- Co-authored-by: David Chavez <[email protected]>
minghuaw
added a commit
that referenced
this pull request
Jan 7, 2025
* impl pooling * clippy and fmt * feat: Change `Module::forward` to take `&mut self` (#145) * change Module::forward to take &mut self * clippy and fmt * update Module impl * update pooling * update: Update to revamped c binding (#147) * update mlx-c * removed shim * partial updates to new c api * update fft * update dtype and device * updated indexing * updated index and fft ops to take impl AsRef<Array> * use custom Result type alias * avoid conflict * updated more mods * update logical * updated optmizers * updated compile * updated transforms * updated shapes * updated quantization * added more linalg fns * updated io * need clone * impl Clone using mlx_array_set * add comments about Vec<&Array> * clippy and fmt * revert back to cloning * revert to perform type casting in item * default all fft/ifft on cpu for now * pass all tests * try fix CI problem * Revert "try fix CI problem" This reverts commit 3c8ca26. * Use newer Xcode * free new mlx_array if cloning fails * added guard * impl guard and guarded for vec pairs * make most ops return result regardless of underlying c++ impl * renamed try_op to try_from_op * update index to use guarded * update to Guarded * update to Guarded op * update remaning ops to use Guarded op * added test_clip_grad_norm * clippy and fmt * fix doctest * update mlx-c to tags/v0.1.0 * remove device = "cpu" * remove affine_quantize which was removed from python and swift as well * change newtype wrapper to type alias * fix latest clippy warnings * cargo fmt * remove unused static * update mlx-sys crate version to match mlx-c * re-export ModuleParameters macro * changing test_celu to follow the python version * try using gh hosted mac runners * try setting CMAKE_OSX_DEPLOYMENT_TARGET * try setting runner to macos-15 * try setting xcode version to 15.2 * try setting xcode version to 16.1 * try xcode 16.1 on macos-14 * try macos-14 and xcode 16.0 * need macos-15 * try blaze/macos-15 runners --------- Co-authored-by: David Chavez <[email protected]> * fix errror handling * cargo fmt * replace Arc with DynClone * clippy and fmt --------- Co-authored-by: David Chavez <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.