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

Add operations/arguments to local CuPy array benchmark #524

Merged
merged 7 commits into from
Feb 12, 2021

Conversation

charlesbluca
Copy link
Member

This PR adds the following operations to the local CuPy array benchmark:

  • sum
  • mean
  • array slicing

This also adds an additional special argument, --benchmark-json, which takes an optional path to dump the results of the benchmark in JSON format. This would allow us to generate plots using the output, as discussed in #517.

Some thoughts:

  • Should there be an additional argument to specify the array slicing interval (which is currently fixed at 3)?
  • Could the JSON output be cleaned up? Currently, a (truncated) sample output file looks like:
{
  "operation": "transpose_sum",
  "size": 10000,
  "second_size": 1000,
  "chunk_size": 2500,
  "compute_size": [
    10000,
    10000
  ],
  "compute_chunk_size": [
    2500,
    2500
  ],
  "ignore_size": "1.05 MB",
  "protocol": "tcp",
  "devs": "0,1,2,3",
  "threads_per_worker": 1,
  "times": [
    {
      "wall_clock": 1.4910394318867475,
      "npartitions": 16
    }
  ],
  "bandwidths": {
    "(00,01)": {
      "25%": "136.34 MB/s",
      "50%": "156.67 MB/s",
      "75%": "163.32 MB/s",
      "total_nbytes": "150.00 MB"
    }
  }
}

@charlesbluca charlesbluca requested a review from a team as a code owner February 12, 2021 01:12
@charlesbluca charlesbluca mentioned this pull request Feb 12, 2021
@codecov-io
Copy link

codecov-io commented Feb 12, 2021

Codecov Report

Merging #524 (ff03dec) into branch-0.18 (32d9d33) will increase coverage by 2.02%.
The diff coverage is 96.35%.

Impacted file tree graph

@@               Coverage Diff               @@
##           branch-0.18     #524      +/-   ##
===============================================
+ Coverage        90.42%   92.45%   +2.02%     
===============================================
  Files               15       16       +1     
  Lines             1128     1550     +422     
===============================================
+ Hits              1020     1433     +413     
- Misses             108      117       +9     
Impacted Files Coverage Δ
dask_cuda/cli/dask_cuda_worker.py 96.92% <ø> (ø)
dask_cuda/cuda_worker.py 78.75% <75.00%> (+1.73%) ⬆️
dask_cuda/device_host_file.py 90.90% <80.00%> (-7.96%) ⬇️
dask_cuda/get_device_memory_objects.py 89.04% <89.04%> (ø)
dask_cuda/proxify_device_objects.py 93.87% <93.87%> (ø)
dask_cuda/proxy_object.py 91.21% <96.07%> (+3.42%) ⬆️
dask_cuda/explicit_comms/dataframe/merge.py 96.24% <96.24%> (ø)
dask_cuda/explicit_comms/dataframe/shuffle.py 98.51% <98.51%> (ø)
dask_cuda/__init__.py 100.00% <100.00%> (ø)
dask_cuda/explicit_comms/comms.py 98.78% <100.00%> (-0.23%) ⬇️
... and 8 more

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 f9ce83a...ff03dec. Read the comment docs.

@madsbk madsbk added 3 - Ready for Review Ready for review by team improvement Improvement / enhancement to an existing function non-breaking Non-breaking change labels Feb 12, 2021
Copy link
Member

@madsbk madsbk left a comment

Choose a reason for hiding this comment

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

Looks good to me, nice addition @charlesbluca.

Should there be an additional argument to specify the array slicing interval (which is currently fixed at 3)?

I think fixing it to 3 is fine for now. If we need to benchmark the impact of step sizes, we can always add it. At that point, we might consider using the first position argument as a command and use the following arguments as command-specific (e.g. like how git works)

Could the JSON output be cleaned up? Currently, a (truncated) sample output file looks like:

Looks fine to me :)

@@ -179,6 +197,40 @@ async def run(args):
)
print(fmt % (d1, d2, bw[0], bw[1], bw[2], total_nbytes[(d1, d2)]))

if args.benchmark_json:
import json
Copy link
Member

Choose a reason for hiding this comment

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

Moving import json to the top should be fine

Copy link
Member Author

Choose a reason for hiding this comment

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

Done! Also going to change this to from json import dump.

x = rs.random((args.size, args.size), chunks=args.chunk_size).persist()
await wait(x)
func_args = (x,)

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change

Copy link
Member

@pentschev pentschev left a comment

Choose a reason for hiding this comment

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

LGTM as well, thanks @charlesbluca !

@pentschev pentschev added 5 - Ready to Merge Testing and reviews complete, ready to merge and removed 3 - Ready for Review Ready for review by team labels Feb 12, 2021
@pentschev
Copy link
Member

@gpucibot merge

@rapids-bot rapids-bot bot merged commit acded78 into rapidsai:branch-0.18 Feb 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Ready to Merge Testing and reviews complete, ready to merge improvement Improvement / enhancement to an existing function non-breaking Non-breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants