Video yükleniyor...

Video Yüklenemedi

Ana Sayfaya Dön

I wrote a blog post about my own Python tensor compiler library called TensorFrost that I've been working on for the last 14 months! As a sneak peak here is the last pet project that I've made using it - an implementation of Neural Cellular Automata:

11,989 görüntüleme • 1 yıl önce •via X (Twitter)

10 Yorum

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

The library is my attempt of making a PyTorch-like library which is more shader-code friendly. This required better kernel fusion and control-flow over tensors. For example, in the same program you can write a software rasterizer like in a shader, or write tensor operations.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Another aspect I wanted the library to have was real-time visualization and interactivity. So I integrated GLFW+ImGUI into it. With these I could write an interactive fractal path tracer in Python, without any explicitly defined kernels, as a bonus using autodiff for SDF normals

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

I've also implemented a basic PyTorch-like module system with built-in optimizer submodules, so I can for example easily implement and train a MNIST classifier and with a real-time drawing demo on top.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

There are lot of other examples, like a real-time N-body gravitational SPH with a custom software sphere rasterizer all written in TensorFrost.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Or an interactive 2D fluid simulation with a basic multigrid pressure solver and RK4 + bicubic advection.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Or a neural texture embedder.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

You can try out these and other examples in Installing the library should be an easy `pip install tensorfrost` and that's it. Tho I've only tested it on Nvidia + Windows/Linux, so I expect it to be still broken in a lot of cases.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

Right now the library is in more of a prototype state, and a lot of features you'd expect from PyTorch are missing, including lots of tensor operations and missing backends like CUDA. Not even mentioning compiler bugs. So don't expect too much out of it at the moment.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

On that note, any help would be welcome, this project is a bit too much for me to chew through, and I'm not even a compiler specialist, so I have no clue if what I'm doing is even good or not.

Mykhailo Moroz profil fotoğrafı
Mykhailo Moroz1 yıl önce

There is still a lot of work to do, especially with making it easier to write shader-like code. Right now I need to implement my own vec3 class in Python to emulate vectors, while ideally I'd just want to use tensors of shape [..., 3] instead, with all the nice features it gives

Benzer Videolar