Better HN
topnewbestaskshowjobs
Log inSign up

PartiallyTyped

2,940 karma · joined Oct 16, 2020 (6y ago) · 2,890 submissions

me [at] [$handle].dev

----------------------------------------------------

Submissions

comment 5y ago · link · parent

You are giving me more credit than I deserve. My brain had a bad reference.

comment 5y ago · link · parent

> the way a supermarket puts the milk at the far corner of the store

I never noticed, but I can only recall a single instance from a set of 10 or so where that isn't the case.

Any links on related content to the topic?

comment 5y ago · link · parent

> If Python's performance in the ML space is not sufficient, then the community would have quickly moved on from it and built something better.

Python's performance is sufficient when the bottleneck is actually the computation done in the accelerator. In my flavour of ML, we use small models, think 3 layer NN 64 neuron wide and in some cases a small CNN. During training, most of the models reported using <150MB.

Most of the community finds python sufficient because they do not need to interleave training and simulating.

> For ML purposes, if your model isn't running on the GPU, it doesn't matter if you're using Swift, Rust, or whatever, your stuff is gonna be slow. Like it or not, Python is one of the best glue languages out there, and the reason why libraries like TensorFlow and Torch are not used in their native languages (C++) [0] is because they're significantly simpler to use in Python and the performance overhead is usually one function call (e.g run_inference(...)) and not billions.

You don't know in what I am running/doing, hence your comment comes off as ignorant.

This is the setup:

Run X number of simulated steps on CPU, collect X samples, store them in a buffer of size either X, or Z>>X, train for Y number of steps sampling from buffer, copy model to CPU, repeat for total of 1M steps, repeat 10+ times to get a good average of the performance.

All of that without any hyper parameter tuning.

Now, you also need to note that a non trivial amount of work is also done in python to augment the inputs as necessary. If the work is done in numpy, there's usually little overhead, but, it is often the case that the environment I am simulating is wrapped in wrapper functions that modify the behavior, e.g. I may need to remember the last 4 instances created by the environment, and so on. All these modifications quickly accumulate and for a single experiment of 1M steps, you end up with billions of python calls. The community uses more or less the same package/framework as the intermediary between simulations and models.

The issue is so prominent, that the community as a whole moved away from running in single core the simulations, to having multiple parallel actors to collect transitions/data points, this also requires new theory. Furthermore, there have been many proposed architectures for distributed and asynchronous training because the bottleneck is not the GPU or the model, but rather, how fast you can collect transitions. Infact, there was a distributed architecture by google that literally sends the transitions over the network into a few GPUs, the reason is that the network cost is amortized because you get to run hundreds of simulations concurrently.

IIRC, a maintainer of a popular project/framework that I contribute saw improvements upwards of 2x when using C++ over python.

comment 5y ago · link · parent

> I prefer having a Python monoculture for AI to be able to mix and match different algorithms.

I do not. Unfortunately, high performance and python do not go hand in hand. Yes, I know the heavy lifting is done by C/C++/Rust/Cuda/Blas/Numba and so on, but, when you run simulations for millions of steps, you end up with billions of python function calls.

Afaik only Jax actually performs any optimizations because it constructs an analytical gradient. Zygote seems to be able to that and more on the LLVM IR level which, I think should enable more optimizations.

comment 5y ago · link · parent

'Conjecture' could also work.

2676.

High Speed Hashing for Integers and Strings (2015)(arxiv.org ↗)

28 points · by PartiallyTyped · 5y ago · 13 comments

comment 5y ago · link · parent

I have the same experience. Growing up in Greek schools, we learn early about our 'great ancestors', but every depiction is with rose coloured glasses.

We are not taught about the atrocities of our ancestors and how the Greece the 'mother of all cultures' was infact filled with traitors and slavery, especially Athens.

Our 'great' past is ,beat, almost literally into our heads. We named one of the worst warlords in history 'Great' and instead of talking about the slavery and death he brought, we call it 'liberation of the barbarians', with 'barbarians' meaning all who are not greeks (::winky face::).

When it came to the Romans, we were still the winners because conquered them with our culture.

The worst of all is that this becomes so ingrown, even in young people, that for many it becomes a corner-store of their identity; any critical discussion is met with attacks because it literally shakes the foundation of their world.

comment 5y ago · link · parent

Let's get something out of the way, it's not the 1 percenters that make things for us, it's the engineers, the programmers, the developers, the physicists, the biologists, the chemists, the grad students and every other poor soul grinding for progress on a computer screen in exchange for basic decency.

Why is it that nearly every company that puts first the shareholders ends up pooping the bed? Because the shareholders don't know jack except what the other people in the 1% want.

comment 5y ago · link · parent

You could swap Dutch with Danish and the video would be mostly the same. I still need to learn how to bike and Copenhagen isn't really kind to newbs.

comment 5y ago · link · parent

Still vanished for me, here is a webarchive link.

https://web.archive.org/web/20210211144406/https://blog.rust...

comment 5y ago · link · parent

Not only was he within policy, he was given permission, explicitly.

> Dr. Gokal said he called a Harris County public health official in charge of operations to report his plans to find 10 people to receive the remaining doses. He said he was told, simply: OK.

comment 5y ago · link · parent

And faster; there was a post recently named "architecture.md", that explained that for most new code contributions most of the time is spent finding where to go to fix a bug. Following that idea, it makes sense that it will take a very long time for a new dev team to pick up the code base, or at least more time than it is worth it.

comment 5y ago · link · parent

Yes, I am currently learning Julia. My issue with it is that the documentation is rather sparse or lacking, but I am getting the hang of it. On the positive side, it appears that the jitter works quite well and fast arrays as first class citizens make me happy.

comment 5y ago · link · parent

> But Python has never been about performance

I have been burnt by this. As much as I like python's "expressiveness" so to speak, it is too slow for my needs; the ML community gravitated towards that because it is simple to implement and test large models because C++/C/Cuda are doing the lifting. However, in my flavour/field of ML, python is often the bottleneck because the sampling/simulations are glued with it and the need to sample 10s of millions of steps ends up with possibly billions of function calls in python.

comment 5y ago · link · parent

In python, strings are mostly unique, meaning that a string can be bound on many variables, and all the variables point to the same string. This is where the 'is' operator comes in, 'is' checks for reference equality, that is, the object that is bound onto the two variables is the same. If they are not the same, 'is' fails.

In other words:

    x = "foo"
    y = "foo"
    x == y and x is y
Both strings point to the same exact memory. Hence, 'is' works. But it isn't always true:

    x = "foo"
    y = f"{x} "[:-1] # get everything but the space
    x == y # True
    y is x # False

comment 5y ago · link · parent

The folk over at openAI do something similar in order to create a registry, so that you can initialize objects using a name.

comment 5y ago · link · parent

Different access tokens have different permissions, you can't just do whatever you want.

comment 5y ago · link · parent

To be fair, python itself isn't jitting anything, while node is.

comment 5y ago · link · parent

Even on subsequent runs?

comment 5y ago · link · parent

I asked, run it twice. The first time is for compilation. The second time it reaches 90ms on my machine.

comment 5y ago · link · parent

Numba version:

    @numba.jit
    def fib(n):
      if n == 1 or n == 0:
        return 1
      return fib(n - 1) + fib(n - 2)
first run:

498.46601486206055 ms.

second run:

89.19310569763184 ms.

For completeness, with njit:

    @numba.njit
    def fib(n):
      if n == 1 or n == 0:
        return 1
      return fib(n - 1) + fib(n - 2)
first run:

152.62889862060547 ms

second run:

86.35592460632324 ms

comment 5y ago · link · parent

I wouldn't say so. The TR series have many more bus lanes than the desktop variants, and support >= 128GB ram, iirc official EEC support, and iirc quad channel memory.
1
899091
97