Skip to content

Commit

Permalink
[dicp][ascend] get soc_version from aclrt (#505)
Browse files Browse the repository at this point in the history
  • Loading branch information
tangzhiyi11 authored Dec 7, 2023
1 parent 2770001 commit 30894d0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
6 changes: 3 additions & 3 deletions dicp/dicp/vendor/AscendGraph/codegen/graph_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include <unordered_set>
#include <vector>

#include "acl/acl.h"
#include "all_ops.h"
#include "ascend_string.h"
#include "ge_api.h"
Expand Down Expand Up @@ -83,10 +84,9 @@ class AclgraphBuilder {
public:
explicit AclgraphBuilder() {
// 1. system init
std::string kSocVersion = "Ascend910ProB";
auto kSocVersion = aclrtGetSocName();
std::map<AscendString, AscendString> global_options = {
{AscendString(ge::ir_option::SOC_VERSION),
AscendString(kSocVersion.c_str())},
{AscendString(ge::ir_option::SOC_VERSION), AscendString(kSocVersion)},
{AscendString(ge::ir_option::PRECISION_MODE), "allow_fp32_to_fp16"},
};
auto status = aclgrphBuildInitialize(global_options);
Expand Down
5 changes: 3 additions & 2 deletions dicp/dicp/vendor/AscendGraph/compile_job.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ def __init__(self, source_code) -> None:
'-std=c++11',
'-O3',
'-Wall',
'-I/usr/local/Ascend/ascend-toolkit/latest/include',
'-I/usr/local/Ascend/ascend-toolkit/latest/opp/built-in/op_proto/inc',
'-I/usr/local/Ascend/ascend-toolkit/latest/include/graph',
'-I/usr/local/Ascend/ascend-toolkit/latest/include/ge',
Expand All @@ -46,10 +47,10 @@ def __init__(self, source_code) -> None:
'-lge_runner',
source_path,
'-o' + self._lib_path,
'-Wl,-rpath,/usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/stub',
'/usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/stub/libgraph.so',
'/usr/local/Ascend/ascend-toolkit/latest/compiler/lib64/stub/libge_runner.so',
'/usr/local/Ascend/ascend-toolkit/latest/lib64/libgraph_base.so']
'/usr/local/Ascend/ascend-toolkit/latest/lib64/libgraph_base.so',
'/usr/local/Ascend/ascend-toolkit/latest/runtime/lib64/stub/libascendcl.so',]

def _compile(self):
if not os.path.exists(self._lib_path):
Expand Down

0 comments on commit 30894d0

Please sign in to comment.