Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SimpleKernelTimer enhancement #277

Open
dutkalex opened this issue Nov 20, 2024 · 0 comments
Open

SimpleKernelTimer enhancement #277

dutkalex opened this issue Nov 20, 2024 · 0 comments

Comments

@dutkalex
Copy link

Hi folks!
The SimpleKernelTimer is very handy for quick profilings, but I find the output hard to read when profiling regions are nested. Consider the following code example:

Kokkos::Profiling::pushRegion("MyKokkosApp");

  Kokkos::Profiling::pushRegion("Initialization");
  // ...
  Kokkos::Profiling::popRegion();

  Kokkos::Profiling::pushRegion("Solve");
  // ...
    Kokkos::Profiling::pushRegion("Foo");
    // ...
    Kokkos::Profiling::popRegion();
  // ...
    Kokkos::Profiling::pushRegion("Bar");
    // ...
    for (int i=0; i < N; ++i){
      Kokkos::Profiling::pushRegion("BarLoop");
      // ...
      Kokkos::Profiling::popRegion();
    }
    // ...
    Kokkos::Profiling::popRegion();  
  // ...
  Kokkos::Profiling::popRegion();
  
Kokkos::Profiling::popRegion();

The output show currently shows all the regions as one big flat list, which is hard to analyze. It be much clearer if the formatting took into account the hierarchical structure of the regions. The output could look something like the following:

 (Type)   Total Time, Call Count, Avg. Time per Call, %Total Time in Kernels, %Total Program Time
-------------------------------------------------------------------------

Regions:

+ MyKokkosApp
|  (REGION)                       ...
|    + Solve
|    |  (REGION)                  ...
|    |    + Bar
|    |    |  (REGION)             ...
|    |    |    - BarLoop
|    |    |       (REGION)        ...
|    |    |    - Other
|    |    |       (REGION)        ...
|    |  - Foo
|    |     (REGION)               ...
|    |  - Other
|    |     (REGION)               ...
|    - Initialization
|       (REGION)                  ...
|    - Other
|       (REGION)                  ...

What do you think of this?

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

No branches or pull requests

1 participant