-
Notifications
You must be signed in to change notification settings - Fork 486
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
Add IsVirtualDeivce() and refactor #6726
Conversation
data_ = data; | ||
data_.reset(data.get()); |
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.
what's the difference between these two?
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.
Better memory management, this is refactoring to reuse the existing data_ to hold the new data.
@@ -346,7 +346,7 @@ class XLAGraphExecutor : public torch::lazy::LazyGraphExecutor { | |||
std::vector<size_t> SetBufferDonors(LoweringContext* lowering_ctx); | |||
|
|||
// We don't use upstream Compile to have BuildInputOutputAliases. | |||
CompilationResult Compile(const std::vector<XLATensorPtr>& tensors, | |||
CompilationResult Compile(std::vector<XLATensorPtr>& tensors, |
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.
I can see how this will become problematic for the dynamo, since in dynamo we will first dry run the compilation and don't execute the compiled program. Please leave a TODO somewhere for the dynamo integration with auto-sharding.
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.
Makes sense I will also add a section in the design doc.
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 don't use upstream Compile to have BuildInputOutputAliases.
// TODO(yeounoh) auto-sharding can change tensors shardings, which needs to be
// accounted for in Dynamo integration.
CompilationResult Compile(std::vector<XLATensorPtr>& tensors,
absl::Span<const std::string> devices,
const SyncTensorCollection& coll,
PostOrderData* po_data,
const std::vector<torch::lazy::Value>& ir_values);
sharding_specs.push_back(""); | ||
} | ||
sharding_specs.push_back( | ||
GetXLAShardingSpec(bridge::GetXlaTensor(tensor))); |
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.
what will GetXLAShardingSpec
return when sharding_spec is null?
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.
""
empty string as expected.
11cc726
to
381077a
Compare
381077a
to
b21f260
Compare
This addresses the following to support #6322
tensors
argument toXLAGraphExecutor::Compile
method, since they can be updated during auto-sharding paass.