Skip to content

Request: PyTorch 2.8+ compatibility patches #588

@morrismeyer

Description

@morrismeyer

Summary

We're using GraalPy to build PyTorch from source for a project that traces PyTorch models using torch.fx.symbolic_trace and converts them to StableHLO MLIR. The current patches support up to PyTorch 2.7.0, but PyTorch mainline is now at 2.11+.

Request

Please add compatibility patches for PyTorch 2.8, 2.9, 2.10, and 2.11 (or at least the latest stable release).

Context

  • Use case: We embed GraalPy in a native-image to trace PyTorch models and export them to StableHLO for GPU kernel generation
  • Current setup: GraalPy 25.0.1 + PyTorch 2.7.0 (working great!)
  • Tracing APIs used: torch.fx.symbolic_trace, torch.jit.trace, torch.jit.script

Current patch coverage

The graalpython/lib-graalpython/patches/ directory contains:

  • torch-1.13.1.patch
  • torch-2.2.1.patch
  • torch-2.4.1.patch
  • torch-2.7.0.patch

Why this matters

PyTorch 2.8+ includes improvements to the FX tracing infrastructure and better support for modern model architectures. Staying current with PyTorch versions helps us support newer models and take advantage of tracing improvements.

Workaround

We've bundled the torch-2.7.0.patch in our repo and it works well. We're happy to help test patches for newer versions if that would be useful.

Thank you for the excellent work on GraalPy - the PyTorch integration is impressive!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions