Skip to content

Commit

Permalink
close floating point check in popart (#665)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
yanwei-gr and yanwei authored Nov 3, 2021
1 parent 4c67b79 commit 5cf3b6f
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 22 deletions.
4 changes: 2 additions & 2 deletions .github/actions/build/build_in_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ CONTAINER_NAME="halo.ci-$VER-$VARIANT"

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

if [[ "$VARIANT" =~ cuda ]]; then
docker_run_flag="--runtime=nvidia"
Expand Down
21 changes: 7 additions & 14 deletions ODLA/platforms/odla_popart/odla_compute.cc
Original file line number Diff line number Diff line change
Expand Up @@ -65,13 +65,6 @@ odla_status odla_SetComputationItem(odla_computation comp, odla_item_type type,
PopartConfig::instance()->set_load_cache(true);
PopartConfig::instance()->set_cache_path(reinterpret_cast<char*>(value));
PopartConfig::instance()->extract_config_from_cache();
_odla_computation::instance()->set_executor();
if (PopartConfig::instance()->execution_mode() == PARALLEL ||
PopartConfig::instance()->execution_mode() == PIPELINE) {
QManager::instance()->createQ(PopartConfig::instance()->queue_type());
QManager::instance()->getQ()->init(
PopartConfig::instance()->queue_capacity());
}
break;
default:
std::cerr << "Unsupported property type: " << type << std::endl;
Expand Down Expand Up @@ -105,13 +98,13 @@ odla_status odla_CreateComputation(odla_computation* comp) {
// Read the config file
if (!PopartConfig::instance()->inited()) {
PopartConfig::instance()->load_config(std::getenv("ODLA_POPART_CONFIG"));
_odla_computation::instance()->set_executor();
if (PopartConfig::instance()->execution_mode() == PARALLEL ||
PopartConfig::instance()->execution_mode() == PIPELINE) {
QManager::instance()->createQ(PopartConfig::instance()->queue_type());
QManager::instance()->getQ()->init(
PopartConfig::instance()->queue_capacity());
}
}
_odla_computation::instance()->set_executor();
if (PopartConfig::instance()->execution_mode() == PARALLEL ||
PopartConfig::instance()->execution_mode() == PIPELINE) {
QManager::instance()->createQ(PopartConfig::instance()->queue_type());
QManager::instance()->getQ()->init(
PopartConfig::instance()->queue_capacity());
}
return ODLA_SUCCESS;
}
Expand Down
2 changes: 1 addition & 1 deletion ODLA/platforms/odla_popart/odla_popart.cc
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ void _odla_computation::set_session_opts() {
// session_opts_.matmulOptions["use128BitConvUnitLoad"] = "true";
// session_opts_.matmulOptions["enableMultiStageReduce"] = "false";
// session_opts_.matmulOptions["enableFastReduce"] = "true";
session_opts_.enableFloatingPointChecks = true;
session_opts_.enableFloatingPointChecks = false;
session_opts_.enableStochasticRounding = false;
session_opts_.enablePrefetchDatastreams = false; // true;
session_opts_.enableOutlining = true;
Expand Down
3 changes: 1 addition & 2 deletions ODLA/platforms/odla_popart/popart_config.cc
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ void PopartConfig::load_config(const char* file_path) {
popart::logging::info("use default config");
use_default();
if (file_path != nullptr) load_from_file(file_path);
print();
}

void PopartConfig::parse_from_json(const json& jf) {
Expand Down Expand Up @@ -108,7 +107,6 @@ void PopartConfig::parse_from_json(const json& jf) {
element.value()[1]);
}
}

if (jf.contains("queue_type"))
queue_type_ = jf["queue_type"].get<std::string>();
else
Expand All @@ -119,6 +117,7 @@ void PopartConfig::parse_from_json(const json& jf) {
else
queue_capacity_ = 1024 * 1024;
if (jf.contains("debug")) debug_ = jf["debug"].get<bool>();
print();

inited_ = true;
}
Expand Down
7 changes: 4 additions & 3 deletions ODLA/platforms/odla_popart/popart_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,10 @@ class PopartConfig {
inline bool save_model() { return save_model_; }
inline const std::string& load_onnx_path() { return load_onnx_path_; }
inline const std::string& save_model_path() { return save_model_path_; }
inline const std::string& get_default_config_string() {
return default_config_string_;
;
}
inline const int ipu_num() { return ipu_num_; }
inline bool no_pipeline() { return pipeline_setting_.empty(); }
inline std::string queue_type() { return queue_type_; }
Expand All @@ -116,9 +120,6 @@ class PopartConfig {
inline bool inited() { return inited_; }
inline std::shared_ptr<std::ifstream> get_cache_fs() { return cache_fs; }
inline void set_cache_fs(std::shared_ptr<std::ifstream> fs) { cache_fs = fs; }
inline std::string get_default_config_string() {
return default_config_string_;
}

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

0 comments on commit 5cf3b6f

Please sign in to comment.