1,804 karma · joined October 22, 2018
For SIMD, Chris Elrod's LoopVectorization.jl [1] is an (IMHO) incredibly impressive piece of work (which incidentally provides the foundation for I think the first pure Julia linear algebra library competitive with BLAS).
Multithreading is pretty easy with things like `@spawn`/`@sync` and `@threads for` in the base language, as well as super low-overhead multithreading from the Polyester.jl [2] package (which LoopVectorization also uses to provide a version its vectorization macro that'll also multithread your loops in addition to SIMD-vectorizing them).
MPI.jl [3] has been totally problem free for me, though I wouldn't be surprised if the Fortran bindings still have an edge somewhere, and Cuda.jl [4] seems to provide pretty seamless GPU support which should play nicely with MPI.jl's Cuda-aware MPI [5], but I don't work as much with GPUs myself.
[1] https://github.com/JuliaSIMD/LoopVectorization.jl
[2] https://github.com/JuliaSIMD/Polyester.jl
[3] https://github.com/JuliaParallel/MPI.jl
[4] https://github.com/JuliaGPU/CUDA.jl
[5] https://juliaparallel.github.io/MPI.jl/latest/usage/#CUDA-aw...
Unless you're using [Octavian.jl](https://github.com/JuliaLinearAlgebra/Octavian.jl) or such for your linear algebra in place of BLAS. But yes, it is always interesting how many people do not know how much of modern software is built on Fortran!
This definitely fits with my experience. It took me quite a while to really "get" dispatch-oriented programming as a paradigm, but once I started to get it there was no going back.
How on Earth did you reach that conclusion? A trivial look at that list:
* Web browsers. -- Worked so well that IE remained the dominant browser for over a decade [1]. Of course, bundling was important here too but without the intentional incompatibilities between IE and Netscape, bundling alone would not have been nearly as effective.
* Office documents. -- Despite .docx files being notionally based on an open standard, to this day, Microsoft office will frequently reject as "corrupted" .docx files that have been edited using other implementations of the OOXML standard (in my experience, particularly when tracked changes are enabled or images are involved). In most such cases in my experience, the sentiment from coworkers is "why don't you just install Word" --- so apparently still working as intended.
* Instant messaging -- seems to have worked pretty well at the time [2] and remained popular for nearly a decade. And while they later lost marketshare to transformationally different technologies (texting, mobile messaging), the competitors against which they used the strategy remain dead.
* Against Java -- Led to major legal action, in which Microsoft was forced to pay Sun >$2B and agree to discontinue the practice in settlements, presumably only because by now people were catching on to the strategy. Failing that, Microsoft just made a separate competing language for cross-platform (AKA "write once run anywhere" :) development and called it.... .NET [3]
> And it's strictly better than Microsoft spending their time enhancing closed-source software, no? That was my question at the end: they could make .NET closed-source
Presumably it is reasonable to assume that they would like to grow the market share of .NET. While more open code is usually good, I would indeed not consider it "strictly better" if their goal in this work is to capture market share against other languages by leveraging the popularity and community that comes with "Open Source", while leaving them in a position where they can then reassert hegemonic control over their language via exactly the pathway being discussed here.
[1] https://en.wikipedia.org/wiki/Browser_wars#First_Browser_War...
[2] https://www.nplusonemag.com/issue-19/essays/chat-wars/
[3] The tagline on https://dotnet.microsoft.com is currently "Free. Cross-platform. Open source." The "Open Source" part of course only added somewhat more recently after the closed-source version failed to dethrone Java. Not that I like Java so much or anything, but you get the point.
For another alternative to Julia's built-in `Threads.@threads` macro, folks may also be interested in checking out `@batch` from Polyester.jl [2] (formerly CheapThreads.jl), which features particularly low-overhead threading.
[1] https://www.fast.ai/2019/03/06/fastai-swift/
help?> Base.Experimental.@optlevel
Experimental.@optlevel n::Int
Set the optimization level (equivalent to the -O command line argument) for code in
the current module. Submodules inherit the setting of their parent module.
Supported values are 0, 1, 2, and 3.
The effective optimization level is the minimum of that specified on the command line
and in per-module settings.While it is not part of the language semantics, there certainly is, in the current implementation, a time at which any given method in Julia is (JAOT) compiled (via SSA-form IR, LLVM IR, and finally to native machine code) -- and whether or not types are able to be inferred at this time is sufficiently important that it has its own name: type stability [e.g., 2], with type-stable code being generally a couple orders of magnitude faster than equivalent type-unstable code.
[1] https://stackoverflow.com/questions/28078089/is-julia-dynami...
[2] https://www.juliabloggers.com/writing-type-stable-julia-code...
I'm a bit confused still though why you say it's a "missing" feature, given that as we discussed above, there is absolutely nothing to stop anyone who wants to use the "Python OOP" style of namespacing in Julia from doing so? Most of us don't seem to find it necessary or to prefer it personally, but that doesn't restrict anyone else from choosing it.
In other words, one package would define `fit(mymodel::TensorFlowModel)` and the other would define `fit(mymodel:PyTorchModel)`, and then when you call `fit` it'll just dispatch to the appropriate one depending on the type of `mymodel`.
This dispatch-oriented style also allows a shocking degree of composability, e.g. [1], where a lot of packages will just work together, such that you could for example just use the equivalent of PyTorch or TensorFlow on the equivalent of (e.g.) NumPy arrays without having to convert anything.
If you mean "what about the case where both packages just call their model type `Model`", while I've never run into that, the worst case scenario is just that you have to fall back to the Python style explicit Module.function usage (which was always allowed anyways...). And if you if you don't like names being exported, you can always just `import` a package instead of `using` it:
help?> import
search: import
import
import Foo will load the module or package Foo. Names from the imported Foo module can
be accessed with dot syntax (e.g. Foo.foo to access the name foo). See the manual
section about modules for details.
[1] https://www.youtube.com/watch?v=kc9HwsxE1OYIt also pretty much solved my version of the two-language problem, but that means different things to different people so ymmv.