Skip to content

Commit ff7b1c2

Browse files
SNOW-2380741: Use all logical cores in snowpark tests. (#3824)
Formerly, we had limited the test parallelism to not overwhelm our Snowflake deployments, but now that we are using multi-cluster warehouses, we should be able to use all 64 cores. This change speeds up Modin CI jobs according to a sample size of 1. Other long-running CI jobs seem to take about as long before and after. [before](https://github.com/snowflakedb/snowpark-python/actions/runs/18150423863) vs [after](https://github.com/snowflakedb/snowpark-python/actions/runs/18150450772?pr=3824): <table> <tr> <td> test <td> before (minutes) <td> after (minutes) <tr> <td> modin-macos-latest-3.9-aws <td> 30 <td> 28 <tr> <td> modin-ubuntu-latest-64-cores-3.10-azure <td> 42 <td> 31 <tr> <td> modin-ubuntu-latest-64-cores-3.12-aws <td> 48 <td> 30 <tr> <td> modin-windows-latest-64-cores-3.11-gcp <td> 71 <td> 42 </table> Signed-off-by: sfc-gh-mvashishtha <mahesh.vashishtha@snowflake.com>
1 parent d989dfa commit ff7b1c2

1 file changed

Lines changed: 9 additions & 3 deletions

File tree

tox.ini

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,14 @@ setenv =
6262
COVERAGE_FILE = {env:COVERAGE_FILE:{toxworkdir}/.coverage.{envname}}
6363
ci: SNOWFLAKE_PYTEST_VERBOSITY = -vvv
6464
# Do not run doctests in parallel so coverage works
65-
# Snowpark uses 36 workers to accelerate testing in merge gate
66-
!doctest: SNOWFLAKE_PYTEST_PARALLELISM = -n 36
65+
# Snowpark uses all available logical cores to accelerate testing in merge gate.
66+
# Note that using all available physical cores with `-n auto` seems to
67+
# spawn fewer than 64 pytest processes on the 64-core github runners.
68+
# For AST tests, use just 36 cores, because using more cores sometimes
69+
# causes the test job to fail with exit code 143, which supposedly means
70+
# that it uses too many machine resources.
71+
!doctest-!ast: SNOWFLAKE_PYTEST_PARALLELISM = -n logical
72+
ast: SNOWFLAKE_PYTEST_PARALLELISM = -n 36
6773
# Snowpark uses 4 workers for daily testing since some of its test jobs use weak MacOS instances.
6874
!doctest: SNOWFLAKE_PYTEST_DAILY_PARALLELISM = -n 6
6975
# Set test type, either notset, unit, integ, or both
@@ -129,7 +135,7 @@ commands =
129135
# is difficult.
130136
snowparkpandasnotdoctest: bash scripts/run_snowparkpandasnotdoctest.sh {env:SNOW_1314507_WORKAROUND_RERUN_FLAGS} {posargs:}
131137
# This one only run doctest but we still need to include the tests folder to let tests/conftest.py to mark the doctest files for us
132-
snowparkpandasdoctest: {env:MODIN_PYTEST_CMD} --durations=20 -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} src/snowflake/snowpark/modin/ tests/unit/modin
138+
snowparkpandasdoctest: {env:MODIN_PYTEST_CMD} --durations=20 -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} {env:SNOW_1314507_WORKAROUND_RERUN_FLAGS} src/snowflake/snowpark/modin/ tests/unit/modin
133139
# This one is used by daily_modin_precommit_py39_py310.yml
134140
snowparkpandasdailynotdoctest: {env:MODIN_PYTEST_DAILY_CMD} --durations=20 -m "{env:SNOWFLAKE_TEST_TYPE}" {posargs:} {env:SNOW_1314507_WORKAROUND_RERUN_FLAGS} tests/unit/modin tests/integ/modin tests/integ/test_df_to_snowpark_pandas.py
135141
# This one is only called by jenkins job and the only difference from `snowparkpandasnotdoctest` is that it uses

0 commit comments

Comments
 (0)