Skip to content

CPU MobileBert performance regression starting from #5573 #5634

Closed

Description

@hanhanW

The performance number on Mako dashboard went from ~700 ms to ~11400 ms starting from #5573

It happens on both S20 and Pixel 4.

@asaadaldien and I had a few discussion in PR and discord. Filing an issue for tracking it.

Ahmed, could you share how you get ~690 ms on main branch? I suspect that the flags you used is different from the setting on configuration.py. The compilation flags are --iree-llvm-target-triple=aarch64-none-linux-android29 --iree-flow-inline-constants-max-byte-length=2048 --iree-flow-dispatch-formation-enable-operand-fusion on Mako. (I will also give it a shot on my local Pixel 4)

Activity

  1. added
    performance ⚡
    on Apr 27, 2021
  2. hanhanW commented on Apr 27, 2021

    @hanhanW
    ContributorAuthor

    I got 17285 ms on my Pixel 4.

    This is my full command for compilation: iree-translate --iree-mlir-to-vm-bytecode-module --iree-hal-target-backends=dylib-llvm-aot ~/MobileBertSquad/iree_input.mlir -iree-llvm-target-triple=aarch64-none-linux-android29 --iree-flow-inline-constants-max-byte-length=2048 --iree-flow-dispatch-formation-enable-operand-fusion -o a.vmfb

    Execution command:

    adb shell LD_LIBRARY_PATH=/data/local/tmp/ taskset 80 /data/local/tmp/iree-benchmark-module \
      --flagfile=/data/local/tmp/mobilebert_flagfile \
      --module_file=/data/local/tmp/a.vmfb \
      --driver=dylib-sync
    

    And you will see

    ------------------------------------------------------------------------------------
    Benchmark                                          Time             CPU   Iterations
    ------------------------------------------------------------------------------------
    BM_serving_default/process_time/real_time      17285 ms        17193 ms            1
    

    With -iree-llvm-loop-unrolling=true, it is a bit better -- 16649 ms.

  3. asaadaldien commented on Apr 27, 2021

    @asaadaldien
    Contributor

    --iree-flow-dispatch-formation-enable-operand-fusion is causing regression and compilation error (unhandled multiple root operations in a dispatch region) that isn't failing the pass and I think it should.
    Lets file a different issue to track why operand-fusion is broken for Mobilebert when linalg.generic are tiled and distributed.

  4. hanhanW commented on Apr 27, 2021

    @hanhanW
    ContributorAuthor

    Issue #5636 already filed. I'll close this one after I fix it in configuration.py

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

performance ⚡

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions