Code Monkey home page Code Monkey logo

Comments (7)

5had3z avatar 5had3z commented on June 16, 2024

If I change the max_displacement to 1 or 2 and C=H=W=64, it works fine.
But if I have C=H=W=128 it doesn't work (with max_displacement 1 or 2)

from arflow.

lliuz avatar lliuz commented on June 16, 2024

This is an issue about correlation_cuda package. I am not very familiar with cuda programming, so I may not be able to help you to solve this problem.

If you have trouble with this package during training, you can alternatively use my PyTorch implementation (It is correct although kind of slower.)

Since the correlation_cuda package is widely used in other projects, such as ClementPinard/Pytorch-Correlation-extension, NVIDIA/flownet2-pytorch, you can refer to these repos for help.

from arflow.

5had3z avatar 5had3z commented on June 16, 2024

From some testing that I did, there are access requests for index -1 during some operations.
correlaiton forward kernel during the element wise product sum: prod_sum += rInput1*rInput2
And in correlation_backward_input1 when reading from rInput2

In my own code I skip these operations during a boundary check and consequently don't have this issue anymore.

from arflow.

lliuz avatar lliuz commented on June 16, 2024

Thanks for sharing and I'm glad you could find a workaround in the end!

from arflow.

sun0215 avatar sun0215 commented on June 16, 2024

Hi, I have met the same issue as you. May I ask how do you use boundary check to skip these operations you mentioned above? @5had3z

from arflow.

5had3z avatar 5had3z commented on June 16, 2024

@sun0215 I've got the checks in my re-implementation but they're commented out as it turns out it this issue is due to insufficient padding (the pad_size variable). You won't access out of bounds if this is large enough, just search for the smallest number that works for you.

Bound checks are commented out as cuda cores are dumb afaik, there's no branch predicting, so you're paying the full cost of these checks, hence why I've commented out, but still there for future reference.

from arflow.

sun0215 avatar sun0215 commented on June 16, 2024

from arflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.