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

Finch+PyData benchmarks #652

Merged
merged 1 commit into from
Apr 3, 2024
Merged

Finch+PyData benchmarks #652

merged 1 commit into from
Apr 3, 2024

Conversation

mtsokol
Copy link
Collaborator

@mtsokol mtsokol commented Mar 22, 2024

Issue: finch-tensor/finch-tensor-python#24

Finch and PyData asv benchmarks.

Hi @willow-ahrens!
I started working on a list of specific benchmarks that we want to implement and use for measuring improvements for Lazy API and Finch in general:

  • sparse matrix-vector (generated with fsprand)

    • large 1000x1000, medium 100x100, small 10x10 (calls sparse.tensordot)
    • uses CSC, CSR formats
    • y = Ax + z (A is sparse)
    • eager and compiled mode!
  • sparse tensor-tensor

    • uses CSF, GCXS (PyData) formats
  • SDDMM

    • A=B∘CD (A and B are sparse)
    • eager and compiled mode!
  • reductions (sum, prod)

  • elementwise (add, mul)

@mtsokol mtsokol force-pushed the finch-benchmark-test branch from 31f3b9f to 405bf3a Compare March 22, 2024 10:03
Copy link

github-actions bot commented Mar 22, 2024

Test Results

5 905 tests  ±0   5 875 ✅ +1   6m 21s ⏱️ +4s
    1 suites ±0      30 💤  - 1 
    1 files   ±0       0 ❌ ±0 

Results for commit 525149d. ± Comparison against base commit 9a8b31a.

♻️ This comment has been updated with latest results.

@mtsokol mtsokol force-pushed the finch-benchmark-test branch 4 times, most recently from 7d021de to ae598b9 Compare March 22, 2024 16:26
@mtsokol mtsokol changed the title Test finch in asv Finch in asv Mar 22, 2024
@mtsokol mtsokol force-pushed the finch-benchmark-test branch 2 times, most recently from fe066d5 to e9b5a1f Compare April 2, 2024 10:12
@mtsokol mtsokol changed the title Finch in asv Finch+PyData benchmarks Apr 2, 2024
@mtsokol mtsokol force-pushed the finch-benchmark-test branch from e9b5a1f to 8294fb4 Compare April 2, 2024 10:56
@mtsokol mtsokol self-assigned this Apr 2, 2024
@mtsokol mtsokol force-pushed the finch-benchmark-test branch 4 times, most recently from fcc2fc0 to 3958b47 Compare April 2, 2024 13:21
@willow-ahrens
Copy link
Collaborator

Tensordot is a fine way to benchmark, though I would almost prefer the A[:, None] syntax because it's more granular, so it feels like there are more opportunities to make scheduling mistakes. Also, since finch_tensor and finch are the repos that we want to change, wouldn't we want this suite to live there?

@willow-ahrens
Copy link
Collaborator

also, I think that large should be 1_000_000 by 1_000_000 with 10_000_000 nnz.

@willow-ahrens
Copy link
Collaborator

it's fine to leave small as 10 x 10, as a test case to measure calling overhead, though we might want to make it even smaller to be more accurate. the medium size you've chosen is also very small. The two most meaningful sizes are the extremes, as these show the latency and throughput of the kernel.

@mtsokol mtsokol force-pushed the finch-benchmark-test branch 3 times, most recently from 4e65ecc to 6938f55 Compare April 2, 2024 17:24
@mtsokol
Copy link
Collaborator Author

mtsokol commented Apr 2, 2024

Tensordot is a fine way to benchmark, though I would almost prefer the A[:, None] syntax because it's more granular

By None you mean adding a new dimention at that position? If yes, then this index type isn't supported in finch-tensor

Also, since finch_tensor and finch are the repos that we want to change, wouldn't we want this suite to live there?

Hmm, we plan to add another backend to pydata/sparse so we need benchmarks also there. This would mean there are going to be similar benchmarks in finch-tensor, sparse, and Finch.jl.

I'm Ok, with copying these to finch-tensor as well, it's just something to remember that they are there.

@mtsokol mtsokol force-pushed the finch-benchmark-test branch from f3531f1 to ff411c7 Compare April 2, 2024 18:01
Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

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

This LGTM overall, just a couple of minor changes.

asv.conf.json Outdated Show resolved Hide resolved
benchmarks/utils.py Outdated Show resolved Hide resolved
@mtsokol mtsokol force-pushed the finch-benchmark-test branch from ff411c7 to 97685cf Compare April 3, 2024 10:37
@mtsokol mtsokol force-pushed the finch-benchmark-test branch from 97685cf to 525149d Compare April 3, 2024 10:51
@mtsokol mtsokol requested a review from hameerabbasi April 3, 2024 11:04
@hameerabbasi
Copy link
Collaborator

I'm Ok, with copying these to finch-tensor as well, it's just something to remember that they are there.

I'd suggest setting up a new repo that can test both libraries instead of copying code, which can get increasingly out of sync. In addition, it might be a nice start to a "sparse extension" to the Array API benchmarks.

Copy link
Collaborator

@hameerabbasi hameerabbasi left a comment

Choose a reason for hiding this comment

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

LGTM, thanks @mtsokol!

@mtsokol mtsokol merged commit 18c1596 into main Apr 3, 2024
10 checks passed
@mtsokol mtsokol deleted the finch-benchmark-test branch April 3, 2024 11:46
@willow-ahrens
Copy link
Collaborator

willow-ahrens commented Apr 3, 2024

I don't think we need to copy these over to finch-tensor, and I see why we would want them here. I'll likely add some similar benchmarks in Finch.jl to test the scheduling heuristics in-tree as I make changes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants