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

ONNX-GPU #60

Closed
wants to merge 1 commit into from
Closed

ONNX-GPU #60

wants to merge 1 commit into from

Conversation

michaelfeil
Copy link

@michaelfeil michaelfeil commented Nov 4, 2023

This PR aims to add optional GPU support, only if onnxruntime-gpu is installed. Reference: michaelfeil/infinity#26

Closes #52

@equal-l2
Copy link

equal-l2 commented Dec 25, 2023

You might want to add the extras section to the pyproject.toml, to indicate that fastembed can use onnxruntime-gpu as an optional dependency.
For details about extras section in pyproject.toml, see https://python-poetry.org/docs/pyproject/#extras.

@michaelfeil
Copy link
Author

Yes, I have done this in my personal package. Note that I stopped contributing here, as none of the PRs was getting attention.

@logan-markewich
Copy link

would be cool if this got merged...

@generall
Copy link
Member

generall commented Jan 5, 2024

I have the following concerns before merging this PR:

  • Does it introduce new cuda-related dependencies into the package?
    • If not, how can it work with cuda?
    • Does it requires manual installation of dependencies? If so, this should be documented.
    • If it introduces new dependencies, is it possible to make them optional? Usually cuda-related packages are very big and I would prefer to avoid them if I am working in CPU-only environment
  • If I have GPU on my machine, how can I force it to use CPU-only? This should be documented

@Anexen
Copy link

Anexen commented Jan 17, 2024

I believe it would be beneficial to allow users to specify a list of providers. The FlagEmbeddings class can be enhanced to accept an additional parameter called onnx_providers.

My current workaround is as follows:

embedding = FlagEmbedding()
embedding.model.model.set_providers(
    ["CUDAExecutionProvider", "CPUExecutionProvider"]
)

@pazoff
Copy link

pazoff commented Jan 31, 2024

It would be very, very cool if this got merged...

@valentimarco
Copy link

would be very cool if this got merged!

@NirantK
Copy link
Contributor

NirantK commented Apr 28, 2024

Closing this in favour of #214, closes #52 and #97

@NirantK NirantK closed this Apr 28, 2024
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.

Feature: Option for ONNX on GPU execution provider
8 participants