JuliaGPU/CUDA.jl

CuDNN: Support for asymmetric padding?

Open

#128 建立於 2019年6月11日

在 GitHub 查看
 (9 留言) (0 反應) (0 負責人)Julia (274 fork)batch import
cuda librariesenhancementhelp wanted

倉庫指標

Star
 (1,408 star)
PR 合併指標
 (平均合併 5天 5小時) (30 天內合併 16 個 PR)

描述

Problem Currently, asymmetric padding doesn't work in Flux when using CuArrays:

using Flux, CuArrays
m = Conv((3,3), 1=>1, pad=(0,1,0,0)) |> gpu
x = rand(100,100,1,1) |> gpu
m(x)

throws an error (when run on a gpu): CUDNNError(code 3, CUDNN_STATUS_BAD_PARAM) and gives the warning Warning: CuDNN does not support asymmetric padding; defaulting to symmetric choice. This means that

  1. my current model (which runs on the CPU) cannot be trained using a GPU (without modifying the code)
  2. there is no longer a one-to-one correspondence between CPU valid code and GPU valid code. (I.e., the above code will run just fine on the CPU if there is no GPU available.)

Desired solution Well, CuDNN support for asymmetric padding would be great. Then I wouldn't have to worry (as much) about whether code developed on a CPU will work on a GPU.

Alternative solution I've considered One can obviously use symmetric padding and then crop the output to get the desired result. This is however not very elegant, nor as efficient (?).

貢獻者指南