Skip to content

Commit de359f5

Browse files
naummoGoogle-ML-Automation
authored andcommitted
[Mosaic] Verify that the target IDs are provided in remote DMAs
Adds an extra verification check. Since the source semaphore is used only for remote DMAs, we should check that device or core IDs are also provided when source semaphore is provided. PiperOrigin-RevId: 707675228
1 parent af63e44 commit de359f5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

jaxlib/mosaic/dialect/tpu/tpu_ops.cc

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -935,6 +935,13 @@ LogicalResult EnqueueDMAOp::verify() {
935935
"device_id or core_id is specified");
936936
}
937937
}
938+
if (getSourceSemaphore()) {
939+
if (!getDeviceId() && !getCoreId()) {
940+
return emitOpError(
941+
"DMA destination device_id or core_id must be specified when source "
942+
"semaphore is specified");
943+
}
944+
}
938945
return success();
939946
}
940947

0 commit comments

Comments
 (0)