-
Notifications
You must be signed in to change notification settings - Fork 25.6k
Expose enablement of TensorExpr fuser as env variable #35341
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
Conversation
💊 CircleCI build failures summary and remediationsAs of commit 600f887 (more details on the Dr. CI page): ✅ None of the build failures appear to be your fault 💚
1 job timed out:
🚧 1 upstream failure:These were probably caused by upstream breakages:
This comment was automatically generated by Dr. CI (expand for details).Follow this link to opt-out of these comments for your Pull Requests.Please report bugs/suggestions on the GitHub issue tracker. This comment has been revised 3 times. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we start to always register our pass, we should probably just add it to the graph executor pipeline directly. The existing machinery is only used because it is optional.
if (std::string(enable_c_str) == "0") { | ||
return false; | ||
} | ||
return true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If PYTORCH_TENSOREXPR
env variable is set then torch._C._jit_set_texpr_fuser_enabled(False/True)
calls will have no effect. Is it a desired behavior?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for me, yea. One can override the program with PYTORCH_TENSOREXPR=0
Right now, for benchmarks, this is really useful because I don't need to inspect internals of various scripts. In the future, I see the python interface as eventually becoming deprecated anyway (once it is always on), and this functioning the same way regardless
namespace jit { | ||
|
||
static bool texpr_fuser_enabled = true; | ||
static bool texpr_fuser_enabled_ = false; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: why underscore at the end?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
previous code used texpr_fuser_enabled
directly, whereas code should now use the function tensorExprFuserEnabled
. the underscore is my attempt at "privatizing" the variable so folks don't use it directly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bwasti has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
This commit allows one to use an environment variable to enable the fuser in torch/csrc/jit/tensorexpr/
This commit also changes the registration to happen by default, removing the requirement for the python exposed "_jit_register_tensorexpr_fuser"