daphne-project/daphne

Enable timing report for pass pipeline

Aperta

#739 aperta il 29 mag 2024

 (0 commenti) (0 reazioni) (0 assegnatari)C++ (84 fork)auto 404
good first issue

Metriche repository

Star
 (80 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

#423 and #206 mention time reporting for the compiler pass pipeline, MLIR provides a straightforward way to generate a timing report for a compilation pipeline.

With mlir::PassManager::enableTiming() one can generate the following (example) output:

===-------------------------------------------------------------------------===
                         ... Execution time report ...
===-------------------------------------------------------------------------===
  Total Execution Time: 0.0584 seconds

  ----User Time----  ----Wall Time----  ----Name----
    0.0059 (  4.9%)    0.0013 (  2.3%)  'func.func' Pipeline
    0.0058 (  4.9%)    0.0013 (  2.2%)    InferencePass
    0.0029 (  2.4%)    0.0029 (  5.0%)  Canonicalizer
    0.0006 (  0.5%)    0.0006 (  1.0%)  {anonymous}::PhyOperatorSelectionPass
    0.0005 (  0.4%)    0.0005 (  0.9%)  CSE
    0.0000 (  0.0%)    0.0000 (  0.0%)    (A) DominanceInfo
    0.0073 (  6.1%)    0.0008 (  1.4%)  'func.func' Pipeline
    0.0021 (  1.8%)    0.0004 (  0.6%)    AdaptTypesToKernelsPass
    0.0021 (  1.7%)    0.0004 (  0.7%)    InsertDaphneContextPass
    0.0035 (  2.9%)    0.0035 (  6.0%)  Canonicalizer
    0.0006 (  0.5%)    0.0006 (  1.0%)  CSE
    0.0000 (  0.0%)    0.0000 (  0.0%)    (A) DominanceInfo
    0.0460 ( 38.3%)    0.0117 ( 20.1%)  'func.func' Pipeline
    0.0020 (  1.7%)    0.0004 (  0.7%)    ManageObjRefsPass
    0.0428 ( 35.7%)    0.0113 ( 19.3%)    {anonymous}::RewriteToCallKernelOpPass
    0.0014 (  1.2%)    0.0014 (  2.4%)  SCFToControlFlow
    0.0024 (  2.0%)    0.0003 (  0.5%)  'func.func' Pipeline
    0.0018 (  1.5%)    0.0003 (  0.5%)    LLVMRequestCWrappers
    0.0275 ( 22.9%)    0.0275 ( 47.1%)  {anonymous}::DaphneLowerToLLVMPass
    0.0046 (  3.8%)    0.0046 (  7.9%)  ReconcileUnrealizedCasts
    0.0006 (  0.5%)    0.0006 (  1.0%)  Rest
    0.1200 (100.0%)    0.0584 (100.0%)  Total

This example is generated by running bin/daphne test/api/cli/algorithms/decisionTreeRealData2.daphne data=\"test/data/wine/winequality-red-white.csv\" dt=1 maxV=1.000000.

Adding this to an existing flag, e.g., --statistics or --timing would already be a step towards better analysis of compilation time in DAPHNE.

Guida contributor