Skip to content

Add code size and compile time stats to benchmarking infrastructure for RISC-V #9167

Closed

Description

@dcaballe

We would like to extend the benchmarking infrastructure to track new metrics for RISC-V (initially). Below is a summary of requirements and initial plans discussed in several meetings.

Requirements for a new RISC-V benchmarking pipeline:

  • Metrics: Gather new code size and compile time metrics and upload them to a dashboard.
    • Code size must be computed for the whole model, not individual dispatches.
    • Compile time may be subject to certain level of noise. Compiling on low noise servers is not expected in the first implementation.
  • Pipeline steps: Only compile the model for now and skip execution. Several execution strategies might be considered in the future.
  • Targets: Compilation must support up to two different RISC-V targets (different sets of flags): rv64 and rv32.
  • Benchmarks to track: MobileNetV1 (rv64, fp32), MobileBert (rv64, fp32), DeepLabV3 (rv64, fp32) and Person Detection (rv32, quantized).
  • CI integration: a new Github label must trigger the new pipeline on a specific PR.

The initial implementation will be a simple ad-hoc extension to the current benchmarking infrastructure. We will incorporate the newly implemented functionality and learnings to the ongoing long-term design. For code size metrics, we can leverage the recently introduced flags to dump the intermediate compilation files.

Future work:

  • Define pre-commit testing criteria and implement it.
  • Enable execution on simulator/FPGA.
  • Accurate compile time computation.

@pzread, feel free to edit the issue if I missed anything!

Activity

  1. added
    enhancement ➕
    infrastructure/benchmark
    on May 19, 2022
  2. antiagainst commented on May 19, 2022

    @antiagainst
    Member

    I've #8271 that prototypes support for compilation statistics. @pzread please feel free to complete it or reuse whatever suitable there.

  3. added
    codegen/riscv
    on May 23, 2022
  4. dcaballe commented on May 26, 2022

    @dcaballe
    ContributorAuthor

    @hcindyl should also be able to help us add the the Person Detection one.

  5. pzread commented on Jun 3, 2022

    @pzread
    Contributor

    #9218 has been checked in and we can start adding the required models from there : )

    I'll work on #9227 to add tools to collect binary size and add the benchmark pipeline to run it.

    The new models should be imported at https://github.com/google/iree/blob/main/benchmarks/TFLite/CMakeLists.txt and define the benchmark suite in https://github.com/google/iree/blob/main/benchmarks/TFLite/linux-riscv.cmake

  6. bjacob commented on Jun 6, 2022

    @bjacob
    Collaborator

    Please implement a 'code size' metric that has fine granularity. Typically that means use size -A <thefile> (see man 1 size) to look at code section sizes rather than ls or stat looking at raw file size, as the latter often fails to see incremental code size increases.

  7. hcindyl commented on Jun 6, 2022

    @hcindyl
    Contributor

    Add RISC-V benchmark configs #9218

    Please see the discussion in #9218 (comment). We will start off with tracking the .so total dispatch library size, but later we could move to track the individual library size, but it would require 1) more benchmark infra refactoring and 2) stable fuse result so the certain library would be more trackable over commits.

  8. added
    infrastructure
    on Jun 8, 2022
  9. pzread commented on Jun 10, 2022

    @pzread
    Contributor

    Update: #9227 has been merged. I'll set up the pipeline to run it.

  10. bjacob commented on Jun 10, 2022

    @bjacob
    Collaborator

    I would still like to draw your attention to the issue mentioned in my previous comment :-) I have elaborated on it in a comment on the PR: https://github.com/google/iree/pull/9227/files#r894579748

    Please note, that this isn't just for the sake of having a higher-sensitivity metric that can detect smaller size regressions. This is also to have a metric that's actionable. Because binary file size tends to be unchanged under small code size increases (see the example worked out in the linked comment), only eventually bumping when a certain threshold is reached, in practice a file-size metric will blame whichever, potentially tiny, change happened to cross the threshold. The metric won't be able to point to the previous bigger code increases that are the root cause of the eventual file size increase.

  11. dcaballe commented on Jun 10, 2022

    @dcaballe
    ContributorAuthor

    I think that's a great follow-up work! Thanks, Benoit. For this quarter we are mostly interested in catching large code size variations but I totally agree that having a more reliable way of measuring the code size would be really useful in the short term.

  12. moved this to In Progress in IREEon Jun 28, 2022
  13. pzread commented on Jul 11, 2022

    @pzread
    Contributor

    Done with #9625

  14. Repository owner moved this from In Progress to Done in IREEon Jul 11, 2022
  15. Repository owner moved this from In Progress to Done in IREE - ARCHIVED (do not update)on Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

codegen/riscvenhancement ➕infrastructureinfrastructure/benchmark

Type

No type

Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions