Jump to content
  • Microsoft brings native PyTorch Arm support to Windows devices


    Karlston

    • 139 views
    • 4 minutes
     Share


    • 139 views
    • 4 minutes

    Just weeks after bringing Windows on Arm runner support to GitHub, which makes it easier for developers to build and test software for Arm natively, Microsoft has announced another significant development for those targeting Arm-powered devices running Windows. Native builds of PyTorch are now officially available for Windows on Arm.

     

    If you haven’t heard of it, PyTorch is a go-to open-source machine learning framework that a lot of researchers and developers use to build and train deep neural networks. Before now, getting it to run on Windows devices with Arm chips was a pain since you had to compile the whole thing from source yourself, which takes time and is not beginner-friendly.

     

    With the release of PyTorch 2.7, native Arm builds for Windows on Arm are now readily available for Python 3.12. This means developers can simply install PyTorch using a standard package manager like pip.

     

    According to Microsoft:

     

    This unlocks the potential to leverage the full performance of Arm64 architecture on Windows devices, like Copilot+ PCs, for machine learning experimentation, providing a robust platform for developers and researchers to innovate and refine their models.

    The availability of these native builds is expected to boost local development, training, and testing of machine learning models directly on Arm-powered Windows machines. Microsoft specifically mentioned use cases such as image classification, natural language processing, and generative AI like Stable Diffusion.

     

    To get started with the native PyTorch binaries on Windows on Arm, developers first need to ensure they have a few key prerequisites installed. This includes obtaining specific components from Visual Studio Build Tools or a full Visual Studio installation.

     

    Specifically, you will need the Desktop development with C++ workload and make sure the VS 2022 C++ ARM64/ARM64EC build tools (latest) are selected within the installer.

     

    Visual Studio Installer Project Selection

     

    You also need to install Rust and, of course, have Python 3.12 (the Arm64 version) installed on your system. Once those are in place, installing the stable PyTorch build via pip is a straightforward command pointing to the correct download index:

    pip install --extra-index-url https://download.pytorch.org/whl torch
    

    If you are interested in trying out the latest features and are comfortable with less stable builds, you can also install the Nightly or Preview version using this command:

    pip install --pre torch --index-url https://download.pytorch.org/whl/nightly/cpu
    

    Beyond the Python package, native builds for LibTorch, PyTorch's C++ front-end often used for deployment scenarios, are also available. The getting started and installation guide for LibTorch can be accessed directly on PyTorch's website. As is good practice for any Python development, Microsoft also recommends creating a Virtual Environment (venv) for your projects to manage dependencies cleanly and avoid conflicts between different project requirements.

     

    Microsoft also provided an example of using the native PyTorch binaries for Stable Diffusion on Windows on Arm, demonstrating how developers can build applications leveraging generative AI. If you're interested, you can find the code in this GitHub repo.

     

    It is worth noting that while PyTorch and LibTorch themselves now have native binaries for Windows on Arm, the story is not always so complete for every single dependency you might need. Some additional Python packages developers might use alongside PyTorch, especially those with performance-sensitive code often written in C, C++, or Rust, may not yet have pre-compiled native Arm64 .whl files available on PyPI. This means a simple pip install might not find a ready-to-use native version for every single library in your environment.

     

    However, pip does have a capability to automatically install dependencies directly from source code distributions, often provided as .tar.gz files. If the necessary build tools are present on your system, which is why prerequisites like MSVC with the Arm64 toolchain and Rust were mentioned earlier, pip can compile these packages into Windows-compatible .whl files locally.

     

    Microsoft pointed out that this method can be used to install specific versions of popular packages like NumPy 2.2.3 and safetensors 0.5.3, and shared the commands to do it:

    pip install numpy==2.2.3 
    # and 
    pip install safetensors==0.5.3
    

    as examples of packages that can be installed via compilation from source.

     

    You can read the full announcement, with more examples on the Microsoft Windows Blogs.

     

    Source


    Hope you enjoyed this news post.

    Thank you for appreciating my time and effort posting news every day for many years.

    News posts... 2023: 5,800+ | 2024: 5,700+ | 2025 (till end of March): 1,357

    RIP Matrix | Farewell my friend  :sadbye:


    User Feedback

    Recommended Comments

    There are no comments to display.



    Join the conversation

    You can post now and register later. If you have an account, sign in now to post with your account.
    Note: Your post will require moderator approval before it will be visible.

    Guest
    Add a comment...

    ×   Pasted as rich text.   Paste as plain text instead

      Only 75 emoji are allowed.

    ×   Your link has been automatically embedded.   Display as a link instead

    ×   Your previous content has been restored.   Clear editor

    ×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...