Skip to content

[Feature Request] Make binary artifacts portable on torch and Python versions #333

@Harry-Chen

Description

@Harry-Chen

Currently this project uses pybind11, which is coupled with both torch and Python ABIs. This leads to a huge amount of release artifacts (M * N, now 86) for each version, and sometimes causes some trouble to downstream projects that want to vendor it (vllm-project/vllm#41516, vllm-project/vllm#41487).

To make it portable, my suggestions are:

  1. Switch to https://github.com/apache/tvm-ffi as a whole. This might not be easy since this project depends on torch a lot. Or,
  2. Provides ABI stability on both torch and Python by migrating to LibTorch Stable ABI and compile the Cpp interface with Py_LIMITED_API. So we can have 1 binary wheel on each architecture that is compatible with Torch 2.9+ and Python 3.8+. Or,
  3. Moving to TORCH_LIBRARY (not using stable ABIs) and opt-inPy_LIMITED_API. Then the wheel still depends on a specific torch version, but a wide range of Python versions from 3.8+. Or,
  4. Replacing pybind11 with nanobind. This requires minimal effort with Python stable ABI support, but only ranging from 3.12+.

I can help with any option if needed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions