Open idreamerhx opened 1 year ago
I add this code to the generated cu file. It runs ok.
` int main() { int32_t Constant_97_0_host=(int32_t)new int32_t[14]; int32_t Constant_98_0_host=(int32_t)new int32_t[14]; int32_t Concat_193_0_host=(int32_t)new int32_t[2*4];
double ret=Concat_int32_t_int32_t_int32_t_cuda_Concat_193_host(Constant_97_0_host, Constant_98_0_host, Concat_193_0_host);
printf("%f", ret); }
`
nvcc /root/.nnfusion/tmp//XXXXXXXXXXP0UdrR.cu -o aa -gencode arch=compute_75,code=sm_75 /aa 0.020576r
seems like cuda-11.x (my env is 11.7) not work. I compile commit 0a40b5a07850645e33cd04e2ca3a759a4e4af805 (HEAD -> master, origin/master, origin/HEAD) Author: Wenxiang Hu Wenxiang.Hu@Microsoft.com Date: Fri Oct 30 13:51:46 2020 +0800
in nnfusion official docker works
in cuda_runtiome.cpp:518
p ke->entry_point &"p ke->entry_point\n" $2 = (double (*)(void , void )) 0x7ff592a0d7d0 <Concat_int32_t_int32_t_int32_t_cuda_Concat_193_entry(void, void)>
🐛 Bug
To Reproduce Steps to reproduce the behavior: Ubuntu 20.04.4 LTS
branch: main
Expected behavior
generate code
but:
` root@f045db07876c:/opt/nnfusion/output# /opt/nnfusion/build/src/tools/nnfusion/nnfusion /opt/nnfusion/frozenmodels/frozen_lstm_l8s8h256_bs1.pb --format tensorflow [WARNING] 2022-09-07T11:01:09z src/contrib/custom_op/custom_op.h 27 $NNFUSION_HOME was not set, use /root/.nnfusion. [WARNING] 2022-09-07T11:01:09z src/contrib/custom_op/custom_op.h 27 $NNFUSION_HOME was not set, use /root/.nnfusion.
============================================================================ ---- Processing '/opt/nnfusion/frozenmodels/frozen_lstm_l8s8h256_bs1.pb'
[INFO] 2022-09-07T11:01:09z src/nnfusion/frontend/tensorflow_import/tensorflow.cpp 18 Import Tensorflow Graph Size: [17000596] [INFO] 2022-09-07T11:01:09z src/nnfusion/frontend/tensorflow_import/util/graph_convert.cpp 3526 Converting Tensorflow Graph [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. [WARNING] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 211 Datatypes byte size are not same. 1, 1, 1 1, 1, 1 [INFO] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 61 [0:0] Working for node: BasicLSTMCellZeroState/concat_0 [INFO] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 61 [1:0] Working for node: BasicLSTMCellZeroState/Const [INFO] 2022-09-07T11:01:09z src/nnfusion/frontend/util/evaluator.hpp 61 [1:1] Working for node: BasicLSTMCellZeroState/Const_1 [WARNING] 2022-09-07T11:01:09z src/nnfusion/common/util.cpp 47 $NNFUSION_HOME was not set, use /root/.nnfusion. terminate called after throwing an instance of 'std::runtime_error' what(): error: cudaMemcpy(Constant_97_0, Constant_97_0_host, 1 * 4, cudaMemcpyHostToDevice) failed with error file: /root/.nnfusion/tmp//XXXXXXXXXXP0UdrR.cu line: 75 msg: invalid argument Aborted (core dumped) `
Additional context
` extern "C" double Concat_int32_t_int32_t_int32_t_cuda_Concat_193_host(int32_t Constant_97_0_host, int32_t Constant_98_0_host, int32_t Concat_193_0_host) { int32_t Constant_97_0; cudaMalloc((void)&Constant_97_0,1 4); CUDA_SAFE_CALL(cudaMemcpy(Constant_97_0, Constant_97_0_host, 1 4, cudaMemcpyHostToDevice)); int32_t* Constant_98_0; cudaMalloc((void*)&Constant_98_0,1 4); CUDA_SAFE_CALL(cudaMemcpy(Constant_98_0, Constant_98_0_host, 1 4, cudaMemcpyHostToDevice)); int32_t Concat_193_0; cudaMalloc((void)&Concat_193_0,2 * 4);
`