Skip to content

Update multi-gpu notebook to set cupy device#675

Merged
marcromeyn merged 3 commits intoNVIDIA-Merlin:mainfrom
edknv:multi_gpu_cupy_device
Apr 18, 2023
Merged

Update multi-gpu notebook to set cupy device#675
marcromeyn merged 3 commits intoNVIDIA-Merlin:mainfrom
edknv:multi_gpu_cupy_device

Conversation

@edknv
Copy link
Copy Markdown
Collaborator

@edknv edknv commented Apr 17, 2023

Depends on NVIDIA-Merlin/dataloader#135.

Goals ⚽

Update the multi-gpu training notebook to work with the new version of the Merlin dataloader.

Implementation Details 🚧

The new dataloader keeps the data in cupy arrays and converts each batch to torch tensors at the last minute, while the old dataloader converted everything to torch tensors as soon as the dataset was loaded from dask-cudf. Since we are using cupy in the dataloader now, we have to ensure that cupy uses the correct device by using cupy.cuda.Device. This should ideally be set in merlin.io.Dataset so users don't have to set this, but we add this to the notebook as a short-term workaround.

Testing Details 🔍

@review-notebook-app
Copy link
Copy Markdown

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@github-actions
Copy link
Copy Markdown

@edknv edknv requested review from bbozkaya and rnyak April 17, 2023 19:32
@edknv edknv self-assigned this Apr 17, 2023
@edknv edknv added this to the Merlin 23.04 milestone Apr 17, 2023
@edknv edknv marked this pull request as ready for review April 17, 2023 19:33
@edknv edknv added bug Something isn't working chore Maintenance for the repository labels Apr 17, 2023
@marcromeyn marcromeyn merged commit 61f67ab into NVIDIA-Merlin:main Apr 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/examples bug Something isn't working chore Maintenance for the repository

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants