return generate_hlo_graph_;
}
+ExecutableBuildOptions& ExecutableBuildOptions::set_hlo_profile(bool enabled) {
+ hlo_profile_ = enabled;
+ return *this;
+}
+
+bool ExecutableBuildOptions::hlo_profile() const { return hlo_profile_; }
+
} // namespace xla
ExecutableBuildOptions& set_generate_hlo_graph(string regex);
const tensorflow::gtl::optional<string>& generate_hlo_graph() const;
+ // If set, specifies that we should record an HLO profile during execution and
+ // log it after execution (as in DebugOptions).
+ ExecutableBuildOptions& set_hlo_profile(bool enabled);
+ bool hlo_profile() const;
+
// Returns a string representation of the build options, suitable for
// debugging.
string ToString() const;
private:
+ bool hlo_profile_ = false;
int device_ordinal_ = -1;
Shape result_layout_;
bool result_layout_set_ = false;
}
Py_DECREF(o);
+ o = PyObject_GetAttrString($input, "hlo_profile");
+ if (o == NULL) {
+ return NULL;
+ }
+ if (o != Py_None) {
+ if (!PyBool_Check(o)) {
+ PyErr_SetString(PyExc_TypeError, "ExecutableBuildOptions.hlo_profile must be a bool or None.");
+ return NULL;
+ }
+ build_options.set_hlo_profile(o == Py_True);
+ }
+ Py_DECREF(o);
+
o = PyObject_GetAttrString($input, "result_shape");
if (o == nullptr) {
return nullptr;
def __init__(self):
self.generate_hlo_graph = None
+ self.hlo_profile = False
def transfer_to_infeed(value, replica_number=None):
}
ExecutionOptions execution_options = CreateDefaultExecutionOptions();
+ execution_options.mutable_debug_options()->set_xla_hlo_profile(
+ build_options.hlo_profile());
if (build_options.generate_hlo_graph().has_value()) {
execution_options.mutable_debug_options()->set_xla_generate_hlo_graph(
build_options.generate_hlo_graph().value());