0 votes

How interaction nets could be used to design more efficient hardware

1 comment

  1. skybrian
    Link
    From the article: [...] [...] [...] Apparently this has been used to design a new CPU architecture. But it's unclear to me whether they actually manufactured the chip. It sounds like they might...

    From the article:

    Understanding the potential of our novel general-purpose architecture requires understanding the underlying model of computation: interaction nets. So we will introduce interaction nets and their unique properties (specifically locality, parallelism, and linearity) and how they help to overcome some of the hardest challenges in hardware architecture design.

    [...]

    Having an efficient implementation is one thing, but programming in raw interaction nets is not really feasible. For this, we’ll talk about the third property we haven’t mentioned yet: linearity. This property refers to the fact that things get used exactly once. As a matter of fact, we’ve seen this property in action already when we defined specific nodes to explicitly erase and duplicate numbers. This property is interesting because, as it turns out, a normal programming language with a linear type system can be compiled down to a linear model of computation, such as interaction nets, perfectly. Specifically, Rust has popularized a kind of linear type system with its concept of ownership.

    While there are a couple of big caveats as to why Rust specifically can’t easily be compiled to interaction nets, we’re able to create a language (Vine) that is similar to Rust but compiles directly to interaction nets.

    [...]

    The way the Vine compiler does this is not by magically extracting parallelism out of the program; it simply preserves dependency information all the way down to the hardware (or runtime, in this case). We can find very similar patterns of parallelism in e.g. option pricing algorithms.

    Normal compilers already track these dependencies internally and use them to make optimizations. However, this information is then thrown away and the entire program is linearized into a sequence of instructions. Ironically, modern CPUs then try to extract this parallelism to a limited degree in silicon with out-of-order buffers and superscalar execution. Instead of that, with interaction nets, we can keep and exploit this information at the lowest level.

    [...]

    Earlier, we claimed that the properties of interaction nets can help us overcome some of the hardest challenges in hardware architecture design. To see why, let’s look at some of the modern challenges in architecture design.

    One of the key design choices of CPUs is having one unified memory space. This has become a problem in recent years, because since the early 2000s, single-core CPU performance has stagnated. We’ve thus seen a stark rise in multi-core CPUs, but when all processors work on a single memory space, every load and store instruction is technically a global operation. Of course, modern caches hide most of this, but cache coherency protocols are the price for it. They typically scale poorly and limit the number of cores. With interaction nets, operations are local and cores can store the relevant data in local SRAM, which does not require any cache coherence. Moreover, for the same reason that Rust’s type system allows automatic memory management without a garbage collector, the linearity of interaction nets also makes memory management on the chip feasible. With these properties, we can scale to thousands of cores.

    Another issue with multi-core CPUs is the difficulty of programming them. Debuggability is a major issue, and entirely new classes of issues arise, such as race conditions. However, in interaction nets, all active pairs are independent, and so can actually be executed in any order. This property is known as confluence, and means that no matter the order in which things are executed, the result will be the same. This makes debugging straightforward and eliminates issues like race conditions. This allows Vine to be parallel out of the box; the programmer does not have to do anything special with threads, processes, CUDA kernels, etc. to get parallel execution.

    Apparently this has been used to design a new CPU architecture.

    We synthesized Frostbite on a 7 nm process, reaching 800 MHz timing at synthesis and 500 MHz in the final GDS. Each Frostbite quad (a two-by-two grid of tiles) paired with four L3 nodes is 0.792 mm². We benchmark one Quad+L3 cluster against a single core of a modern superscalar (dual-issue, in-order) CPU, which we refer to as TCPU (“Traditional CPU”). This TCPU is 0.895 mm² at the same process.

    But it's unclear to me whether they actually manufactured the chip. It sounds like they might have benchmarked a simulation somehow?

    They do plan to release a version that runs on FPGAs.