Skip to content

Conversation

@matthewdouglas
Copy link
Member

Removes support for Python 3.9.

Additionally, Ruff is upgraded and fixes made as appropriate.

Resolves #1777

@matthewdouglas matthewdouglas added this to the v0.49.0 milestone Nov 3, 2025
@github-actions
Copy link

github-actions bot commented Nov 3, 2025

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@matthewdouglas matthewdouglas merged commit 45dcd4d into main Nov 3, 2025
104 checks passed
@matthewdouglas matthewdouglas deleted the remove-py39 branch November 3, 2025 21:37
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@matthewdouglas, have you tested on Python 3.14? We are getting this error on trl: huggingface/trl#4225 (comment)

    import bitsandbytes as bnb
.venv/lib/python3.14/site-packages/bitsandbytes/__init__.py:19: in <module>
    from .backends.default import ops as default_ops
.venv/lib/python3.14/site-packages/bitsandbytes/backends/default/ops.py:324: in <module>
    @torch.compile
     ^^^^^^^^^^^^^
.venv/lib/python3.14/site-packages/torch/__init__.py:2590: in compile
    raise RuntimeError("torch.compile is not supported on Python 3.14+")
E   RuntimeError: torch.compile is not supported on Python 3.14+

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertvillanova Thanks for pointing that out. I think it's likely to work with torch nightly, but haven't tested it on the main releases. We probably need to better guard our use of the @torch.compile decorator. Will add that to our backlog.

bitsandbytes 0.47.0 may actually work with Python 3.14 for the time being, as it doesn't have this use of torch.compile in it.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the quick follow-up and the additional context. 🤗

We'll keep an eye on the progress regarding the @torch.compile guarding and the compatibility updates. We'll also test with bitsandbytes 0.47.0 once released as suggested.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertvillanova bitsandbytes==0.47.0 is a past existing release that can be used today (current is 0.48.2). Since we didn't have that usage of torch.compile I would expect it to just work, but it would be broken in 0.48+.

I'm planning to get a v0.49.0 release out by end of year, and will create a new issue for this and make sure to include it.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@albertvillanova #1831 should fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop Python 3.9 Support

3 participants