Skip to content

Conversation

@houseroad
Copy link
Member

Since parameter.data will create a new torch.Tensor each time, we get duplicate tensors when call _unique_state_dict now. Try to deduplicate it before creating new tensor.

@houseroad houseroad requested a review from ezyang March 18, 2019 20:37
@houseroad
Copy link
Member Author

cc: @spandantiwari

@facebook-github-bot facebook-github-bot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Mar 18, 2019
@houseroad houseroad requested a review from dzhulgakov March 18, 2019 20:58
Copy link
Contributor

@ezyang ezyang left a comment

Choose a reason for hiding this comment

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

LGTM

@ezyang
Copy link
Contributor

ezyang commented Mar 18, 2019

Might be worth a comment explaining why we do it this way though

@houseroad houseroad requested a review from zrphercule March 18, 2019 21:41
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.

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

@spandantiwari
Copy link

@houseroad - LGTM. I can double check it on my side but I am sure that this will fix the issue that we were seeing.

@dzhulgakov
Copy link
Collaborator

Also, since it fixes a bug - add a unittest for previously failing case as a good eng practice?

@houseroad
Copy link
Member Author

Yes, will add a test @dzhulgakov

@houseroad houseroad force-pushed the fix_unique_state_dict branch from 879826b to a1f420b Compare April 1, 2019 17:06
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.

@houseroad 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.

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

@houseroad
Copy link
Member Author

@dzhulgakov test case has been added. Does it look good to you? :-)

@facebook-github-bot
Copy link
Contributor

@houseroad merged this pull request in 0c237f1.

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.

5 participants