Giter Site home page Giter Site logo

[CUDA ERROR] at file \llm.c\train_gpt2.cu:405: too many resources requested for launch (old version does not have this issue - fyi) about llm.c HOT 6 OPEN

karpathy avatar karpathy commented on June 12, 2024
[CUDA ERROR] at file \llm.c\train_gpt2.cu:405: too many resources requested for launch (old version does not have this issue - fyi)

from llm.c.

Comments (6)

msharmavikram avatar msharmavikram commented on June 12, 2024

Change the following lines

__global__  void layernorm_forward_kernel3(float* __restrict__ out, float* __restrict__ mean, float* __restrict__ rstd,
                                    const float*  __restrict__ inp, const float*  __restrict__ weight,
                                    const float* __restrict__ bias, int N, int C) {

to below

__global__ __launch_bounds__(1024,2) 
void layernorm_forward_kernel3(float* __restrict__ out, float* __restrict__ mean, float* __restrict__ rstd,
                                    const float*  __restrict__ inp, const float*  __restrict__ weight,
                                    const float* __restrict__ bias, int N, int C) {

I believe it is running out of registers. So need to forcefully do register spills. This solved the error for me.

from llm.c.

ross-wheeler avatar ross-wheeler commented on June 12, 2024

Thank you, Vikram @msharmavikram ! That fixed it! Should this be a generic fix or is it card/gpu specific?

from llm.c.

msharmavikram avatar msharmavikram commented on June 12, 2024

This may not work on all cards. I need to determine the correctness of this fix for different thread block size before submitting a PR. I didn't a chance to work on that yet.

from llm.c.

msharmavikram avatar msharmavikram commented on June 12, 2024

Submitted a PR #126

from llm.c.

msharmavikram avatar msharmavikram commented on June 12, 2024

@ross-wheeler I do not see this issue anymore on the top of the tree. Let me know if you still see the error without the proposed fix.

from llm.c.

rosslwheeler avatar rosslwheeler commented on June 12, 2024

@msharmavikram - I still need your above fix. The top of tree did not fix my issue.

from llm.c.

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.