Skip to content

Commit 9290484

Browse files
authored
support torch-npu 2.5.1 (#229)
1 parent a9a4969 commit 9290484

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

dlinfer/vendor/ascend/csrc/torch_npu_symbol_fix.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,4 +28,17 @@ bool checkUceErrAndRepair() {
2828
return false;
2929
}
3030

31+
void checkUceErrAndRepair(bool tf, std::string& str) {
32+
throw std::runtime_error(
33+
"Dlinfer checkUceErrAndRepair should not be called. "
34+
"Please check your environment setup.");
35+
return;
36+
}
37+
38+
void record_mem_hbm_ecc_error() {
39+
throw std::runtime_error(
40+
"Dlinfer record_mem_hbm_ecc_error should not be called. "
41+
"Please check your environment setup.");
42+
}
43+
3144
} // namespace c10_npu

dlinfer/vendor/ascend/csrc/torch_npu_utils.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,14 +155,15 @@ aclError AclrtCtxSetSysParamOpt(aclSysParamOpt opt, int64_t value) {
155155
} \
156156
} while (0)
157157

158+
static bool deterministicaclnn_oldstatus = false;
158159
void SetDeterministic() {
159160
auto deterministicAlgorithmsStatus = at::globalContext().deterministicAlgorithms();
160-
if (at_npu::native::deterministicaclnn_oldstatus != deterministicAlgorithmsStatus) {
161+
if (deterministicaclnn_oldstatus != deterministicAlgorithmsStatus) {
161162
NPU_CHECK_ERROR(AclSetCompileopt(aclCompileOpt::ACL_OP_DETERMINISTIC, deterministicAlgorithmsStatus ? "1" : "0"));
162163
NPU_CHECK_ERROR(AclrtCtxSetSysParamOpt(aclSysParamOpt::ACL_OPT_DETERMINISTIC, deterministicAlgorithmsStatus ? 1 : 0));
163164
HcclConfigValue configValue = {deterministicAlgorithmsStatus ? 1 : 0};
164165
HCCL_CHECK_ERROR(HcclSetConfig(HcclConfig::HCCL_DETERMINISTIC, configValue));
165-
at_npu::native::deterministicaclnn_oldstatus = deterministicAlgorithmsStatus;
166+
deterministicaclnn_oldstatus = deterministicAlgorithmsStatus;
166167
}
167168
}
168169

0 commit comments

Comments
 (0)