Skip to content
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

[core] Optimize mars graph building performance #2848

Closed
chaokunyang opened this issue Mar 22, 2022 · 1 comment · Fixed by #2857
Closed

[core] Optimize mars graph building performance #2848

chaokunyang opened this issue Mar 22, 2022 · 1 comment · Fixed by #2857
Labels
mod: task service type: bug Something isn't working
Milestone

Comments

@chaokunyang
Copy link
Contributor

chaokunyang commented Mar 22, 2022

Is your feature request related to a problem? Please describe.

num_rows = 100_0000_0000
df1 = md.DataFrame(
    mt.random.rand(num_rows, 4, chunk_size=100_0000),
    columns=list('abcd'))
df2 = md.DataFrame(
    mt.random.rand(num_rows, 4, chunk_size=100_0000),
    columns=list('abcd'))
df1.merge(df2, left_on='a', right_on='a').execute()

20000subtasks and 50 16C32Gworker

  • without coloring, graph build time:
    • tile: 128s
    • assign: 40min
      image
      image

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

@chaokunyang
Copy link
Contributor Author

The process can be reproduced by:

from ..... import dataframe as md
from ..... import tensor as mt
from .....core.graph import TileableGraph, TileableGraphBuilder, ChunkGraphBuilder
from ..analyzer import GraphAnalyzer
from ..assigner import GraphAssigner


def test_assigner():
    num_rows = 100_0000_0000
    df1 = md.DataFrame(
        mt.random.rand(num_rows, 4, chunk_size=100_0000),
        columns=list('abcd'))
    df2 = md.DataFrame(
        mt.random.rand(num_rows, 4, chunk_size=100_0000),
        columns=list('abcd'))
    merged_df = df1.merge(df2, left_on='a', right_on='a')
    graph = TileableGraph([merged_df.data])
    next(TileableGraphBuilder(graph).build())
    chunk_graph = next(ChunkGraphBuilder(graph, fuse_enabled=False).build())
    start_ops = list(GraphAnalyzer._iter_start_ops(chunk_graph))
    band_slots = {
        (f"worker-{i}", "numa-0"): 16 for i in range(50)
    }
    current_assign = {}
    assigner = GraphAssigner(chunk_graph, start_ops, band_slots)
    assigned_result = assigner.assign(current_assign)
    print(len(assigned_result))

@wjsi wjsi added type: bug Something isn't working mod: task service labels Mar 24, 2022
@wjsi wjsi added this to the v0.9.0rc2 milestone Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mod: task service type: bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants