KEMBAR78
Inductor lowerings for magic methods are suspicious · Issue #127789 · pytorch/pytorch · GitHub
Skip to content

Inductor lowerings for magic methods are suspicious #127789

@ezyang

Description

@ezyang

🐛 Describe the bug

Steps to reproduce:

  1. Patch in Complete revamp of float/promotion sympy handling #126905 (landing soon)
  2. Edit torch/_inductor/graph.py
            elif is_magic_method(n.target):
                # TODO: this is sus, it probably should be handled in the
                # lowerings themselves similarly to sym_size/sym-stride
                debug("is_magic_method")
                if isinstance(
                    n.meta["val"], (torch.SymInt, torch.SymFloat, torch.SymBool)
                ):
                    result = n.meta["val"].node.expr
                else: 
                    result = super().run_node(n)

remove the node.expr direct run check.

Tests will fail, because the lowerings will be doing insane things. Why are there insane lowerings in the table? I'm not sure...

Versions

main

cc @msaroufim @bdhirsh @anijain2305 @chauhang @voznesenskym @penguinwu @EikanWang @jgong5 @Guobing-Chen @XiaobingSuper @zhuhaozhe @blzheng @wenzhe-nrv @jiayisunx @peterbell10 @ipiszy @yf225 @chenyang78 @kadeng @muchulee8 @ColinPeppler @amjames @desertfire

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions