-
Notifications
You must be signed in to change notification settings - Fork 7.2k
Erase CV-CUDA Backend #9304
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
base: main
Are you sure you want to change the base?
Erase CV-CUDA Backend #9304
Conversation
…memcpy hack, need to figure out
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/vision/9304
Note: Links to docs will display an error until the docs builds have been completed. ❗ 1 Active SEVsThere are 1 currently active SEVs. If your PR is affected, please view them below: ❌ 6 New FailuresAs of commit fbd3dc1 with merge base aa35ca1 ( NEW FAILURES - The following jobs have failed:
This comment was automatically generated by Dr. CI and updates every 15 minutes. |
| # packed types (_2S32, _3S32) need to be copied into pre-allocated tensors | ||
| # torch does not support these packed types directly, so we create a helper function | ||
| # which will enable torch copy into the data directly (by overriding type/strides info) | ||
| def _to_torch(cv_tensor: cvcuda.Tensor, shape: tuple[int, ...], typestr: str) -> torch.Tensor: |
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.
Consider moving _to_torch to module level — currently it's recreated on every function call.
Not a performance concern for typical usage, but cleaner for readability.
| return erase_image(video, i=i, j=j, h=h, w=w, v=v, inplace=inplace) | ||
|
|
||
|
|
||
| def _erase_image_cvcuda( |
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.
Need to take a closer look at the implementation @NicolasHug
| # CV-CUDA doesnt have same random distribution as torchvision | ||
| # it uses its own seeding, but we have determinism | ||
| # set seed with torch.randint in the kernel | ||
| assert_close(actual, expected, rtol=0, atol=256) |
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.
need investigation for atol = 256
Summary
Add the CV-CUDA for
eraseTesting
python3 -m pytest test/test_transforms_v2.py::TestErase