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

Adding input sharding collection in ModuleBuilder #289

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ajakovljevicTT
Copy link
Contributor

As part of adding support for multichip, adding collection of the information about the device sharding of the inputs of the the StableHLO graph during compilation. That way, we will know how to create MultiDevice input tensors when executing.

Copy link

github-actions bot commented Feb 28, 2025

TestsPassed ❌️SkippedFailed
TT-XLA Tests0 ran0 passed0 skipped0 failed
TestResult
No test annotations available

Comment on lines 178 to 179
auto shardingAttr = llvm::dyn_cast_if_present<mlir::StringAttr>(
funcOp.getArgAttr(i, mlir::tt::sharding_utils::kXlaShardingAttr));
Copy link
Contributor

Choose a reason for hiding this comment

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

Nitpick: can we avoid casting to stringattr and directly convert from the fetched attribute?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I left it like this so I can use the already made functions in tt-mlir. See: lib/Conversion/StableHLOToTTIR/StableHLOToTTIRPatterns.cpp in tt-mlir

Comment on lines +42 to +46
const std::vector<mlir::tt::sharding_utils::MeshSharding> &
getInputShardings() const {
return m_input_shardings;
}

Copy link
Contributor

Choose a reason for hiding this comment

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

Unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Left a getter there for future use, do you think I should erase it?

@ajakovljevicTT ajakovljevicTT force-pushed the ajakovljevic/adding_input_sharding_collection branch from 93a81fd to 9ce0256 Compare March 3, 2025 12:12
@ajakovljevicTT ajakovljevicTT force-pushed the ajakovljevic/adding_input_sharding_collection branch from 9ce0256 to 260fb4d Compare March 3, 2025 13:14
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