Skip to content

deeplink开发不能调用我写的算子 #901

@jianlonghaha

Description

@jianlonghaha

我在开发deleplink的时候遇到了一个问题一直不能解决,

我在/home/deeplink/deeplink.framework/dipu/third_party/DIOPI/impl里面编译好了共享库libdiopi_impl.so,so里面只实现了这么一段代码

#include <diopi/functions.h>
#include <math.h>
#include
#include "../musa_pytorch.h"
// #include "../common/common.hpp"

namespace impl {
namespace musa {
static const char* name = "MUSADevice";
DIOPI_RT_API const char* diopiGetVendorName() { return name; }
DIOPI_API diopiError_t diopiAdd(diopiContextHandle_t ctx, diopiTensorHandle_t out, diopiConstTensorHandle_t input, diopiConstTensorHandle_t other,
const diopiScalar_t* alpha) {
std::cout << "==================diopiAdd===========================\n";
return diopiSuccess;
}
编译deeplink之后在打开python之后,不能调用我写的算子,说我回退到cpu端了,如下
import torch,torch_dipu,os
dipu device will show as cuda device. if it's not expected behavior, please set env DIPU_PYTHON_DEVICE_AS_CUDA=false
Wed Jul 17 16:01:46 2024 dipu | git hash:fdc1b4c1-dirty
::diopiFill 01 is not yet implemented, fill_.Scalar will be fallback to cpu
::diopiAddScalar 01 is not yet implemented, add.Scalar_out will be fallback to cpu
::diopiAddInpScalar 01 is not yet implemented, add_.Scalar will be fallback to cpu
::diopiAddInp 01 is not yet implemented, add_.Tensor will be fallback to cpu
::diopiAdd 01 is not yet implemented, add.out will be fallback to cpu
::diopiAdd 01 is not yet implemented, add.Tensor will be fallback to cpu
这怎么解决?

Metadata

Metadata

Assignees

No one assigned

    Labels

    DIPUDIPU related

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions