Skip to content

[FEA][torchinductor-EVT] Allow function source code to be passed directly to EVT tracer #2244

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

Open
mlazos opened this issue Apr 17, 2025 · 2 comments
Labels

Comments

@mlazos
Copy link
Contributor

mlazos commented Apr 17, 2025

Is your feature request related to a problem? Please describe.
At

def trace(fn, example_tensors, **kwargs):

the trace(..) API takes in a function. The main issue here is that when dynamically defining a python function like so

fn = exec("""
def fn(x):
  return x
"""

extracting the source using inspect.getsource here fails.

This is how inductor generates the python source in essence (it generates a function string) so this does signature doesn't work.

Describe the solution you'd like
Modify the signature of trace to take the function source string directly.

cc @henrylhtsang, @eellison

@mlazos mlazos added ? - Needs Triage feature request New feature or request labels Apr 17, 2025
@hwu36
Copy link
Collaborator

hwu36 commented Apr 30, 2025

@jackkosaian

@jackkosaian
Copy link
Contributor

@apuaaChen, can you help take a look at this EVT request?

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

No branches or pull requests

3 participants