crfasrnn_keras icon indicating copy to clipboard operation
crfasrnn_keras copied to clipboard

Filtering can now be performed on the GPU

Open thwjoy opened this issue 7 years ago • 2 comments

Filtering is now done on either the CPU or GPU depending on which template argument uses in the crfasrnn op. We have two partially specialized functors (one for GPU and one for CPU), which call their respective implementations. There seems to be some issue with using CUDA through tensorflow (https://github.com/tensorflow/tensorflow/issues/18441) so we now directly link against cuda for the g++ stage and use some cuda macors to check results.

I have only tested that the output is the same as when run on CPU, and I only checked it with CUDA 9 and Tensorflow 1.7.

thwjoy avatar May 10 '18 14:05 thwjoy

@thwjoy Many thanks for submitting the pull request. Sorry I took so long to test it.

After making some changes to the Makefile I was able to compile & link successfully on Tensorflow 1.4 and CUDA 8.0. However, when I ran the demo code, got the following error:

2018-05-26 18:27:56.442704: E tensorflow/stream_executor/cuda/cuda_dnn.cc:385] could not create cudnn handle: CUDNN_STATUS_INTERNAL_ERROR 2018-05-26 18:27:56.442732: E tensorflow/stream_executor/cuda/cuda_dnn.cc:352] could not destroy cudnn handle: CUDNN_STATUS_BAD_PARAM 2018-05-26 18:27:56.442752: F tensorflow/core/kernels/conv_ops.cc:667] Check failed: stream->parent()->GetConvolveAlgorithms( conv_parameters.ShouldIncludeWinogradNonfusedAlgo<T>(), &algorithms) out of memoryout of memoryinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentan illegal memory access was encounteredan illegal memory access was encounteredan illegal memory access was encounteredan illegal memory access was encounteredan illegal memory access was encounteredan illegal memory access was encounteredan illegal memory access was encounteredAborted (core dumped)

Do you happen to know what could have gone wrong?

In any case, for now, I have merged your pull request into a new branch of the main repo and documented the details in the main README file. Once I manage to fully test your implementation, I'll merge it with the master branch.

sadeepj avatar May 26 '18 18:05 sadeepj

@thwjoy Any updates on this, please? I got the same errors as @sadeepj :(

out of memoryCuda kernel failed. Error: out of memoryinvalid argumentinvalid argumentCuda kernel failed. Error: invalid argumentinvalid argumentinvalid argumentCuda kernel failed.

netw0rkf10w avatar Nov 12 '18 23:11 netw0rkf10w