Skip to content

Simplify union payload copying#11353

Closed
smessmer wants to merge 10 commits intoexport-D9778042from
export-D9694326
Closed

Simplify union payload copying#11353
smessmer wants to merge 10 commits intoexport-D9778042from
export-D9694326

Conversation

@smessmer
Copy link
Contributor

@smessmer smessmer commented Sep 6, 2018

Stack:
    :white_circle:  #11352 Remove intrusive_ptr::reclaim() in Storage  💛
    :white_circle:  #11547 Remove intrusive_ptr::reclaim() in Storage (2/2)  💚
    :black_circle:  #11353 Simplify union payload copying  💛
    :white_circle:  #11355 Simplify IValue::toTensor()  💛
    :white_circle:  #11402 Simplify Blob move constructor/assignment  💛
    :white_circle:  #11414 IValue can store Blob  💛
    :white_circle:  #11548 Blob doesn't allow access to destroyCall anymore  💛
    :white_circle:  #11500 Use TypeMeta::dtor() instead of Blob::DestroyCall  💛
    :white_circle:  #11501 Move GetExceptionString to Error.h  💛
    :white_circle:  #11502 Improve TypeMeta  💛

Before, there was one extra member in the union that had to be at least as large as the largest other member, because it was used for copying.

Now, this isn't needed anymore and we copy the union directly.

Differential Revision: D9694326

Differential Revision: D9694326
Differential Version: 57135216
@pytorchbot pytorchbot added the oncall: jit Add this issue/PR to JIT oncall triage queue label Sep 6, 2018
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.

Worth mentioning that this is only OK as long as everything in the union is trivially copyable/constructible...

Differential Revision: D9694326
Differential Version: 57214006
@smessmer
Copy link
Contributor Author

smessmer commented Sep 7, 2018

@ezyang If a member is not trivially copyable/constructible, the compiler should delete the copy constructor of the union, i.e. it would be a compiler error.

Differential Revision: D9694326
Differential Version: 57417173
Differential Revision: D9694326
Differential Version: 57452245
Differential Revision: D9694326
Differential Version: 5753540
@smessmer smessmer changed the base branch from export-D9694327 to export-D9778042 September 11, 2018 20:57
Differential Revision: D9694326
Differential Version: 57551490
Differential Revision: D9694326
Differential Version: 57670062
Differential Revision: D9694326
Differential Version: 57695965
Differential Revision: D9694326
Differential Version: 57757847
Differential Revision: D9694326
Differential Version: 57851519
@soumith soumith deleted the export-D9694326 branch February 21, 2019 12:10
@ezyang ezyang added the merged label Jun 26, 2019
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.

3 participants