Skip to content

Commit

Permalink
Minor changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gokulavasan committed Mar 26, 2024
1 parent 4178f61 commit 7cf9005
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test/dataloader2/test_mprs.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ class TestMultiProcessingReadingService(TestCase):
@parametrize("dp_fn", [subtest(_non_dispatching_dp, "non_dispatch"), subtest(_dispatching_dp, "dispatch")])
@parametrize("main_prefetch", [0, 10])
@parametrize("worker_prefetch", [0, 10])
def test_early_exit(self, ctx="forkserver", dp_fn, main_prefetch, worker_prefetch) -> None:
def test_early_exit(self, dp_fn, main_prefetch, worker_prefetch) -> None:
ctx = "forkserver"
dp = dp_fn(1000)
rs = MultiProcessingReadingService(
num_workers=2,
Expand All @@ -246,7 +247,8 @@ def test_early_exit(self, ctx="forkserver", dp_fn, main_prefetch, worker_prefetc
@parametrize("dp_fn", [subtest(_non_dispatching_dp, "non_dispatch"), subtest(_dispatching_dp, "dispatch")])
@parametrize("main_prefetch", [0, 10])
@parametrize("worker_prefetch", [0, 10])
def test_exit(self, ctx="forkserver", dp_fn, main_prefetch, worker_prefetch) -> None:
def test_exit(self, dp_fn, main_prefetch, worker_prefetch) -> None:
ctx = "forkserver"
dp = dp_fn(1000)
rs = MultiProcessingReadingService(
num_workers=2,
Expand All @@ -263,8 +265,8 @@ def test_exit(self, ctx="forkserver", dp_fn, main_prefetch, worker_prefetch) ->
"n_workers,worker_prefetch_cnt,main_prefetch_cnt",
[(1, 0, 0), (1, 0, 2), (2, 0, 0), (2, 2, 0), (2, 0, 2), (2, 2, 2)],
)
def test_reading_service_pause_resume(self, ctx="forkserver", dp, n_workers, worker_prefetch_cnt, main_prefetch_cnt) -> None:

def test_reading_service_pause_resume(self, dp, n_workers, worker_prefetch_cnt, main_prefetch_cnt) -> None:
ctx = "forkserver"
# Functional Test: Testing various configuration of DataPipe/ReadingService to ensure the pipeline
# properly pauses and resumes
rs = MultiProcessingReadingService(
Expand Down Expand Up @@ -292,8 +294,8 @@ def test_reading_service_pause_resume(self, ctx="forkserver", dp, n_workers, wor

@dp_parametrize
@parametrize("n_workers,worker_prefetch_cnt,main_prefetch_cnt", [(2, 0, 1), (2, 1, 0), (2, 0, 0)])
def test_reading_service_pause_stop_yield(self, ctx="forkserver", dp, n_workers, worker_prefetch_cnt, main_prefetch_cnt) -> None:

def test_reading_service_pause_stop_yield(self, dp, n_workers, worker_prefetch_cnt, main_prefetch_cnt) -> None:
ctx = "forkserver"
# Functional Test: Confirms that `dl` will stop yielding elements after `_pause` is called
rs = MultiProcessingReadingService(
num_workers=n_workers,
Expand Down

0 comments on commit 7cf9005

Please sign in to comment.