Stable Diffusion
Stable Diffusion running on "Mandelbrot"

Stable Diffusion

I've been slowly getting the various "popular" or "flavour of the month" AI things up and running on our Graphcore systems. This week I got LLAMA 2 running which was surprisingly easy, although in the process I've determined that the issues I had with making a "Dolly" based chatbot work on the system earlier were defintely due to a clash between langchain and the way Graphcore's own pipelines work (one to play with in more detail later).

On Wednesday I decided to try Stable Diffusion. Stable Diffusion is of course controversial for all sorts of reasons - the potential for people to use it instead of paying artists, the extremely fuzzy situation on copyright (eventually it may not be legally fuzzy but I'd argue it's at best morally fuzzy) - and the fact that it and related tools are being used by extremely weird and unpleasant people to generate adult content of non-consenting people - but the goal here is merely to prove that it works on this platform and move on.

And yes, it works. I had to do some fiddling with library versions on our system, probably because we have newer versions of Poplar than the examples were written with.

I also decided to try a version of Stable Diffusion (1.4) that was not in the examples.

I discovered a couple of interesting things.

The first is that Stable Diffusion 1.4 and 1.5 seem to be "better" than 2.0 on the same prompt and settings. In order to trigger a "graph compile" step (which you only have to do once), the examples tell the model to generate an image for the prompt "apple".


"apple" - Stable Diffusion 1.4


"apple" - Stable Diffusion 1.5



"apple" - Stable Diffusion 2.0

Now, obviously this particular fruit is poisoned by the company existing, but many times the older models generated actual fruit. 2.0 basically never did. There's also a big style difference going on. Overwhelmingly, the output of 2.0 is more cartoonish, looks more like (dare I say it) the output of previous image generative models. I gave all three models the same prompt "an Atlas battlemech from the battletech universe liberating an alien city, oil paint". They all did not know enough to draw the correct mech, however, it was clear that the style of 2.0's output was much worse:


Stable Diffusion 1.4



Stable Diffusion 1.5


Stable Diffusion 2.0

(note that in all of the above I generated 12 images and picked the best one)

What is going on here? Is the actually worse? One friend on twitter suggested that later versions had "copyright problematic" material pulled from the training set, which is possible.

The other thing I discovered quite by accident (the issues with the wrong libraries) is that inference of Stable Diffusion is perfectly fine on CPU as long as you have a fairly beefy CPU - it takes 30 seconds or so on 96 cores of AMD Zen2 and about 2 minutes on 36 cores of Intel Cascade Lake Xeon.

For comparison, once the initial graph compilation has happened, it takes less than a second on 8 of the IPUs in our Pod16.



要查看或添加评论,请登录

Owain Kenway的更多文章

  • The 3B2 is small, grey and lumpish and possibly the oddest computer in the Unixverse...

    The 3B2 is small, grey and lumpish and possibly the oddest computer in the Unixverse...

    Long term readers will know that I'm really into old and weird computers, both hardware and operating systems - I have…

    6 条评论
  • What I did on my holidays by Owain aged 42.

    What I did on my holidays by Owain aged 42.

    Last week, I had a great victory in the war against my personal demons, when I actually successfully attended ISC ‘24…

    15 条评论
  • The Language Problem

    The Language Problem

    In the second half of the 2010s I became really obsessed with Lisp. I presume this happens to most computer-sciency…

    6 条评论
  • Nvidia GPU support on AlmaLinux

    Nvidia GPU support on AlmaLinux

    All of us who are in the "Enterprise Linux" space have been dealing with the fallout in how Redhat feeds back to the…

    2 条评论
  • The Department of Applied Computer Science

    The Department of Applied Computer Science

    Occasionally, as one is wont to do, someone asks what I want my career path to be. I think the natural path is of…

    16 条评论
  • Vindicator

    Vindicator

    A while back I posted that we had received an exciting delivery in our London datacentre - our LinuxOne test system…

    22 条评论
  • Living with mental illness.

    Living with mental illness.

    One of the things that can be difficult to explain is it’s never really one thing that’s making your mood low for a…

    2 条评论
  • Cross pollination

    Cross pollination

    I attended a LinuxONE event yesterday, mostly because I've always been interested in the architecture and evaluating it…

    3 条评论
  • As you may know, I have mental health problems.

    As you may know, I have mental health problems.

    Introduction Well, this is going to be challenging to write. I like to keep my LinkedIn professional, a contrast to…

    23 条评论
  • It’s a dinosaur, but like the dinosaurs, it’s perfectly suited to its environment.

    It’s a dinosaur, but like the dinosaurs, it’s perfectly suited to its environment.

    Those who know me will know I have opinions. They will know that I work in academic HPC, a field there there is…

    6 条评论

社区洞察

其他会员也浏览了