Skip to content

Avoid network access during ordinary tests #11422

@carmocca

Description

@carmocca

Proposed refactor

Some of our tests use the MNIST and TrialMNIST classes which download the MNIST data off the internet (or from a cache).

https://github.com/PyTorchLightning/pytorch-lightning/blob/948cfd24de4f64a2980395581f15544e5e37eab0/tests/helpers/datasets.py#L25

https://github.com/PyTorchLightning/pytorch-lightning/blob/948cfd24de4f64a2980395581f15544e5e37eab0/tests/helpers/datasets.py#L134

Motivation

We should avoid this to reduce the inherent flakiness of network access.

Pitch

If a test uses these classes, do one of 3 options:

  • Remove the test, if we consider it's not useful (probably an old test)
  • Update the test to use either RandomDataset or a RandomMNIST class which would "mock" the actual MNIST dataset but with random data.
  • Move the test to tests/benchmarks

Additional context

Master is currently blocked due to errors while reading the MNIST data zipfiles.


If you enjoy Lightning, check out our other projects! ⚡

  • Metrics: Machine learning metrics for distributed, scalable PyTorch applications.

  • Lite: enables pure PyTorch users to scale their existing code on any kind of device while retaining full control over their own loops and optimization logic.

  • Flash: The fastest way to get a Lightning baseline! A collection of tasks for fast prototyping, baselining, fine-tuning, and solving problems with deep learning.

  • Bolts: Pretrained SOTA Deep Learning models, callbacks, and more for research and production with PyTorch Lightning and PyTorch.

  • Lightning Transformers: Flexible interface for high-performance research using SOTA Transformers leveraging Pytorch Lightning, Transformers, and Hydra.

cc @Borda @akihironitta

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions