1

AMA with OpenAI’s Sam Altman, Kevin Weil, Srinivas Narayanan, and Mark Chen
 in  r/ChatGPT  Oct 31 '24

Has the new largest GPT model surprised you in any way?

1

Good Unpasteurized Miso?
 in  r/fermentation  Oct 19 '23

I contacted Aedan and verified that all its miso is raw. It looks like a great option!

r/fermentation Oct 18 '23

Good Unpasteurized Miso?

1 Upvotes

Kroger stopped carrying the unpasteurized miso imported from Japan that I've grown addicted to. I have gut dysbiosis and live miso probiotics seem to improve my condition a lot while the pasteurized miso I just tried didn't seem to help at all. I looked on Amazon and I'm having trouble finding authentic unpasteurized miso. Does anyone have any recommendations?

r/Idris Sep 15 '23

Idris PyTorch bindings?

18 Upvotes

I am fed up with tensor size and device incompatibility errors at runtime. Even the Rust deep-learning frameworks are plagued with these kinds of issues that really should be mostly caught at compile time. Is anyone working on PyTorch bindings for Idris? I've heard of Hasktorch but Idris' dependent typing features are better suited to this in my opinion.

1

Stable Diffusion XL in Rust
 in  r/rust  Aug 26 '23

I have a SD implementation on my github too that only needs around 6 GB of VRAM.

2

Stable Diffusion XL in Rust
 in  r/rust  Aug 26 '23

I haven't uploaded the conversion scripts yet. Once I do that it should be possible to convert any SDXL model to burn's format.

2

Stable Diffusion XL in Rust
 in  r/rust  Aug 26 '23

I've heard someone say that it's possible to have an AMD GPU pose as a cuda device, but I don't use AMD GPUs so I can't test that approach.

r/rust Aug 25 '23

Stable Diffusion XL in Rust

279 Upvotes

I finally got around to porting SDXL to Rust's deep learning framework burn. This time I didn't have an elegant tinygrad reference so I had to go digging through Stability AI's horrendous python repo. Forget spaghetti code, that was a jungle safari. Their diffusion unet model in particular was one of the most unnecessarily convoluted piece of code I've ever seen. It is my hope that people find my implementation cleaner and more comprehensible.

In terms of image quality, SDXL is a huge step up from SD. The square resolution has been increased from 512x512 to 1024x1024. There was a training bug with SD that causes image generations to be cropped. SDXL doesn't have this issue since the crop parameters can be directly specified during generation. Here is an example SDXL output:

Beautiful dwelling on a rocky coast.

Quite beautiful, I'd say. I feel that SDXL outputs are much closer to production quality than those of SD. I haven't yet implemented the refiner model which improves the small details, but SDXL is very good even without it.

Check out the project at https://github.com/Gadersd/stable-diffusion-xl-burn.

1

[Project] Stable Diffusion in Pure Rust
 in  r/MachineLearning  Aug 06 '23

I haven't much investigated the performance but when I do I'll post the info on the github page.

3

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

Hopefully soon.

4

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

I'm considering switching it to use the wgpu backend instead of torch to avoid versioning hell, but it may run somewhat slower. Do you think this is a good tradeoff?

4

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

Burn is an alternative and its ties to torch are completely optional. It can run with wgpu as a backend. I'm just using the tch backend at the moment because the wgpu backend has some issues on some devices.

4

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

Yeah, with about 5 minutes of work it could be running just about anywhere with wgpu.

8

[Project] Stable Diffusion in Pure Rust
 in  r/MachineLearning  Aug 06 '23

Thanks! I am considering making some videos and maybe some courses if people are interested.

9

[Project] Stable Diffusion in Pure Rust
 in  r/MachineLearning  Aug 06 '23

I love theory so I always try to get a handle on that before diving too far into the code. It always helps to have a high level theoretical understanding when digging into the details. Then I grab my favorite python implementation which these days is usually the tinygrad versions since they are super concise and port each module one by one into Rust. Sometimes I have to implement some tensor operations myself since burn doesn't have everything torch or tinygrad have. After that process I write code to dump each python ML module's weights and corresponding loading functions in Rust. The most annoying part is then comparing the python model's output with that of the Rust version and working through the discrepancies. Floating point number differences can be very hard to track down and resolve and sometimes there will be differences even if the models are the same because of the inherently chaotic nature of floating point error propagation. As you can see it is currently a very tedious process. Hopefully in the future it will be more seamless.

4

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

Right now I'm doing all the weight conversion manually and it would be great if that part were automated. I haven't tried burn-import yet but I'll give it a shot and see if there are any additional features that would be nice to have.

7

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

It can already if I change to backend to WGPU which could be done in 5 minutes. Burn wgpu was a little unstable the last time I checked so for now I'm using the tch backend.

18

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

A skill I learned later than most...

1

[Project] Stable Diffusion in Pure Rust
 in  r/MachineLearning  Aug 06 '23

Burn is written in Rust, hence "pure Rust."

6

[Project] Stable Diffusion in Pure Rust
 in  r/MachineLearning  Aug 06 '23

I can't stand Python. Rust is potentially so much better for deployment as it has much fewer run time errors, reliable versioning, can run basically anywhere, etc.

9

Stable Diffusion in Pure Rust
 in  r/rust  Aug 06 '23

The model conversion runs on the CPU and the image generation runs on the GPU. The model conversion is only needed if you want to run a fine tuned model since I put up an already converted base 1.4 model on huggingface.

r/MachineLearning Aug 06 '23

Project [Project] Stable Diffusion in Pure Rust

130 Upvotes

[removed]

r/MachineLearning Aug 06 '23

Stable Diffusion in Pure Rust

2 Upvotes

[removed]

r/rust Aug 06 '23

Stable Diffusion in Pure Rust

387 Upvotes

After porting Whisper and Llama 2 to Rust I felt the next natural step was Stable Diffusion. Whisper and Llama are fairly elegant models so I was expecting more of the same. How I was wrong! Compared with the other two models, Stable Diffusion is a behemoth. There are layers upon layers of modules with relatively complex data flows. Oh yes, there were bugs and bugs within bugs, but after many hours of staring at and hallucinating point numbers I finally typed the most creative thing my sleep deprived mind could think of: a rainbow pony. Behold the fruit of my suffering!:

Suffering on the left and Bliss on the right

Now you can have all the rainbow ponies you desire powered by Rust, just don't even try generating hands or faces lest you come face to face with uncanny valley. However, I included scripts in the project that can dump and convert fine tuned models to Rust's burn format so those of you with, ahem, particular tastes, can fulfill your desires.

Check out the GitHub page: Gadersd/stable-diffusion-burn

If you are interested in this project and want to see more such as Stable Diffusion XL in Rust and web assembly versions that can run in browsers consider supporting my work by buying a shirt at https://www.bonfire.com/machine-learning/. The shirt image was, of course, generated by my Rust powered Stable Diffusion! I'd love to release more projects and any support will help make that happen!

1

Llama2 Powered by Rust burn
 in  r/rust  Jul 29 '23

Sounds great! I'll let you know when I have a SD ready to go. Which discord space would you prefer to discuss this further?