jiazhihao / TASO

The Tensor Algebra SuperOptimizer for Deep Learning
Apache License 2.0
682 stars 89 forks source link

Assertion failed when using new substitution rules. #58

Open anhtuanhsgs opened 4 years ago

anhtuanhsgs commented 4 years ago

Hi,

I used followed the installation instruction and successfully ran the python examples.

I follwed SOSP19AE.pdf and successfully compile and generate new graph substitution rules. How ever, when using new substitutions, I got assertion error in GraphXfer::create_operator_from_pb () in substitutions.pb as follows:

python: /usr/TASO/src/core/substitution.cc:351: void taso::GraphXfer::create_operator_from_pb(const GraphSubst::Operator&, std::map<int, taso::TensorX>&, bool): Assertion `false' failed.
Aborted (core dumped)

I commented out lines https://github.com/jiazhihao/TASO/blob/a310b60ff03842fe4a3f0fc7c423cf8b4883851b/src/generator/generator.cc#L1762 and https://github.com/jiazhihao/TASO/blob/a310b60ff03842fe4a3f0fc7c423cf8b4883851b/src/generator/generator.cc#L1763

In src/generator/generator.cc to not use operator Constant_IMM which caused Assertion 'false' failed.

I build and run python examples/resnet50.py but still get the error:

python: /usr/TASO/src/core/substitution.cc:309: void taso::GraphXfer::create_operator_from_pb(const GraphSubst::Operator&, std::map<int, taso::TensorX>&, bool): Assertion `pbOp.input_size() == 2' failed.
Aborted (core dumped)

How to fix this error? Is there a version of 'generator.cc' that was used in the paper?

DLYLL commented 2 years ago

i change assert(collection.ParseFromIstream(&input)); to collection.ParseFromIstream(&input); to solve this problem. just wo assert, you can try it.