Skip to content

Commit

Permalink
Use DynamicPartitioning env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
Retribution98 committed Aug 19, 2024
1 parent 8bc1375 commit 2d73dda
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
7 changes: 3 additions & 4 deletions modin/core/dataframe/pandas/partitioning/partition_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,10 +681,7 @@ def broadcast_apply(
np.ndarray
NumPy array of result partition objects.
"""
# The `broadcast_apply` runtime condition differs from
# the same condition in `map_partitions` because the columnar
# approach for `broadcast_apply` results in a slowdown.
if np.prod(left.shape) <= 1.5 * CpuCount.get():
if not DynamicPartitioning.get():
# block-wise broadcast
new_partitions = cls.base_broadcast_apply(
axis,
Expand All @@ -693,6 +690,8 @@ def broadcast_apply(
right,
)
else:
# The dynamic partitioning behavior of `broadcast_apply` differs from that of `map_partitions`,
# since the columnar approach for `broadcast_apply` results in slowdown.
# axis-wise broadcast
new_partitions = cls.broadcast_axis_partitions(

Check warning on line 696 in modin/core/dataframe/pandas/partitioning/partition_manager.py

View check run for this annotation

Codecov / codecov/patch

modin/core/dataframe/pandas/partitioning/partition_manager.py#L696

Added line #L696 was not covered by tests
axis=axis ^ 1,
Expand Down
3 changes: 1 addition & 2 deletions modin/core/storage_formats/pandas/query_compiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,7 @@
from pandas.core.indexing import check_bool_indexer
from pandas.errors import DataError

from modin.config import RangePartitioning
from modin.config.envvars import CpuCount
from modin.config import CpuCount, RangePartitioning
from modin.core.dataframe.algebra import (
Binary,
Fold,
Expand Down

0 comments on commit 2d73dda

Please sign in to comment.