Skip to content

Perform CSE across block boundaries.#10105

Closed
resistor wants to merge 3 commits intopytorch:masterfrom
resistor:recursive-cse
Closed

Perform CSE across block boundaries.#10105
resistor wants to merge 3 commits intopytorch:masterfrom
resistor:recursive-cse

Conversation

@resistor
Copy link
Contributor

This comment was marked as off-topic.

This comment was marked as off-topic.

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.

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

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.

resistor is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

This comment was marked as off-topic.

This comment was marked as off-topic.

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.

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

@resistor
Copy link
Contributor Author

resistor commented Aug 9, 2018

@apaszke ping

Copy link
Contributor

@apaszke apaszke left a comment

Choose a reason for hiding this comment

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

Actually when does it happen that CSE replaces a node with a different output type, even though its kind and all types of inputs are the same! We shouldn't really have nodes overloaded on output types

@resistor
Copy link
Contributor Author

resistor commented Aug 9, 2018

@apaszke I did not observe any differences in test results switching from kind equality + input equality to operator==. That said, even if the difference does not inherently matter in CSE, I'd prefer to use the semantically correct check to make this easier to maintain in case CSE or our operator changes in the future in a way that would break the clever way.

@apaszke
Copy link
Contributor

apaszke commented Aug 13, 2018

@resistor this is because most of our types are singletons, and so their pointers will compare equal iff they compare equal. However, this is not always true (e.g. TensorType has many distinct instances), and we should use the reference-level equality in place of the pointer-level one.

Do you remember which test has triggered failure because of missing equality checks? I'm not 100% sure if they're needed.

@resistor
Copy link
Contributor Author

@apaszke
$ python test/test_jit.py -v 2>&1 | grep ERROR
test_beam_search (main.TestBatched) ... ERROR
test_greedy_search (main.TestBatched) ... ERROR

@yf225
Copy link
Contributor

yf225 commented Aug 14, 2018

@apaszke What should be the next step for this patch?

@zou3519 zou3519 added the oncall: jit Add this issue/PR to JIT oncall triage queue label Aug 14, 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.

I think all the changes were addressed and this is ready to land.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants