[testing] rename skip targets + docs (#7863)

* rename skip targets + docs

* fix quotes

* style

* Apply suggestions from code review

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>

* small improvements

* fix

Co-authored-by: Sylvain Gugger <35901082+sgugger@users.noreply.github.com>
This commit is contained in:
Stas Bekman
2020-10-20 01:39:13 -07:00
committed by GitHub
parent c912ba5f69
commit 3e31e7f956
9 changed files with 52 additions and 35 deletions

View File

@@ -22,7 +22,7 @@ import unittest
from typing import List, Tuple
from transformers import is_torch_available
from transformers.testing_utils import require_multigpu, require_torch, slow, torch_device
from transformers.testing_utils import require_torch, require_torch_multigpu, slow, torch_device
if is_torch_available():
@@ -980,7 +980,7 @@ class ModelTesterMixin:
return True
return False
@require_multigpu
@require_torch_multigpu
def test_multigpu_data_parallel_forward(self):
config, inputs_dict = self.model_tester.prepare_config_and_inputs_for_common()

View File

@@ -18,7 +18,7 @@ import unittest
from transformers import is_torch_available
from transformers.file_utils import cached_property
from transformers.testing_utils import require_torch, require_torch_and_cuda, slow, torch_device
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device
from .test_configuration_common import ConfigTester
from .test_modeling_common import ModelTesterMixin, ids_tensor
@@ -234,6 +234,6 @@ class LayoutLMModelTest(ModelTesterMixin, unittest.TestCase):
"""Test loss/gradients same as reference implementation, for example."""
pass
@require_torch_and_cuda
@require_torch_gpu
def test_large_inputs_in_fp16_dont_cause_overflow(self):
pass

View File

@@ -17,10 +17,10 @@ import unittest
from transformers import is_torch_available
from transformers.testing_utils import (
require_multigpu,
require_sentencepiece,
require_tokenizers,
require_torch,
require_torch_multigpu,
slow,
torch_device,
)
@@ -558,7 +558,7 @@ class ReformerTesterMixin:
config_and_inputs = self.model_tester.prepare_config_and_inputs()
self.model_tester.create_and_check_reformer_model_fp16_generate(*config_and_inputs)
@require_multigpu
@require_torch_multigpu
def test_multigpu_data_parallel_forward(self):
# Opt-out of this test.
pass

View File

@@ -17,7 +17,7 @@ import random
import unittest
from transformers import is_torch_available
from transformers.testing_utils import require_multigpu, require_torch, slow, torch_device
from transformers.testing_utils import require_torch, require_torch_multigpu, slow, torch_device
from .test_configuration_common import ConfigTester
from .test_modeling_common import ModelTesterMixin, ids_tensor
@@ -204,7 +204,7 @@ class TransfoXLModelTest(ModelTesterMixin, unittest.TestCase):
output_result = self.model_tester.create_transfo_xl_lm_head(*config_and_inputs)
self.model_tester.check_transfo_xl_lm_head_output(output_result)
@require_multigpu
@require_torch_multigpu
def test_multigpu_data_parallel_forward(self):
# Opt-out of this test.
pass

View File

@@ -34,7 +34,7 @@ import unittest
import pytest
from parameterized import parameterized
from transformers.testing_utils import require_torch, require_torch_and_cuda, slow, torch_device
from transformers.testing_utils import require_torch, require_torch_gpu, slow, torch_device
# skipping in unittest tests
@@ -63,11 +63,11 @@ def check_slow_torch_cuda():
@require_torch
class SkipTester(unittest.TestCase):
@slow
@require_torch_and_cuda
@require_torch_gpu
def test_2_skips_slow_first(self):
check_slow_torch_cuda()
@require_torch_and_cuda
@require_torch_gpu
@slow
def test_2_skips_slow_last(self):
check_slow_torch_cuda()
@@ -97,12 +97,12 @@ class SkipTester(unittest.TestCase):
@slow
@require_torch_and_cuda
@require_torch_gpu
def test_pytest_2_skips_slow_first():
check_slow_torch_cuda()
@require_torch_and_cuda
@require_torch_gpu
@slow
def test_pytest_2_skips_slow_last():
check_slow_torch_cuda()