Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] #457

Open
idreamerhx opened this issue Sep 7, 2022 · 3 comments
Open

[BUG] #457

idreamerhx opened this issue Sep 7, 2022 · 3 comments
Labels
bug Something isn't working

Comments

@idreamerhx
Copy link

idreamerhx commented Sep 7, 2022

🐛 Bug

To Reproduce
Steps to reproduce the behavior:
Ubuntu 20.04.4 LTS
branch: main

  1. ./maint/script/install_dependency.sh
  2. mkdir buid; cd build; cmake ..; make
  3. /opt/nnfusion/build/src/tools/nnfusion/nnfusion /opt/nnfusion/frozenmodels/frozen_lstm_l8s8h256_bs1.pb --format tensorflow -fdefault_device CUDA

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);

`

@idreamerhx idreamerhx added the bug Something isn't working label Sep 7, 2022
@idreamerhx
Copy link
Author

idreamerhx commented Sep 7, 2022

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

@idreamerhx
Copy link
Author

seems like cuda-11.x (my env is 11.7) not work.
I compile
commit 0a40b5a (HEAD -> master, origin/master, origin/HEAD)
Author: Wenxiang Hu [email protected]
Date: Fri Oct 30 13:51:46 2020 +0800

in nnfusion official docker works

@idreamerhx
Copy link
Author

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)>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant