Files
xc-llm-ascend/csrc/aclnn_torch_adapter/NPUBridge.cpp
Slightwind 9fdabb7b60 [feature] Add Custom Op grouped_matmul_swiglu_quant (#4431)
This PR introduces the `EXEC_NPU_CMD` macro, serving as an adapter layer
to simplify the invocation of `aclnn` operators on Ascend NPUs.

**Key Changes:**
* **Adapter Layer:** Added `EXEC_NPU_CMD` macro and related dependencies
to standardize `aclnn` calls.
* **Operator Support:** Integrated `grouped_matmul_swiglu_quant` as a
reference implementation to demonstrate the usage of the new macro.

---


- vLLM version: v0.11.2

---------

Signed-off-by: SlightwindSec <slightwindsec@gmail.com>
2025-11-27 21:56:18 +08:00

31 lines
942 B
C++

// Copyright (c) 2020, Huawei Technologies Co., Ltd
// All rights reserved.
//
// This source code is licensed under the BSD-style license found in the
// LICENSE file in the root directory of this source tree.
#include "NPUBridge.h"
namespace vllm_ascend
{
NPUStorageImpl *NPUBridge::GetNpuStorageImpl(c10::StorageImpl *storageImpl)
{
return static_cast<NPUStorageImpl *>(storageImpl);
}
NPUStorageImpl *NPUBridge::GetNpuStorageImpl(c10::Storage &&storage)
{
return static_cast<NPUStorageImpl *>(storage.unsafeGetStorageImpl());
}
NPUStorageImpl *NPUBridge::GetNpuStorageImpl(const at::Tensor &tensor)
{
return static_cast<NPUStorageImpl *>(tensor.storage().unsafeGetStorageImpl());
}
NPUStorageDesc &NPUBridge::GetNpuStorageImplDesc(const at::Tensor &tensor)
{
return static_cast<NPUStorageImpl *>(tensor.storage().unsafeGetStorageImpl())->npu_desc_;
}
}