Skip to content

Improve support for tracing sizes, add more tracer warnings#11288

Closed
apaszke wants to merge 3 commits intopytorch:masterfrom
apaszke:jit_constructors
Closed

Improve support for tracing sizes, add more tracer warnings#11288
apaszke wants to merge 3 commits intopytorch:masterfrom
apaszke:jit_constructors

Conversation

@apaszke
Copy link
Contributor

@apaszke apaszke commented Sep 5, 2018

Many constructors like torch.zeros or torch.randn didn't support
size tracing correctly which is fixed by this pass. Same issue has been
fixed in legacy tensor constructors.

Additionally, new tensor constructors, which do not participate in
tracing (most notably torch.tensor, torch.as_tensor and
torch.from_numpy) raise a warning when they are used.

Finally, entering a traceable operation disables the tracing in its body.
This is needed because

@zdevito

@apaszke apaszke added the oncall: jit Add this issue/PR to JIT oncall triage queue label Sep 5, 2018
Copy link
Contributor

@zdevito zdevito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

This comment was marked as off-topic.

This comment was marked as off-topic.

Many constructors like `torch.zeros` or `torch.randn` didn't support
size tracing correctly which is fixed by this pass. Same issue has been
fixed in legacy tensor constructors.

Additionally, new tensor constructors, which do not participate in
tracing (most notably `torch.tensor`, `torch.as_tensor` and
`torch.from_numpy`) raise a warning when they are used.

Finally, entering a traceable op will disable tracing of its body. This
is important, because e.g. dropout is traceable, but calls non-traceable
`bernoulli_` inside. Using functions that have an explicit `Generator`
argument is an error now.
Copy link
Contributor

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

apaszke has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

PenghuiCheng pushed a commit to PenghuiCheng/pytorch that referenced this pull request Sep 11, 2018
…11288)

Summary:
Many constructors like `torch.zeros` or `torch.randn` didn't support
size tracing correctly which is fixed by this pass. Same issue has been
fixed in legacy tensor constructors.

Additionally, new tensor constructors, which do not participate in
tracing (most notably `torch.tensor`, `torch.as_tensor` and
`torch.from_numpy`) raise a warning when they are used.

Finally, entering a traceable operation disables the tracing in its body.
This is needed because

zdevito
Pull Request resolved: pytorch#11288

Reviewed By: ezyang

Differential Revision: D9751183

Pulled By: apaszke

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

Labels

oncall: jit Add this issue/PR to JIT oncall triage queue open source

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants