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

About Inference time #36

Open
qazzombie opened this issue Jul 20, 2023 · 8 comments
Open

About Inference time #36

qazzombie opened this issue Jul 20, 2023 · 8 comments

Comments

@qazzombie
Copy link

I tested lightglue and superglue using both CPU and GPU ,In both cases, superglue takes less time,but in paper,lightglue is faster。I want to know why there is such a contradiction,and my CPU:Intel(R) Xeon(R) Gold 6242 CPU @ 2.80GHz ,GPU:
RTX 2080Ti

@sarlinpe
Copy link
Member

sarlinpe commented Jul 20, 2023

How many keypoints are there in the two images? if less than 1k, can you compare the runtimes with point pruning turned off? We indeed need to add some checks in the model.

@kvnptl
Copy link

kvnptl commented Jul 20, 2023

I tested lightglue and superglue using both CPU and GPU ,In both cases, superglue takes less time,but in paper,lightglue is faster。I want to know why there is such a contradiction,and my CPU:Intel(R) Xeon(R) Gold 6242 CPU @ 2.80GHz ,GPU: RTX 2080Ti

How much inference time?

@qazzombie
Copy link
Author

@skydes Two images have 274 and 265 keypoints respectively 。 point pruning turned off or not, lightglue takes more time

@qazzombie
Copy link
Author

@kvnptl
Two images have 274 and 265 keypoints respectively 。
Superglue took 0.024 seconds, while lightglue took 0.0339 seconds 。

@Phil26AT
Copy link
Collaborator

Phil26AT commented Jul 31, 2023

Hi @qazzombie @kvnptl

We realized that run time overhead limited the inference speed of LightGlue with few keypoints. We pushed some improvements in PR #37. Could you maybe checkout the corresponding branch and run the benchmark script:

python benchmark.py --compile --add_superglue

To add SuperGlue in the benchmark you also need hloc.

@xuanlanxingkongxia
Copy link

I meet similar problem. For the image DSC_0410.JPG and DSC_0411.JPG, it seems that in the case of closing the "flash-attention", Lightglue can be only ~30% faster than superglue? I do this evaluation on rtx2070. (I have excluded the time comsumed by superpoint)

@xuanlanxingkongxia
Copy link

LightGlue_benchmark_(cuda)
Oh, I find my problem. But with benchmark code, it still seems something wrong? Without falsh-attention and compile, the speed will be similar to superglue?Am I still do something wrong?

@Phil26AT
Copy link
Collaborator

Hi @xuanlanxingkongxia

This looks good to me. Note that in the plot above we benchmark against SuperGlue-fast, with fewer sinkhorn iterations. To compare against the original SuperGlue, you should uncomment the line here.

The main run time improvements of LightGlue are its adaptiveness, and this is clearly visible in your benchmark.

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

No branches or pull requests

5 participants