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

ENH: Implement reshape function #776

Merged
merged 2 commits into from
Sep 23, 2024
Merged

ENH: Implement reshape function #776

merged 2 commits into from
Sep 23, 2024

Conversation

mtsokol
Copy link
Collaborator

@mtsokol mtsokol commented Sep 17, 2024

Hi @hameerabbasi,

This PR adds Array API reshape function (without copy keyword for now).

Unfortunately calling sparse.reshape(...) gives a segmentation fault (on exit) - I haven't figured out it yet.

@mtsokol mtsokol self-assigned this Sep 17, 2024
Copy link

codspeed-hq bot commented Sep 17, 2024

CodSpeed Performance Report

Merging #776 will improve performances by 19.89%

Comparing reshape-func (9325477) with main (373f29f)

Summary

⚡ 5 improvements
✅ 335 untouched benchmarks

Benchmarks breakdown

Benchmark main reshape-func Change
test_elemwise[f=<built-in function add>-backend='Finch'-side=100] 862.4 µs 719.4 µs +19.89%
test_elemwise[f=<built-in function add>-backend='Finch'-side=500] 1,027.2 µs 884.4 µs +16.15%
test_elemwise[f=<built-in function mul>-backend='Finch'-side=1000] 828 µs 735.2 µs +12.62%
test_elemwise[f=<built-in function mul>-backend='Finch'-side=100] 788.5 µs 694.8 µs +13.48%
test_elemwise[f=<built-in function mul>-backend='Finch'-side=500] 811.1 µs 711.2 µs +14.05%

@mtsokol
Copy link
Collaborator Author

mtsokol commented Sep 23, 2024

@hameerabbasi The PR is ready from my side. For now reshape only works on CSF and CSR formats. For other ones it's broken (there are skips in the test with relevant links pointing to issues).

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.

Two minor changes.

sparse/mlir_backend/_ops.py Outdated Show resolved Hide resolved
sparse/mlir_backend/_ops.py Outdated Show resolved Hide resolved
@mtsokol mtsokol merged commit c81d2e2 into main Sep 23, 2024
17 checks passed
@mtsokol mtsokol deleted the reshape-func branch September 23, 2024 16:40
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.

2 participants