Add CPU support for cumem_utils to remove GPU dep on MTIA (#5315)#5320
Closed
spcyppt wants to merge 1 commit into
Closed
Add CPU support for cumem_utils to remove GPU dep on MTIA (#5315)#5320spcyppt wants to merge 1 commit into
spcyppt wants to merge 1 commit into
Conversation
Contributor
…ytorch#5320) Summary: X-link: facebookresearch/FBGEMM#2313 X-link: facebookresearch/FBGEMM#2307 CPU support for cumem_utils to remove GPU dep on MTIA ==================================================================== The change adds CPU support to the `cumem_utils` library, which was previously dependent on the GPU. This change removes the GPU dependency. The changes include: * Move ops registration to `memory_utils.cpp` so that the ops are available on CPU binary. * Adding CPU implementations for the `is_uvm_tensor`, `uvm_to_cpu_clone`, `uvm_to_cpu`, and `new_uvm_tensor` functions in the `memory_utils.cpp` file. * Updating the `BUCK` file to include the new CPU-specific library and exclude the GPU-specific library. * Removing the `memory_utils_fallback.cpp` file, which is no longer needed. * Add lightweight wrappers to ensure compatibility for existing direct C++ call of the function. The wrappers then appropriately dispatch through PyTorch Dispatcher based on the input tensor device. Reviewed By: Myrthan, q10 Differential Revision: D90833398
75aa419 to
1315c0b
Compare
Contributor
|
This pull request has been merged in c6ddfe0. |
spcyppt
added a commit
to spcyppt/FBGEMM
that referenced
this pull request
Feb 26, 2026
…ytorch#5320) Summary: X-link: facebookresearch/FBGEMM#2313 X-link: facebookresearch/FBGEMM#2307 CPU support for cumem_utils to remove GPU dep on MTIA ==================================================================== The change adds CPU support to the `cumem_utils` library, which was previously dependent on the GPU. This change removes the GPU dependency. The changes include: * Move ops registration to `memory_utils.cpp` so that the ops are available on CPU binary. * Adding CPU implementations for the `is_uvm_tensor`, `uvm_to_cpu_clone`, `uvm_to_cpu`, and `new_uvm_tensor` functions in the `memory_utils.cpp` file. * Updating the `BUCK` file to include the new CPU-specific library and exclude the GPU-specific library. * Removing the `memory_utils_fallback.cpp` file, which is no longer needed. * Add lightweight wrappers to ensure compatibility for existing direct C++ call of the function. The wrappers then appropriately dispatch through PyTorch Dispatcher based on the input tensor device. Reviewed By: Myrthan, q10 Differential Revision: D90833398
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary:
X-link: https://github.com/facebookresearch/FBGEMM/pull/2313
X-link: https://github.com/facebookresearch/FBGEMM/pull/2307
CPU support for cumem_utils to remove GPU dep on MTIA
The change adds CPU support to the
cumem_utilslibrary, which was previously dependent on the GPU. This change removes the GPU dependency.The changes include:
memory_utils.cppso that the ops are available on CPU binary.is_uvm_tensor,uvm_to_cpu_clone,uvm_to_cpu, andnew_uvm_tensorfunctions in thememory_utils.cppfile.BUCKfile to include the new CPU-specific library and exclude the GPU-specific library.memory_utils_fallback.cppfile, which is no longer needed.Differential Revision: D90833398