Open SamuelMarks opened 3 years ago
Hey @SamuelMarks!
Let me first clarify our current goals / situation:
jax
is a pleasure to work with and primitives like jit
, pmap
, and friends are extremely powerful and often not found in other frameworks, we want to be as close to jax
as possible, this is even more true with the new low-level API.About the possibility of creating multiple backends, my personal opinion is that Keras ultimately showed that supporting multiple backends is more of a weakness since it limits the user compared to having a single first-class backend, this is why now Keras is part of TensorFlow. Thanks to this change the need for Lambda
layers disappeared, vastly improving the developer experience as you can now freely use any TensorFlow op directly.
Hey @cgarciae,
Thanks for your speedy response
I'd just like to note that the future of all these frameworks is uncertain. optax or jax.experimental.optimizers
? Flax or Trax? JAX or TensorFlow?
It is conceivable that a number of these codebases will merge, become deprecated, or become completely unmaintained. elegy being not Google/Facebook/Microsoft backed increases the chance that this will be abandoned also.
What I'm proposing is a way out of it. I'm not expecting this to be easy, and certain nice primitives that JAX exposes isn't available in other frameworks. But having a bunch of TODO
s around the place isn't so bad an idea, we can always port the JAX primitives at a later stage, probably exposed into it's own meta polyfill library.
Yes, Keras failed. And maybe elegy—or whoever implements this concept^—will fail also. But at some stage, a framework will succeed in coordinating most everyone into using the one consistent API. What I'm proposing is to give it a shot, IMHO it's the best chance for elegy to be around medium-to-long term.
Is your feature request related to a problem? Please describe. There are too many alternatives to elegy. Let's make more. If elegy could become the Keras of ML, then let's remove all the dependencies.
Describe the solution you'd like Remove all nonbuiltin imports. Specifically, centralise them all to one file, say
elegy.engine
, which would be simple to do, as there are only these 55 occurrences, basically all inexamples
:So the solution would be to have either/both a function or an environment variable set:
Obviously this is an incomplete solution, there are a number of inconsistencies between the various numpy implementations, and the API elegy uses also goes beyond mere numpy. But moving in that direction is a good idea.
Describe alternatives you've considered Write abstract classes, and implement them in
elegy-numpy
,elegy-cupy
,elegy-tensorflow
,elegy-jax
.