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

docs: docs for retrieval #808

Merged
merged 19 commits into from
Sep 9, 2022
Merged

docs: docs for retrieval #808

merged 19 commits into from
Sep 9, 2022

Conversation

jemmyshin
Copy link
Contributor

add documentation for clip-retrieval

@codecov
Copy link

codecov bot commented Aug 23, 2022

Codecov Report

Merging #808 (324cd29) into main (47144c2) will decrease coverage by 30.76%.
The diff coverage is n/a.

@@             Coverage Diff             @@
##             main     #808       +/-   ##
===========================================
- Coverage   83.90%   53.13%   -30.77%     
===========================================
  Files          21       21               
  Lines        1466     1466               
===========================================
- Hits         1230      779      -451     
- Misses        236      687      +451     
Flag Coverage Δ
cas 53.13% <ø> (-30.77%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
server/clip_server/executors/clip_tensorrt.py 0.00% <0.00%> (-92.73%) ⬇️
server/clip_server/model/clip_trt.py 0.00% <0.00%> (-85.72%) ⬇️
server/clip_server/model/mclip_model.py 0.00% <0.00%> (-84.22%) ⬇️
server/clip_server/model/trt_utils.py 0.00% <0.00%> (-83.52%) ⬇️
client/clip_client/client.py 44.79% <0.00%> (-42.54%) ⬇️
server/clip_server/executors/helper.py 64.70% <0.00%> (-32.36%) ⬇️
server/clip_server/model/model.py 53.86% <0.00%> (-25.06%) ⬇️
server/clip_server/model/clip.py 68.75% <0.00%> (-18.75%) ⬇️
server/clip_server/model/pretrained_models.py 84.12% <0.00%> (-14.29%) ⬇️
server/clip_server/model/clip_model.py 75.00% <0.00%> (-12.50%) ⬇️
... and 5 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
@jemmyshin jemmyshin marked this pull request as ready for review August 24, 2022 03:08
@jemmyshin jemmyshin requested review from ZiniuYu and numb3r3 August 24, 2022 03:08
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved

In order to implement retrieval, we add an [`AnnLite`](https://github.com/jina-ai/annlite) indexer executor after the encoder executor in CLIP-as-service.


Copy link

Choose a reason for hiding this comment

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

a table of contents would be nice

Copy link
Contributor Author

Choose a reason for hiding this comment

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

a table about what?

Copy link

Choose a reason for hiding this comment

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

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think we already have one here on the right side of the page:
Screen Shot 2022-09-07 at 2 47 32 PM

docs/index.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retrieval.md Outdated Show resolved Hide resolved
docs/user-guides/retriever.md Outdated Show resolved Hide resolved
# Search API


## Basics of CLIP Search
Copy link
Member

Choose a reason for hiding this comment

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

I'd recommend remove this title




## How to lower memory footprint?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## How to lower memory footprint?
## Lower the memory footprint


Sometimes the indexer will use a lot of memory because the HNSW indexer (which is used by `AnnLite`) is stored in memory. The efficient way to reduce memory footprint is dimension reduction. Retrieval in CLIP-as-service use [`Principal component analysis(PCA)`](https://en.wikipedia.org/wiki/Principal_component_analysis#:~:text=Principal%20component%20analysis%20(PCA)%20is,components%20and%20ignoring%20the%20rest.) to achieve this.

### Whether PCA is needed in my case?
Copy link
Member

Choose a reason for hiding this comment

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

I'd suggest to remove this title

However, PCA will definitely lead to information losses since we remove some dimensions. And the more dimensions you remove, the more information losses will be. So the best practice will be estimate the memory usage first (if possible, see below) and choose the reasonable dimension after PCA.
```

## How to deal with a very large dataset?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## How to deal with a very large dataset?
## Dealing with large dataset

```


## How to deploy it on the cloud?
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
## How to deploy it on the cloud?
## Deploy to JCloud



## How to deploy it on the cloud?
Deployment can be easily achieved by using [`jcloud`](https://github.com/jina-ai/jcloud) or [`Amazon Kubernetes(EKS) Cluster`](https://aws.amazon.com/eks/). Taking `jcloud` as an example:
Copy link
Member

Choose a reason for hiding this comment

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

Use JCloud not `jcloud`


Then you can perform exactly the same operations as we do on a single machine.(`/encode`, `/index` and `/search`)

### Why different [polling strategies](https://docs.jina.ai/how-to/scale-out/?highlight=polling#different-polling-strategies) are needed for different endpoints?
Copy link
Member

Choose a reason for hiding this comment

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

Different polling strategies for different endpoints

@ZiniuYu
Copy link
Member

ZiniuYu commented Sep 9, 2022

I'm not sure. Should we put the search in Client doc since it is part of the Client?
We should at least mention the search function in Client intros and link to the search docs

@github-actions
Copy link

github-actions bot commented Sep 9, 2022

📝 Docs are deployed on https://ft-docs-retrieval--jina-docs.netlify.app 🎉

@jemmyshin jemmyshin requested a review from numb3r3 September 9, 2022 09:54
@numb3r3 numb3r3 merged commit fa7e577 into main Sep 9, 2022
@numb3r3 numb3r3 deleted the docs-retrieval branch September 9, 2022 09:54
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