Skip to content

GpuKernel_sched will return LS/GS values that do not satisfy LS*GS => N #438

Open

Description

@HapeMask

The documentation for GpuKernel_sched states that it may return LS*GS > N and your code should be able to handle that (which is fine), but I found that it's actually returning values where LS*GS < N.

Is this intended? For a specific example, calling GpuKernel_sched() w/N=273280 on a Titan X (target_g=768, target_l=512) returns LS=352 GS=768, LS*GS = 270336.

It looks like the function tries to make sure LS*GS >= N here:

*ls = ((n / min_l) / *gs) * min_l;

but the code doesn't do that in this case.

Activity

  1. nouiz commented on May 18, 2017

    @nouiz
    Member

    First, it is impossible that in all cases LS*GS will always be greater then N for big N, due to hardware/cuda limitation. So in some cases, it won't be higher or equal to N. So your code should be able to handle that too (or detect it and raise an error).

    Maybe we can modify that function to be better and do it in more cases. I let @abergeron check that in more detail. But it will probably wait to next week, as he should be back today and there is a bunch of stuff that accumulated.

  2. abergeron commented on May 18, 2017

    @abergeron
    Member

    Yes, that isn't explicitly mentioned and the documentation could be improved on that, but your code should handle cases where LS*GS doesn't cover the whole N by looping.

    I'm leaving this open to remind me to update the doc.

  3. HapeMask commented on May 18, 2017

    @HapeMask
    Author

    Ah I see, that makes sense. Thanks for clearing things up.

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