Open Max191 opened 1 month ago
It most definitely should be a codegen issue.... If we can narrow it down to the diverging dispatch that would help.
It most definitely should be a codegen issue.... If we can narrow it down to the diverging dispatch that would help.
I can spend some time to bisect it.
It most definitely should be a codegen issue.... If we can narrow it down to the diverging dispatch that would help.
I can spend some time to bisect it.
I can take a look
@Max191 and @IanWood1 thanks for volunteering. Maybe @IanWood1 can look into it for now. Please ask if you need help
The numerical differences originate from a linalg.conv_2d_nhwc_hwcf
op followed by a linalg.generic
cd sdxl-scripts/int8-model
compile-punet.sh
and run against the inputs
Thanks Ian for narrowing it down!
I have reduced the repro a bit more to a difference in vector distribution. Running with aggressive fusion with vs. without vector distribution produces the same numerical precision errors.
Follow Ian's steps above, but replace the scripts from (5) and (6) with https://gist.github.com/Max191/9bdedc086a12a0b314cbd98be2d15450 and https://gist.github.com/Max191/cc70f92399879d05231c448252f8d62d
This error also reproduces on IREE main without tuning, so there is no longer a need to use https://github.com/iree-org/iree/tree/shared/sdxl_quantized or https://github.com/nod-ai/sdxl-scripts
@MaheshRavishankar any ideas on who could investigate this issue? It seems that it is related to vector distribution now, so ideally I think someone who knows that pipeline better should pick this up, but I know that the folks who know about it are pretty busy right now.
Running SDXL int8 with aggressive fusion enabled produces different results from running without aggressive fusion enabled.
Repro Instructions
cd sdxl-scripts/int8-model
./compile-punet.sh gfx942
and--iree-flow-enable-aggressive-fusion
fromcompile-punet-base.sh
./compile-punet.sh gfx942
andout_default.npy
vs.out_no_aggressive_fusion.npy
:a= np.load("out_default.npy") b= np.load("out_no_aggressive_fusion.npy")
diff = a- b
print(diff) print(np.max(diff))