Skip to content

Commit a1b5802

Browse files
committed
bugfix: add USE_NPU macro to support multiple platforms.
1 parent 0ffeaec commit a1b5802

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

xllm/core/layers/rms_norm.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,20 @@ limitations under the License.
1414
==============================================================================*/
1515

1616
#pragma once
17+
#if defined(USE_NPU)
1718
#ifdef TORCH_HIGHER_THAN_PTA6
1819
#include <torch_npu/csrc/core/npu/NPUFormat.h>
1920
#include <torch_npu/csrc/framework/OpCommand.h>
2021
#else
2122
#include <torch_npu/csrc/aten/NPUNativeFunctions.h>
2223
#include <torch_npu/csrc/framework/utils/OpPreparation.h>
2324
#endif
24-
2525
#include <torch_npu/csrc/libs/init_npu.h>
2626

27+
#include "npu/npu_rms_norm_impl.h"
28+
#include "pytorch/adapter/utils/utils.h"
29+
#endif
30+
2731
#include <functional>
2832

2933
#include "atb/atb_infer.h"
@@ -36,8 +40,6 @@ limitations under the License.
3640
#include "framework/model/model_input_params.h"
3741
#include "framework/state_dict/state_dict.h"
3842
#include "nlohmann/json.hpp"
39-
#include "npu/npu_rms_norm_impl.h"
40-
#include "pytorch/adapter/utils/utils.h"
4143

4244
namespace xllm {
4345

0 commit comments

Comments
 (0)