Lunderberg commented on PR #16588:
URL: https://github.com/apache/tvm/pull/16588#issuecomment-1955024693

   Good point on checking the performance.  I did a benchmark, with shown 
results shown in the plot below.  The x-axis is the time required to run the 
analyzer with the `BoundUsingReciprocal` function disabled, and the y-axis is 
the time with it enabled.  A `y=x` diagonal line is shown for comparison.
   
   <details>
   <summary>Click for benchmark settings</summary>
   
   * The benchmark measures the time to run the analyzer itself.  The is the 
call to `analyzer.const_int_bound(expr)` for the tests in 
`test_arith_const_int_bound.py`, and the call to 
`analyzer.rewrite_simplify(expr)` for the tests in 
`test_arith_rewrite_simplify.py`.
   * Tests were performed using `pytest-benchmark` plugin using default 
settings.  For each benchmark, the number of iterations was selected to take 
about 1 second total time, and the plot shows the average per-iteration time.  
The number of iterations was at least 5k for all benchmarks, typically around 
30-40k.
   * When disabling PR-16588, the `BoundUsingReciprocal` function was never 
entered.
   * Order of each benchmark was randomized to avoid any systematic bias 
between groups.
   
   </details>
   
   
![image](https://github.com/apache/tvm/assets/3888575/655a06e8-96ce-47c6-88f7-601a0a452927)
   
   In the majority of cases, there is effectively no performance difference.  
In cases where the improved bounds returned from `ConstIntBound` allow a 
simplification, the performance is improved as fewer recursive rewrites need to 
be applied.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to