-
Notifications
You must be signed in to change notification settings - Fork 84
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
parser: parse bytes directly into a BytesAttr for DenseIntOrFPElementsAttrs #3845
Conversation
Nice! Just for fun, could you please add a benchmark here for the before/after? |
I will have a look! |
c9210f4
to
498b942
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #3845 +/- ##
==========================================
+ Coverage 91.26% 91.41% +0.14%
==========================================
Files 461 461
Lines 57656 58940 +1284
Branches 5570 5849 +279
==========================================
+ Hits 52619 53879 +1260
+ Misses 3612 3606 -6
- Partials 1425 1455 +30 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good! Let's merge this tomorrow, after we have a "before" run on https://xdsl.dev/xdsl-bench/
(I misclicked) |
Sounds good! |
Oh, weird, indeed |
The benchmarks are in (e.g., https://xdsl.dev/xdsl-bench/#parser.time_parser__dense_attr_hex) We are good to merge, I think |
Nice! |
How exciting, I can't wait to see the numbers tomorrow |
…> 100 elements (xdslproject#3846) mimicking mlir behaviour This, along with xdslproject#3845 should allow for very fast printing/parsing of large dense attrs, allowing for low-overhead calling of intermediate mlir-opt passes in our pipeline.
…sAttrs (xdslproject#3845) Because DenseIntOrFPElementsAttrs are backed by `bytes`, there is no need to convert the hex representation to a list of values when creating the attribute. We can directly convert the hex representation to a BytesAttr when constructing the attribute. This is a lot faster, and gets rid of a lot of code somewhat duplicating the `StructPackable` things we made.
Because DenseIntOrFPElementsAttrs are backed by
bytes
, there is no need to convert the hex representation to a list of values when creating the attribute. We can directly convert the hex representation to a BytesAttr when constructing the attribute.This is a lot faster, and gets rid of a lot of code somewhat duplicating the
StructPackable
things we made.