microsoft / nnfusion

A flexible and efficient deep neural network (DNN) compiler that generates high-performance executable from a DNN model description.
MIT License
959 stars 163 forks source link

[BUG] Equal operator backward reports check error #337

Closed xysmlx closed 3 years ago

xysmlx commented 3 years ago

šŸ› Bug

Compiling the GNN model in training mode (-fautodiff=true -ftraining_mode=true) will report check error: inputs and inputs_grad must be equal size.

std::cout << node->get_op_type() << " " << inputs_grad.size() << " " << node->get_input_size() << std::endl;

Equal 1 2

[ERROR] 2021-11-01T14:16:28z src/nnfusion/util/errors.hpp 169   Check failed: 'inputs_grad.size() == node->get_input_size()' at nnfusion/src/nnfusion/engine/pass/graph/autodiff/backward_registry.cpp:160:
inputs and inputs_grad must be equal size
terminate called after throwing an instance of 'nnfusion::errors::CheckError'
  what():  Check failed: 'inputs_grad.size() == node->get_input_size()' at nnfusion/src/nnfusion/engine/pass/graph/autodiff/backward_registry.cpp:160:
inputs and inputs_grad must be equal size
Aborted (core dumped)

Equal operator does not have backward because it is logical operator. However, commenting this check to bypass this problem will result in segmentation fault.

To Reproduce Steps to reproduce the behavior:

Expected behavior

Additional context