HNHacker News
TopNewBestAskShowJobs

37ef_ced3

898 karma · joined December 2, 2020

Generate stand-alone C code for AVX-512 neural nets:

https://NN-512.com

Jonathan Aylard's NN-512 ResNet50 example:

https://github.com/jonatron/test_nn512

submissionscomments
37ef_ced3··on Ask HN: Heavy Metal Music for Programming?
I second this (most excellent) recommendation and suggest, in particular, the band "Windhand".

For example, Windhand's song "Three Sisters":

https://youtu.be/0FkhnGdwDcw

37ef_ced3··on Ask HN: Heavy Metal Music for Programming?
Yes. Put some ear plugs in and crank up the Elder or Pelican. Way up.

Filtered through (muffled by) ear plugs, heavy metal is a good accompaniment to software work.

37ef_ced3··on RTNeural – real-time neural network inferencing engine
I didn't mean to insult you. My apologies.

All I meant was: it's not hard to write your weights to a file as floats and fread() them into a struct. I view this as the simplest possible universal interface.

And you're right: NN-512 supports only the classical ConvNet operations. It does that one thing, and it does it well. If you need LSTMs or transformers, or training, etc., another tool is needed.

Have a nice day.

37ef_ced3··on Go will use pdqsort in next release
According to the benchmarks, pdqsort only really helps for Go's integer sort.

The fastest way to sort integers is a radix-256 increasing-significance radix sort, and that has been a well-known fact since the 1960's. In other words: a stable bytewise counting sort, sorting from least-significant byte to most-significant byte.

A comparison sort, no matter how clever, will not outperform a radix sort, except for very small arrays or very large (many byte) integers.

37ef_ced3··on RTNeural – real-time neural network inferencing engine
NN-512 was monetized by making its author a Senior Architect at the most important company in the machine learning space, a company whose hardware and software you almost certainly use. NN-512 was an EXTREMELY profitable project for its author.

Most competent engineers will be able to dump their network weights to a file as described in the headers. Do you understand your network or not? The weights, etc., are literally a C struct in the header file. Use fread() to load the floats. If that's too complicated, NN-512 is not for you.

As clearly stated on its brief webpage (which you might care to read before commenting) NN-512 does every kind of fusion you can imagine, fusing convolutions, fusing elementwise operations, fusing batch normalization, etc. See https://nn-512.com/example/28 for an example.

If you're using a classical ConvNet (e.g., a DenseNet-121), as many people are, and you want to do inference on AVX-512 CPUs, nothing will outperform NN-512. And your inference code will be completely stand-alone. No dependencies.

37ef_ced3··on RTNeural – real-time neural network inferencing engine
Related:

Generate fully specialized, stand-alone, human-readable C code for AVX-512 neural net inference:

https://NN-512.com

Far outperforms TensorFlow, PyTorch, etc.

Code generator is also stand-alone (no dependencies) and is written in Go.

37ef_ced3··on Ask HN: What creative field will be safe from AI?
Do something where there's no training data available.

The AI companies are re-encoding large corpora of human creative work as a kind of compressed, conceptually-indexed representation. This allows that work to be mixed and the patterns regurgitated in very flexible ways.

Everybody's output (our creative work) is assimilated by the AI, and becomes the AI's output.

For example, OpenAI's Codex is trained on about 54 million public GitHub repositories.

This allows Microsoft's CoPilot to regurgitate pieces of that code without attribution. Code from many sources is blended together and regurgitated for Microsoft's customers (without any acknowledgement of the source).

It is perhaps the greatest theft of intellectual property in the history of Man.

37ef_ced3··on My website is one binary
Here is a compiler (written in Go) that also generates and serves its own website with no dependencies:

https://nn-512.com/browse/NN-512#46

37ef_ced3··on How Go mitigates supply chain attacks
Go is a distillation of many decades of software engineering experience. The people behind Go (e.g., Russ Cox) have learned from history.

The peanut gallery loves to complain about superficial aspects of Go. Typically these are people with little or no actual experience using the language and tools. They fixate on imagined problems that don't matter in practice.

But anyone who has used Go full-time for a few years is likely to deeply respect and appreciate it.

37ef_ced3··on Ask HN: How do you search large codebases before adding a feature or fixing bug?
Do whatever works for you.

I use Vim on a concatenation. It's a simple technique that allows me to search, read, annotate, and understand how everything fits together in a medium sized C++ codebase full of templates (i.e., a pile of garbage).

37ef_ced3··on Ask HN: How do you search large codebases before adding a feature or fixing bug?
Concatenate all the source code files into a single file, with pathnames inserted between files.

Then use Vim to read the concatenation and (regexp) search.

37ef_ced3··on TikTok is scary good. It's digital crack
You're talking to a transformer language model.
37ef_ced3··on An Introduction to Generics
In Go we use ^ for bitwise-NOT.
37ef_ced3··on Nvidia Hopper GPU Architecture and H100 Accelerator
Because it's 32-bits wide in memory.

The effective mantissa is like FP16 but it's padded out to be the same size as FP32.

In other words, there's 1 sign bit, 8 exponent bits, 10 mantissa bits that are USED, and 13 mantissa bits that are IGNORED.

1 + 8 + 10 + 13 = 32

The 13 ignored mantissa bits are part of the memory image: they pad the number out to 32-bit alignment.

37ef_ced3··on Ask HN: What ML platform are you using?
Fast CPU transformers: https://bellard.org/libnc

Fast CPU convolutions: https://NN-512.com

Both are completely stand-alone (no external dependencies).

37ef_ced3··on Who's Attacking My Server?
Anecdotally, I run a several servers hosting several websites and several Android app back-ends.

Every few weeks they are attacked: 12 hours of attempted logins, port scanning, etc.

It's perfectly normal and nothing new.

37ef_ced3··on Launch HN: Tensil (YC S19) – Open-Source ML Accelerators
Please compare against https://NN-512.com
37ef_ced3··on Things I hate about Rust, redux
Complication without benefit.
37ef_ced3··on It is high time we let go of the Mersenne Twister (2019)
You need 128 random bits to seed the generator (i.e., two uint64 variables).

The bits1 and bits2 arguments to pcg32.New() should each be 64 bits of "noise".

They may be drawn from /dev/urandom or whatever. You can use crypto/rand.Read() from Go's standard library, for example. Just read 16 bytes using crypto/rand.Read() and use encoding/binary.LittleEndian.Uint64() to produce bits1 and bits2.

Or you can use a hash to produce bits1 and bits2. If you want to use a constant seed, take 32 hex digits from an arbitrary git commit id. Like this: bits1=0xd240853866f20fc3 bits2=0xe536cb3bca86c86c

It's an orthogonal issue.

37ef_ced3··on It is high time we let go of the Mersenne Twister (2019)
Use PCG: https://www.pcg-random.org/

Here is a stand-alone implementation of PCG32 in Go:

  package pcg32

  type Src [2]uint64

  func New(bits1, bits2 uint64) *Src {
      return &Src{bits1, bits2 | 1}
  }

  func (s *Src) Uint32() uint32 {
      var (
          x = s[0]
          y = uint32(x >> 59)
          z = uint32((x>>18 ^ x) >> 27)
      )
      s[0] = s[1] + x*6364136223846793005
      return z>>y | z<<(-y&31)
  }

  func (s *Src) LessThan(n uint32) uint32 {
      for min := -n % n; ; {
          r := s.Uint32()
          if r >= min {
              return r % n
          }
      }
  }
37ef_ced3··on Go Chainable: .map().filter().reduce() in Go
A bad programmer can make a mess in any language, including Go.

A great example is this .map().filter().reduce() joke we're looking at today.

Well-written Go is absolutely sublime.

37ef_ced3··on SpaceX reprioritized to cyber defense and overcoming signal jamming
The goal is publicity. The brag is the most important thing.

Just like with the Thai cave rescue.

37ef_ced3··on Cello – High Level C
Too complicated. Rust is more similar to C++ than it is to C.
37ef_ced3··on Cello – High Level C
Consider using Go instead, as a replacement for C.
37ef_ced3··on Show HN: Berkeley Mono Typeface
I use the Go font:

https://go.dev/blog/go-fonts

Free and beautiful.

37ef_ced3··on Dive into deep learning compilers
The compiler generates and serves its own website with no dependencies.

For personal projects (including NN-512) I use Mercurial for version control, not git. But in any case I don't want the compiler (or the website it generates) to depend on git or any other version control software.

37ef_ced3··on Dive into deep learning compilers
Related: https://NN-512.com is a compiler that generates C99 code for neural net inference. It takes as input a simple text description of a convolutional neural net inference graph. It produces as output a human-readable, stand-alone (no dependencies) C99 implementation of that graph. The generated C99 code uses AVX-512 vector instructions to perform inference.
37ef_ced3··on Akamai to Acquire Linode
For example, my https://NN-512.com is served by a Nanode in Linode's Fremont datacenter (45.56.92.68).

That same Nanode has been running the back-end of an Android app for almost 5 years, on another port.

37ef_ced3··on Akamai to Acquire Linode
I love Linode. Strongly recommended.

For many years, I have run all my websites and services (back-ends for apps, etc.) on a few $5/month Nanodes.

For temporary/experimental stuff I sometimes use Vultr and Digital Ocean, but Linode's service and reliability is superior (especially versus Vultr). Linode is just top-notch.

37ef_ced3··on Intel joins RISC-V international and invests another billion in foundry
Thanks. Yes. Let me give you an example of the difficulties: The NN-512 code generator knows (with AVX-512) it can do an efficient (up to) 16x16 transpose, and makes heavy use of lane permutations. But with RISC-V vector instructions, you don't have that knowledge and you can't do the lane permutations efficiently.
← PreviousPage 2 of 10Next →