Skip to content

[FEA]: Experimental PTX wrappers to expose TMA #359

Closed

Description

@ahendriksen

Is this a duplicate?

Area

libcu++

Is your feature request related to a problem? Please describe.

I would like to use TMA features, even if in a somewhat rough fashion using functions with a C-like signature that simply wrap PTX instructions.

Describe the solution you'd like

Location

Provide the header <cuda/experimental/ctk_12_features> that exposes a number of new PTX instructions, especially around TMA.

PTX instructions

  • cp.async.bulk: both shared to global and global to shared

  • fence.proxy.async.shared.cta

  • cp.async.bulk.commit.group

  • cp.async.bulk.wait.group.read

    • For initial exposure .read should be fine.
    • It has a template int argument that indicates how many groups to wait on.
  • cp.async.bulk.tensor.2d: both global to shared and shared to global

Higher dimensions: not sure if we should expose 3d, 4d, and 5d. Open to
suggestions.

mbarrier.arrive.expect_tx: This one has so many integration issues with the barrier::arrival_token that I have opened a separate PR #354 to get it included.

Deprecation policy

We can support these wrappers during the CTK 12 life-cycle, mark them deprecated for CTK 13 cycle, and remove them in the CTK 14 cycle.

Describe alternatives you've considered

Many alternatives were considered. It may not make sense to list them in this GitHub issue.

Additional context

No response

Activity

  1. ahendriksen commented on Aug 18, 2023

    @ahendriksen
    ContributorAuthor

    @jrhemstad @griwes @gonzalobg, @vishalmehta1991 : I have created a minimal proposal to get preliminary support for some TMA instructions out there in libcu++.

    If you could provide feedback on the location of the header, the deprecation policy, and how to go about this in general, that would be great!

  2. miscco commented on Aug 18, 2023

    @miscco
    Contributor

    Personally I am against experimental headers. We just recently added an experimental feature by guarding it behind a feature flag (<cuda/memory_resource>).

    That way, when the experimental phase is over a user has nothing to do as the only code change is removal of the feature flag guard.

  3. miscco commented on Aug 18, 2023

    @miscco
    Contributor

    Moreover, I see no benefit in experimental features if it isn't clear that we can break them at any time. (Obviously with clear justification and a replacement)

  4. gonzalobg commented on Aug 18, 2023

    @gonzalobg
    Contributor

    I think it makes sense to move the header out of experimental, since the plan is to not evolve and therefore not break these APIs.

  5. jrhemstad commented on Aug 18, 2023

    @jrhemstad
    Collaborator

    @miscco this is a stop-gap implementation that we fully intend to remove in the future.

  6. ahendriksen commented on Aug 18, 2023

    @ahendriksen
    ContributorAuthor

    For each of the exposed instructions (perhaps except the 2D bulk one), there is a 1:1 correspondence to the planned exposure in #38. So these features should be deprecatable in a painless fashion.

  7. miscco commented on Aug 18, 2023

    @miscco
    Contributor

    I would rather not start adding experimental headers, but use a feature flag. That is much easier to remove

  8. gonzalobg commented on Aug 18, 2023

    @gonzalobg
    Contributor

    @miscco this is a stop-gap implementation that we fully intend to remove in the future.

    @jrhemstad the reason this stop-gap implementation is being added, is to teach users to use it in the programming guide. We can't never remove this; it would break users that read the docs and use these APIs.

  9. jrhemstad commented on Aug 18, 2023

    @jrhemstad
    Collaborator

    It's no different than any other API in that we are free to deprecate and remove it at a major version change, right?

  10. gonzalobg commented on Aug 18, 2023

    @gonzalobg
    Contributor

    You can try, but given the time frame between these wrappers and their replacement landing, and the extremely high demand that has been expressed for these wrappers, I'm skeptical we will ever be able to remove them.

  11. moved this from Todo to In Progress in CCCLon Aug 28, 2023
  12. moved this from In Progress to In Review in CCCLon Sep 1, 2023
  13. moved this from In Review to Done in CCCLon Sep 13, 2023
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

    • Status
      Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions