Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make pyo3 an optional dependency in mistralrs-core #303

Merged
merged 3 commits into from
May 15, 2024

Conversation

LLukas22
Copy link
Contributor

Puts pyo3 behind the pyo3_macros feature flag, which is set per default in the mistralrs-pyo3 create.

This allows us to compile the benchmark/server without any python depencies via:

cargo build --release --workspace --exclude mistralrs-pyo3

@@ -17,7 +17,7 @@ doc = false

[dependencies]
pyo3.workspace = true
mistralrs-core = { version = "0.1.7", path = "../mistralrs-core" }
mistralrs-core = { version = "0.1.7", path = "../mistralrs-core", features = ["pyo3_macros"] }
Copy link
Owner

Choose a reason for hiding this comment

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

Can you please also update mistralrs-pyo3/Cargo_template.toml?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah forgot to add it there, is the Cargo_template.toml only used to select features for the pypi uploads?

Copy link
Owner

Choose a reason for hiding this comment

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

Yeah, it's used for creating packages with different features. I don't love that way of doing it, though, because we have so many packages uploaded. Do you know of another way to do this? Ideally, we could gate features on install, but maturin is missing functionality to do that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well it seams to be possible to set feature flags via the MATURIN_PEP517_ARGS environment, as mentioned here. But that is very unintuitive.

Maybe we should create a ticket to enable features via pips optional dependency flags e.g. mistralrs[cuda] to use the cuda feature.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

For now i just added pyo3_macros as a forced feature. Should be good to go 👍

@EricLBuehler EricLBuehler merged commit fc38687 into EricLBuehler:master May 15, 2024
10 checks passed
@EricLBuehler
Copy link
Owner

Thank you!

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.

None yet

2 participants