Skip to content

Commit 97f5a65

Browse files
yanwei-gryanwei
and
yanwei
authored
update popart api to 2.3.1 & optimize logs (#715)
* update to poplar 2.3.1 & remove useless code * update log message & add open log option Co-authored-by: yanwei <yw01041751@alibaba-inc.com>
1 parent 389c131 commit 97f5a65

File tree

10 files changed

+11
-150
lines changed

10 files changed

+11
-150
lines changed

.github/actions/build/build_in_docker.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ DOCKER_ID=`docker ps -aq -f name=$CONTAINER_NAME -f status=running`
3636
gid=$(id -g ${USER})
3737
group=$(id -g -n ${USER})
3838
uid=$(id -u ${USER})
39-
extra_mnt="-v /opt/poplar_sdk-ubuntu_18_04-2.2.2+711-26aba6cf16:/opt/poplar_sdk:ro"
39+
extra_mnt="-v /opt/poplar_sdk-ubuntu_18_04-2.3.1_793:/opt/poplar_sdk:ro"
4040
mkdir -p /tmp/ubuntu.cache
4141
extra_mnt="$extra_mnt -v /tmp/ubuntu.cache:/cache"
4242

.github/workflows/main.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ jobs:
7777
$image_registry/computation/halo:$image_tag \
7878
/bin/bash -c 'source scl_source enable devtoolset-7 && cd /build && cmake -G Ninja /host/halo -DHALO_USE_TIDY_CHECK=OFF -DHALO_GEN_DOCS=OFF -DODLA_BUILD_POPART_USE_CXX11ABI=OFF -DODLA_BUILD_POPART_CUSTOM_OPS=ON -DODLA_BUILD_TRT=OFF -DODLA_BUILD_XNNPACK=OFF -DODLA_BUILD_EIGEN=OFF -DODLA_BUILD_DNNL=OFF -DHALO_BUILD_RTLIB=OFF -DHALO_USE_STATIC_PROTOBUF=ON -DCPACK_SYSTEM_NAME=centos-i686 && ninja && source /opt/poplar_sdk/poplar/enable.sh && ninja check-halo && ninja package && cp /build/*.bz2 /build/*.rpm /host/output_centos'
7979
env:
80-
poplar_sdk: /opt/poplar_sdk-centos_7_6-2.2.2+711-26aba6cf16
80+
poplar_sdk: /opt/poplar_sdk-centos_7_6-2.3.1_793
8181
repo_name : heterogeneity-aware-lowering-and-optimization
8282
image_registry : registry-intl.us-west-1.aliyuncs.com
8383
image_tag : latest-devel-x86_64-centos7

ODLA/platforms/odla_popart/CMakeLists.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ set(POPART_ROOT ${POPART_ROOT} PARENT_SCOPE)
3535

3636
list(APPEND CMAKE_PREFIX_PATH ${POPLAR_ROOT})
3737
list(APPEND CMAKE_PREFIX_PATH ${POPART_ROOT})
38-
find_package(popart 2.2.1... REQUIRED CONFIG COMPONENTS popart-only REQUIRED)
38+
find_package(popart 2.3.0... REQUIRED CONFIG COMPONENTS popart-only REQUIRED)
3939

4040
message(STATUS "Found popart, version: ${popart_VERSION}")
4141

ODLA/platforms/odla_popart/custom_ops/CMakeLists.txt

-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
# ==============================================================================
1616

1717
add_odla_library(custom_ops SHARED
18-
erf.cc
1918
rsqrt.cc
2019
postprocess.cc
2120
attention_mask.cc

ODLA/platforms/odla_popart/custom_ops/erf.cc

-136
This file was deleted.
-537 KB
Binary file not shown.

ODLA/platforms/odla_popart/custom_ops/rsqrt.cc

+3-3
Original file line numberDiff line numberDiff line change
@@ -59,18 +59,18 @@ static popart::OpCreator<RsqrtOp> rsqrtOpCreator(popart::OpDefinitions({
5959
class RsqrtOpx : public popart::popx::ElementWiseUnaryOpx {
6060
public:
6161
RsqrtOpx(popart::Op*, popart::popx::Devicex*);
62-
void grow(poplar::program::Sequence&) const final;
62+
void grow(snap::program::Sequence&) const final;
6363
};
6464

6565
RsqrtOpx::RsqrtOpx(popart::Op* op, popart::popx::Devicex* devicex)
6666
: popart::popx::ElementWiseUnaryOpx(op, devicex) {
6767
verifyOp<RsqrtOp>(op, CustomOperators::Rsqrt_1);
6868
}
6969

70-
void RsqrtOpx::grow(poplar::program::Sequence& prog) const {
70+
void RsqrtOpx::grow(snap::program::Sequence& prog) const {
7171
auto result =
7272
popops::map(graph().getPoplarGraph(), popops::expr::UnaryOpType::RSQRT,
73-
getInTensor(0).getPoplarTensor(), prog, debugContext());
73+
getInTensor(0).getPoplarTensor(), prog.getPoplarSequence(), debugContext());
7474
setOutTensor(0, snap::Tensor{result, graph()});
7575
}
7676

ODLA/platforms/odla_popart/odla_compute.cc

+3
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,13 @@ odla_status odla_SetComputationItem(odla_computation comp, odla_item_type type,
6363
comp->opts.cache_dir = (reinterpret_cast<char*>(value));
6464
break;
6565
case 1001: // load cache directly, need set path of cache file
66+
popart::logging::info("set load_or_save_cache");
6667
PopartConfig::instance()->set_load_or_save_cache(true);
6768
PopartConfig::instance()->set_cache_path(
6869
(std::string) reinterpret_cast<char*>(value));
6970
break;
71+
case 1002:
72+
setenv("POPART_LOG_LEVEL", "INFO", 1);
7073
default:
7174
std::cerr << "Unsupported property type: " << type << std::endl;
7275
return ODLA_UNSUPPORTED_DATATYPE;

ODLA/platforms/odla_popart/odla_ops.cc

-5
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,6 @@ odla_value odla_Div(odla_value lhs, odla_value rhs, const odla_value_id id) {
8383
odla_value odla_Erf(odla_value input, const odla_value_id id) {
8484
const auto& name = id ? std::string(reinterpret_cast<const char*>(id)) : "";
8585

86-
// const popart::OperatorIdentifier erf(popart::Domain::ai_graphcore, "Erf",
87-
// 1,
88-
// 1, 1);
89-
// auto result = g_comp->builder->customOp(erf, 1, {input->tensor_id}, 1, {},
90-
// name)[0];
9186
auto result = g_comp->builder->aiOnnxOpset10().erf({input->tensor_id}, name);
9287

9388
return new _odla_value(result,

ODLA/platforms/odla_popart/odla_popart.cc

+2-2
Original file line numberDiff line numberDiff line change
@@ -288,10 +288,10 @@ odla_status _odla_computation::init(bool is_compile) {
288288
"Poplar unrecoverable_runtime_error exception caught");
289289
return ODLA_UNRECOVERABLE_ERR;
290290
} catch (poplar::unknown_runtime_error& e) {
291-
popart::logging::info("Poplar unknown runtime exception caught}");
291+
popart::logging::err("Poplar unknown runtime exception caught");
292292
return ODLA_UNRECOVERABLE_ERR;
293293
} catch (...) {
294-
popart::logging::info("Poplar unknown exception caught");
294+
popart::logging::err("Poplar unknown exception caught");
295295
return ODLA_UNRECOVERABLE_ERR;
296296
}
297297
// If in parallel mode, start the thread

0 commit comments

Comments
 (0)