Skip to content

Conversation

benhg
Copy link
Contributor

@benhg benhg commented Sep 12, 2025

Description

This is an implementation for #967.

Summary:

  • Implement VMM grow-in-place via:
    • Fast path: contiguous VA extension with fixedAddr + cuMemMap
    • Slow path: remap to new VA, preserve data without memcpy
  • Use aligned sizes everywhere and cast pointers for arithmetic
  • Return proper enums for CUmemAccessDesc.flags
  • Default all VMMConfig fields to common values

References:

NVIDIA VMM blog
CUDA Driver VMM docs

Checklist

  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

Copy link
Contributor

copy-pr-bot bot commented Sep 12, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@leofang leofang self-requested a review September 15, 2025 14:35
@leofang leofang added P1 Medium priority - Should do feature New feature or request cuda.core Everything related to the cuda.core module labels Sep 15, 2025
@leofang leofang added this to the cuda.core beta 7 milestone Sep 15, 2025
@leofang
Copy link
Member

leofang commented Sep 17, 2025

@benhg the IPC PR was merged, could you resolve conflicts plz? 🙂

@leofang leofang requested a review from Andy-Jost September 17, 2025 23:20
@benhg
Copy link
Contributor Author

benhg commented Sep 18, 2025

@benhg the IPC PR was merged, could you resolve conflicts plz? 🙂

Done, thanks for the reminder.

@leofang
Copy link
Member

leofang commented Sep 18, 2025

pre-commit.ci autofix

Copy link
Contributor

copy-pr-bot bot commented Sep 18, 2025

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

kkraus14
kkraus14 previously approved these changes Oct 2, 2025
Copy link
Collaborator

@kkraus14 kkraus14 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @Andy-Jost's comment that it would be nice to parametrize some existing tests with using the VirtualMemoryResource, but I'm okay doing that in a follow up

Copy link
Member

@leofang leofang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, Ben! Sorry I was not as responsive as I'd like for reviews. Keith told me this is ready to go. We have a number of PRs that have conflicts with each other, so what I'd do is to merge all P0 tasks for the release, and then merge this the last, to minimize conflicts. By the time we get to merge this PR, I will resolve all conflicts and rerun tests. No action is needed.

Marking this PR red only to avoid unplanned merge, again no action is needed. Much appreciated, Ben!

@leofang
Copy link
Member

leofang commented Oct 7, 2025

I am working on resolving the merge conflicts logically.

leofang
leofang previously approved these changes Oct 7, 2025
@leofang
Copy link
Member

leofang commented Oct 7, 2025

/ok to test 6450712

Copy link

github-actions bot commented Oct 7, 2025

@benhg
Copy link
Contributor Author

benhg commented Oct 8, 2025

/ok to test 4af54ac

@leofang
Copy link
Member

leofang commented Oct 8, 2025

Vetter: a user that has permissions to leave an /ok to test comment on a pull request. This is a user with write access (or greater) for a particular repository or a member that is listed in the additional_vetters configuration list (see note below)

I always forget that not all NV employees can launch the CI... 😞

@leofang
Copy link
Member

leofang commented Oct 8, 2025

/ok to test 4af54ac

kkraus14
kkraus14 previously approved these changes Oct 8, 2025
@leofang
Copy link
Member

leofang commented Oct 8, 2025

Ben, Piotr and I discussed with Vishnu from the memory team, and confirmed that VMM is not supported by the TCC mode. I suggested Ben to skip the tests on Windows for now.. perhaps also raise a warning (or exception?) on VirtualMemoryResource constructor. We can revisit this once we turn on WDDM (#462) and MCDM CI (#984).

@leofang
Copy link
Member

leofang commented Oct 8, 2025

/ok to test 9db04b1

@leofang leofang enabled auto-merge (squash) October 8, 2025 01:45
@leofang leofang merged commit 6efc348 into NVIDIA:main Oct 8, 2025
71 checks passed
@leofang
Copy link
Member

leofang commented Oct 8, 2025

Thanks Ben for your first contribution to cuda.core and Keith/Andy for review 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cuda.core Everything related to the cuda.core module feature New feature or request P1 Medium priority - Should do

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEA]: Add a MemoryResource which uses CUDA VMM APIs to allocate memory

4 participants