一些编译torch-mlir到日记

因为版本不匹配,torch-mlir版本老于mlir,报错

/torch-mlir-main/include/torch-mlir/Conversion/TorchToTosa/TosaLegalizeUtils.h:13:
In file included from /usr/local/include/mlir/Dialect/Quant/IR/QuantTypes.h:13:
/usr/local/include/mlir/IR/Builders.h:507:11: error: no matching member function for call to 'build'
    OpTy::build(*this, state, std::forward<Args>(args)...);
    ~~~~~~^~~~~
/usr/local/include/mlir/IR/ImplicitLocOpBuilder.h:67:23: note: in instantiation of function template specialization 'mlir::OpBuilder::create<mlir::tosa::RescaleOp, mlir::Type &, mlir::Value &, mlir::IntegerAttr &, mlir::IntegerAttr &, mlir::detail::DenseArrayAttrImpl<int32_t> &, mlir::detail::DenseArrayAttrImpl<int8_t> &, mlir::BoolAttr &, mlir::BoolAttr &, mlir::BoolAttr &>' requested here
    return OpBuilder::create<OpTy>(curLoc, std::forward<Args>(args)...);

于是直接跳过编译TOSA:

cmake -G Ninja .. -DCMAKE_BUILD_TYPE=Release -DMLIR_DIR=/usr/local/lib/cmake/mlir -DTORCH_MLIR_ENABLE_TOSA=OFF

然后遇到报错

/Users/haorancheng/Desktop/torch-mlir-main/lib/InitAll.cpp:75:20: error: no member named 'registerStablehloAggressiveSimplificationPass' in namespace 'mlir::stablehlo' mlir::stablehlo::registerStablehloAggressiveSimplificationPass(); ~~~~~~~~~~~~~~~~~^ 1 error generated.

于是comment out InitAll.cpp里的

//mlir::stablehlo::registerStablehloAggressiveSimplificationPass();

大部分问题都是ChatGPT可以解决的

全部评论

相关推荐

LXXXXd:有点杂,想搞自动化的话没必要把法律的经历写上去
点赞 评论 收藏
分享
09-14 17:23
门头沟学院
故事和酒66:所以说副业很重要,程序员干到40岁,再怎么也赚300万了,吃吃利息也够活下去
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务