flow 1.3.0
Kokkos cut-cell IBM incompressible Navier-Stokes solver + pnm pore extraction
Loading...
Searching...
No Matches
kernel_diff Namespace Reference

Functions

 short_nsys (name)
 
 load_nsys (prefix)
 
 load_kp (path)
 
 memcpy_hist (prefix)
 

Variables

 A = sys.argv
 
 MODE
 
 PA
 
 PB
 
str STEPS = int(A[A.index("--steps") + 1]) if "--steps" in A else 20
 
str TOP = int(A[A.index("--top") + 1]) if "--top" in A else 25
 
 a
 
 b
 
list rows = []
 
 na
 
 ta
 
 nb
 
 tb
 
 key
 
 tot_n = sum(r[1] for r in rows)
 
 tot_t = sum(r[2] for r in rows)
 
 ha
 
 hb
 
tuple d = (hb.get(key, 0) - ha.get(key, 0)) / STEPS
 

Detailed Description

Per-step kernel launches and times from two profiles of the same run at different lengths
(the VoF step-performance harness, WO-0 -- doc/vof_step_performance_design.md sec. 8 G-PERF and
the transfer gate).

A profile covers the whole process (build, warm-up, timed steps). Two runs that differ ONLY in the
number of timed steps (e.g. prof.py 10 --warm 3 and prof.py 30 --warm 3) differ by exactly those
steps, so (B - A) / steps is the per-step cost with setup and warm-up cancelled.

    # GPU: nsys, then its csv summaries
    nsys profile --trace=cuda -o n10 python prof.py 10 --warm 3 --pcg --flux device   (and n30)
    nsys stats --report cuda_gpu_kern_sum,cuda_gpu_mem_size_sum --format csv --output n10 n10.nsys-rep
    python kernel_diff.py nsys n10 n30 --steps 20 [--top 25]
    # host: the Kokkos simple kernel timer (kokkos-tools profiling/simple-kernel-timer)
    KOKKOS_TOOLS_LIBS=.../kp_kernel_timer.so python prof.py 10 ... > k10.log 2>&1   (and k30)
    python kernel_diff.py kp k10.log k30.log --steps 20 [--top 25]
    (the 2024-09 timer prints its table to stdout at finalize and writes no .dat; an older one
    writes <host>-<pid>.dat, which kp_reader turns into the same text)

nsys mode names a kernel by the function that launched it (Kokkos labels are not visible under
--trace=cuda); kp mode by its Kokkos label. nsys mode also prints the D->H / H->D memcpy count per
step and a size histogram, from the cuda_gpu_mem_size_sum reports and the .sqlite exports.

Function Documentation

◆ short_nsys()

kernel_diff.short_nsys (   name)
'void Kokkos::Impl::cuda_parallel_launch_...<Kokkos::Impl::ParallelFor<peclet::flow::X::f(...)
::[lambda ... (instance 2)] ...' -> 'X::f#2' (the launching function, lambda instance).

Definition at line 36 of file kernel_diff.py.

Referenced by load_nsys().

◆ load_nsys()

kernel_diff.load_nsys (   prefix)

Definition at line 51 of file kernel_diff.py.

References short_nsys().

◆ load_kp()

kernel_diff.load_kp (   path)
kernel-timer text: '- <label>' then ' (<type>)  <total s> <calls> <avg> ...'.

Definition at line 60 of file kernel_diff.py.

◆ memcpy_hist()

kernel_diff.memcpy_hist (   prefix)

Definition at line 74 of file kernel_diff.py.

Variable Documentation

◆ A

kernel_diff.A = sys.argv

Definition at line 30 of file kernel_diff.py.

◆ MODE

kernel_diff.MODE

Definition at line 31 of file kernel_diff.py.

◆ PA

kernel_diff.PA

Definition at line 31 of file kernel_diff.py.

◆ PB

kernel_diff.PB

Definition at line 31 of file kernel_diff.py.

◆ STEPS

str kernel_diff.STEPS = int(A[A.index("--steps") + 1]) if "--steps" in A else 20

Definition at line 32 of file kernel_diff.py.

◆ TOP

str kernel_diff.TOP = int(A[A.index("--top") + 1]) if "--top" in A else 25

Definition at line 33 of file kernel_diff.py.

◆ a

kernel_diff.a

Definition at line 89 of file kernel_diff.py.

◆ b

kernel_diff.b

Definition at line 89 of file kernel_diff.py.

◆ rows

list kernel_diff.rows = []

Definition at line 90 of file kernel_diff.py.

◆ na

kernel_diff.na

Definition at line 92 of file kernel_diff.py.

◆ ta

kernel_diff.ta

Definition at line 92 of file kernel_diff.py.

◆ nb

kernel_diff.nb

Definition at line 93 of file kernel_diff.py.

◆ tb

kernel_diff.tb

Definition at line 93 of file kernel_diff.py.

◆ key

kernel_diff.key

Definition at line 95 of file kernel_diff.py.

◆ tot_n

kernel_diff.tot_n = sum(r[1] for r in rows)

Definition at line 96 of file kernel_diff.py.

◆ tot_t

kernel_diff.tot_t = sum(r[2] for r in rows)

Definition at line 97 of file kernel_diff.py.

◆ ha

kernel_diff.ha

Definition at line 103 of file kernel_diff.py.

◆ hb

kernel_diff.hb

Definition at line 103 of file kernel_diff.py.

◆ d

tuple kernel_diff.d = (hb.get(key, 0) - ha.get(key, 0)) / STEPS

Definition at line 107 of file kernel_diff.py.