Skip to content

Commit

Permalink
Fixed cuDNN 8.x usage
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexeyAB committed Sep 6, 2020
1 parent ecad770 commit eb0272f
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
25 changes: 25 additions & 0 deletions scripts/get_coco2017.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# Zip coco folder
# zip -r coco.zip coco
# tar -czvf coco.tar.gz coco

# Download labels from Google Drive, accepting presented query
filename="coco2017labels.zip"
fileid="1cXZR_ckHki6nddOmcysCuuJFM--T-Q6L"
curl -c ./cookie -s -L "https://drive.google.com/uc?export=download&id=${fileid}" > /dev/null
curl -Lb ./cookie "https://drive.google.com/uc?export=download&confirm=`awk '/download/ {print $NF}' ./cookie`&id=${fileid}" -o ${filename}
rm ./cookie

# Unzip labels
unzip -q ${filename} # for coco.zip
# tar -xzf ${filename} # for coco.tar.gz
rm ${filename}

# Download and unzip images
cd coco/images
f="train2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $f # 19G, 118k images
f="val2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $f # 1G, 5k images
# f="test2017.zip" && curl http://images.cocodataset.org/zips/$f -o $f && unzip -q $f && rm $f # 7G, 41k images

# cd out
cd ../..
6 changes: 3 additions & 3 deletions src/convolutional_layer.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ void cudnn_convolutional_setup(layer *l, int cudnn_preference, size_t workspace_
if (conv_fwd_results[i].status == CUDNN_STATUS_SUCCESS &&
conv_fwd_results[i].algo != CUDNN_CONVOLUTION_FWD_ALGO_WINOGRAD_NONFUSED &&
conv_fwd_results[i].memory < free_memory &&
conv_fwd_results[i].memory <= workspace_size_specify &&
(conv_fwd_results[i].memory <= workspace_size_specify || cudnn_preference == cudnn_fastest) &&
conv_fwd_results[i].time < min_time)
{
found_conv_algorithm = 1;
Expand Down Expand Up @@ -357,7 +357,7 @@ void cudnn_convolutional_setup(layer *l, int cudnn_preference, size_t workspace_
{
if (conv_bwd_data_results[i].status == CUDNN_STATUS_SUCCESS &&
conv_bwd_data_results[i].memory < free_memory &&
conv_bwd_data_results[i].memory <= workspace_size_specify &&
(conv_bwd_data_results[i].memory <= workspace_size_specify || cudnn_preference == cudnn_fastest) &&
conv_bwd_data_results[i].time < min_time)
{
found_conv_algorithm = 1;
Expand Down Expand Up @@ -394,7 +394,7 @@ void cudnn_convolutional_setup(layer *l, int cudnn_preference, size_t workspace_
{
if (conv_bwd_filter_results[i].status == CUDNN_STATUS_SUCCESS &&
conv_bwd_filter_results[i].memory < free_memory &&
conv_bwd_filter_results[i].memory <= workspace_size_specify &&
(conv_bwd_filter_results[i].memory <= workspace_size_specify || cudnn_preference == cudnn_fastest) &&
conv_bwd_filter_results[i].time < min_time)
{
found_conv_algorithm = 1;
Expand Down

0 comments on commit eb0272f

Please sign in to comment.