Skip to content

Commit 1919655

Browse files
authored
feat: update minimal thread number for concurrent artifact download (Azure#29648)
1 parent dffd1a6 commit 1919655

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

sdk/ml/azure-ai-ml/azure/ai/ml/_internal/entities/_additional_includes.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import yaml
1515

16-
from ..._artifacts._constants import PROCESSES_PER_CORE
1716
from ..._utils._asset_utils import IgnoreFile, traverse_directory
1817
from ..._utils.utils import is_concurrent_component_registration_enabled, is_private_preview_enabled
1918
from ...entities._util import _general_copy
@@ -346,7 +345,10 @@ def _load_artifact_additional_includes(self):
346345
additional_includes_configs = additional_includes_configs.get(ADDITIONAL_INCLUDES_KEY, [])
347346

348347
additional_includes, conflict_files = [], {}
349-
num_threads = int(cpu_count()) * PROCESSES_PER_CORE
348+
# Unlike component registration, artifact downloading is a pure download progress; so we can use
349+
# more threads to speed up the downloading process.
350+
# We use 5 threads per CPU core plus 5 extra threads, and the max number of threads is 64.
351+
num_threads = min(64, (int(cpu_count()) * 5) + 5)
350352
if (
351353
len(additional_includes_configs) > 1
352354
and is_concurrent_component_registration_enabled()

0 commit comments

Comments
 (0)