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

Feature/python benchmarking #11125

Merged
merged 27 commits into from
Jun 27, 2022

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Jun 17, 2022

This PR ports the benchmarks in https://github.com/vyasr/cudf_benchmarks, adding official benchmarks to the repository. The new benchmarks are designed from the ground up to make the best use of pytest, pytest-benchmark, and pytest-cases to simplify writing and maintaining benchmarks. Extended discussions of various previous design questions may be found on the original repo. Reviewers may also benefit from reviewing the companion PR creating documentation for how to write benchmarks, #11122.

Tests will not pass here until rapidsai/integration#492 is merged.

@vyasr vyasr added feature request New feature or request 3 - Ready for Review Ready for review by team Python Affects Python cuDF API. non-breaking Non-breaking change labels Jun 17, 2022
@vyasr vyasr requested review from a team as code owners June 17, 2022 21:59
@vyasr vyasr self-assigned this Jun 17, 2022
@vyasr vyasr requested review from shwina and isVoid and removed request for rgsl888prabhu June 17, 2022 22:02
@vyasr
Copy link
Contributor Author

vyasr commented Jun 17, 2022

This PR has a large changeset by necessity. In order to make this review process a bit smoother, I have explicitly requested reviews from people who have contributed benchmarks before and/or are familiar with my design for the benchmarks (@isVoid, @shwina, and @galipremsagar).

Copy link
Contributor

@isVoid isVoid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review part 1. Incredible work!

python/cudf/benchmarks/common/config.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/conftest.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/common/utils.py Show resolved Hide resolved
python/cudf/benchmarks/common/utils.py Show resolved Hide resolved
python/cudf/benchmarks/common/utils.py Show resolved Hide resolved
python/cudf/benchmarks/common/utils.py Outdated Show resolved Hide resolved
@ajschmidt8
Copy link
Member

rerun tests

@codecov
Copy link

codecov bot commented Jun 24, 2022

Codecov Report

❗ No coverage uploaded for pull request base (branch-22.08@379faf9). Click here to learn what that means.
The diff coverage is n/a.

@@               Coverage Diff               @@
##             branch-22.08   #11125   +/-   ##
===============================================
  Coverage                ?   86.33%           
===============================================
  Files                   ?      144           
  Lines                   ?    22751           
  Branches                ?        0           
===============================================
  Hits                    ?    19641           
  Misses                  ?     3110           
  Partials                ?        0           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 379faf9...5f80061. Read the comment docs.

Copy link
Contributor

@galipremsagar galipremsagar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For consistency sake can we switch all the relative imports to absolute imports?

python/cudf/benchmarks/API/bench_dataframe.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/API/bench_frame_or_index.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/API/bench_functions.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/API/bench_functions_cases.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/API/bench_index.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/internal/conftest.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/internal/bench_column.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/conftest.py Outdated Show resolved Hide resolved
python/cudf/benchmarks/common/utils.py Outdated Show resolved Hide resolved
@vyasr
Copy link
Contributor Author

vyasr commented Jun 24, 2022

For consistency sake can we switch all the relative imports to absolute imports?

Done

Copy link
Contributor

@mroeschke mroeschke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks pretty good! This is a good base of benchmarks that can be expanded on in the future.

Not sure if this was discussed, but how did you imagine these benchmarks to be used? For example in pandas, we have used ASV to catch performance regressions across verions, but we're inconsistent about this as it takes a while to run the whole suite.

@vyasr
Copy link
Contributor Author

vyasr commented Jun 24, 2022

rerun tests

@vyasr
Copy link
Contributor Author

vyasr commented Jun 24, 2022

Looks pretty good! This is a good base of benchmarks that can be expanded on in the future.

Not sure if this was discussed, but how did you imagine these benchmarks to be used? For example in pandas, we have used ASV to catch performance regressions across verions, but we're inconsistent about this as it takes a while to run the whole suite.

We have indeed discussed this before. ASV is something that we've definitely considered, not for running benchmarks but rather using the dashboards with data from pytest-benchmark via some plugins written by other RAPIDS team members. For the moment, the process of tracking historical benchmark results is pretty manual. We've discussed automating benchmark runs more going forward, but we haven't come to any specific solution yet. I think that to some extent this is waiting on various changes from our ops team.

@vyasr
Copy link
Contributor Author

vyasr commented Jun 25, 2022

rerun tests

ci/gpu/build.sh Show resolved Hide resolved
ci/gpu/build.sh Outdated Show resolved Hide resolved
@vyasr
Copy link
Contributor Author

vyasr commented Jun 25, 2022

@bdice I had to roll back the changes making the benchmarks a Python package because it appears to change pytest's package discovery logic in a way that leads to it always finding the local copy of the package rather than the installed one, which is problematic when the package is not built in place (the case in our CI). I'm happy to revisit this further in the future, but in the interest of moving us forward I would like to merge as is and try to improve the organization and address the CI issues in future PRs.

@vyasr
Copy link
Contributor Author

vyasr commented Jun 27, 2022

@gpucibot merge

@rapids-bot rapids-bot bot merged commit c75baeb into rapidsai:branch-22.08 Jun 27, 2022
rapids-bot bot pushed a commit that referenced this pull request Oct 11, 2022
The version of `bench_isin` merged in #11125 used key and column names of the format `f"key{i}"` rather than the format `f"{string.ascii_lowercase[i]}"` as is used in the dataframe generator. As a result the `isin` benchmark using a dictionary argument short-circuits with no matching keys, and the `isin` benchmark using a dataframe argument finds no matches.

This PR also adjusts the `isin` arguments from `range(1000)` to `range(50)` to better match the input dataframe cardinality of 100. With `range(1000)`, every element matches but with `range(50)` only 50% of the elements match.

Authors:
  - Gregory Kimball (https://github.com/GregoryKimball)

Approvers:
  - Bradley Dice (https://github.com/bdice)
  - GALI PREM SAGAR (https://github.com/galipremsagar)

URL: #11549
@vyasr vyasr deleted the feature/python_benchmarking branch January 23, 2024 21:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3 - Ready for Review Ready for review by team feature request New feature or request non-breaking Non-breaking change Python Affects Python cuDF API.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants