From 84bc20fe9d09542a6ec9dd9b97ac960161fcecfd Mon Sep 17 00:00:00 2001 From: satyajandhyala Date: Thu, 8 Jul 2021 14:38:09 -0700 Subject: [PATCH] Enable cast propagation with level one by default. (#8286) --- include/onnxruntime/core/optimizer/graph_transformer_config.h | 2 +- orttraining/orttraining/python/orttraining_pybind_state.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/onnxruntime/core/optimizer/graph_transformer_config.h b/include/onnxruntime/core/optimizer/graph_transformer_config.h index 42395ff303..6866433d51 100644 --- a/include/onnxruntime/core/optimizer/graph_transformer_config.h +++ b/include/onnxruntime/core/optimizer/graph_transformer_config.h @@ -51,7 +51,7 @@ struct GraphTransformerConfiguration { return (s1 == s2) == false; } - int level{-1}; /* -1 => no cast propagation, + int level{1}; /* -1 => no cast propagation, 0 => use user specified list of opcodes to allow moving cast operations, 1 => use ORT predefined list of level 1 opcodes in addition to the user specified allow opcodes 2 => use ORT predefined list of level 2 opcodes in addition to the user specified allow opcodes diff --git a/orttraining/orttraining/python/orttraining_pybind_state.cc b/orttraining/orttraining/python/orttraining_pybind_state.cc index 31c61727a8..a7eabe9b4b 100644 --- a/orttraining/orttraining/python/orttraining_pybind_state.cc +++ b/orttraining/orttraining/python/orttraining_pybind_state.cc @@ -71,7 +71,7 @@ struct TrainingParameters { bool enable_adasum = false; // transformation - int propagate_cast_ops_level = -1; + int propagate_cast_ops_level = 1; std::vector propagate_cast_ops_allow; GraphTransformerConfiguration::PropagateCastOpsConfiguration::Strategy propagate_cast_ops_strategy = GraphTransformerConfiguration::PropagateCastOpsConfiguration::Strategy::None;