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

Fix search path for torch allocator in editable installs and ensure CUDA support is available #1498

Merged

Conversation

vyasr
Copy link
Contributor

@vyasr vyasr commented Mar 5, 2024

Description

The current logic for finding the allocator .so file presumes that torch.py is in the same directory tree as the compiled allocator. While this is true when the package is installed, it is not true for editable installs of the package where py files are left in the source tree while compiled modules are placed into a build tree (both are found by indirection).

The current allocator logic also assumes that if pytorch is available it is a version compiled with CUDA support. This PR also adds a check to verify that we don't try to set the allocator on a CPU-only build of torch.

Checklist

  • I am familiar with the Contributing Guidelines.
  • New or existing tests cover these changes.
  • The documentation is up to date with these changes.

@vyasr vyasr added bug Something isn't working non-breaking Non-breaking change labels Mar 5, 2024
@vyasr vyasr self-assigned this Mar 5, 2024
@vyasr vyasr requested a review from a team as a code owner March 5, 2024 22:22
@github-actions github-actions bot added the Python Related to RMM Python API label Mar 5, 2024
Copy link
Contributor

@wence- wence- left a comment

Choose a reason for hiding this comment

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

Makes sense

@vyasr vyasr changed the title Fix search path for torch allocator in editable installs Fix search path for torch allocator in editable installs and ensure CUDA support is available Mar 5, 2024
Copy link
Member

@harrism harrism left a comment

Choose a reason for hiding this comment

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

One small doc suggestion. Thanks!

python/rmm/allocators/torch.py Outdated Show resolved Hide resolved
@vyasr
Copy link
Contributor Author

vyasr commented Mar 8, 2024

/merge

@rapids-bot rapids-bot bot merged commit c299fc1 into rapidsai:branch-24.04 Mar 8, 2024
53 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working non-breaking Non-breaking change Python Related to RMM Python API
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

None yet

4 participants