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.
Dear authors,
Thank you for releasing
fast_l1
code together withdatamodels
.This pull request intends to fix the device of some tensors in
regressor.py
.While running the linear regression step of datamodels, I faced an issue regarding tensors not being in the same device.
After running
I would face something similar to
or
This happened because in lines
221
and341
some CPU tensors are being indexed/sliced using other tensors that lie on the GPU, in this case,idx
andstill_opt_outer
. On the other hand, they are both on the GPU becauseweight
andtrain_loader
in datamodels/datamodels/regression/compute_datamodels.py#L151 are on the GPU whentrain_saga
is called.This pull request ensures that both
idx
andstill_opt_outer
are on the CPU before indexing/slicing.