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

Made onxxrutime an optional dependency #2722

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

mangin
Copy link

@mangin mangin commented Aug 25, 2024

Description of changes

Now onxxrutime is used to calculate default embedding. But onxxrutime doesn't support all operation systems (for example it doesn't work with alpine at all)

I think to replace onxxruntime to something else it's a big task, but at least we can allow to run chromadb without default embedding if onxxrutime is not present.

Summarize the changes made by this PR.

  • Improvements & Bug fixes
    • Make onxxrutime optional
  • New functionality
    • Added initial support of alpine

Copy link

Reviewer Checklist

Please leverage this checklist to ensure your code review is thorough before approving

Testing, Bugs, Errors, Logs, Documentation

  • Can you think of any use case in which the code does not behave as intended? Have they been tested?
  • Can you think of any inputs or external events that could break the code? Is user input validated and safe? Have they been tested?
  • If appropriate, are there adequate property based tests?
  • If appropriate, are there adequate unit tests?
  • Should any logging, debugging, tracing information be added or removed?
  • Are error messages user-friendly?
  • Have all documentation changes needed been made?
  • Have all non-obvious changes been commented?

System Compatibility

  • Are there any potential impacts on other parts of the system or backward compatibility?
  • Does this change intersect with any items on our roadmap, and if so, is there a plan for fitting them together?

Quality

  • Is this code of a unexpectedly high quality (Readability, Modularity, Intuitiveness)

@jeffchuber
Copy link
Contributor

@tazarov can you take a look here?

@JoshKarpel
Copy link

JoshKarpel commented Sep 16, 2024

Just chiming in in favor of this change - we're running into a problem where we'd like to install onnxruntime-gpu, which provides an alternate implementation of the onnxruntime package, but we can't because the chromadb packages requires onnxruntime unconditionally in its requirements.

@tazarov
Copy link
Contributor

tazarov commented Sep 16, 2024

@mangin, you have a point about alpine. Arguably though, there is a build for onnx that runs on musl distros, although the pypi package isn't there, which makes it a tad more difficult to run onnx and therefore Chroma on alpine.

That said, this change can be challenging to merge as it will break DX. Consider this: today you install chroma and doing something like:

collection.add(ids=[...], documents=[...])

just works.

With an optional onnxruntime, users will get an error as optional deps are not installed by default. Which creates a friction for the starting experience.

We're also in the process of transitioning away onnx-based default EF, so that would be a natural point for merging the proposed solution in this PR.

Either way, I think this needs a bit deeper consideration. So give me couple of days to do some experiments.

@JoshKarpel
Copy link

JoshKarpel commented Sep 16, 2024

That said, this change can be challenging to merge as it will break DX. Consider this: today you install chroma and doing something like:

collection.add(ids=[...], documents=[...])

just works.

With an optional onnxruntime, users will get an error as optional deps are not installed by default. Which creates a friction for the starting experience.

Could you instead recommend pip install 'chromadb[onnx]' in your various guides? That would still give the desired UX, and then advanced users can drop the optional requirement when needed.

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

Successfully merging this pull request may close these issues.

4 participants