Skip to content

Improve im2col for certain cases #715

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

Closed
wants to merge 1 commit into from

Conversation

dskhudia
Copy link
Contributor

Summary:
Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

Copy across pixels of input width if we can. We can only do this
if the following conditions are met.

  1. If the number of groups is 1. For number of groups > 1, im2col
    doesn't copy data across groups.
  2. If dilation is 1. For dilation > 1, copying from input
    across channels is not sequential.
  3. For copy from the last channel (end of filter or
    end of image width) for the current filter,
    only copy if we have enough in the current channel.

Differential Revision: D31227743

@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

dskhudia added a commit to dskhudia/FBGEMM that referenced this pull request Sep 29, 2021
Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Differential Revision: D31227743

fbshipit-source-id: eadc62308f221f8731f566cd35eaeccd40781e6a
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

dskhudia added a commit to dskhudia/FBGEMM that referenced this pull request Sep 30, 2021
Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Differential Revision: D31227743

fbshipit-source-id: 1e126e5488ca8f88dd33faa94abf61ae691c4e57
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

dskhudia added a commit to dskhudia/FBGEMM that referenced this pull request Oct 1, 2021
Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Differential Revision: D31227743

fbshipit-source-id: 5ea8545c62e39474cad5d4615161b16ec5216603
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

dskhudia added a commit to dskhudia/FBGEMM that referenced this pull request Oct 6, 2021
Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Reviewed By: jspark1105

Differential Revision: D31227743

fbshipit-source-id: 6ce1155839f8fde17031213243ade31cb002b943
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

dskhudia added a commit to dskhudia/FBGEMM that referenced this pull request Oct 6, 2021
Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Reviewed By: jspark1105

Differential Revision: D31227743

fbshipit-source-id: 4df1064bdd99e35635c98bd37d143382fbf3d470
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

dskhudia added a commit to dskhudia/FBGEMM that referenced this pull request Oct 11, 2021
Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Reviewed By: jspark1105

Differential Revision: D31227743

fbshipit-source-id: 7db9f66b20aad64d3afcca2a47ae60d74b6979f1
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

Summary:
Pull Request resolved: pytorch#715

Copy across pixels along width dim for im2col. This should help convolution with small number of input channels.

 Copy across pixels of input width if we can. We can only do this
 if the following conditions are met.
  1) If the number of groups is 1. For number of groups > 1, im2col
     doesn't copy data across groups.
  2) If dilation is 1. For dilation > 1, copying from input
     across channels is not sequential.
  3) For copy from the last channel (end of filter or
     end of image width) for the current filter,
     only copy if we have enough in the current channel.

Reviewed By: jspark1105

Differential Revision: D31227743

fbshipit-source-id: bbe14412c5e402714ed3ba7906d609d9e3c6a2f5
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D31227743

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 0375f13.

cgufb added a commit to cgufb/FBGEMM that referenced this pull request Jan 30, 2025
q10 pushed a commit to q10/FBGEMM that referenced this pull request Apr 10, 2025
…ytorch#715)

Summary:
X-link: pytorch#3640

Pull Request resolved: facebookresearch/FBGEMM#715

Reviewed By: q10, jianyuh

Differential Revision: D68817290

fbshipit-source-id: b57b475aa9ee746d8726945b28b71fafd93cfbbe
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants