Close Menu
geekfence.comgeekfence.com
    What's Hot

    BT outlines mobile video pilots with Meta

    May 30, 2026

    Posit AI Blog: torch 0.9.0

    May 30, 2026

    For AI, Context Isn’t Optional: What Data and Analytics Leaders are Saying

    May 30, 2026
    Facebook X (Twitter) Instagram
    • About Us
    • Contact Us
    Facebook Instagram
    geekfence.comgeekfence.com
    • Home
    • UK Tech News
    • AI
    • Big Data
    • Cyber Security
      • Cloud Computing
      • iOS Development
    • IoT
    • Mobile
    • Software
      • Software Development
      • Software Engineering
    • Technology
      • Green Technology
      • Nanotechnology
    • Telecom
    geekfence.comgeekfence.com
    Home»Artificial Intelligence»Posit AI Blog: torch 0.9.0
    Artificial Intelligence

    Posit AI Blog: torch 0.9.0

    AdminBy AdminMay 30, 2026No Comments4 Mins Read0 Views
    Facebook Twitter Pinterest LinkedIn Telegram Tumblr Email
    Posit AI Blog: torch 0.9.0
    Share
    Facebook Twitter LinkedIn Pinterest Email


    We are happy to announce that torch v0.9.0 is now on CRAN. This version adds support for ARM systems running macOS, and brings significant performance improvements. This release also includes many smaller bug fixes and features. The full changelog can be found here.

    Performance improvements

    torch for R uses LibTorch as its backend. This is the same library that powers PyTorch – meaning that we should see very similar performance when
    comparing programs.

    However, torch has a very different design, compared to other machine learning libraries wrapping C++ code bases (e.g’, xgboost). There, the overhead is insignificant because there’s only a few R function calls before we start training the model; the whole training then happens without ever leaving C++. In torch, C++ functions are wrapped at the operation level. And since a model consists of multiple calls to operators, this can render the R function call overhead more substantial.

    We have established a set of benchmarks, each trying to identify performance bottlenecks in specific torch features. In some of the benchmarks we were able to make the new version up to 250x faster than the last CRAN version. In Figure 1 we can see the relative performance of torch v0.9.0 and torch v0.8.1 in each of the benchmarks running on the CUDA device:


    Relative performance of v0.8.1 vs v0.9.0 on the CUDA device. Relative performance is measured by (new_time/old_time)^-1.

    Figure 1: Relative performance of v0.8.1 vs v0.9.0 on the CUDA device. Relative performance is measured by (new_time/old_time)^-1.

    The main source of performance improvements on the GPU is due to better memory
    management, by avoiding unnecessary calls to the R garbage collector. See more details in
    the ‘Memory management’ article in the torch documentation.

    On the CPU device we have less expressive results, even though some of the benchmarks
    are 25x faster with v0.9.0. On CPU, the main bottleneck for performance that has been
    solved is the use of a new thread for each backward call. We now use a thread pool, making the backward and optim benchmarks almost 25x faster for some batch sizes.


    Relative performance of v0.8.1 vs v0.9.0 on the CPU device. Relative performance is measured by (new_time/old_time)^-1.

    Figure 2: Relative performance of v0.8.1 vs v0.9.0 on the CPU device. Relative performance is measured by (new_time/old_time)^-1.

    The benchmark code is fully available for reproducibility. Although this release brings
    significant improvements in torch for R performance, we will continue working on this topic, and hope to further improve results in the next releases.

    Support for Apple Silicon

    torch v0.9.0 can now run natively on devices equipped with Apple Silicon. When
    installing torch from a ARM R build, torch will automatically download the pre-built
    LibTorch binaries that target this platform.

    Additionally you can now run torch operations on your Mac GPU. This feature is
    implemented in LibTorch through the Metal Performance Shaders API, meaning that it
    supports both Mac devices equipped with AMD GPU’s and those with Apple Silicon chips. So far, it
    has only been tested on Apple Silicon devices. Don’t hesitate to open an issue if you
    have problems testing this feature.

    In order to use the macOS GPU, you need to place tensors on the MPS device. Then,
    operations on those tensors will happen on the GPU. For example:

    x <- torch_randn(100, 100, device="mps")
    torch_mm(x, x)

    If you are using nn_modules you also need to move the module to the MPS device,
    using the $to(device="mps") method.

    Note that this feature is in beta as
    of this blog post, and you might find operations that are not yet implemented on the
    GPU. In this case, you might need to set the environment variable PYTORCH_ENABLE_MPS_FALLBACK=1, so torch automatically uses the CPU as a fallback for
    that operation.

    Other

    Many other small changes have been added in this release, including:

    • Update to LibTorch v1.12.1
    • Added torch_serialize() to allow creating a raw vector from torch objects.
    • torch_movedim() and $movedim() are now both 1-based indexed.

    Read the full changelog available here.

    Enjoy this blog? Get notified of new posts by email:

    Posts also available at r-bloggers

    Reuse

    Text and figures are licensed under Creative Commons Attribution CC BY 4.0. The figures that have been reused from other sources don’t fall under this license and can be recognized by a note in their caption: “Figure from …”.

    Citation

    For attribution, please cite this work as

    Falbel (2022, Oct. 25). Posit AI Blog: torch 0.9.0. Retrieved from 

    BibTeX citation

    @misc{torch-0-9-0,
      author = {Falbel, Daniel},
      title = {Posit AI Blog: torch 0.9.0},
      url = {},
      year = {2022}
    }



    Source link

    Share. Facebook Twitter Pinterest LinkedIn Tumblr Email

    Related Posts

    The Download: unlocking lithium and controlling Ebola

    May 29, 2026

    Your AI Agent Already Forgot Half of What You Told It – O’Reilly

    May 28, 2026

    From Nature publication to catalyzing Computational Discovery

    May 27, 2026

    From potential to opportunity: How Microsoft and YES are reshaping South Africa’s digital future

    May 26, 2026

    Technology usually creates jobs for young, skilled workers. Will AI do the same? | MIT News

    May 25, 2026

    Building Context-Aware Search in Python with LLM Embeddings + Metadata

    May 24, 2026
    Top Posts

    Understanding U-Net Architecture in Deep Learning

    November 25, 202546 Views

    Hard-braking events as indicators of road segment crash risk

    January 14, 202630 Views

    Redefining AI efficiency with extreme compression

    March 25, 202627 Views
    Don't Miss

    BT outlines mobile video pilots with Meta

    May 30, 2026

    Press Release When we watch videos on our phones, we expect them to load instantly…

    Posit AI Blog: torch 0.9.0

    May 30, 2026

    For AI, Context Isn’t Optional: What Data and Analytics Leaders are Saying

    May 30, 2026

    Netherlands Seizes 800 Servers, Arrests 2 for Aiding Cyberattacks – Krebs on Security

    May 30, 2026
    Stay In Touch
    • Facebook
    • Instagram
    About Us

    At GeekFence, we are a team of tech-enthusiasts, industry watchers and content creators who believe that technology isn’t just about gadgets—it’s about how innovation transforms our lives, work and society. We’ve come together to build a place where readers, thinkers and industry insiders can converge to explore what’s next in tech.

    Our Picks

    BT outlines mobile video pilots with Meta

    May 30, 2026

    Posit AI Blog: torch 0.9.0

    May 30, 2026

    Subscribe to Updates

    Please enable JavaScript in your browser to complete this form.
    Loading
    • About Us
    • Contact Us
    • Disclaimer
    • Privacy Policy
    • Terms and Conditions
    © 2026 Geekfence.All Rigt Reserved.

    Type above and press Enter to search. Press Esc to cancel.