Skip to content

Commit 5cf3b6f

Browse files
yanwei-gryanwei
and
yanwei
authored
close floating point check in popart (#665)
* close floating point check in popart * create pipeline resource when computation created. not do it at the time of set the cache computation item fix pixel bert detect application runtime error * add weiming build script fix Co-authored-by: yanwei <yw01041751@alibaba-inc.com>
1 parent 4c67b79 commit 5cf3b6f

File tree

5 files changed

+15
-22
lines changed

5 files changed

+15
-22
lines changed

.github/actions/build/build_in_docker.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ CONTAINER_NAME="halo.ci-$VER-$VARIANT"
2222

2323
docker_run_flag=""
2424
cmake_flags="-DDNNL_COMPILER=gcc-10"
25-
check_cmds="parallel -k --plus LIT_NUM_SHARDS={##} LIT_RUN_SHARD={#} CUDA_VISIBLE_DEVICES={} ninja check-halo ::: {0..1}"
26-
check_cmds="$check_cmds && ninja FileCheck && parallel -k --plus LIT_NUM_SHARDS={##} LIT_RUN_SHARD={#} CUDA_VISIBLE_DEVICES={} ninja check-halo-models ::: {0..1}"
25+
check_cmds="ninja FileCheck && parallel -k --plus LIT_NUM_SHARDS={##} LIT_RUN_SHARD={#} CUDA_VISIBLE_DEVICES={} ninja check-halo ::: {0..1}"
26+
check_cmds="$check_cmds && parallel -k --plus LIT_NUM_SHARDS={##} LIT_RUN_SHARD={#} CUDA_VISIBLE_DEVICES={} ninja check-halo-models ::: {0..1}"
2727

2828
if [[ "$VARIANT" =~ cuda ]]; then
2929
docker_run_flag="--runtime=nvidia"

ODLA/platforms/odla_popart/odla_compute.cc

+7-14
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,6 @@ odla_status odla_SetComputationItem(odla_computation comp, odla_item_type type,
6565
PopartConfig::instance()->set_load_cache(true);
6666
PopartConfig::instance()->set_cache_path(reinterpret_cast<char*>(value));
6767
PopartConfig::instance()->extract_config_from_cache();
68-
_odla_computation::instance()->set_executor();
69-
if (PopartConfig::instance()->execution_mode() == PARALLEL ||
70-
PopartConfig::instance()->execution_mode() == PIPELINE) {
71-
QManager::instance()->createQ(PopartConfig::instance()->queue_type());
72-
QManager::instance()->getQ()->init(
73-
PopartConfig::instance()->queue_capacity());
74-
}
7568
break;
7669
default:
7770
std::cerr << "Unsupported property type: " << type << std::endl;
@@ -105,13 +98,13 @@ odla_status odla_CreateComputation(odla_computation* comp) {
10598
// Read the config file
10699
if (!PopartConfig::instance()->inited()) {
107100
PopartConfig::instance()->load_config(std::getenv("ODLA_POPART_CONFIG"));
108-
_odla_computation::instance()->set_executor();
109-
if (PopartConfig::instance()->execution_mode() == PARALLEL ||
110-
PopartConfig::instance()->execution_mode() == PIPELINE) {
111-
QManager::instance()->createQ(PopartConfig::instance()->queue_type());
112-
QManager::instance()->getQ()->init(
113-
PopartConfig::instance()->queue_capacity());
114-
}
101+
}
102+
_odla_computation::instance()->set_executor();
103+
if (PopartConfig::instance()->execution_mode() == PARALLEL ||
104+
PopartConfig::instance()->execution_mode() == PIPELINE) {
105+
QManager::instance()->createQ(PopartConfig::instance()->queue_type());
106+
QManager::instance()->getQ()->init(
107+
PopartConfig::instance()->queue_capacity());
115108
}
116109
return ODLA_SUCCESS;
117110
}

ODLA/platforms/odla_popart/odla_popart.cc

+1-1
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ void _odla_computation::set_session_opts() {
241241
// session_opts_.matmulOptions["use128BitConvUnitLoad"] = "true";
242242
// session_opts_.matmulOptions["enableMultiStageReduce"] = "false";
243243
// session_opts_.matmulOptions["enableFastReduce"] = "true";
244-
session_opts_.enableFloatingPointChecks = true;
244+
session_opts_.enableFloatingPointChecks = false;
245245
session_opts_.enableStochasticRounding = false;
246246
session_opts_.enablePrefetchDatastreams = false; // true;
247247
session_opts_.enableOutlining = true;

ODLA/platforms/odla_popart/popart_config.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@ void PopartConfig::load_config(const char* file_path) {
6464
popart::logging::info("use default config");
6565
use_default();
6666
if (file_path != nullptr) load_from_file(file_path);
67-
print();
6867
}
6968

7069
void PopartConfig::parse_from_json(const json& jf) {
@@ -108,7 +107,6 @@ void PopartConfig::parse_from_json(const json& jf) {
108107
element.value()[1]);
109108
}
110109
}
111-
112110
if (jf.contains("queue_type"))
113111
queue_type_ = jf["queue_type"].get<std::string>();
114112
else
@@ -119,6 +117,7 @@ void PopartConfig::parse_from_json(const json& jf) {
119117
else
120118
queue_capacity_ = 1024 * 1024;
121119
if (jf.contains("debug")) debug_ = jf["debug"].get<bool>();
120+
print();
122121

123122
inited_ = true;
124123
}

ODLA/platforms/odla_popart/popart_config.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,10 @@ class PopartConfig {
108108
inline bool save_model() { return save_model_; }
109109
inline const std::string& load_onnx_path() { return load_onnx_path_; }
110110
inline const std::string& save_model_path() { return save_model_path_; }
111+
inline const std::string& get_default_config_string() {
112+
return default_config_string_;
113+
;
114+
}
111115
inline const int ipu_num() { return ipu_num_; }
112116
inline bool no_pipeline() { return pipeline_setting_.empty(); }
113117
inline std::string queue_type() { return queue_type_; }
@@ -116,9 +120,6 @@ class PopartConfig {
116120
inline bool inited() { return inited_; }
117121
inline std::shared_ptr<std::ifstream> get_cache_fs() { return cache_fs; }
118122
inline void set_cache_fs(std::shared_ptr<std::ifstream> fs) { cache_fs = fs; }
119-
inline std::string get_default_config_string() {
120-
return default_config_string_;
121-
}
122123

123124
inline bool load_cache() { return load_cache_; }
124125
inline const std::string load_cache_path() { return cache_path_; }

0 commit comments

Comments
 (0)