WangZeJun
WangZeJun
请问一下这个问题解决了吗,我也碰到了这个问题,使用 FP32 模式从源码编译后安装: >>> import lightseq.inference Traceback (most recent call last): File "", line 1, in ImportError: /home/wangzejun/nlp-tools/transformer_tools/lightseq-master/lightseq/inference.cpython-37m-x86_64-linux-gnu.so: undefined symbol: fatbinData
> > 请问一下这个问题解决了吗,我也碰到了这个问题,使用 FP32 模式从源码编译后安装: > > > > > import lightseq.inference > > > > > Traceback (most recent call last): > > > > > File "", line...
> > 请问一下这个问题解决了吗,我也碰到了这个问题,使用 FP32 模式从源码编译后安装: > > > > > import lightseq.inference > > > > > Traceback (most recent call last): > > > > > File "", line...
> Thanks for your feedback, you could try building from tag v2.2.0. The latest build of master may be unstable. Thanks. I have solved this problem by building with different...
问下哈: https://github.com/Tencent/TurboTransformers/blob/master/turbo_transformers/core/tensor.h 中 NewDLPackTensorT里面的device_id是gpu的device id嘛: template inline DLManagedTensor *NewDLPackTensorT(const std::vector &shape_list, DLDeviceType device = kDLCPU, int device_id = 0, const std::string &name = "") { return NewDLPackTensor(shape_list, device, device_id, details::DataTypeTrait::DLPackTypeCode,...
在xshell里首先执行: export CUDA_VISIBLE_DEVICES=3 就可以在gpu的3卡上运行turbo_transformers
albert和Roberta有c++的推理示例吗
在加载bert模型npz文件时: https://github.com/Tencent/TurboTransformers/blob/master/turbo_transformers/loaders/npz_load.h 设置core::NewDLPackTensorT里面的device_id为3: core::Tensor LoadT(const std::string &name) { auto &array = view_[name]; std::vector shape; shape.resize(array.shape.size()); std::copy(array.shape.begin(), array.shape.end(), shape.begin()); core::Tensor tensor(core::NewDLPackTensorT(shape, device_)); core::Copy(array.data(), tensor.numel(), DLDeviceType::kDLCPU, tensor); return tensor; } 改为: core::Tensor...
> 精度可以到小数点后两位 我使用electra的bert模型进行推理,发现精度有点下降:  [-2.28732795e-01 6.75604939e-01 -4.36096016e-05 -1.55787677e-01 1.01697122e-04 2.64978588e-01 1.07041633e+00 -9.58646238e-02 2.08994150e-01 2.78842412e-02 -7.49029890e-02 1.40876785e-01 ...... 上面这个是在tensorflow下的结果。 下面是在TurboTransformers c++推理得到的结果: -0.218206 0.685999 -3.69157e-06 -0.155642 0.000119527 0.26852 1.07638 -0.102435 0.226186 0.0320726...
> > BTW,你比较一下tf和pytorch的精度有差异么? hi 我比较了pytorch的bert-base-uncased模型与TurboTransformers c++版本的bert-base-uncased推理,发现精度是类似的。 下面这个是pytorch版本的结果: [-3.1108e-02, 4.5749e-01, 3.5974e-02, 1.7493e-02, -1.7767e-01, 2.1110e-01, 1.3598e-01, -3.7370e-01, -7.2889e-01, -5.2631e-01, 3.6267e-01, 4.6182e-01, -2.8690e-01, 3.1322e-01, 2.0028e-01, 5.3880e-01, 2.4759e-01, -2.4060e-01, -7.5732e-02, -1.4053e-01,...... 下面这个是TurboTransformers的结果: -0.0248861 0.459299...