add few ops of bufferization dialect and arith dialect.#127
Merged
jamesthejellyfish merged 1 commit intoHuawei-CPLLab:mainfrom Mar 4, 2026
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR adds support for new operations in the bufferization and arith dialects. The bufferization dialect gains to_tensor and materialize_in_destination operations for converting between tensor and memref representations. The arith dialect adds trunc for type truncation, and vadd/vmul for vector addition and multiplication operations.
Changes:
- Added new
bufferization.pyfile withto_tensorandmaterialize_in_destinationoperations - Extended
arith.pywithtrunc,vadd, andvmuloperations for vector operations and type truncation
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 11 comments.
| File | Description |
|---|---|
| src/pydsl/bufferization.py | New file implementing bufferization dialect operations for tensor/memref conversion with helper validation functions |
| src/pydsl/arith.py | Added vector import and implemented trunc, vadd, and vmul operations for arithmetic on vectors and type truncation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
jamesthejellyfish
requested changes
Feb 19, 2026
Collaborator
jamesthejellyfish
left a comment
There was a problem hiding this comment.
Looks mostly pretty good, but there's a few things that should be cleaned up:
- pass the formatting check: This should be as simple as running
hatch fmt -fon your repo (assuming you have the latest hatch installed) and then rebasing - fix or resolve the small issues that copilot mentioned - if you think the suggestion is wrong, just add a reply and then resolve without changing anything
- can you add some test cases to arith.py and bufferization.py that utilize the new ops? For some of the more obscure ops you could just check that the op is created (there are examples of how to do this in test_transform.py), but if you could write a simple program that utilizes each op and then verify the results that would be ideal
603b110 to
3eb8a68
Compare
418d450 to
9edce0b
Compare
…_destination. add support for arith dialect's vadd and mul. Update memref.py and frontend.py.
9edce0b to
1940abb
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
add support for bufferization dialect's to_tensor and materialize_in_destination.
add support for arith dialect's vadd and vmul.