Skip to content

[pytorch] remove AutoNonVariableTypeMode guard around forward() call#28399

Closed
ljk53 wants to merge 1 commit intogh/ljk53/66/basefrom
gh/ljk53/66/head
Closed

[pytorch] remove AutoNonVariableTypeMode guard around forward() call#28399
ljk53 wants to merge 1 commit intogh/ljk53/66/basefrom
gh/ljk53/66/head

Conversation

@ljk53
Copy link
Contributor

@ljk53 ljk53 commented Oct 22, 2019

Stack from ghstack:

Summary:
This is also to address issue #26764

Turns out it's incorrect to wrap the entire forward() call with
NonVariableTypeMode guard as some JIT passes has is_variable() check and
can be triggered within forward() call, e.g.:
jit/passes/constant_propagation.cpp

Since now we are toggling NonVariableTypeMode per method/op call, we can
remove the guard around forward() now.

Test Plan:

  • With stacked PRs, verified it can load and run previously failed models.

Differential Revision: D18055850

Summary:
This is also to address issue #26764

Turns out it's incorrect to wrap the entire forward() call with
NonVariableTypeMode guard as some JIT passes has is_variable() check and
can be triggered within forward() call, e.g.:
jit/passes/constant_propagation.cpp

Since now we are toggling NonVariableTypeMode per method/op call, we can
remove the guard around forward() now.

Test Plan:
- With stacked PRs, verified it can load and run previously failed models.

[ghstack-poisoned]
@facebook-github-bot
Copy link
Contributor

@ljk53 merged this pull request in 04bfc21.

@facebook-github-bot facebook-github-bot deleted the gh/ljk53/66/head branch October 28, 2019 22:16
thiagocrepaldi pushed a commit to thiagocrepaldi/pytorch that referenced this pull request Feb 4, 2020
…8399)

Summary:
Pull Request resolved: pytorch#28399

This is also to address issue pytorch#26764

Turns out it's incorrect to wrap the entire forward() call with
NonVariableTypeMode guard as some JIT passes has is_variable() check and
can be triggered within forward() call, e.g.:
jit/passes/constant_propagation.cpp

Since now we are toggling NonVariableTypeMode per method/op call, we can
remove the guard around forward() now.

Test Plan: - With stacked PRs, verified it can load and run previously failed models.

Differential Revision: D18055850

Pulled By: ljk53

fbshipit-source-id: 3074d0ed3c6e05dbfceef6959874e5916aea316c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants