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

[Bug] active_rotated_filter op get a wrong value on cuda #2718

Closed
2 tasks done
dflhw opened this issue Mar 31, 2023 · 0 comments · Fixed by #2822 or #2824
Closed
2 tasks done

[Bug] active_rotated_filter op get a wrong value on cuda #2718

dflhw opened this issue Mar 31, 2023 · 0 comments · Fixed by #2822 or #2824

Comments

@dflhw
Copy link
Contributor

dflhw commented Mar 31, 2023

Prerequisite

Environment

mmcv = 1.7.1
pytorch = 1.13.1
cuda = 11.2
python = 3.9.15

Reproduces the problem - code sample

import torch
import numpy as np
from mmcv.ops import active_rotated_filter

device = torch.device("cpu")
print('===============>cpu')
feature = torch.tensor([[[[[385., 658., 852.],
[619., 716., 106.],
[189., 706., 143.]],
[[394., 779., 399.],
[268., 891., 822.],
[262., 163., 958.]]]]], dtype=torch.float32, device=device)
indices = torch.tensor([[[[5, 4], [6, 5], [2, 3]], [[3, 2], [1, 6], [7, 7]], [[4, 8], [9, 1], [8, 9]]],
[[[7, 1], [2, 5], [3, 4]], [[5, 2], [1, 7], [9, 8]], [[4, 3], [8, 6], [6, 9]]]],
dtype=torch.int32, device=device)
cpu_out = active_rotated_filter(feature, indices).cpu().numpy()
print("cpu_out: ", cpu_out[0])

print('===============>cuda')
feature = feature.cuda()
indices = indices.cuda()
cuda_out = active_rotated_filter(feature, indices).cpu().numpy()
print("cuda_out: ", cuda_out[0])

assert np.allclose(cuda_out, cpu_out, atol=1e-4)

Reproduces the problem - command or script

When num_orientations is 2, the calculation result of active_rotated_filter op on cpu is inconsistent with that on cuda.

Reproduces the problem - error message

Assertion Error

Additional information

No response

@dflhw dflhw changed the title [Bug] The calculation result of active_rotated_filter op on cpu is inconsistent with that on cuda. [Bug] Active_rotated_filter get a wrong value on cuda. Mar 31, 2023
@dflhw dflhw changed the title [Bug] Active_rotated_filter get a wrong value on cuda. [Bug] active_rotated_filter get a wrong value on cuda. Mar 31, 2023
@dflhw dflhw changed the title [Bug] active_rotated_filter get a wrong value on cuda. [Bug] active_rotated_filter op get a wrong value on cuda. Mar 31, 2023
@dflhw dflhw changed the title [Bug] active_rotated_filter op get a wrong value on cuda. [Bug] active_rotated_filter op get a wrong value on cuda Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant