[BugFix] chunk_size should always be int64_t#165971
[BugFix] chunk_size should always be int64_t#165971lingebeng wants to merge 4 commits intopytorch:mainfrom
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/165971
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 4d17f59 with merge base 03f3f78 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
|
While it is too expensive to create large dense tensors, is it possible to create large sparse tensors to test the ops? |
|
Of course! |
import torch
from torch.optim import Adagrad
def test_torch_adagrad():
num_params = 27000008
param_size = 192
param = torch.randn(num_params, param_size, device="cuda", dtype=torch.float32, requires_grad=True)
grad = torch.randn_like(param) * 0.01
param.grad = grad
optimizer = Adagrad([param], lr=0.01)
optimizer.step()
torch.cuda.synchronize()
if __name__ == "__main__":
test_torch_adagrad()I am so sorry. I cannot run the code,could you run it? @cyyever torch.OutOfMemoryError: CUDA out of memory. Tried to allocate 19.31 GiB. GPU 0 has a total capacity of 31.74 GiB of which 12.12 GiB is free. Including non-PyTorch memory, this process has 19.61 GiB memory in use. Of the allocated memory 19.31 GiB is allocated by PyTorch, and 0 bytes is reserved by PyTorch but unallocated. If reserved but unallocated memory is large try setting PYTORCH_CUDA_ALLOC_CONF=expandable_segments:True to avoid fragmentation. See documentation for Memory Management (https://pytorch.org/docs/stable/notes/cuda.html#environment-variables) |
This one allocates less than 40GB, but no error raises. |
|
Thanks,I see. Maybe it's not a bug! |
|
@lingebeng We can have further chats via e-mail. |
|
OK,I have contacted you! |
albanD
left a comment
There was a problem hiding this comment.
@cyyever my layman understanding is that int is int64_t on linux/mac but int32_t on windows. So I would only expect to see this fail on windows.
Generally, we do want to make these type explicit to avoid windows-only issues.
|
@pytorchbot merge |
Merge startedYour change will be merged once all checks pass (ETA 0-4 Hours). Learn more about merging in the wiki. Questions? Feedback? Please reach out to the PyTorch DevX Team |
|
@albanD Yes, MSVC still recognises |
aspired by pytorch#156872 Pull Request resolved: pytorch#165971 Approved by: https://github.com/albanD
aspired by #156872