Skip to content

For rocm, atol is reduced for gradcheck of oscillator_test to pass wh… #3930

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from parameterized import parameterized
from torch.autograd import gradcheck
from torchaudio_unittest.common_utils import TestBaseMixin
from torch.utils.cpp_extension import ROCM_HOME


class AutogradTestImpl(TestBaseMixin):
Expand All @@ -24,7 +25,10 @@ def test_oscillator_bank(self, sample_rate, shape):
)
amps = torch.linspace(-5, 5, numel, dtype=self.dtype, device=self.device, requires_grad=True).reshape(shape)

assert gradcheck(F.oscillator_bank, (freq, amps, sample_rate))
atol = 1e-05
if ROCM_HOME is not None:
atol = 1e-04
assert gradcheck(F.oscillator_bank, (freq, amps, sample_rate), atol=atol)

def test_extend_pitch(self):
num_frames, num_pitches = 5, 7
Expand Down