Skip to content

Commit 8694236

Browse files
committed
Add ability to set ON_DEMAND using flags
Reviewers: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, gauthamg Reviewed By: #tensorflow, #framework_ip_review_-_any_oss_or_third-party_code_use_has_been_approved, gauthamg Maniphest Tasks: T69999 Differential Revision: https://phabricator.sourcevertex.net/D80365
1 parent 1732bd5 commit 8694236

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

tensorflow/compiler/plugin/poplar/driver/poplar_executor.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1562,7 +1562,8 @@ Status PoplarExecutor::AttachToPoplarDevice() {
15621562
}
15631563

15641564
const bool wait_for_device =
1565-
ConnectionType() == IpuDeviceConnectionType::ON_DEMAND;
1565+
ConnectionType() == IpuDeviceConnectionType::ON_DEMAND ||
1566+
PoplarXlaFlags::Get().use_on_demand;
15661567
const bool use_ipu_model = PoplarXlaFlags::Get().use_ipu_model;
15671568

15681569
try {

tensorflow/compiler/plugin/poplar/driver/tools/flags.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,8 @@ absl::flat_hash_map<std::string, std::string> GetFlagUsage() {
112112
{"show_progress_bar",
113113
"Whether to show the compilation progress bar. Either \"true\", "
114114
"\"false\" or \"auto\". Defaults to \"auto\"."},
115+
{"use_on_demand",
116+
"When true, sets connection type to \"ON_DEMAND\", useful for CI."},
115117
{"on_demand_device_poll_time",
116118
"When using \"ON_DEMAND\" connection type, configure how often to poll "
117119
"for the device (in miliseconds) when a device is not available - "
@@ -166,6 +168,7 @@ PoplarXlaFlags::PoplarXlaFlags() {
166168
ADD_FLAG(allow_nans)
167169
ADD_FLAG(null_data_feed)
168170
ADD_FLAG(show_progress_bar)
171+
ADD_FLAG(use_on_demand)
169172
ADD_FLAG(on_demand_device_poll_time)
170173
ADD_FLAG(on_demand_device_timeout)
171174
ADD_FLAG(ipu_model_tiles)

tensorflow/compiler/plugin/poplar/driver/tools/flags.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,9 @@ class PoplarXlaFlags {
100100
// Whether to show the compilation progress bar.
101101
std::string show_progress_bar = "auto";
102102

103+
// When true, sets connection type to 'ON_DEMAND', useful for CI.
104+
bool use_on_demand = false;
105+
103106
// When using 'ON_DEMAND' connection type, configure how often to poll for the
104107
// device (in milliseconds) when a device is not available - defaults to
105108
// 1000ms. Minimum is 100ms.

0 commit comments

Comments
 (0)