Skip to content

Commit

Permalink
CI cleaning (#4941)
Browse files Browse the repository at this point in the history
* set

* cut

* env

* oonce

* env

* env

* env
  • Loading branch information
Borda authored Dec 2, 2020
1 parent a941f96 commit add387c
Show file tree
Hide file tree
Showing 8 changed files with 23 additions and 226 deletions.
3 changes: 3 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,16 @@ steps:
environment:
CODECOV_TOKEN:
from_secret: codecov_token
AUTH_TOKEN:
from_secret: gh_auth_token
MKL_THREADING_LAYER: GNU

commands:
- python --version
- pip --version
- nvidia-smi
- pip install -r ./requirements/devel.txt --upgrade-strategy only-if-needed -v --no-cache-dir
- pip install git+https://${AUTH_TOKEN}@github.com/PyTorchLightning/[email protected] -v --no-cache-dir
# when Image has defined CUDa version we can switch to this package spec "nvidia-dali-cuda${CUDA_VERSION%%.*}0"
# todo: temprarl fix till https://github.com/PyTorchLightning/pytorch-lightning/pull/4922 is resolved
- pip install --extra-index-url https://developer.download.nvidia.com/compute/redist "nvidia-dali-cuda100<0.27" --upgrade-strategy only-if-needed
Expand Down
2 changes: 1 addition & 1 deletion benchmarks/test_sharded_parity.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from pytorch_lightning.plugins.ddp_plugin import DDPPlugin
from pytorch_lightning.plugins.sharded_plugin import DDPShardedPlugin
from pytorch_lightning.utilities import FAIRSCALE_AVAILABLE, NATIVE_AMP_AVAILABLE
from tests.backends.launcher import DDPLauncher
from tests.backends import DDPLauncher
from tests.base.boring_model import BoringModel, RandomDataset


Expand Down
7 changes: 5 additions & 2 deletions tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,11 @@
import numpy as np

TEST_ROOT = os.path.dirname(__file__)
PACKAGE_ROOT = os.path.dirname(TEST_ROOT)
TEMP_PATH = os.path.join(PACKAGE_ROOT, 'test_temp')
PROJECT_ROOT = os.path.dirname(TEST_ROOT)
TEMP_PATH = os.path.join(PROJECT_ROOT, 'test_temp')

if PROJECT_ROOT not in os.getenv('PYTHONPATH', ""):
os.environ['PYTHONPATH'] = f'{PROJECT_ROOT}:{os.environ.get("PYTHONPATH", "")}'

# generate a list of random seeds for each test
RANDOM_PORTS = list(np.random.randint(12000, 19000, 1000))
Expand Down
10 changes: 10 additions & 0 deletions tests/backends/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
from functools import wraps

try:
from dtrun.launcher import DDPLauncher
except ImportError:
class DDPLauncher:
def run(cmd_line, **kwargs):
def inner(func):
pass
return inner
218 changes: 0 additions & 218 deletions tests/backends/launcher.py

This file was deleted.

3 changes: 1 addition & 2 deletions tests/backends/test_ddp.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,12 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import os
from time import sleep

import pytest
import torch

from tests.backends import ddp_model
from tests.backends.launcher import DDPLauncher
from tests.backends import DDPLauncher
from tests.utilities.distributed import call_training_script


Expand Down
4 changes: 2 additions & 2 deletions tests/base/datasets.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
from torch import Tensor
from torch.utils.data import Dataset

from tests import PACKAGE_ROOT
from tests import PROJECT_ROOT

#: local path to test datasets
PATH_DATASETS = os.path.join(PACKAGE_ROOT, 'Datasets')
PATH_DATASETS = os.path.join(PROJECT_ROOT, 'Datasets')


class MNIST(Dataset):
Expand Down
2 changes: 1 addition & 1 deletion tests/trainer/properties/test_get_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import torch

from pytorch_lightning import Trainer
from tests.backends.launcher import DDPLauncher
from tests.backends import DDPLauncher
from tests.base.boring_model import BoringModel


Expand Down

0 comments on commit add387c

Please sign in to comment.