-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
feat: add fp16 inference support (trt) #875
Draft
OrangeSodahub
wants to merge
15
commits into
main
Choose a base branch
from
add-fp16-inference-support-trt
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
d84edc7
feat: add fp16 inference support for trt
OrangeSodahub 1bec499
fix: add ci test for trt fp16
OrangeSodahub 2e726b7
fix: tensorrt version in ci.yml
Hippopotamus0308 cce2f4a
chore: conflict in ci.yml
Hippopotamus0308 49c201d
fix: retest
Hippopotamus0308 35ec07b
Merge branch 'main' into add-fp16-inference-support-trt
Hippopotamus0308 88a8d37
chore: reactivate ci test
Hippopotamus0308 bb6a73e
fix: open-clip-torch version in ci.yml
Hippopotamus0308 5577e23
chore: add ci test log
Hippopotamus0308 7f019c6
chore: clean print log
Hippopotamus0308 8b162d2
chore: format
Hippopotamus0308 02375e3
feat: specify tensorrt and openclip version in server setup
Hippopotamus0308 9875ffd
feat: specify tensorrt and openclip version in server setup
Hippopotamus0308 485d1e7
fix: specify all package versions in server setup
Hippopotamus0308 32a1dd8
chore: black format
Hippopotamus0308 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,91 +4,93 @@ | |
from setuptools import find_packages, setup | ||
|
||
if sys.version_info < (3, 7, 0): | ||
raise OSError(f'CLIP-as-service requires Python >=3.7, but yours is {sys.version}') | ||
raise OSError(f"CLIP-as-service requires Python >=3.7, but yours is {sys.version}") | ||
|
||
try: | ||
pkg_name = 'clip-server' | ||
pkg_name = "clip-server" | ||
libinfo_py = path.join( | ||
path.dirname(__file__), pkg_name.replace('-', '_'), '__init__.py' | ||
path.dirname(__file__), pkg_name.replace("-", "_"), "__init__.py" | ||
) | ||
libinfo_content = open(libinfo_py, 'r', encoding='utf8').readlines() | ||
version_line = [l.strip() for l in libinfo_content if l.startswith('__version__')][ | ||
libinfo_content = open(libinfo_py, "r", encoding="utf8").readlines() | ||
version_line = [l.strip() for l in libinfo_content if l.startswith("__version__")][ | ||
0 | ||
] | ||
exec(version_line) # gives __version__ | ||
except FileNotFoundError: | ||
__version__ = '0.0.0' | ||
__version__ = "0.0.0" | ||
|
||
try: | ||
with open('../README.md', encoding='utf8') as fp: | ||
with open("../README.md", encoding="utf8") as fp: | ||
_long_description = fp.read() | ||
except FileNotFoundError: | ||
_long_description = '' | ||
_long_description = "" | ||
|
||
setup( | ||
name=pkg_name, | ||
packages=find_packages(), | ||
version=__version__, | ||
include_package_data=True, | ||
description='Embed images and sentences into fixed-length vectors via CLIP', | ||
author='Jina AI', | ||
author_email='[email protected]', | ||
license='Apache 2.0', | ||
url='https://github.com/jina-ai/clip-as-service', | ||
download_url='https://github.com/jina-ai/clip-as-service/tags', | ||
description="Embed images and sentences into fixed-length vectors via CLIP", | ||
author="Jina AI", | ||
author_email="[email protected]", | ||
license="Apache 2.0", | ||
url="https://github.com/jina-ai/clip-as-service", | ||
download_url="https://github.com/jina-ai/clip-as-service/tags", | ||
long_description=_long_description, | ||
long_description_content_type='text/markdown', | ||
long_description_content_type="text/markdown", | ||
zip_safe=False, | ||
setup_requires=['setuptools>=18.0', 'wheel'], | ||
setup_requires=["setuptools>=18.0", "wheel"], | ||
install_requires=[ | ||
'ftfy', | ||
'torch', | ||
'regex', | ||
'torchvision<=0.13.0' if sys.version_info <= (3, 7, 2) else 'torchvision', | ||
'jina>=3.12.0', | ||
'prometheus-client', | ||
'open_clip_torch>=2.7.0', | ||
"ftfy==6.1.1", | ||
"torch==1.13.0", | ||
"regex==2022.10.31", | ||
"torchvision<=0.13.0" | ||
if sys.version_info <= (3, 7, 2) | ||
else "torchvision==0.14.0", | ||
"jina==3.12.0", | ||
"prometheus-client==0.15.0", | ||
"open_clip_torch==2.7.0", | ||
], | ||
extras_require={ | ||
'onnx': [ | ||
'onnxruntime', | ||
'onnx', | ||
'onnxmltools', | ||
"onnx": [ | ||
"onnxruntime==1.13.1", | ||
"onnx==1.12.0", | ||
"onnxmltools==1.11.1", | ||
] | ||
+ (['onnxruntime-gpu>=1.8.0'] if sys.platform != 'darwin' else []), | ||
'tensorrt': ['nvidia-tensorrt'], | ||
'transformers': ['transformers>=4.16.2'], | ||
'search': ['annlite>=0.3.10'], | ||
'flash-attn': ['flash-attn'], | ||
+ (["onnxruntime-gpu==1.13.1"] if sys.platform != "darwin" else []), | ||
"tensorrt": ["nvidia-tensorrt==8.4.1.5"], | ||
"transformers": ["transformers==4.25.1"], | ||
"search": ["annlite>=0.3.10"], | ||
"flash-attn": ["flash-attn==0.2.4"], | ||
}, | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
'Intended Audience :: Developers', | ||
'Intended Audience :: Education', | ||
'Intended Audience :: Science/Research', | ||
'Programming Language :: Python :: 3.7', | ||
'Programming Language :: Python :: 3.8', | ||
'Programming Language :: Python :: 3.9', | ||
'Programming Language :: Python :: 3.10', | ||
'Programming Language :: Unix Shell', | ||
'Environment :: Console', | ||
'License :: OSI Approved :: Apache Software License', | ||
'Operating System :: OS Independent', | ||
'Topic :: Database :: Database Engines/Servers', | ||
'Topic :: Scientific/Engineering :: Artificial Intelligence', | ||
'Topic :: Internet :: WWW/HTTP :: Indexing/Search', | ||
'Topic :: Scientific/Engineering :: Image Recognition', | ||
'Topic :: Multimedia :: Video', | ||
'Topic :: Scientific/Engineering', | ||
'Topic :: Scientific/Engineering :: Mathematics', | ||
'Topic :: Software Development', | ||
'Topic :: Software Development :: Libraries', | ||
'Topic :: Software Development :: Libraries :: Python Modules', | ||
"Development Status :: 5 - Production/Stable", | ||
"Intended Audience :: Developers", | ||
"Intended Audience :: Education", | ||
"Intended Audience :: Science/Research", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Unix Shell", | ||
"Environment :: Console", | ||
"License :: OSI Approved :: Apache Software License", | ||
"Operating System :: OS Independent", | ||
"Topic :: Database :: Database Engines/Servers", | ||
"Topic :: Scientific/Engineering :: Artificial Intelligence", | ||
"Topic :: Internet :: WWW/HTTP :: Indexing/Search", | ||
"Topic :: Scientific/Engineering :: Image Recognition", | ||
"Topic :: Multimedia :: Video", | ||
"Topic :: Scientific/Engineering", | ||
"Topic :: Scientific/Engineering :: Mathematics", | ||
"Topic :: Software Development", | ||
"Topic :: Software Development :: Libraries", | ||
"Topic :: Software Development :: Libraries :: Python Modules", | ||
], | ||
project_urls={ | ||
'Documentation': 'https://clip-as-service.jina.ai', | ||
'Source': 'https://github.com/jina-ai/clip-as-service/', | ||
'Tracker': 'https://github.com/jina-ai/clip-as-service/issues', | ||
"Documentation": "https://clip-as-service.jina.ai", | ||
"Source": "https://github.com/jina-ai/clip-as-service/", | ||
"Tracker": "https://github.com/jina-ai/clip-as-service/issues", | ||
}, | ||
keywords='jina openai clip deep-learning cross-modal multi-modal neural-search', | ||
keywords="jina openai clip deep-learning cross-modal multi-modal neural-search", | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
please specify the
open-clip-torch
andtensorrt
version in setup