Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

INTERNAL ASSERT FAILED source.dtype() == self.dtype() #87672

Closed
creakseek opened this issue Oct 25, 2022 · 6 comments
Closed

INTERNAL ASSERT FAILED source.dtype() == self.dtype() #87672

creakseek opened this issue Oct 25, 2022 · 6 comments
Labels
good first issue module: assert failure The issue involves an assert failure triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module

Comments

@creakseek
Copy link

creakseek commented Oct 25, 2022

🐛 Describe the bug

RuntimeError: source.dtype() == self.dtype() INTERNAL ASSERT FAILED , please report a bug to PyTorch.

import torch

input_ = [
    [
        [1, 2, 3],
        [4, 5, 6],
        [7, 8, 9]
    ],
    [
        [11, 12, 13],
        [14, 15, 16],
        [17, 18, 19]
    ]
]

input_ = torch.tensor(input_, dtype=torch.float32)

input_.set_(torch.tensor(
    [
        [
            [21, 22, 23],
            [24, 25, 26],
            [27, 28, 29]
        ],
        [
            [31, 32, 33],
            [34, 35, 36],
            [37, 38, 39]
        ]
    ]))

print(input_)
RuntimeError: source.dtype() == self.dtype() INTERNAL ASSERT FAILED at "/opt/conda/conda-bld/pytorch_1659484806139/work/torch/csrc/autograd/generated/python_variable_methods.cpp":16766, please report a bug to PyTorch. 

Versions

PyTorch 1.12.1

cc @ezyang @gchanan @zou3519

@bdhirsh bdhirsh added high priority module: assert failure The issue involves an assert failure labels Oct 27, 2022
@bdhirsh
Copy link
Contributor

bdhirsh commented Oct 27, 2022

Hi-pri for the internal assert failure.

In this repro, it looks like we're running float32_tensor.set_(int64_tensor). I'm not sure if that's actually supported - if it's not, we should make it a normal assert failure.

@malfet malfet added good first issue triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module and removed high priority triage review labels Oct 31, 2022
@malfet
Copy link
Contributor

malfet commented Oct 31, 2022

@ezyang : internal asserts should be high priority only if we don't know what is causing them.
We should change internal assert to a regular runtime error as this is not a supported behaviour.

@fool1280
Copy link

fool1280 commented Nov 5, 2022

Hi, I'm interested in this issue, but not familiar with the codebase a lot (first time contributor --ever here). May I ask for some pointer/advice to start with? Thank you!

@ezyang
Copy link
Contributor

ezyang commented Nov 5, 2022

A good start is to find the assert, change it into TORCH_CHECK and add a good error message

@fool1280
Copy link

fool1280 commented Nov 6, 2022

Thank you, please let me take this issue

@PanosAntoniadis
Copy link
Contributor

Hey! I submitted a PR where I replaced the internal error with a TORCH_CHECK! It's my first contribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue module: assert failure The issue involves an assert failure triaged This issue has been looked at a team member, and triaged and prioritized into an appropriate module
Projects
None yet
6 participants