Skip to content

Skip KLDivLoss_cuda tests due to hang #161

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

Merged
merged 11 commits into from
Aug 29, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion aten/src/ATen/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ IF(USE_CUDA AND NOT USE_ROCM)
ENDIF()

IF(USE_ROCM)
### Link in the ROCm libraries BLAS / RNG .
### Link in the ROCm libraries BLAS / RNG.
FIND_LIBRARY(ROCBLAS_LIBRARY rocblas HINTS ${ROCBLAS_PATH}/lib)
FIND_LIBRARY(HIPRAND_LIBRARY hiprand HINTS ${HIPRAND_PATH}/lib)

Expand Down
1 change: 1 addition & 0 deletions test/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,7 @@ def wrapper(*args, **kwargs):
fn(*args, **kwargs)
return wrapper


def skipIfNoLapack(fn):
@wraps(fn)
def wrapper(*args, **kwargs):
Expand Down
45 changes: 22 additions & 23 deletions test/common_nn.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def get_weight(m):
constructor_args=(10, 8),
input_size=(4, 10),
reference_fn=lambda i, p: torch.mm(i, p[0].t()) + p[1].view(1, -1).expand(4, 8),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='Linear',
Expand Down Expand Up @@ -103,28 +103,28 @@ def get_weight(m):
constructor_args=(1,),
input_size=(10, 20),
reference_fn=lambda i, _: torch.exp(i).div(torch.exp(i).sum(1, True).expand(10, 20)),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='Softmax2d',
input_size=(1, 3, 10, 20),
reference_fn=lambda i, _: torch.exp(i).div(torch.exp(i).sum(1, False)),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='LogSoftmax',
constructor_args=(1,),
input_size=(10, 20),
reference_fn=lambda i, _: torch.exp(i).div_(torch.exp(i).sum(1, True).expand(10, 20)).log_(),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='LogSoftmax',
constructor_args=(1,),
input_size=(1, 3, 10, 20),
reference_fn=lambda i, _: torch.exp(i).div_(torch.exp(i).sum(1, False)).log_(),
desc='multiparam',
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='ELU',
Expand Down Expand Up @@ -204,61 +204,59 @@ def get_weight(m):
input_size=(2, 3, 4),
desc='1d_multiparam',
reference_fn=lambda i, p: torch.clamp(i, min=0) + torch.clamp(i, max=0) * p[0][0],
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='PReLU',
input_size=(2, 3, 4, 5),
desc='2d',
reference_fn=lambda i, p: torch.clamp(i, min=0) + torch.clamp(i, max=0) * p[0][0],
#test_cuda = (not TEST_WITH_ROCM)
),
dict(
module_name='PReLU',
constructor_args=(3,),
input_size=(2, 3, 4, 5),
desc='2d_multiparam',
reference_fn=lambda i, p: torch.clamp(i, min=0) + torch.clamp(i, max=0) * p[0][0],
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='PReLU',
input_size=(2, 3, 4, 5, 6),
reference_fn=lambda i, p: torch.clamp(i, min=0) + torch.clamp(i, max=0) * p[0][0],
desc='3d',
#test_cuda = (not TEST_WITH_ROCM)
),
dict(
module_name='PReLU',
constructor_args=(3,),
input_size=(2, 3, 4, 5, 6),
desc='3d_multiparam',
reference_fn=lambda i, p: torch.clamp(i, min=0) + torch.clamp(i, max=0) * p[0][0],
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='Softsign',
input_size=(3, 2, 5),
reference_fn=lambda i, _: i.div(1 + torch.abs(i)),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='Softmin',
constructor_args=(1,),
input_size=(10, 20),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='Softmin',
constructor_args=(1,),
input_size=(2, 3, 5, 10),
desc='multidim',
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='Tanhshrink',
input_size=(2, 3, 4, 5),
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
]

Expand Down Expand Up @@ -575,6 +573,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
reference_fn=lambda i, t, m:
kldivloss_reference(i, t, get_reduction(m)),
check_sum_reduction=True,
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='MSELoss',
Expand All @@ -591,7 +590,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
reference_fn=lambda i, t, m: -(t * i.log() + (1 - t) * (1 - i).log()).sum() /
(i.numel() if get_reduction(m) else 1),
check_gradgrad=False,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='BCELoss',
Expand All @@ -602,7 +601,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
(i.numel() if get_reduction(m) else 1),
desc='weights',
check_gradgrad=False,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='CrossEntropyLoss',
Expand All @@ -623,7 +622,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
reference_fn=lambda i, t, m:
hingeembeddingloss_reference(i, t, reduction=get_reduction(m)),
check_sum_reduction=True,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='HingeEmbeddingLoss',
Expand All @@ -634,7 +633,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
hingeembeddingloss_reference(i, t, margin=0.5, reduction=get_reduction(m)),
desc='margin',
check_sum_reduction=True,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='MultiLabelMarginLoss',
Expand All @@ -661,7 +660,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
target_fn=lambda: torch.rand(5, 10).mul(2).floor(),
reference_fn=lambda i, t, m: -(t * i.sigmoid().log() + (1 - t) * (-i).sigmoid().log()).sum() / i.numel(),
check_gradgrad=False,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='MultiMarginLoss',
Expand Down Expand Up @@ -740,7 +739,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
reference_fn=lambda i, t, m:
cosineembeddingloss_reference(i[0], i[1], t, reduction=get_reduction(m)),
check_sum_reduction=True,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='CosineEmbeddingLoss',
Expand All @@ -751,7 +750,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
cosineembeddingloss_reference(i[0], i[1], t, margin=0.7, reduction=get_reduction(m)),
desc='margin',
check_sum_reduction=True,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='MarginRankingLoss',
Expand All @@ -760,7 +759,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
reference_fn=lambda i, t, m:
marginrankingloss_reference(i[0], i[1], t, reduction=get_reduction(m)),
check_sum_reduction=True,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
dict(
module_name='MarginRankingLoss',
Expand All @@ -771,7 +770,7 @@ def ctcloss_reference(log_probs, targets, input_lengths, target_lengths, blank=0
marginrankingloss_reference(i[0], i[1], t, margin=0.5, reduction=get_reduction(m)),
desc='margin',
check_sum_reduction=True,
test_cuda = (not TEST_WITH_ROCM)
test_cuda=(not TEST_WITH_ROCM)
),
]

Expand Down
1 change: 1 addition & 0 deletions test/test_jit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6324,6 +6324,7 @@ class Config:

self.checkTrace(SNLIClassifier(Config()), (premise, hypothesis), inputs_require_grads=False)

@skipIfRocm
def test_super_resolution(self):
import torch.nn.init as init

Expand Down
Loading