Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optimize class sizes #153

Merged

Conversation

neil-lindquist
Copy link
Contributor

This PR does some miscellaneous cleanup, particularly reducing the size of some classes.

  • Tile's member variables were reordered for better packing and TileKind was switched to char storage
  • Deprecated Tile::stride(int64_t) since it will break the layout management and removed the unused, internal Tile::kind(TileKind)
  • Removed some unused member variables in MatrixStorage
  • Replaced the std::maps in Memory w/ std::vectors since the keys are just 0, 1, ..., num_devices
  • Consolidated all the num_devices_ into Memory::num_devices_. To assist this change, all of the accesses are replaced with calls to helper functions (which the compiler will inline).

MatrixStorage had an unused member (own), although it didn't affect length
Tile was reorganized to go from 80 bytes to 72 bytes
TileKind was changed to use char storage, this also simplified Debug.cc
Likely to leave the tile in an inconsistant state
It adds unnessary storage and instructions
Everything instantiates off Memory::num_devices_, so just use that directly.
Copy link
Contributor

@cayrols cayrols 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 to me.

@neil-lindquist neil-lindquist merged commit 979f9d1 into icl-utk-edu:master Dec 13, 2023
8 checks passed
@neil-lindquist neil-lindquist deleted the optimize-struct-sizes branch December 13, 2023 17:10
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