From 25bb63f128e55477f1da2cf45d7c4118453b9206 Mon Sep 17 00:00:00 2001 From: Daniel King <43149077+dakinggg@users.noreply.github.com> Date: Fri, 17 Nov 2023 11:25:20 -0800 Subject: [PATCH] Patch os cpu count to avoid extra multiprocessing inside pytest which sometimes hangs (#745) --- tests/fixtures/data.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/fixtures/data.py b/tests/fixtures/data.py index 39032146b6..16dd01347d 100644 --- a/tests/fixtures/data.py +++ b/tests/fixtures/data.py @@ -2,6 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 from pathlib import Path +from unittest.mock import MagicMock, patch from composer.utils import dist from omegaconf import DictConfig @@ -25,6 +26,7 @@ def tiny_ft_dataset_path(tmp_path: Path, dataset_size: int = 4) -> Path: @fixture +@patch('os.cpu_count', MagicMock(return_value=None)) def tiny_ft_dataloader(tiny_ft_dataset_path: Path, mpt_tokenizer: PreTrainedTokenizerBase, max_seq_len: int = 128,