Unique patterns are matched as duplicates.
Created by: wojtuss
The algorithm used in GraphPatternDetector::UniquePatterns()
method for determining duplicate subgraphs seems to be flawed. Quite often it marks two distinct subraphs as duplicates. This leads to nondeterministic results of fuse passes.
Below are two sequences of addresses (item.first
and item.second
) taken into the calculation of the hash key
for two different subgraphs, with intermediate values of the key
, which gave the same final hash key
value while running a pass fuse conv+bn (see PR https://github.com/PaddlePaddle/Paddle/pull/13486):
1.
key: 0
item.first: 0x7d15df0
key: 131161584
item.second: 0x7d85b40
key: 591536
item.first: 0x7de3130
key: 131544960
item.second: 0x7d85490
key: 1008400
item.first: 0x7d1a1e0
key: 132039408
item.second: 0x7d86b20
key: 436688
item.first: 0x7d1bbc0
key: 131535376
item.second: 0x7d851c0
key: 1000400
item.first: 0x7d20400
key: 131942352
item.second: 0x7d86870
key: 339872
item.first: 0x7d24480
key: 131558176
item.second: 0x7d861c0
key: 985824
item.first: 0x7dd95a0
key: 131243840
item.second: 0x7d84030
key: 712560
item.first: 0x7d64b10
key: 131896416
item.second: 0x7d86510
key: 323952
item.first: 0x7d116f0
key: 131458944
item.second: 0x7d83290
key: 906512
item.first: 0x7cf5c80
key: 130189712
item.second: 0x7d82fc0
key: 1746512
item.first: 0x7d12ae0
key: 130780336
item.second: 0x7d83d00
key: 1290672
item.first: 0x7dd9c60
key: 130952656
item.second: 0x7d857e0
key: 1473072
item.first: 0x7d12790
key: 130506144
item.second: 0x7d84320
key: 2039424
item.first: 0x7dde030
key: 130219696
item.second: 0x7d850a0
key: 1748496
key: 0
item.first: 0x7d15df0
key: 131161584
item.second: 0x7d5d510
key: 297184
item.first: 0x7de3130
key: 131774928
item.second: 0x7d5ce60
key: 1013680
item.first: 0x7d1a1e0
key: 132044368
item.second: 0x7d5e4f0
key: 733856
item.first: 0x7d1bbc0
key: 131762528
item.second: 0x7d5cb90
key: 1000176
item.first: 0x7d20400
key: 131942128
item.second: 0x7d5e240
key: 566448
item.first: 0x7d24480
key: 131784752
item.second: 0x7d5db90
key: 998304
item.first: 0x7dd95a0
key: 131247616
item.second: 0x7d5ba00
key: 463872
item.first: 0x7d64b10
key: 131161872
item.second: 0x7d5dee0
key: 295408
item.first: 0x7d116f0
key: 131438336
item.second: 0x7d5ac10
key: 15120
item.first: 0x7cf5c80
key: 131032976
item.second: 0x7d5a940
key: 1756880
item.first: 0x7d12ae0
key: 130802736
item.second: 0x7d5b6d0
key: 1987296
item.first: 0x7dd9c60
key: 130272896
item.second: 0x7d5d1b0
key: 1449776
item.first: 0x7d12790
key: 130496672
item.second: 0x7d5bcf0
key: 1213520
item.first: 0x7dde030
key: 131032160
item.second: 0x7d5ca70
key: 1748496