Vectorize box encoding in FCOS#6278
Conversation
jdsgomes
left a comment
There was a problem hiding this comment.
Hi @abhi-glitchhg, thanks for working on this.
On a first pass looks good. But it is important to test that the implementation is equivalent and also test the performance, would you be able to provide these test scripts? If you need support to run benchmark in GPU for instance I am happy to help
|
@jdsgomes thanks for the review. I have checked this implementation on the CPU device only. Running the above script, I am getting around 5x improvement. Could you please check the same on GPU? BTW this script is a slight modification of @datumbox's script in #6203 (review) :) |
thanks for the confirmation. I did a benchmark using GPU and got similar results: |
jdsgomes
left a comment
There was a problem hiding this comment.
LGTM, thanks for working on this
|
Hey @jdsgomes! You merged this PR, but no labels were added. The list of valid labels is available at https://github.com/pytorch/vision/blob/main/.github/process_commit.py |
Summary: * intial structure * fixed types of few variables * remove the commented code * list -> List * encode method will take input as tensors instead of list of tensor Reviewed By: datumbox Differential Revision: D38154574 fbshipit-source-id: ee4936b9968fc1b0cf751c4884c3d5c8064e7d10 Co-authored-by: Joao Gomes <jdsgomes@fb.com>

Just like #5247, i think it is possible to vectorize the following loop at this line.
Here is my attempt.