-
Notifications
You must be signed in to change notification settings - Fork 11
[codex] Add native pHash deduplication acceleration #464
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| from __future__ import annotations | ||
|
|
||
| import sys | ||
|
|
||
| from setuptools import Extension | ||
|
|
||
|
|
||
| def build(setup_kwargs): | ||
| extra_compile_args = [] | ||
| if sys.platform != "win32": | ||
| extra_compile_args.extend(["-std=c11", "-O3"]) | ||
|
|
||
| setup_kwargs.update( | ||
| { | ||
| "ext_modules": [ | ||
| Extension( | ||
| "nucleus._native_dedup", | ||
| ["nucleus/_native_dedup.c"], | ||
| extra_compile_args=extra_compile_args, | ||
| optional=True, | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It makes sense that this is optional and this probably won't happen, but curious once this is deployed, is it possible for you/the user who runs this dedup function to see if the C code is actually running or if its falling back to the python-based version. ie. could we detect if some weird/strange error occurred that causes the C code to never/barely run on user's who should be able to support C-mode?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh interesting, I don't know I'll look into it. I guess the in general clients don't have visibility into SDKs although nucleus-python-client is open source. |
||
| ) | ||
| ], | ||
| } | ||
| ) | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should this be the same as line 14?
- image: python:3.10-bullseyeThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nah it doesn't matter, the previous tests used the debian bullseye image so I just stuck to that convention