-
Notifications
You must be signed in to change notification settings - Fork 185
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
Enabled DETR (Object Detection) model #1046
Conversation
@cfgfung can you rebase the PR? |
b26d202
to
5dddd9e
Compare
Hi, |
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.
Hi @cfgfung
thank you for the work here.
Below are my suggestions for this PR. Let's work on these and do a final review.
- I've made some changes regarding some minor clean ups and ci tests. Please review and implement them via
git am < 0001*
(file attached). - Few minor comments are give in comment.
0001-fea-Minor-CI-updates-and-clean-ups.patch
G2 results (after applying the patch)
---------------------------: System Configuration :---------------------------
Num CPU Cores : 160
CPU RAM : 1056375224 KB
------------------------------------------------------------------------------
Detected cat with confidence 1.0 at location [344.0, 25.25, 640.0, 376.0]
Detected remote with confidence 0.996 at location [328.0, 75.5, 372.0, 188.0]
Detected remote with confidence 0.996 at location [39.0, 70.5, 176.0, 118.0]
Detected cat with confidence 1.0 at location [15.62, 52.5, 316.0, 472.0]
Detected couch with confidence 0.996 at location [-1.25, 0.94, 640.0, 472.0]
Stats:
------------------------------------------------------------
Total latency (ms): 58.38346481323242 (for n_iterations=10)
Average latency (ms): 5.838346481323242 (per iteration)
------------------------------------------------------------
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.
minor comments.
Makefile
Outdated
# Run unit and integration tests related to Image segmentation | ||
fast_tests_object_detection: | ||
python -m pip install .[tests] | ||
python -m pip install timm |
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.
if no_timm is used for the test, is this needed?
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.
Yes, it is still needed. The model has called some API/modules from timm library
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.
then let's move this to here: https://github.com/huggingface/optimum-habana/blob/main/setup.py#L41-L51
doesn't need to be a separate pip install.
|
||
adapt_transformers_to_gaudi() | ||
|
||
# you can specify the revision tag if you don't want the timm dependency |
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.
not sure how to approach this here, but would be nice to able to pass/toggle between no_timm
and main
revisions.
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.
Hi,
The DETR is composed of different modules from timm, transformer and other popular libraries.
Calling this line will apply any applicable optimizations to this DETR model, especially the transformer submodules.
@cfgfung |
I have applied the patch. |
6e0f7e9
to
1d2eb59
Compare
@imangohari1 Hi, I have applied rebase and addressed the changes mentioned above. |
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.
minor change.
Also could we test this with multiple input images?
Please make sure to run make style
and rebase/sync with the head of OH at main.
Makefile
Outdated
# Run unit and integration tests related to Image segmentation | ||
fast_tests_object_detection: | ||
python -m pip install .[tests] | ||
python -m pip install timm |
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.
then let's move this to here: https://github.com/huggingface/optimum-habana/blob/main/setup.py#L41-L51
doesn't need to be a separate pip install.
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.
Looks good.
@regisss
Could you take a final look here please?
Thanks
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. |
@cfgfung can you please fix code style? |
475e63a
to
8e088af
Compare
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.
LGTM!
What does this PR do?
This PR contains the patch, example, and test codes for DETR models.
A100 CUDA BF16(Autocast) benchmarks:
n_iterations: 10
Total latency (ms): 241.29199981689453
Average latency (ms): 24.129199981689453
Gaudi2 BF16(Autocast and Graph mode) benchmarks:
n_iterations: 10
Total latency (ms): 65.3073787689209
Average latency (ms): 6.53073787689209
Before submitting