Skip to content

Collect metrics for miscellaneous IREE system states #6161

Closed

Description

@antiagainst

Right now the benchmark pipeline only supports model benchmarks, with basically the following scheme:

<input-model> [<model-tags>] (<model-source>) <benchmark-mode-tags>
with <iree-driver> @ <device-name> (<target-arch>)

We need to increase the metrics collection to include various IREE system states and track them in the dashboard like model benchmarks.

This issue is for collecting such miscellaneous metrics, and trying to define a category and naming scheme for them for consistency.

Activity

  1. antiagainst commented on Jun 9, 2021

    @antiagainst
    MemberAuthor

    Some initial candidates to be refined:

    • Compiled VMFB size
    • IREE runtime binary size
    • IREE system initialization time

    Also initial thoughts from @ScottTodd:

    • model compilation time
    • peak runtime memory use
    • certain pass statistics
    • program analyses (e.g. number of synchronization points)
  2. added
    infrastructure/benchmark
    on Jun 9, 2021
  3. ScottTodd commented on Sep 3, 2021

    @ScottTodd
    Member

    Pass statistics (sample output) can be extracted with

    # build with CMake in Debug or RelWithDebInfo + `-DLLVM_FORCE_ENABLE_STATS=ON`
    
    iree-translate \
      ${MODEL_PATH} (flags like -iree-input-type=mhlo) \
      -pass-statistics \
      -o /dev/null \
      2> ${MODEL}_statistics.txt
    
    # Extract number of dispatches after FusionOfTensorOps + DispatchLinalgOnTensors
    cat ${MODEL}_statistics.txt | grep "number of dispatches" | sed -E 's/.* ([0-9]+) number.*/\1/'
    # Extract number of unique executables after DeduplicateExecutables
    cat ${MODEL}_statistics.txt | grep "unique executable" | sed -E 's/.* ([0-9]+) unique.*/\1/'

    For bert_encoder_unrolled_fake_weights.mlir there are currently 969 dispatches and 28 unique executables. The number of dispatches is a useful codegen metric tracking how much code is getting fused, and tracking that would make regressions like #6648 easier to spot.

    We can add more statistics with #1409. Number of host round trips will be useful for flow->streams->hal.


    #6868 added the --print_statistics flag for iree-run-module, with output like

    [[ iree_hal_allocator_t memory statistics ]]
      HOST_LOCAL:            0b peak /            0b allocated /            0b freed /            0b live
    DEVICE_LOCAL:    106340864b peak /    106340864b allocated /    106340864b freed /            0b live
    

    which will give an accurate report for memory usage even for models with dynamic behavior.

  4. added
    infrastructure
    on Dec 2, 2021
  5. moved this to Available in IREEon Jul 1, 2022
  6. moved this from Available to Inbox in (Deprecated) IREEon Apr 5, 2023
  7. allieculp commented on Apr 10, 2023

    @allieculp

    Sending to backlog due to the date of the issue - please reprioritize if needed.

  8. moved this from Inbox to Backlog in (Deprecated) IREEon Apr 10, 2023
  9. ScottTodd commented on Apr 10, 2023

    @ScottTodd
    Member

    Is there anything still to do here, or can that be tracked in other issues? We are measuring some metrics (but more would be nice).

  10. pzread commented on May 8, 2023

    @pzread
    Contributor

    The benchmark tools can now collect memory usages (#13325), compilation time, dispatch sizes, and will include the numbers of dispatches soon. I think in general we have a schema to collect multiple metrics, so we can close this one. (And for sure more metrics will be added later).

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

Metadata

Metadata

Assignees

Labels

infrastructureinfrastructure/benchmark

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions