Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Why Rust Is the Optimal Choice for Deep Learning, and How to Start Your Journey with the Burn Deep Learning Framework

Posted on Sep 7 The comprehensive, open-source Deep Learning framework in Rust, Burn, has recently undergone significant advancements in its latest release, highlighted by the addition of The Burn Book 🔥. There has never been a better moment to embark on your deep learning journey with Rust, as this book will guide you through your initial project, providing extensive explanations and links to relevant resources.Whether you're a newcomer to deep learning or have experience with frameworks like PyTorch, transitioning to Burn promises to spare you numerous headaches, both when initially learning the tool and when the time will come to deploy your models in the near future.It would be unwise to overlook how much the Python programming language and its ecosystem have helped deep learning grow as it did. Its high-level abstractions and low barrier of entry have assisted researchers in developing their ideas quickly, disregarding implementation and performance details that can often slow things down.Today, the field of deep learning is full of extremely complex models, relying on gigantic computations. While Python is practical for prototyping, alone, it is too slow to handle such workloads. The mainstream solution has been, to this day, to rely on bindings to low-level programming languages such as C/C++.This solution has certainly proved its worth, as the most widespread active model today, ChatGPT, was programmed exactly that way. However, this divides the deep learning ecosystems into two parties: researchers and optimization engineers, both working in two separate worlds with a small interface. While any high-level language is too slow for such computations, low-level languages are too detail-sensitive to be used for such complex tasks.Enter Rust 🦀.Its approach to abstractions makes it versatile enough to tackle this dichotomy. Indeed, thanks to the borrow-checker, which prevents the programmer from using a variable without explicitly stating if it can be changed or just looked at, Rust is able to provide high-level abstractions for concurrent programming and memory safety guarantees without incurring any runtime overhead.Rust also comes with the Cargo package manager, which makes it incredibly easy to build, test, and deploy. The latter is usually painstaking in a Python environment.A word on the difficulty of learning Rust: It is commonly stated that Rust is hard to learn, but that its compiler can save you from encountering obscure bugs in the long run. It is true that, compared to other languages, it might take longer in the beginning to get your code to compile, often because of the aforementioned borrow-checker. Although this and other mechanics may feel like complications at first, they result in the programmer dialoguing with the compiler to converge on a solution that, once it compiles, the programmer can almost trust blindfolded. One example of the borrow-checker being useful in deep learning is for tensor manipulations, such as determining whether an operation should be done in place or not. Rust abstractions can also be used to encapsulate backend computations, enabling them to run efficiently on any machine. With the capacity to delve deep into low-level computations while maintaining high-level abstractions, Rust has everything it takes to become the go-to language for deep learning.These are some motivations that led to the creation of Burn. This deep learning framework leverages Rust's advantages, with an innovative flexible architecture, to be used from training to inference and from prototyping to deployment. It represents a novel approach, placing significant emphasis on making well-considered design decisions to support exceptional flexibility, increased performance, and an outstanding developer experience.Burn is incredibly easy to use, even to those not yet well-acquainted with Rust. Now equipped with its comprehensive book, it should be very easy to jump from the messy Python / (C/C++) dichotomy present in frameworks such as TensorFlow and PyTorch, to the harmonized, Rusty vision of Burn.The Burn Book 🔥 starts with a presentation of a basic workflow that will lead you from training a model to deploying it for inference. It is a short 5-page read, filled with code snippets, that should be enough to start using Burn in the most typical deep learning scenarios.As for the subsequent sections, they delve into the details of everything that one would expect from a deep learning library (modules, tensors, learning algorithms and metrics, compatibility with other deep learning ecosystems...) and, especially, what sets Burn apart from other frameworks. Take, for example, the Backend trait, which allows flexibility over different low-level implementations, for optimal computations depending on your machine. Or the backend extensions, which are decorators over the backend trait, the most remarkable being the Autodifferentiation backend, which automatically enables the autodiff functionality on any chosen backend.With the addition of the book, which simplifies the onboarding process, Burn is now unquestionably the main entry point to the field of deep learning in Rust, which promises to be the language of the next generation of deep learning. Templates let you quickly answer FAQs or store snippets for re-use.Awesome post! Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink. Hide child comments as well Confirm For further actions, you may consider blocking this person and/or reporting abuse Kiran Krishnan - Sep 1 Arik - Aug 25 Gianluca - Aug 21 Bradley Schofield - Aug 31 Once suspended, louisfd will not be able to comment or publish posts until their suspension is removed. Once unsuspended, louisfd will be able to comment and publish posts again. Once unpublished, all posts by louisfd will become hidden and only accessible to themselves. If louisfd is not suspended, they can still re-publish their posts from their dashboard. Note: Once unpublished, this post will become invisible to the public and only accessible to Louis Fortier-Dubois. They can still re-publish the post if they are not suspended. Thanks for keeping DEV Community safe. Here is what you can do to flag louisfd: louisfd consistently posts content that violates DEV Community's code of conduct because it is harassing, offensive or spammy. Unflagging louisfd will restore default visibility to their posts. DEV Community — A constructive and inclusive social network for software developers. With you every step of your journey. Built on Forem — the open source software that powers DEV and other inclusive communities.Made with love and Ruby on Rails. DEV Community © 2016 - 2023. We're a place where coders share, stay up-to-date and grow their careers.



This post first appeared on VedVyas Articles, please read the originial post: here

Share the post

Why Rust Is the Optimal Choice for Deep Learning, and How to Start Your Journey with the Burn Deep Learning Framework

×

Subscribe to Vedvyas Articles

Get updates delivered right to your inbox!

Thank you for your subscription

×