Code Monkey home page Code Monkey logo

Comments (6)

alyashev avatar alyashev commented on July 26, 2024

Hi,
Could you be more specific, please?
What configuration is causing the problem?
Or have you found an obvious bug in the source code?
Thank you a lot, we enormously appreciate your feedback.
Best regards,
MIOpen team.

from miopen.

ashmanov avatar ashmanov commented on July 26, 2024

Hi!
I meant that in cuDNN LRN is calculated like:

y_ij = |x_ij| / (K + alpha * (sum_kl x_kl^2) / N^2)^beta

and in MIOpen:

y_ij = x_ij / (K + alpha * (sum_kl x_kl^2) / N^2)^beta

(without abs value of x_ij)

So, may be it should be changed, so in deep learning frameworks LRN layers for NVIDIA and AMD would be similar?

from miopen.

alyashev avatar alyashev commented on July 26, 2024

Here is, roughly, the cuda code:
template
global void LRNComputeOutput(const int nthreads, const Dtype* const in,
const Dtype* const scale, const Dtype negative_beta, Dtype* const out) {
CUDA_KERNEL_LOOP(index, nthreads) {
out[index] = in[index] * pow(scale[index], negative_beta);
}
}

X is in[index]
Y is out[index]

Iā€™m not sure where is the difference?

I do not see any abs function here.
Abs will indeed cause the sign loss but LRN is a scaling operation it should keep sign unchanged.

Best regards,
MIOpen team.

from miopen.

ashmanov avatar ashmanov commented on July 26, 2024

Sorry, I meant that in cuDNN it is without abs.
If you look at MIOpen LRN line 385, there is bot_val * s. And bot_val (line 381) is sqrt of something. Therefore, it is always >= 0, we lost a sign.

from miopen.

alyashev avatar alyashev commented on July 26, 2024

you're right. some minor optimization can cause a lot of havoc :)
thank you, great catch. we've fixed it already and put it into the next release.
Best regards,
MIOpen team.

from miopen.

dagamayank avatar dagamayank commented on July 26, 2024

@ashmanov this issue has been fixed in the latest release.

from miopen.

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.