Skip to content
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

Tips on installing for pytorch>1.11, to avoid <THC/THC.h> bugs #19

Open
sijieaaa opened this issue Sep 4, 2023 · 0 comments
Open

Tips on installing for pytorch>1.11, to avoid <THC/THC.h> bugs #19

sijieaaa opened this issue Sep 4, 2023 · 0 comments

Comments

@sijieaaa
Copy link

sijieaaa commented Sep 4, 2023

If you find bugs about <THC/THC.h>, you can do the following modifications:

  1. uncomment this line:

  2. define a new ceil_div function:

int  ceil_div(int a, int b){ 
    return  (a + b - 1) / b; 
}
  1. replace this line:

    dim3 grid(std::min(THCCeilDiv((long)(output_size / 2), 512L), 4096L));

    with
    dim3 grid(std::min(ceil_div((long)(output_size / 2), 512), 4096));

  2. replace this line:

    dim3 grid(std::min(THCCeilDiv((long)grad.numel(), 512L), 4096L));

    with
    dim3 grid(std::min(ceil_div((long)(grad.numel()), 512) , 4096));

  3. replace THCudaCheck(cudaGetLastError()); with AT_CUDA_CHECK(cudaGetLastError());

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

No branches or pull requests

1 participant