[0]: https://www.tensorflow.org/guide/create_op
[1]: https://pytorch.org/tutorials/advanced/cpp_extension.html
Even then, you're not going to have fast custom types to be used on the GPU without dropping into C++
I don't understand why it's not possible. You're asking if it's possible in the language. I don't see anything stopping you from, as you say, writing your own framework, or simply doing it in TF. Perhaps my ignorance of Julia is showing :)
But there really is a profound difference. The thing is that Python is really just a language to rearrange networks of nodes written in C++. A node written for one ML framework will be incompatible with a node written in another language. If you want them to work together you need to spend a lot of effort gluing them together, and most likely the performance benefits are lost.
This is very different in Julia because you are using pure Julia code. What is specialized C++ nodes in Python, are for the most part just plain functions in Julia. There is nothing special about them. That is why they can be used anywhere.
In Python frameworks each of these C++ nodes need to contain information about how auto-differentiation is done. That is why they are tailor made for one specific ML library.
In Julia the whole automatic differentiation stuff is perform code transformations on regular Julia code.
Are you familiar with LISP, and the idea of code as data? That is what we are talking about here. A regular syntax graph of regular Julia code gets manipulated to do autodiff. You are not organizing C++ nodes in a network.
That does sound very different than Python. Admittedly, I haven't used Julia, because I never had to for professional purposes. For personal projects, I use PyTorch, because I find it easy to use, intuitive, and I have a lot of experience with it. Maybe one day I will be forced to use Julia and will appreciate what it brings :)
I don’t much use Julia, but it is a beautiful language. I started a tiny side project for using Julia for non-numerical things like querying SPARQL endpoints, text processing, etc. Julia could be a universal, use for almost everything language.
It's not that it's not possible. Yeah, you could always "write your own framework".
It's that it's not readily available by the language, ready-made to compose, without resorting to external libs on C/C++/Fortran, and so on.
So, "not possible" not in the sense that "it's not possible to write a program that solves the halting problem". More like "it's not possible to write a web app in assembly". Which means, yeah, it's possible, technically, but you wouldn't like it, it would be full of holes, a pain to maintain, and not a good time investment.
I think the reason why people use python is because it’s the only universally-accepted language for coding interviews.
I am not asking anyone to write Python when it isn't part of the job.
https://numba.pydata.org/numba-doc/latest/cuda-reference/ker...
which basically calls NVPTX
https://github.com/numba/numba/blob/ec6fa07c12c3703a52c2b4ac...
which is exactly what CUDA does anyway; CUDA code is actually a frontend for an ISA
The irony here is that tiny Julia libraries give the same power as much larger Python libraries which require highly specialized and trained developers to evolve and maintain.
With Julia it is much easier to grow the eco system because you can make lots of relatively small packages which can then be combined in almost any way.
The challenge for the Julia community today is really to make people new to the environment aware of this.
I have encountered people who thought Flux couldn't do anything because it was so small. He was so used to the huge monolithic libraries in Python, that it did not occur to him that adding something like an new activation function is literally one line of code. He is used to that requiring adding various C++ nodes. Wrap those up and God knows what more steps you need when you extend something like TensorFlow.
I don't think most people realize how powerful Julia is. They are not used to being able to combine libraries the way you can do in Julia. A big part of the effort for the Julia community will simply be to write more tutorial and introduction which better introduce beginners to these kinds of capabilities. Once you know Julia it is pretty obvious.
But grab people's attention and make them realize Julia could be a solution to their problem, I think one needs a lot of sort of shallow and quick intros to these kinds of things.
^This. As we're seeing here in the discussion thread Python folks don't really realize what they're missing when we're talking about composability of of libraries in Julia - it's kind of difficult to explain the impact on productivity without people actually trying it out. I think Julia and Flux are getting to the point where they're quite useable and comparable with PyTorch. Also some of the Neural ODE stuff and differentiable programming in SciML seems just a lot easier to implement than it would be in Python.
I don't think I realize how powerful Julia is, and it's my main language (and I have written libraries, and contributed to Base).
See the paper.
It allows for the ecosystem to have a combinatorial explosion of possibilities as each domain expert works on their own package.
I can't foresee every application, but the emergence is the point. This is just a crazy example to show the bounds of what's possible.
In Julia you can compose a custom distribution, with a bayesian model with an ODE with a neural network with unit number types with custom Julia written CUDA kernels and multithreading.
Edit: That are not designed specifically to work with each other
Can python even hope to do a fraction of that, still be fast and differentiate through everything?