Skip to content

Commit 4dac2e2

Browse files
committed
Add more VLOG around compile/execute ops.
1 parent 74cff13 commit 4dac2e2

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

torch_xla/csrc/tensor.cpp

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1089,12 +1089,17 @@ std::shared_ptr<XLATensor::Async> XLATensor::ScheduleSyncTensorsGraph(
10891089
async->tensors_data.emplace_back(std::move(xla_data));
10901090
}
10911091

1092-
auto syncfn = [async]() {
1092+
auto syncfn = [async, hash = coll->hash]() {
10931093
xla::ComputationClient::ExecuteComputationOptions options;
10941094
try {
1095+
TF_VLOG(3) << "Executing IR graph hash " << hash << " on device "
1096+
<< async->device << " ...";
10951097
auto results = xla::ComputationClient::Get()->ExecuteComputation(
10961098
*async->cached_computation->computation, async->parameters_data,
10971099
async->device, options);
1100+
TF_VLOG(3) << "Executing IR graph hash " << hash << " on device "
1101+
<< async->device << " done!";
1102+
10981103
for (size_t i = 0; i < results.size(); ++i) {
10991104
if (async->tensors_data[i] != nullptr) {
11001105
async->tensors_data[i]->Assign(*results[i]);
@@ -1189,8 +1194,13 @@ XLATensor::OpByOpAsync XLATensor::SyncTensorsGraphOpByOp(
11891194
std::string device = async->unique_device
11901195
? async->unique_device->ToString()
11911196
: std::string();
1197+
TF_VLOG(3) << "Executing (OpByOp) IR graph hash " << async->coll.hash
1198+
<< " on device " << device << " ...";
11921199
std::vector<xla::ComputationClient::DataPtr> results =
11931200
OpByOpExecutor::Get()->Execute(async->roots, device, async->devices);
1201+
TF_VLOG(3) << "Executing (OpByOp) IR graph hash " << async->coll.hash
1202+
<< " on device " << device << " done!";
1203+
11941204
for (size_t i = 0; i < results.size(); ++i) {
11951205
if (async->tensors_data[i] != nullptr) {
11961206
async->tensors_data[i]->Assign(*results[i]);
@@ -1244,9 +1254,14 @@ std::shared_ptr<XLATensor::Async> XLATensor::SyncTensorsGraphInternal(
12441254
unique_device->ToString(), devices),
12451255
&shape});
12461256

1257+
TF_VLOG(3) << "Compiling IR graph hash " << coll.hash << " on device "
1258+
<< coll.device << " ...";
12471259
std::vector<std::shared_ptr<xla::ComputationClient::Computation>>
12481260
computations =
12491261
xla::ComputationClient::Get()->Compile(std::move(instances));
1262+
TF_VLOG(3) << "Compiling IR graph hash " << coll.hash << " on device "
1263+
<< coll.device << " done!";
1264+
12501265
std::vector<xla::ComputationClient::DataPtr> parameters_data =
12511266
lowering_ctx.GetParametersData();
12521267
XLA_CHECK_EQ(program_shape.parameters_size(), parameters_data.size());

0 commit comments

Comments
 (0)