Skip to content

Add CPU support for cumem_utils to remove GPU dep on MTIA (#5315)#5320

Closed
spcyppt wants to merge 1 commit into
pytorch:mainfrom
spcyppt:export-D90833398
Closed

Add CPU support for cumem_utils to remove GPU dep on MTIA (#5315)#5320
spcyppt wants to merge 1 commit into
pytorch:mainfrom
spcyppt:export-D90833398

Conversation

@spcyppt

@spcyppt spcyppt commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

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_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.

Differential Revision: D90833398

@meta-cla meta-cla Bot added the cla signed label Jan 16, 2026
@meta-codesync

meta-codesync Bot commented Jan 16, 2026

Copy link
Copy Markdown
Contributor

@spcyppt has exported this pull request. If you are a Meta employee, you can view the originating Diff in D90833398.

…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
@meta-codesync

meta-codesync Bot commented Jan 19, 2026

Copy link
Copy Markdown
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants