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

[OM] Add location info to EvaluatorValue #6240

Merged
merged 5 commits into from
Oct 10, 2023
Merged

Conversation

prithayan
Copy link
Contributor

Add the debug locations to the evaluator value, which will be used to generate info fields of the object model output json.

Copy link
Contributor

@dtzSiFive dtzSiFive left a comment

Choose a reason for hiding this comment

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

Haven't been working with this code a lot and not expert re:python bindings aspect, but generally LGTM! Small nit re:test.

@prithayan prithayan force-pushed the dev/pbarua/om_location_info branch 2 times, most recently from 16e4084 to 8f66b61 Compare October 4, 2023 05:08
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

The evaluator logic for fields looks good, thanks. I still have one comment about the location for objects, as well as some API design thoughts about the Python side.

lib/Bindings/Python/OMModule.cpp Outdated Show resolved Hide resolved
lib/Bindings/Python/OMModule.cpp Outdated Show resolved Hide resolved
lib/Dialect/OM/Evaluator/Evaluator.cpp Outdated Show resolved Hide resolved
Copy link
Contributor

@mikeurbach mikeurbach left a comment

Choose a reason for hiding this comment

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

I'm still getting familiar with the latest refactor here to support graph regions, but I think this makes sense. Thanks for the iterations on this and dealing with the big refactor while this PR is in flight!

I would appreciate a second pair of eyes.. @uenoku do you mind taking a look?

# CHECK: name: reference, field: ('Root', 'x')
print(f"name: {name}, field: {field}")
# CHECK-SAME: loc: loc("-":32:7)
#location from om.class.field @field, %param : !om.integer
Copy link
Contributor

Choose a reason for hiding this comment

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

extreme nit:

Suggested change
#location from om.class.field @field, %param : !om.integer
# location from om.class.field @field, %param : !om.integer

Comment on lines 130 to 134
: EvaluatorValue(attr.getContext(), Kind::Attr,
mlir::UnknownLoc::get(attr.getContext())),
attr(attr) {
markFullyEvaluated();
}
Copy link
Member

Choose a reason for hiding this comment

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

Can we reuse AttributeValue(Attribute attr, Location loc) constructor?

Copy link
Member

@uenoku uenoku left a comment

Choose a reason for hiding this comment

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

LGTM, thank you for working on this!

@prithayan prithayan merged commit cbc8c39 into main Oct 10, 2023
5 checks passed
@prithayan prithayan deleted the dev/pbarua/om_location_info branch October 10, 2023 17:06
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.

4 participants