Replies: 8 comments 23 replies
-
Correct (open issue for this is #282).
Indexing uses
If I understand you question correctly: cmake should mostly handle not rebuilding the whole project with every change. It only rebuilds the .o for the .cpp you update.
Not at the moment, but if you keep track of your pain points and we can update accordingly! |
Beta Was this translation helpful? Give feedback.
-
Every change you make in C++ requires a rebuild 😄 . But it shouldn't be that slow. Usually I can rebuild in seconds for a small change to a .cpp file.
Exactly the same as in the python side but using the C++ functions instead. You can look in |
Beta Was this translation helpful? Give feedback.
-
Hi @awni and @Kheims, I jump into the conversation as I'm working with @Kheims on the implementation of a message passing neural network architecture to include within MLX. At the moment, we want to implement vjp and jvp for the Also, do you use any debugger during your developments? |
Beta Was this translation helpful? Give feedback.
-
This is just me, others may have other solutions:
|
Beta Was this translation helpful? Give feedback.
-
As a side comment, are you certain you need the vjp of |
Beta Was this translation helpful? Give feedback.
-
For backprop you just need VJP. Usually we implement both because they end up being pretty similar but in your case you can just do VJP. Throw
No you don't need to do all of them, you can just do the one you need and throw for the ones you don't. But feel free to add them if you're interested / up for it! |
Beta Was this translation helpful? Give feedback.
-
Sorry to be late to the party but there is a branch (scatter-vjp I think it is called) where a few weeks ago I started implementing the vjps of scatter. Simple scatter is already there working and scatter add shouldn't be too hard to implement in a similar fashion. |
Beta Was this translation helpful? Give feedback.
-
Hi @Kheims, @TristanBilot :) @francescofarina recently opened #380, aiming to introduce GNN layer. We also recently started working on Python bindings for |
Beta Was this translation helpful? Give feedback.
-
Hello everyone,
First of all, I wish all of you a great year filled with joy and success.
To put some context, I am a Phd Candidate working on Graph Neural Networks, and was really impressed by MLX.
I was trying the past few days to implement Graph Neural Networks MessagePassing's paradigm in MLX (following pyg's official implementationand other renown papers advocating the efficiency of using operations such as scatter and gather in this particular context).
To do it for Graph Convolutional Network for example the use of scatter_add implementation is required, therefore I have binded that cpp function implementation to python, I was able to use it in python and it has passed the equivalent cpp tests, the forward pass has a correct behaviour but during backward the grads aren't updated.
From my understanding, when using an operation such as scatter_add (that in short term just uses scatter with a Reduce Type of Sum) the primitive needs to implement jvp and vjp, as the operation itself builds the computation graph but doesn't update parameters.
The scatter function in the file mlx/primitives.cpp doesn't have implementation of jvp and vjp and therefore can't be used yet, am I correct ?
TLDR :
Is the scatter function with it's different strategies (scatter_add, _max ...etc) usable as of now in python API if we just provide a binding to it ?
If we want to make core contributions to operations and primitives ( say for example implementations of jvp and vjp ) is there a more efficient way to isolate the functions ( advices from your personal experience would be great :D ) rather than needing to modify the code and rebuilding all the project.
I have read the developer documentation, but if you have any other resources that might be useful that would be amazing.
Beta Was this translation helpful? Give feedback.
All reactions