Skip to content
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

prefetch mvp #986

Merged
merged 6 commits into from Nov 10, 2020
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/codestyle.yml
Expand Up @@ -66,7 +66,7 @@ jobs:
flake8 . | reviewdog -f=pep8 -reporter=github-pr-review

build:
name: codestyle
name: codestyle-pytest-docs
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand Down
6 changes: 4 additions & 2 deletions CHANGELOG.md
Expand Up @@ -15,16 +15,20 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
- `OneOf` and `OneOfV2` batch transforms ([#951](https://github.com/catalyst-team/catalyst/pull/951))
- ``precision_recall_fbeta_support`` metric ([#971](https://github.com/catalyst-team/catalyst/pull/971))
- Pruning tutorial ([#987](https://github.com/catalyst-team/catalyst/pull/987))
- BatchPrefetchLoaderWrapper ([#986](https://github.com/catalyst-team/catalyst/pull/986))
- DynamicBalanceClassSampler ([#954](https://github.com/catalyst-team/catalyst/pull/954))

### Changed

- update Catalyst version to `20.10.1` for tutorials ([#967](https://github.com/catalyst-team/catalyst/pull/967))
- added link to dl-course ([#967](https://github.com/catalyst-team/catalyst/pull/967))
- docs were restructured ([#985](https://github.com/catalyst-team/catalyst/pull/985))
- `set_global_seed` moved from `utils.seed` to `utils.misc` ([#986](https://github.com/catalyst-team/catalyst/pull/986))

### Removed

- several deprecated tutorials ([#967](https://github.com/catalyst-team/catalyst/pull/967))
- several deprecated func from utils.misc ([#986](https://github.com/catalyst-team/catalyst/pull/986))

### Fixed

Expand Down Expand Up @@ -74,7 +78,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Added

- Runner registry support for Config API ([#936](https://github.com/catalyst-team/catalyst/pull/936))

- `catalyst-dl tune` command - Optuna with Config API integration for AutoML hyperparameters optimization ([#937](https://github.com/catalyst-team/catalyst/pull/937))
- `OptunaPruningCallback` alias for `OptunaCallback` ([#937](https://github.com/catalyst-team/catalyst/pull/937))
- AdamP and SGDP to `catalyst.contrib.nn.criterion` ([#942](https://github.com/catalyst-team/catalyst/pull/942))
Expand All @@ -90,7 +93,6 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/).
### Fixed

- Logging double logging :) ([#936](https://github.com/catalyst-team/catalyst/pull/936))

- CMCCallback ([#941](https://github.com/catalyst-team/catalyst/pull/941))

## [20.09] - 2020-09-07
Expand Down
67 changes: 0 additions & 67 deletions catalyst/contrib/utils/tests/test_misc.py
Expand Up @@ -50,70 +50,3 @@ def forward(self, *, x, y=None):
)
)
assert params_predicted == params_true


def test_fn_ends_with_pass():
def useless_fn():
pass

def usefull_fn():
print("I am useful!")

assert utils.fn_ends_with_pass(useless_fn) is True
assert utils.fn_ends_with_pass(usefull_fn) is False


def test_fn_ends_with_pass_on_callbacks():
def test_fn_ends_with_pass_on_callback(
callback, events,
):
for event in events["covered"]:
fn_name = f"on_{event}"
assert (
utils.fn_ends_with_pass(getattr(callback.__class__, fn_name))
is False
)
for event in events["non-covered"]:
fn_name = f"on_{event}"
assert (
utils.fn_ends_with_pass(getattr(callback.__class__, fn_name))
is True
)

# Callback test
from catalyst.dl import Callback

callback = Callback(order=1)
start_events = [
"stage_start",
"epoch_start",
"batch_start",
"loader_start",
]
end_events = [
"stage_end",
"epoch_end",
"batch_end",
"loader_end",
"exception",
]
events = {"covered": [], "non-covered": [*start_events, *end_events]}
test_fn_ends_with_pass_on_callback(callback=callback, events=events)

# CriterionCallback test
from catalyst.dl import CriterionCallback

callback = CriterionCallback()
covered_events = ["stage_start", "batch_end"]
non_covered_start_events = ["epoch_start", "batch_start", "loader_start"]
non_covered_end_events = [
"stage_end",
"epoch_end",
"loader_end",
"exception",
]
events = {
"covered": [*covered_events],
"non-covered": [*non_covered_start_events, *non_covered_end_events],
}
test_fn_ends_with_pass_on_callback(callback=callback, events=events)
3 changes: 1 addition & 2 deletions catalyst/core/runner.py
Expand Up @@ -30,8 +30,7 @@
from catalyst.utils.components import process_components
from catalyst.utils.distributed import get_rank
from catalyst.utils.loaders import validate_loaders
from catalyst.utils.misc import maybe_recursive_call
from catalyst.utils.seed import set_global_seed
from catalyst.utils.misc import maybe_recursive_call, set_global_seed
from catalyst.utils.torch import any2device


Expand Down
6 changes: 5 additions & 1 deletion catalyst/data/__init__.py
Expand Up @@ -10,7 +10,11 @@
MetricLearningTrainDataset,
QueryGalleryDataset,
)
from catalyst.data.loader import BatchLimitLoaderWrapper
from catalyst.data.loader import (
ILoaderWrapper,
BatchLimitLoaderWrapper,
BatchPrefetchLoaderWrapper,
)
from catalyst.data.reader import (
ReaderSpec,
ScalarReader,
Expand Down