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

Replace Ops.<...> with a custom @op macro #671

Open
avik-pal opened this issue Feb 1, 2025 · 3 comments
Open

Replace Ops.<...> with a custom @op macro #671

avik-pal opened this issue Feb 1, 2025 · 3 comments
Labels
good first issue Good for newcomers

Comments

@avik-pal
Copy link
Collaborator

avik-pal commented Feb 1, 2025

Currently we get location info in the Ops file. This will let us populate the location info from where the corresponding Ops.<...> is being made.

Essentially

res = @op convert(....)

gets converted into

res = Ops.convert(....; ...., location = ....)

with the location info of the current line automatically populated.

@mofeing mofeing added the good first issue Good for newcomers label Feb 1, 2025
@mofeing
Copy link
Collaborator

mofeing commented Feb 1, 2025

That would be very nice and quite easy. The solution I thought for this (which is still interesting for profiling) is to create a custom mlir::Location that takes a Julia callstack snapshot without actually solving the caller symbols (until requested).

Also, with this the Ops.with_debug would be become useless and can be removed. It just calls stacktrace and converts each StackFrame into a MLIR.IR.Location which is extremely slow.

@wsmoses
Copy link
Member

wsmoses commented Feb 1, 2025

with_debug still has use, since that gets the full stacktrace and not just the line which called it (e.g. we would now see +(TracedRArray, TracedRArray) but not who calls +)

@mofeing
Copy link
Collaborator

mofeing commented Feb 1, 2025

true, but current implementation has a high overhead

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

No branches or pull requests

3 participants