News for hackers. Stuff that matters.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Thursday April 22, 2021 @06:39PM (#26908990)
I’m bearish on new hardware for AI training. The most important thing is the software stack, and thus far everyone has failed to support pytorch in a drop-in way.

The philosophy here seems to be “if we build it, they’ll buy it.” But suppose you wanted to train a gpt model with this specialized hardware. That means you’re looking at two months of R&D minimum to get everything rewritten, running, tested, trained, and with an inferencing pipeline to generate samples.

And that’s just for gpt — you lose all the other libraries people have written. This matters more in GAN training, since for example you can find someone else’s FID implementation and drop it in without too much hassle. But with this specialized chip, you’d have to write it from scratch.

We had a similar situation in gamedev circa 2003-2009. Practically every year there was a new GPU, which boasted similar architectural improvements. But, for all its flaws, GL made these improvements “drop-in” —- just opt in to the new extension, and keep writing your gl code as you have been.

Ditto for direct3d, except they took the attitude of “limit to a specific API, not arbitrary extensions.” (Pixel shader 2.0 was an awesome upgrade from 1.1.)

AI has no such standards, and it hurts. The M1 GPU in my new Air is supposedly ready to do AI training. Imagine my surprise when I loaded up tensorflow and saw that it doesn’t support any GPU devices whatsoever. They seem to transparently rewrite the cpu ops to run on the gpu automatically, which isn’t the expected behavior.

So I dig into Apple’s actual api for doing training, and holy cow, that looks miserable to write in swift. I like how much control it gives you over allocation patterns, but I can’t imagine trying to do serious work in it on a daily basis.

What we need is a unified API that can easily support multiple backends — something like “pytorch, but just enough pytorch to trick everybody” since supporting the full api seems to be beyond hardware vendors’ capabilities at the moment. (Lookin’ at you, google. Love ya though.)

Re:Cerebras’ new monster AI chip adds 1.4T transistors by solidasparagus on Friday April 23, 2021 @01:24AM (#26911251)
I don't really agree, at least from a longer term perspective. It's early days yet, but XLA seems to be a promising intermediate representation for allowing the DL frameworks to run on a wider array of hardware without user-facing software changes. It has traction with Google, NVIDIA, IIRC Intel and maybe more (others are definitely using the same approach of compute graph splitting and subgraph scheduling, but I'm not certain if they are using XLA specifically - I know some aren't like Mindspore).

XLA has already proven its value by allowing PyTorch to run on TPUs (shittily, but that appears to be more of a VM/GCP infra problem than an XLA problem). The work done for TPUs (and to a lesser extent for GPU optimization) has started to expose some of the major issues and so work can start on addressing them (the cost of dynamic XLA compilation as tensor shapes change and how lots of important code assumes that accelerator-to-CPU communication isn't tooo expensive, but it's is a huge issue when trying to compile the graph into machine-specific code with XLA or similar to because it forces you to only be able to compile small subgraphs).

It's early, but the rise of a really effective IR in XLA combined with the huge amount of resources that Google/NVIDIA can pour into XLA makes me very bullish on purpose-built hardware for AI training. It will take a while I admit.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Friday April 23, 2021 @01:44AM (#26911336)
Mr/mrs anonymous HN person, please put some info in your profile. You clearly have some deep knowledge of TPUs that I didn’t expect to pop up offhandedly on HN. You’re correct on all counts: dynamic tensor shapes are more or less impossible with XLA, making it more or less impossible to train a model with arbitrary image size inputs, even though the math would allow for that; the pytorch XLA work on TPUs is indeed kind of shitty, and I’m surprised as heck that literally anyone said this except me; and XLA as an IR is promising for portability. Now I’m curious what you’ve been doing to have experienced these things, since there didn’t seem to be many others who have (or at least, who are vocal about it).

I agree with you, but I think we differ on our timetables. I am bearish for the next two years, at which point I’ll awaken from my slumber and become a flaming bull. (It helps to remember that “we overestimate the impact of years, but underestimate the impact of decades.” I try to plan accordingly.)

In other words, if you’re bullish that two years from now we’ll start seeing portability implemented in the field across various HPC chips, then we fully agree. But that’s also a glacial pace; GPT-2 changed the world almost two years ago now, and DALL-E seems to be the next frontier for doing interesting generative work. So, we’ll split the difference and say that the bears and bulls will meet in two years for a deep learning hackathon. As a bonus, the pandemic will be over by then, so it can be an in-person meetup.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by solidasparagus on Sunday April 25, 2021 @01:41PM (#26934670)
Ah I see - I think we're pretty much on the same page in terms of timetables. Although if you include TPU, I think it's fair to say that custom accelerators are already a moderate success.

Updated my profile. I've been working on DL training platforms and distributed training benchmarking for a bit so I've gotten a nice view into the GPU/TPU battle.

Shameless plug: you should check out the open-source training platform we are building, Determined[1]. One of the goals is to take our hard-earned expertise on training infrastructure and build a tool where people don't need to have that infrastructure expertise. We don't support TPUs, partially because a lack of demand/TPU availability, and partially because our PyTorch TPU experiments were so unimpressive.

[1] GH: https://github.com/determined-ai/determined, Slack: https://join.slack.com/t/determined-community/shared_invite/...

Re:Cerebras’ new monster AI chip adds 1.4T transistors by nl on Friday April 23, 2021 @07:37AM (#26913634)
Re:Cerebras’ new monster AI chip adds 1.4T transistors by byronyi on Friday April 23, 2021 @03:48AM (#26912172)
+1 please put some info in your profile.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Friday April 23, 2021 @03:55AM (#26912222)
I'm dying to know what they work on, either officially or in their spare time. https://news.ycombinator.com/item?id=26586151
Re:Cerebras’ new monster AI chip adds 1.4T transistors by cs702 on Friday April 23, 2021 @11:26AM (#26915698)
> from a longer term perspective

Yes.

Longer term, new hardware will also make it practical to train large models in a fully parallelized, fully distributed manner -- i.e., without having to backpropagate gradients, which requires a lot of complex bookkeeping and plumbing for distributed training.

Recent progress suggests this will happen. See, for example:

https://arxiv.org/abs/2006.04182

https://arxiv.org/abs/2103.03725

https://arxiv.org/abs/2010.01047

I for one am excited to see what happens over the next decade as it becomes trivial to train/use models with 1K, 1M, or 1B times more dense connections than present state-of-the-art models.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by blihp on Thursday April 22, 2021 @10:45PM (#26910502)
The philosophy is working as it often does in the early days/years of a technology. The customers for this have problems at an entirely different scale. It's worth it for them to drop millions on hardware and potentially millions more to (re)write the software as needed. Sure, they'd prefer to be buying commodity hardware with standardized APIs. But since that doesn't currently exist for this class of performance, they'll pay up. People did the same back in the days of Cray/SGI/Lisp Machines and so on. These custom solutions can be quite profitable until the competition gets to the 'good enough' stage and then orders start drying up.

If you're looking for standardized hardware and software for AI, Apple is the wrong platform to be on. I'm fairly confident it won't be happening there. (I don't say that to be a hater: see the direction they've gone re: GPU APIs... it's just Apple being Apple)

Re:Cerebras’ new monster AI chip adds 1.4T transistors by systemvoltage on Thursday April 22, 2021 @07:36PM (#26909423)
You're bearish on new hardware for AI training because it takes 2 months to setup? That's like saying you're bearish on the invention of transistor because there are no computers yet. This chip is for research organizations such as LLNL and ANL. Tooling and commoditization will happen.

> “if we build it, they’ll buy it.”

This is literally how any new thing is invented and commercialized.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Thursday April 22, 2021 @07:58PM (#26909565)
Well, two months has a way of turning into two years. June 2019 was right around when I fell in love with TPUs, and we’re still happily TPUing today.

Sometimes, though, it would be nice to simply focus on doing interesting ML work rather than wrestling with the intricacies of tensor slicing and memory access pattern optimization (to say nothing of the cursed inability to manually manage memory, resulting in explosions of allocations in the forward pass for unclear reasons).

Let’s put it this way. If you contract me to implement a full gpt model on this new hardware, two months full time work would be my minimum estimate. That’s 40 hours a week of focused effort, with no breaks and no other projects. I don’t know about you, but two months with nothing to show can demoralize most teams I’ve worked with.

The point was, we’re early in ML’s lifecycle. And, like React for webdev, people are slow to change their habits — for better or worse, pytorch and tensorflow are the APIs people think in. So if you want your hardware to be widely adopted, you need tooling that supports the workflows people have spent months learning.

Jax is on the horizon too. Supposedly they’re launching something soon that might tip the scale in their favor. Perhaps an ambitious hardware vendor could capture the future market by preemptively implementing Jax support. But perhaps not: at that point you’d be competing toe to toe with Google’s TPU offering, since Jax is Google’s dogfood.

Right now my money is on TPUs, partly because of their fantastic support staff. But maybe some other company will come along and offer a better integrated cloud experience.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by durst on Thursday April 22, 2021 @08:16PM (#26909656)
Do you have a longer writeup on your experience performance tuning for the TPU? Is https://cloud.google.com/tpu/docs/performance-guide the best resource in this area?
Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Thursday April 22, 2021 @09:14PM (#26910022)
Sadly I have nothing to offer yet, other than to DM me on Twitter with questions. Always happy to answer basic ones; I love this stuff.

But you’re right, I should write up something. That guide is pretty good, but it doesn’t walk you through anything specific; it shows you a map, but doesn’t take you on a trip, so to speak.

Some tips:

Use tf.name_scopes! You probably use them for variables, but there’s a different one for operations. If you make an @op_scope decorator, you can use it on all your ML functions and immediately get lots of insights as to where the XLA ops end up mapping to in your source code.

As much as it pains me to say this, avoid tensorflow 2 style code like the plague. Pretend that if you use eager execution, someone will jump out of the bushes and shoot you. I technically use TF2.4 now, but it’s still session / graph-based, not the new tf.function magic. The new magic pipeline seems to be slower, harder to use, harder to debug, and very likely to explode when you do anything even slightly different than the tutorial examples. YMMV, and maybe things are better now (or in a future release).

The profiler is magical; leverage it whenever you can. My workflow is to start up a TPU run, then ssh into my server and fire up a Tensorboard to that model dir. Then I manually navigate to <tensorboard_url>/#profile (because the “profile” button doesn’t seem to show up in the menu anymore) which then lets you “capture profile”.

Make sure your TPU version matches your Tensorboard version. At this point we use TPU version 2.4.0, Tensorboard 2.4.1. If you get mysterious errors, this is likely the reason things are going wrong. Even TPU version 2.3.0 wasn’t enough.

Happily, the new profiling tooling is totally badass. The trace viewer is great, the op profiling is ok (though I wish it would show me all the damn ops, instead of “helpfully” hiding all but the top N ops), and the memory viewer is incredible. You can see exactly where in your pipeline is causing “peak memory usage”, what the peak is (down to the kilobyte), and have at least some idea of what’s causing it.

It’s not effortless though. The XLA fusion ops sort of make it harder to track down what’s doing what. (TF compiler is very powerful, but the trade off is that you almost never have manual control over memory usage, which can be frustrating).

All in all (or all-to-all, ha) it’s a lot of fun if you like seeing expensive hardware go brrrr, as I do. It makes it all worth it when your loss drops from 11 to 3 overnight on a 430m parameter gpt model. :)

Re:Cerebras’ new monster AI chip adds 1.4T transistors by durst on Thursday April 22, 2021 @09:53PM (#26910235)
Thank you for the tips! Whenever I hear about new accelerators, my first question is: "how do people in the real world run fast code on this"? Because (related to your above points), you don't use an accelerator for things to just run, they have to run fast. Otherwise, you'd just use a CPU.

Detailed Question 1: do you have examples of fusion making things hard? Is there a way to nudge the compiler to not fuse or create a symbol table tracking fusion? Does fusion cause issues with the name_scopes?

Detailed Question 2: isn't Pytorch eager execution? Do you know how it compares to Tensorflow's eager execution?

General Request: I'm in a more theoretical position, writing papers on programming languages for accelerators https://aetherling.org/ and TAing courses on accelerators http://cs149.stanford.edu/fall20. So, I'm excited to see people's practical experiences using these accelerators in industry. It would be very enlightening (if you have time) to write up a comparison of tuning a model for an A100's tensor cores vs a TPU. This seems like the key trade-off in comparing architectures.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Thursday April 22, 2021 @11:27PM (#26910681)
I'd be interested in contributing to the course, if you need anything specific.

Here's a tensorboard URL that will probably stop working within a few days. http://bulma.tensorfork.com:31337/#profile

You can view the memory profiler by using the dropdown menus on the left. Here's a particularly chonky CrossReplicaSum: https://i.imgur.com/CcdJzLj.png

The game here is to keep that number at the top -- peak memory usage -- below 15GB. In practice, TPUv3-8's run out of memory at around 14.5GB, which immediately crashes (and hence you can't profile it). So we're always trying to get as close to 15GB as possible.

The first thing you immediately notice is that real-life training runs are very spiky. Different parts of the pipeline end up allocating wildly different amounts of memory. There's almost no such thing as a constant memory usage pipeline (which I was dismayed to discover).

In this profiling run, you can see that there's a big ass-spike at ~4000 on the X axis. The green bar marks the lifetime of the operation causing the highest peak memory usage. Different operations depend on each other, forming a chain of allocations. a + b takes 'a' and 'b' as inputs, and any temporary tensor reachable by either 'a' or 'b' cannot be freed until a + b is finished executing. Ditto for all other operations.

So you see, it's easy to accidentally build a "tower" of allocations, rather than a flat line. Thus, your total model parameter count is severely limited compared to what it could be, since in this situation the only way to reduce memory usage (without rewriting the code) is to scale down the model params.

Hovering over the big ass-orange allocation, we see that the shape is -- gosh, tensorboard is infuriating sometimes. I tried to copy-paste the shape, but whenever I move the mouse off of the allocation, the info on the left vanishes. Anyway, the shape is F32[32,2048,1,12608][1,3,0,2]. It means the cross replica sum is happening across TPU cores 1, 3, 0, and 2; it's a float32 sum; the batch size is 32; the hidden dimension is 2048, and the vocab dimension is 12,608. Since it's across four cores, multiply that dim by 4, and the total vocab size is 50,432, which is exactly right for a GPT model (https://nv-adlr.github.io/MegatronLM has details).

So right away, we can see that (a) the non-peak memory usage is around 4GB or so, and (b) the peak mem usage of the spike is around 12GB. That means if we eliminate the spike, we can scale up our model by more than 3x, if usage scales linearly. (Sometimes you get lucky and it's linear, other times something is superlinear. It's more or less linear in my experience.)

So how do we eliminate the spike? Heck if I know how the Google pros do it, but my way of doing it is to unstack along the batch dimension and perform each operation sequentially.

In other words, the total memory usage here is O(32 * 2048 * 12,608) which is quite hefty. By unstacking along the batch dimension, you get 32 tensors, each of size 2048 by 12,608. Therefore, if you do each operation sequentially, the temporary buffer is now O(2048 * 12,608), giving us a 32x savings.

Is this slower? Surprisingly, more often than not, it's as fast or faster. The reason is subtle: slowdowns occur due to memory bandwidth and network bandwidth. As long as the unstack is strictly a memory bandwidth effect, then it's just as fast, because you're trading CPU cycles for memory -- and you have tons of CPU cycles here, since it's a TPU core. (The TPU core utilization in our experience is always around 30%, and we've never seen it higher than 65%.) So you should always, always make this trade whenever possible.

Network traffic is trickier. This is a cross-replica sum, which means it's sending the tensors across the network to each TPU core. The TPU cores are connected via a high speed interconnect nexus thingie, but like all bottlenecks, this one has a limit. It's a very high limit, but it's not endless.

The only solution I've found is to think of an idea and then test that idea. Reasoning from first principles almost never works for me. I've seen others solve problems by reasoning from first principles, so it's possible that I'm simply stupid. But I find it's much more effective to try as many ideas as possible, as quickly as possible. You often end up surprised.

I'll type more stuff later if I feel like it, or you can ask more followup questions. Feel free to DM me on twitter if you'd like to chat in realtime sometime.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by zucker42 on Thursday April 22, 2021 @06:58PM (#26909137)
> The philosophy here seems to be “if we build it, they’ll buy it.”

Supposedly Cerebras is already profitable, so it's hardly a situation where they are building something and hoping people buy it eventually.

> That means you’re looking at two months of R&D minimum to get everything rewritten, running, tested, trained, and with an inferencing pipeline to generate samples.

Again, based on the companies representations, Cebebras transparently supports Pytorch and Tensorflow, only requiring a few lines of changed code.

Source: https://www.anandtech.com/show/16626/cerebras-unveils-wafer-... (Dr. Cutress's video on TechTechPotato is also good).

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Thursday April 22, 2021 @07:06PM (#26909211)
I’ve learned to be skeptical of such claims. TPUs made that same claim, but it’s hard to use it for real work, since you don’t have access to the 300GB TPU host memory / cpu, where you infeed training examples.

There is a very specific test for “supports pytorch / tendorflow”: show an MLPerf imagenet resnet benchmark. It’s impossible to fake that. If you come anywhere close to TPUs in tensorflow, people (like me) will leap: https://mlcommons.org/en/training-normal-06/

Till then, it’s a “proof, please” type of situation.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sanxiyn on Thursday April 22, 2021 @08:40PM (#26909806)
I agree.

I have high hope for Graphcore. They stated "We will be participating in MLPerf in 2021, starting with the first training submission in the spring".

https://www.graphcore.ai/posts/graphcore-sets-new-ai-perform...

(I would ignore all benchmarks in that post except the sentence quoted above however.)

Re:Cerebras’ new monster AI chip adds 1.4T transistors by algo_trader on Friday April 23, 2021 @08:46AM (#26914169)
Software will lag new hardware. Duh. The question is whether this is solvable (given a couple of master devs)

Cerebras itself commented that DL is not their first use case. They mentioned fluid dynamics instead. (I can find the reference if someone is interested).

Cerebras also has a weird memory/compute ratio, so very hard for some uses.

Somewhat off-topic. If u have standard keras/TF training code, the GPU to TPU is a smooth-ish transition. No?

A re-write will squeeze another 20% but not 200%?

Re:Cerebras’ new monster AI chip adds 1.4T transistors by oivey on Thursday April 22, 2021 @07:52PM (#26909532)
Graphics APIs and deep learning frameworks are really nothing alike. In graphics, save for a few new features, the goal every year is the same: draw more and faster. Deep learning is evolving much faster than that. The answer isn’t an API; it’s powerful and mostly transparent automatic differentiation. Anything that is just an API will forever be behind and is much less useful for active research. There are a few projects around improving AD support, but it’s a relatively difficult problem because to do it best you need deep compiler integration.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by sanxiyn on Thursday April 22, 2021 @08:32PM (#26909761)
The answer is an API, like NNAPI. AD is a frontend concern and doesn't really matter to accelerators.

For AD, I am bullish for Enzyme, which does AD on LLVM IR, avoiding deep compiler integration: https://enzyme.mit.edu/

Re:Cerebras’ new monster AI chip adds 1.4T transistors by oivey on Thursday April 22, 2021 @08:51PM (#26909885)
I would say that integrating AD at the level of LLVM IR is deep compiler integration. The AD has to consume IR and then emit more IR to actually take the derivatives. If you’re using a Python wrapper for this you’ll need codegen for interacting with the generated IR, too. The upside with that approach is that it might more easily work across languages. The downside is that LLVM IR can’t rely on the rich invariants that even C exposes, which makes codegen and optimization harder.

An API is always going to be necessarily behind state-of-the-art because often research depends on inventing things that don’t fit within an existing API.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sanxiyn on Thursday April 22, 2021 @08:59PM (#26909927)
I think we are talking past each other. sillysaurusx is talking about OpenGL/Direct3D as a portability layer for hardwares. API vs AD is not a hardware portability layer concern. The proposal is to standardize OpenGL/Direct3D-like hardware portability layer defined by API. API vs AD you are talking about happens far above that and it is irrelevant.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by oivey on Thursday April 22, 2021 @09:25PM (#26910088)
Today, things like PyTorch are AD systems, optimization systems, libraries of high performance interoperable common blocks, and more. This massive complexity is why there is no standard. If you have a compiler front end that can AD arbitrary code, then the framework no longer has to worry about that. If you have a compiler backend that can target multiple devices, then the framework doesn’t have to do that, either. The size and complexity of PyTorch/TensorFlow is exactly why there isn’t a standard hardware portable NN API. A sane API of hardware independent common blocks can’t happen without all the front and backend compiler stuff first.

A PyTorch/TensorFlow-like API is always going to be massive, complicated, and hard to port to new hardware targets. Additionally, the complexity and reliance on C alone will make integrating exotic new concepts like say, differential equation solvers, extremely laborious.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by justaguy88 on Thursday April 22, 2021 @08:04PM (#26909592)
You might like this talk that describes parts of the compiler ecosystem that are lacking standardization for accelerators

https://www.youtube.com/watch?v=4HgShra-KnY

Re:Cerebras’ new monster AI chip adds 1.4T transistors by whimsicalism on Thursday April 22, 2021 @06:42PM (#26909017)
I'm on board with you that there should be a "drop-in" cross support of these chips, but pytorch is at a way higher abstraction level than what should be commonly supported.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by jquery on Thursday April 22, 2021 @08:54PM (#26909902)
> We had a similar situation in gamedev circa 2003-2009. Practically every year there was a new GPU, which boasted similar architectural improvements.

You mean one of the most rapid periods of graphical improvement in history? Growth was just too breakneck to standardize for a bit.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by MaxBarraclough on Friday April 23, 2021 @10:51AM (#26915296)
sillysaurusx's comment goes on to acknowledge that the major graphics libraries (OpenGL and Direct3D) did a pretty good job of abstracting away/indirecting away the architectural changes. As you indicate, the architectural changes were made for good reason, and translated to real improvements in performance/capabilities.

If AI acceleration chips aren't able to offer similar API standardisation/stability then it's not the same as what happened with GPUs, which was sillysaurusx's point.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by de6u99er on Thursday April 22, 2021 @08:47PM (#26909853)
Thr Anandtech article from a other comment here indicates that both PyTorch and Tensorflow are already running on it.

>A key to the design is the custom graph compiler, that takes pyTorch or TensorFlow and maps each layer to a physical part of the chip, allowing for asynchronous compute as the data flows through.

https://www.anandtech.com/show/16626/cerebras-unveils-wafer-...

Re:Cerebras’ new monster AI chip adds 1.4T transistors by londons_explore on Friday April 23, 2021 @07:11AM (#26913459)
> That means you’re looking at two months of R&D minimum to get everything rewritten,

For a hobbiest, sure, that's a problem.

But for a big company with a big ML research team already, that isn't an issue - they just assign a few people to work on it, and in a few months it's done. If you're running any model at scale anyway you probably want to rewrite everything to make it run efficiently on your hardware.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by docfort on Thursday April 22, 2021 @10:23PM (#26910382)
You might be interested in this for your M1 MBA: https://github.com/apple/tensorflow_macos
Re:Cerebras’ new monster AI chip adds 1.4T transistors by sillysaurusx on Thursday April 22, 2021 @10:43PM (#26910493)
That was actually what I was referring to! It's super weird. I like it, and it's what I use primarily, but only because no other version of tensorflow will install.

Their compiler is closed source, so it's almost impossible to tell what's going on. But, when I connect using tf.Session(), then .list_devices() shows only CPU available.

However, when I enable the TF_MLC_LOGGING=1 magic variable, it does seem to be printing out messages that indicates it's doing some kind of graph substitution under the hood. Therefore, I assume that this is the intended usage mode.

In other words, there seems to be zero difference between the "CPU" and the "GPU". Normally you can say "Do this on the CPU" while "do that on the GPU." But not with this.

Hopefully they'll open source the code sometime this century so that it's clearer what the heck it's doing. For now, though, it's reasonably fast in whatever this "CPU" mode is -- I only need to run unit tests on my laptop anyway, since all training happens on TPUs. So I ended up happy.

(For the first day or so, I was panicking that I was going to have no working tensorflow whatsoever on my M1 laptop, which would've necessitated a swift return + substitution.)

Re:Cerebras’ new monster AI chip adds 1.4T transistors by buildbot on Thursday April 22, 2021 @11:51PM (#26910807)
That seems very apple honestly, they’d rather you emit pure metal primitives (is that the right term? Idk) and then let their backend schedule on their soc- because for all we know, they have some special asic ip that they added/or will add and can take advantage.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by markonen on Friday April 23, 2021 @06:41AM (#26913239)
With the disclaimer that I know nothing about this: doesn't the M1 have a separate "Neural Engine" for this? So it's using neither the CPU nor the GPU cores for TensorFlow?
Re:Cerebras’ new monster AI chip adds 1.4T transistors by zitterbewegung on Thursday April 22, 2021 @07:24PM (#26909333)
I think apple expects you to use pretrained models and convert them to CoreML.

There is also webGPU which is experimental on Safari and Chrome. But that doesn’t touch the ML accelerators on the M1.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by sanxiyn on Thursday April 22, 2021 @08:26PM (#26909715)
> What we need is a unified API that can easily support multiple backends

Android standardized NNAPI and on-device inference is in pretty good shape. As you said, training is different matter.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by fromaj on Friday April 23, 2021 @03:34AM (#26912073)
But they do have PyTorch support??? They ship a 'cerebras graph compiler' extension for pytorch that allows you to replace the default optimizer with theirs.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by habibur on Thursday April 22, 2021 @07:00PM (#26909155)
So we are looking for OpenCUDA for AI. Like OpenGL in the 90s.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by DesiLurker on Thursday April 22, 2021 @09:24PM (#26910077)
So basically OpenCL?
Re:Cerebras’ new monster AI chip adds 1.4T transistors by byronyi on Friday April 23, 2021 @05:03AM (#26912609)
I'd bet on SPIR-V.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by dmingod666 on Thursday April 22, 2021 @11:19PM (#26910659)
If you look at it historically and put it in scale with the AI winter, 2 months is next to nothing..
Re:Cerebras’ new monster AI chip adds 1.4T transistors by TFortunato on Thursday April 22, 2021 @09:41PM (#26910167)
The article mentions that developers use standard PyTorch and Tensorflow.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by socialdemocrat on Thursday April 22, 2021 @06:47PM (#26909050)
Maybe people will get to their senses and switch to Julia instead of having to waste all these time on Python bindings.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by habibur on Thursday April 22, 2021 @06:58PM (#26909133)
Python here basically works as a binder for C, which is what everything is written in.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by eigenspace on Thursday April 22, 2021 @07:12PM (#26909250)
That is in fact the problem, yes.
Re:Cerebras’ new monster AI chip adds 1.4T transistors by dnautics on Friday April 23, 2021 @02:02AM (#26911421)
Honestly I think julia missed the boat. There was an opportunity for julia to treat the gpu as an abstract distributed node (which is a first class concept in julia) and pay respect to the reality of data gravity. But they chose to instead basically treat the gpu as a synchronous entity.

I'm now bullish on elixir-nx because I think there's an outside shot they will get it right.

Python is a lost cause.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by BadInformatics on Friday April 23, 2021 @06:55PM (#26920200)
I'm not sure that's necessarily the domain of a low-level package like CUDA.jl though (which I assume you're referring to). That kind of interface is more the domain of higher-level packages like https://github.com/JuliaGPU/DaggerGPU.jl and to a lesser extent https://juliagpu.github.io/KernelAbstractions.jl/stable/. Moreover, the jury is still out on whether the built-in Distributed module is an ideal abstraction for every use-case (clusters, heterogeneous compute, etc.)

WRT Nx, my biggest question is how they'll crack the problem of still needing big balls of C++ and the shims everywhere to get acceleration. Creating a compiler that generates efficient GPU or other accelerator code is a massive research project with no clear winners, never mind the challenge of reconciling the very mutation-heavy needs of GPU compute with a mostly immutable language model.

Re:Cerebras’ new monster AI chip adds 1.4T transistors by dnautics on Friday April 23, 2021 @08:10PM (#26920786)
There's plenty of mutability escape hatches in the erlang vm, and basically everyone who works in the language long enough is familiar with the idea of holding on to an immutable reference to a mutable thing. Like a database connection. Or a connection to a remote microservice. Or an ETS table.