Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Ability to pass groupcount parameter for depthwise and groupwise convolutions #523

Closed
wants to merge 2 commits into from

Conversation

arhik
Copy link

@arhik arhik commented Nov 30, 2019

With the change in #521, We need an api to set groupcount. I am proposing this as a draft and I am planning to make corresponding changes in NNlib. This will break existing NNlib interface since groupcount is an extra argument to ConvDesc.

Please feel free to comment on this once I have one of these check boxes complete.

  • Add groupcount to NNlib ConvDims as a common Descriptor and have seperate constructs in Fluxml.

@arhik arhik marked this pull request as ready for review December 8, 2019 07:29
@@ -1,11 +1,11 @@
# Compatibility shims until users upgrade to new NNlib format
function conv!(y::CuArray{T}, x::CuArray{T}, w::CuArray{T}; pad=0, stride=1, flipkernel=0, dilation=1, kwargs...) where {T<:CUDNNFloat}
cdims = DenseConvDims(x, w; padding=pad, stride=stride, flipkernel=flipkernel, dilation=dilation)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I need help with these shims.

@MikeInnes
Copy link
Collaborator

Would be great to have a look from @staticfloat for NNlib compatibility.

@arhik
Copy link
Author

arhik commented Dec 10, 2019

Would be great to have a look from @staticfloat for NNlib compatibility.

@staticfloat NNlib related changes are in FluxML/NNlib.jl#146 (comment)

These are complete set of changes to test:
Pkg.add(PackageSpec(url="https://github.com/arhik/Zygote.jl.git#groupwise"))
Pkg.add(PackageSpec(url="https://github.com/arhik/CuArrays.jl.git#groupcount"))
Pkg.add(PackageSpec(url="https://github.com/arhik/NNlib.jl.git#common_convdims"))
Pkg.add(PackageSpec(url="https://github.com/arhik/Flux.jl.git#groupwiseconv"))

I have few test cases ready. I will push them whenever I can.

Please observe the branche names after hashes.

@denizyuret
Copy link

@maleadt any progress on this?

@maleadt
Copy link
Member

maleadt commented Aug 6, 2020

No, I'm not working on any of this.

@denizyuret
Copy link

@DhairyaLGandhi, is this ball in your court? We need group convolutions.

@k8lion
Copy link

k8lion commented Feb 6, 2021

Any progress? As others have said on the related issue thread on Flux.jl, my research also relies on depthwise convolutions on GPU.

@denizyuret
Copy link

denizyuret commented Feb 7, 2021 via email

@k8lion
Copy link

k8lion commented Feb 7, 2021

Great, so now looks NNlib needs to be modified in order for Flux.DepthwiseConv to be correctly evaluated on GPU?

@denizyuret
Copy link

denizyuret commented Feb 8, 2021 via email

@DhairyaLGandhi
Copy link
Member

Now that's on cuda master, we should push the same change on NNlib as well.

@maleadt maleadt closed this Feb 8, 2021
@arhik
Copy link
Author

arhik commented Feb 9, 2021

Sorry I didnt have GPU hardware to work and test any of this after pull request. You can follow the changes I made in NNlib, Zygote and Flux if you agree with FluxML/NNlib.jl#146 (comment) . I am not upto date with Zygote, NNlib and Flux development to judge how easy to translate my changes ...

Edit:
Just checked the diffs. They are easy to translate. Also just to want you : I remember I didn't focus on CPU API. I was only focussed on GPU.

Any one interested in this issue can also leverage my mobilenet implementation here. https://github.com/arhik/Flux_mobilenet.git

Cool that this is in limelight. Cant wait to see groupwise convolutions in Flux.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants