Skip to content

fill_ overflows on uint64 in range [2**63, 2**64) when profiler is engaged #157728

@ecpeterson

Description

@ecpeterson

🐛 Describe the bug

Engaging the profiler and calling .fill_ on a uint64 tensor with a large fill value incorrectly raises an overflow error.

import torch

value = 13921981265324640609                          # number between 2^63 and 2^64
print(value < torch.iinfo(torch.uint64).max)          # check that i'm not lying
signed_value = (value ^ 2**63) - 2**63                # view as a signed value

torch.zeros((), dtype=torch.uint64).fill_(value)      # works outside the profiler

with torch.profiler.profile(record_shapes=True):      # engage profiler with shape info
    (torch.zeros((), dtype=torch.uint64)
        .view(dtype=torch.int64).fill_(signed_value)  # store signed value onto signed view of tensor
        .view(dtype=torch.uint64))                    # works

    torch.zeros((), dtype=torch.uint64).fill_(value)  # raises ***int64*** overflow

Versions

I'm not easily able to clean my development environment for sharing, but I did reproduce the bug at the Getting Started colab, so whatever that is running will do.

cc @robieta @chaekit @guotuofeng @guyang3532 @dzhulgakov @davidberard98 @briancoutinho @sraikund16 @sanrise

Metadata

Metadata

Assignees

No one assigned

    Labels

    oncall: profilerprofiler-related issues (cpu, gpu, kineto)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy