aboutsummaryrefslogtreecommitdiffhomepage
path: root/tensorflow/compiler/xla/service/hlo_module.h
diff options
context:
space:
mode:
authorGravatar Yunxing Dai <yunxing@google.com>2018-10-08 21:18:36 -0700
committerGravatar TensorFlower Gardener <gardener@tensorflow.org>2018-10-08 21:23:03 -0700
commit375c109659d2d0e6265447dffdeb460693b3cccf (patch)
treea6f09b6472cff1ade7fc91c1ff0d5e3f473da774 /tensorflow/compiler/xla/service/hlo_module.h
parentd58712b7fc8de0e1f87fe2ea5221bc3c85230ed3 (diff)
[XLA] Introduce input/output alias config.
- This CL intruduces input/output alias config in HLO module that allows any HLO pass to configure it. Once the alias_config is set, each backend needs to follow the contract during execution time to make sure the input and output are indeed aliased. - Copy insertion / buffer assignment and alias analysis has been updated to correctly honor the config and avoid any possible liveness interference. PiperOrigin-RevId: 216299501
Diffstat (limited to 'tensorflow/compiler/xla/service/hlo_module.h')
-rw-r--r--tensorflow/compiler/xla/service/hlo_module.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/tensorflow/compiler/xla/service/hlo_module.h b/tensorflow/compiler/xla/service/hlo_module.h
index 735804e827..9b9dc3ba9f 100644
--- a/tensorflow/compiler/xla/service/hlo_module.h
+++ b/tensorflow/compiler/xla/service/hlo_module.h
@@ -31,6 +31,7 @@ limitations under the License.
#include "tensorflow/compiler/xla/service/hlo.pb.h"
#include "tensorflow/compiler/xla/service/hlo_clone_context.h"
#include "tensorflow/compiler/xla/service/hlo_computation.h"
+#include "tensorflow/compiler/xla/service/hlo_input_output_alias_config.h"
#include "tensorflow/compiler/xla/service/hlo_instruction.h"
#include "tensorflow/compiler/xla/service/hlo_module_config.h"
#include "tensorflow/compiler/xla/service/hlo_schedule.h"
@@ -212,6 +213,15 @@ class HloModule {
return result;
}
+ // input_output_alias_config indicates the list of aliased buffers that are
+ // expected from the module.
+ HloInputOutputAliasConfig& input_output_alias_config() {
+ return input_output_alias_config_;
+ }
+ const HloInputOutputAliasConfig& input_output_alias_config() const {
+ return input_output_alias_config_;
+ }
+
// Returns the number of unique intruction ids given out. All ids up to
// this point are guaranteed to be in the range [0..NumUniqueInstructionIds())
int NumUniqueInstructionIds() const { return next_unique_id_; }
@@ -284,6 +294,10 @@ class HloModule {
// sequential order of instructions for each non-fusion computation in the
// module.
absl::optional<HloSchedule> schedule_;
+
+ // alias_config indicates the alias information of input/output buffers that
+ // are expected from the module.
+ HloInputOutputAliasConfig input_output_alias_config_;
};
} // namespace xla