-
Notifications
You must be signed in to change notification settings - Fork 116
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
Extend MeshTensor read/write APIs to support uneven sharding #18735
base: jchu/ttnn-integration-with-mesh
Are you sure you want to change the base?
Extend MeshTensor read/write APIs to support uneven sharding #18735
Conversation
|
||
// Set storage with the populated metadata. | ||
mesh_tensor.set_storage(mesh_storage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
errm... was this just not doing anything before? 😱
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was using the same mesh buffer behind the scenes, but there was no metadata to populate, so just worked :)
std::shared_ptr<Buffer> buffer; | ||
std::shared_ptr<distributed::MeshBuffer> mesh_buffer; | ||
std::map<distributed::MeshCoordinate, TensorSpec> specs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not add it as a constructor argument?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is a path that creates DeviceStorage
for a single device... I think there are more changes upcoming that touch this, I think we need to tackle this separately.
bool operator==(const MeshCoordinate& lhs, const MeshCoordinate& rhs); | ||
bool operator!=(const MeshCoordinate& lhs, const MeshCoordinate& rhs); | ||
bool operator<(const MeshCoordinate& lhs, const MeshCoordinate& rhs); | ||
bool operator>(const MeshCoordinate& lhs, const MeshCoordinate& rhs); | ||
bool operator<=(const MeshCoordinate& lhs, const MeshCoordinate& rhs); | ||
bool operator>=(const MeshCoordinate& lhs, const MeshCoordinate& rhs); | ||
std::ostream& operator<<(std::ostream& os, const MeshCoordinate& shape); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1
DeviceStorage device_storage(mesh_buffer); | ||
device_storage.specs = specs; | ||
device_storage.strategy = storage.strategy; | ||
return device_storage; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably move away from direct access like this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1, I was just going to say. Should be class
.
Ticket
N/A
Problem description
MeshBuffer-backed Tensors should support uneven shards.
What's changed
Changes to read/write paths + tests.
Checklist