The Hugging Face Datasets Server is now open-source
github.com
github.com
I love me some Python, but for ML, the "serious work" is handled by C/C++ libraries on the GPU or CPU. Python is provably slower than C/C++, vut being "too slow" or not depends on the domain and/or budget.
Python happens to be the best for this sort of job as it is fast and easy to write and read.
Eh. Is it though? For all possible operations? Are you sure? Which implementation are you using? CPython? PyPy? Are you comparing the exact same algorithms implemented in both languages?
Modern CPUs are pretty good at executing bytecode-based languages, as there's usually a main loop that fits in cache.
A C program can jump all over the place and easily blow caches. It's also easy to access memory in ways that are suboptimal. Because of the difficulty of managing memory, C code tends to free stuff way too quickly. GC languages have an advantage there, as they don't necessarily reclaim the memory immediately, saving malloc/free cycles (at the cost of RAM usage). That's even more of a problem for C++.
Once you have profiled your Python program and found out that there isn't anything else you can do to run faster – including changing your algorithm (something that's easier to do in Python), then you can start thinking about rewriting the section in C on ASM.
The only one in which all documented (and not) Python stuff works, and all Python packages can be used?
There is only one Python for practical purposes.
> Modern CPUs are pretty good at executing bytecode-based languages, as there's usually a main loop that fits in cache.
When everything fits in the cache, bytecode loses most. The more you saddle code with uncached memory accesses, the less it matters whether it's bytecode or machine code. This is just Amdahl's Law.
The best performing Python code will be that which spends very few cycles in any byte code loop, and just lets the C routines in Python do all the work.
The interesting possiblity is that a bytecode program (and it's interpreter) together fit into the instruction and data cache. Whereas the equivalent machine code program blows the instruction cache. I'm not sure that this scenario is possible with Python in such a way that it actually makes it faster.
Plus I'm pretty sure if I go peak at CUDA, it ain't python anyway.
I never heard about the hugging face before that post.