-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FEAT-#5394: Reduce amount of remote calls for TreeReduce and GroupByReduce operators #55
base: main
Are you sure you want to change the base?
Conversation
…educe operators Signed-off-by: Kirill Suvorov <[email protected]>
My review is in progress 📖 - I will have feedback for you in a few minutes! |
WalkthroughThe recent changes streamline the mapping logic in the Modin library, enhancing efficiency in handling data partitions. The Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ModinDataframe
participant PartitionManager
User->>ModinDataframe: Call map function
ModinDataframe->>PartitionManager: Map partitions
PartitionManager->>PartitionManager: Check CPU count
alt If partitions <= 1.5 * CPUs
PartitionManager->>PartitionManager: Apply block-wise mapping
else
PartitionManager->>PartitionManager: Apply axis-wise mapping
end
PartitionManager->>ModinDataframe: Return mapped result
ModinDataframe->>User: Return final output
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have reviewed your code and did not find any issues!
Please note that I can make mistakes, and you should still encourage your team to review your code as well.
/review |
PR Reviewer Guide 🔍(Review updated until commit f1f0c42)
|
@coderabbitai full review |
Persistent review updated to latest commit f1f0c42 |
Actions performedFull review triggered. |
PR Code Suggestions ✨
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (2)
- modin/core/dataframe/pandas/dataframe/dataframe.py (2 hunks)
- modin/core/dataframe/pandas/partitioning/partition_manager.py (2 hunks)
Additional comments not posted (3)
modin/core/dataframe/pandas/partitioning/partition_manager.py (2)
625-641
: Ensure clarity and correctness in CPU-based mapping logic.The logic for choosing between block-wise and axis-wise mapping based on CPU count is a good optimization. However, ensure that the condition
np.prod(partitions.shape) <= 1.5 * CpuCount.get()
is appropriate for all expected use cases. Consider edge cases where the number of partitions might be very low or very high.To verify the correctness of the CPU-based mapping logic, ensure that the condition is tested under various scenarios with different partition sizes and CPU counts. Consider adding unit tests to cover these scenarios.
642-671
: Review axis determination and partition splitting logic.The logic for determining the axis based on CPU count and partition dimensions is sound. However, ensure that the calculation
CpuCount.get() // partitions.shape[1]
forcolumn_splits
is valid for all cases, especially whenpartitions.shape[1]
is zero or very small.Test the axis determination logic with different partition shapes and CPU counts to ensure robustness. Consider edge cases where the partition dimensions are close to or exceed the CPU count.
modin/core/dataframe/pandas/dataframe/dataframe.py (1)
2208-2212
: Simplification ofmap
function logic looks good!The removal of conditional checks related to CPU count simplifies the code and improves maintainability. Ensure that this change does not negatively impact performance in scenarios where CPU count was previously a factor.
Consider verifying the performance impact of this change, especially in multi-core environments.
Run the following script to verify the performance impact:
Zero comments from coderabbit |
User description
Apply approaches from PR-7136 for TreeReduce and GroupByReduce operators
What do these changes do?
flake8 modin/ asv_bench/benchmarks scripts/doc_checker.py
black --check modin/ asv_bench/benchmarks scripts/doc_checker.py
git commit -s
docs/development/architecture.rst
is up-to-dateDescription by Korbit AI
Note
This feature is in early access. You can enable or disable it in the Korbit Console.
What change is being made?
Reduce the number of remote calls for
TreeReduce
andGroupByReduce
operators by simplifying themap
function logic indataframe.py
andpartition_manager.py
.Why are these changes being made?
The previous implementation had complex logic to decide between block-wise and axis-wise mapping, which led to unnecessary remote calls. Simplifying this logic improves performance by reducing the overhead of remote calls, especially for smaller dataframes.
PR Type
Enhancement
Description
map
function indataframe.py
to reduce unnecessary remote calls by removing complex logic for mapping decisions.partition_manager.py
to include logic for deciding between block-wise and axis-wise mapping based on partition size, improving performance for larger dataframes.Changes walkthrough 📝
dataframe.py
Simplify map function logic in dataframe.py
modin/core/dataframe/pandas/dataframe/dataframe.py
mapping.
map
function to always use partition manager's mapfunctions.
partition_manager.py
Enhance partition mapping logic in partition_manager.py
modin/core/dataframe/pandas/partitioning/partition_manager.py
on partition size.
Summary by CodeRabbit
New Features
Bug Fixes
Documentation