NVIDIA-Merlin / Transformers4Rec

Transformers4Rec is a flexible and efficient library for sequential and session-based recommendation and works with PyTorch.
https://nvidia-merlin.github.io/Transformers4Rec/main
Apache License 2.0
1.08k stars 142 forks source link

Update multi-gpu notebook to set cupy device #675

Closed edknv closed 1 year ago

edknv commented 1 year ago

Depends on https://github.com/NVIDIA-Merlin/dataloader/pull/135.

Goals :soccer:

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

Implementation Details :construction:

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 :mag:

review-notebook-app[bot] commented 1 year ago

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

github-actions[bot] commented 1 year ago

Documentation preview

https://nvidia-merlin.github.io/Transformers4Rec/review/pr-675