Skip to content

Fusion print is broken with the presence of castOp. #159

@jjsjann123

Description

@jjsjann123

🐛 Bug

A type assert is mysteriously failing when I have a fusion with a castOp. I briefly scanned through the code in arith.cpp looks like the type is properly set.

To Reproduce

I have the repro here: https://github.com/csarofeen/pytorch/tree/castOp_repro
(basically just trying to print fusion with a castOp).

build and run with ./test_jit --gtest_filter="*GPU_FusionCast*

C++ exception with description "dtype_ != DataType::Null INTERNAL ASSERT FAILED at "../torch/csrc/jit/codegen/cuda/ir_base_nodes.cpp":134, please report a bug to PyTorch. Value does not have a data type.
Exception raised from getDataType at ../torch/csrc/jit/codegen/cuda/ir_base_nodes.cpp:134 (most recent call first):
frame #0: c10::Error::Error(c10::SourceLocation, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >) + 0x6b (0x7fa9c29ef99b in /volume/codegen_project/pytorch_codegen/build/lib/libc10.so)
frame #1: torch::jit::fuser::Val::getDataType() const + 0x3d4 (0x7fa9c5b1de44 in /volume/codegen_project/pytorch_codegen/build/lib/libtorch_cuda.so)
frame #2: torch::jit::fuser::IRPrinter::handle(torch::jit::fuser::UnaryOp const*) + 0x1ad (0x7fa9c5b3d4dd in /volume/codegen_project/pytorch_codegen/build/lib/libtorch_cuda.so)
frame #3: void torch::jit::fuser::Expr::constDispatch<torch::jit::fuser::OptInConstDispatch*>(torch::jit::fuser::OptInConstDispatch*, torch::jit::fuser::Expr const*) + 0xb0 (0x7fa9c5ae76c0 in /volume/codegen_project/pytorch_codegen/build/lib/libtorch_cuda.so)
frame #4: torch::jit::fuser::IRPrinter::handle(torch::jit::fuser::Fusion*) + 0x55 (0x7fa9c5b3a745 in /volume/codegen_project/pytorch_codegen/build/lib/libtorch_cuda.so)
frame #5: torch::jit::fuser::operator<<(std::ostream&, torch::jit::fuser::Fusion*) + 0x6a (0x7fa9c5b3caaa in /volume/codegen_project/pytorch_codegen/build/lib/libtorch_cuda.so)
frame #6: torch::jit::testGPU_FusionCastOps() + 0x8f (0x5605261e181f in ./test_jit)
frame #7: void testing::internal::HandleExceptionsInMethodIfSupported<testing::Test, void>(testing::Test*, void (testing::Test::*)(), char const*) + 0x4a (0x56052623d05a in ./test_jit)
frame #8: <unknown function> + 0x224fc5 (0x560526232fc5 in ./test_jit)
frame #9: <unknown function> + 0x2255d5 (0x5605262335d5 in ./test_jit)
frame #10: <unknown function> + 0x225885 (0x560526233885 in ./test_jit)
frame #11: testing::internal::UnitTestImpl::RunAllTests() + 0xc1c (0x5605262348dc in ./test_jit)
frame #12: testing::UnitTest::Run() + 0x98 (0x560526234b98 in ./test_jit)
frame #13: main + 0xc8 (0x560526081528 in ./test_jit)
frame #14: __libc_start_main + 0xe7 (0x7fa9c1c91b97 in /lib/x86_64-linux-gnu/libc.so.6)
frame #15: _start + 0x2a (0x56052608d30a in ./test_jit)
" thrown in the test body.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions