Skip to content

Fix average runtime and GFLOPS calculation in example 10#818

Merged
tdeng5 merged 1 commit into
intel:mainfrom
jinyouzhi:fix_timing_10
Jun 8, 2026
Merged

Fix average runtime and GFLOPS calculation in example 10#818
tdeng5 merged 1 commit into
intel:mainfrom
jinyouzhi:fix_timing_10

Conversation

@jinyouzhi

@jinyouzhi jinyouzhi commented Jun 5, 2026

Copy link
Copy Markdown

Description

Fix the timing calculation in example 10.

Previously, the measured total runtime from timer.seconds() was divided by
options.iterations twice:

  1. once when assigning cute_time
  2. again when computing cute_average_time

In addition, cute_average_time was later divided by 1000.0 when calculating
GFLOPS, even though the previous value was already based on seconds.

This caused the reported average runtime to be too small and the reported GFLOPS
to be too large. With the default --iterations=100, the GFLOPS value could be
inflated by 1000 * iterations, i.e. 100,000x.

The fix converts total elapsed seconds to milliseconds first, then divides once
by the iteration count to report average runtime in ms. GFLOPS calculation then
converts the average runtime back to seconds.

Type

  • Bug
  • Feature
  • Performance
  • Refactor

Testing

  • Tests pass
  • Xe12
  • Xe20

Performance

Metric Before After

References

Fixes #

Checklist

  • Copyright
  • Co-pilot Review
  • Deprecated APIs not used

@jinyouzhi jinyouzhi changed the title Fix timing calculation in ExampleRunner to report time in milliseconds Fix timing calculation in example 10 Jun 5, 2026
@tdeng5 tdeng5 requested review from jiyang1011 and taozha2 June 8, 2026 01:52
@jinyouzhi jinyouzhi changed the title Fix timing calculation in example 10 Fix average runtime and GFLOPS calculation in example 10 Jun 8, 2026
@tdeng5 tdeng5 merged commit a02de92 into intel:main Jun 8, 2026
8 of 9 checks passed
@jinyouzhi jinyouzhi deleted the fix_timing_10 branch June 9, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants