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

Add an example of object segmentation (ClipSeg) #801

Merged
merged 12 commits into from
May 20, 2024

Conversation

cfgfung
Copy link
Contributor

@cfgfung cfgfung commented Mar 14, 2024

What does this PR do?

The ClipSeg model has been validated using graph mode on Gaudi 2. Adding this as an example for users.

Performance number:

Without graph mode

  • n_iterations: 20
  • Total latency (ms): 670.0191497802734
  • Average latency (ms): 33.50095748901367

With graph mode

  • n_iterations: 20
  • Total latency (ms): 95.40128707885742
  • Average latency (ms): 4.770064353942871

Fixes # (issue)
N.A.

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Did you make sure to update the documentation with your changes?
  • Did you write any new necessary tests?

@cfgfung
Copy link
Contributor Author

cfgfung commented Mar 21, 2024

@regisss
Please take a look at this one. This is a validated model and this is an example script for users.

@libinta libinta requested a review from yeonsily March 21, 2024 18:19
@yeonsily
Copy link
Collaborator

@cfgfung I see that you have a couple of more PRs which has the same change.
#814
#826

Which is the valid one? and can you please close any not valid PR?

@cfgfung
Copy link
Contributor Author

cfgfung commented Mar 25, 2024

@cfgfung I see that you have a couple of more PRs which has the same change. #814 #826

Which is the valid one? and can you please close any not valid PR?

@yeonsily
They are not the same. Each PR is for a dedicated model. I have removed the unrelated files. Thanks!

@cfgfung
Copy link
Contributor Author

cfgfung commented Mar 25, 2024

Add GPU Benchmark:

Nvidia A100-80GB, CUDA 12.2, Driver Version: 535.54.03

With BF16 autocast:
n_iterations: 20
Total latency (ms): 268.7704563140869
Average latency (ms): 13.438522815704346

@jiminha
Copy link
Collaborator

jiminha commented Apr 18, 2024

@cfgfung Your result looks good. Could you also port relevant test case for your model and make sure those are passing?
https://github.com/huggingface/transformers/blob/main/tests/models/clipseg to https://github.com/huggingface/optimum-habana/tree/main/tests/transformers/tests/models

@jiminha
Copy link
Collaborator

jiminha commented Apr 18, 2024

@cfgfung Your result looks good. Could you also port relevant test case for your model and make sure those are passing? https://github.com/huggingface/transformers/blob/main/tests/models/clipseg to https://github.com/huggingface/optimum-habana/tree/main/tests/transformers/tests/models

Actually, above model test cases are optional, it's good to check but not necessary.
For the test cases for this ClipSeg model, please add similar test cases as your other PR(SAM).

@cfgfung
Copy link
Contributor Author

cfgfung commented May 1, 2024

@cfgfung Your result looks good. Could you also port relevant test case for your model and make sure those are passing? https://github.com/huggingface/transformers/blob/main/tests/models/clipseg to https://github.com/huggingface/optimum-habana/tree/main/tests/transformers/tests/models

Actually, above model test cases are optional, it's good to check but not necessary. For the test cases for this ClipSeg model, please add similar test cases as your other PR(SAM).

Hi, I have added the test and followed the same format as the PR of SAM.
Ran 'make style' and the unit test. Also aligned the folder structure and the readme.

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

@jiminha
Copy link
Collaborator

jiminha commented May 3, 2024

@cfgfung all looks good. Could you please make sure that you ran "make style" and upload the fix? I still see many style error.

@cfgfung
Copy link
Contributor Author

cfgfung commented May 6, 2024

@cfgfung all looks good. Could you please make sure that you ran "make style" and upload the fix? I still see many style error.

Hi,

There might be some updates in the rules and hence triggered the new errors.
I have re-ran "make style" and the result is listed below.

image

@jiminha jiminha added the run-test Run CI for PRs from external contributors label May 6, 2024
examples/object-segementation/README.md Outdated Show resolved Hide resolved
examples/object-segementation/README.md Outdated Show resolved Hide resolved
Makefile Outdated Show resolved Hide resolved
tests/test_clipseg.py Outdated Show resolved Hide resolved
tests/test_clipseg.py Outdated Show resolved Hide resolved
@regisss regisss removed the run-test Run CI for PRs from external contributors label May 20, 2024
@regisss regisss added the run-test Run CI for PRs from external contributors label May 20, 2024
@regisss regisss merged commit 1ee7a47 into huggingface:main May 20, 2024
11 of 12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
run-test Run CI for PRs from external contributors synapse1.16
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants