Skip to content

Reduce size of TensorImpl from 160 bytes to 128 bytes#12266

Closed
ezyang wants to merge 5 commits intomasterfrom
export-D10150834
Closed

Reduce size of TensorImpl from 160 bytes to 128 bytes#12266
ezyang wants to merge 5 commits intomasterfrom
export-D10150834

Conversation

@ezyang
Copy link
Contributor

@ezyang ezyang commented Oct 2, 2018

Stack:
    :black_circle:  #12266 Reduce size of TensorImpl from 160 bytes to 128 bytes  💛

  • Put all byte-size fields together (booleans and TensorTypeId),
    so they can be coalesced into a single word.
  • Replace std::vector<int64_t> strides with
    std::unique_ptr<int64_t[]>, saving two words.

Differential Revision: D10150834

ezyang added 5 commits October 2, 2018 13:00
Differential Revision: D10150834
Differential Version: 59477747
Differential Revision: D10150834
Differential Version: 59479009
Differential Revision: D10150834
Differential Version: 59481546
Differential Revision: D10150834
Differential Version: 59484820
Differential Revision: D10150834
Differential Version: 59493561
@ezyang
Copy link
Contributor Author

ezyang commented Oct 3, 2018

@pytorchbot retest this please

at::Storage storage_; // TODO: Fix visibility on me

protected:
std::vector<int64_t> sizes_;

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

This comment was marked as off-topic.

zdevito pushed a commit to zdevito/ATen that referenced this pull request Oct 3, 2018
Summary:
Pull Request resolved: pytorch/pytorch#12266

- Put all byte-size fields together (booleans and TensorTypeId),
  so they can be coalesced into a single word.
- Replace std::vector<int64_t> strides with
  std::unique_ptr<int64_t[]>, saving two words.

Reviewed By: dzhulgakov

Differential Revision: D10150834

fbshipit-source-id: f54f38eec34732f3ff7e52e00b1371d7b5b210eb
@soumith soumith deleted the export-D10150834 branch February 21, 2019 23:26
@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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants