Skip to content

RuntimeError: Cannot launch Triton kernel since n = 46336 exceeds the maximum CUDA blocksize = 65535. #7

Closed

Description

@danielhanchen
RuntimeError: Cannot launch Triton kernel since n = 46336 exceeds the maximum CUDA blocksize = 65535.
ile /usr/local/lib/python3.10/dist-packages/unsloth/kernels/utils.py:23, in calculate_settings(n)
     21 # CUDA only supports 65535 - 2^16-1 threads per block
     22 if BLOCK_SIZE > MAX_FUSED_SIZE:
---> 23     raise RuntimeError(f"Cannot launch Triton kernel since n = {n} exceeds "\
     24                        f"the maximum CUDA blocksize = {MAX_FUSED_SIZE}.")
     25 num_warps = 4
     26 if   BLOCK_SIZE >= 32768: num_warps = 32
H100 80GB

Activity

  1. epicfilemcnulty commented on Dec 4, 2023

    @epicfilemcnulty

    Getting the same on my RTX 4090:

     File "/storage/venvs/unsloth/lib/python3.11/site-packages/unsloth/kernels/utils.py", line 23, in calculate_settings
        raise RuntimeError(f"Cannot launch Triton kernel since n = {n} exceeds "\
    RuntimeError: Cannot launch Triton kernel since n = 64000 exceeds the maximum CUDA blocksize = 65535.
    
  2. danielhanchen commented on Dec 5, 2023

    @danielhanchen
    MemberAuthor

    @epicfilemcnulty Possibly fixed with a pre-release - hopefully you can try it to check it out! :) Thanks!

  3. epicfilemcnulty commented on Dec 5, 2023

    @epicfilemcnulty

    @danielhanchen yep, it's fixed! Thank you for awesome work!

  4. added a commit that references this issue on Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions