Skip to content

A run's fixed host cost is unprofiled: 0.1–0.3 s on capillaries, about 6 s on kerr_beam_384 #347

Closed

Description

@jtravs

What happens

A complete run spends a fixed time outside its steps, on metadata, provenance, output and plane observation, the same for either integrator:

Nobody has profiled the rest. SEP 39 left it out of scope.

Why it matters

Scans of many short runs pay it on every point, and a benchmark window can be dominated by it, as complete-run gains exceed the windows' on the A40. It does not matter for a single long simulation.

Context

Read, not run.

To do

  • Profile a complete he_rdw_averaged, radial_filament_256 and kerr_beam_384 run outside the steps, separating construction, metadata, provenance, hash, file set-up and the first plane.
  • Remove what is not needed per run, and defer what is needed only if a file is written.
  • Find what makes the hash cost 1.7 s on kerr_beam_384, whose configuration should not grow with the field.

The hash's value must stay stable, and the record must not lose a field a reader needs.

Done when

The breakdown is recorded in benchmarks.md. On 2x Xeon Gold 6240, one run's fixed cost at most halves for he_rdw_averaged and kerr_beam_384, or each remaining item is named with why it stays.


Checked against commit 8a9f764. Takes over the roadmap's entry "The fixed host cost of a run."

Activity

  1. added
    performanceSlower or larger than it should be, with no wrong result
    area: backendsAcross backends, and numba_cpu
    area: outputOutput files, processing and plotting
    on Nov 1, 2026
  2. jtravs commented on Nov 4, 2026

    @jtravs
    ContributorAuthor

    Part of the fixed cost, on an Intel Xeon Gold 6240, 8 threads, free-space 768² x 512 bins, #497's branch:

    Step s How often
    Simulation.from_free with a SpatialPulse 78 Per build, and per point if a runner is given a pulse rather than an array
    First translate() 12.2 Once per configuration; cached after that
    configuration_hash() 4.9 Per run, so per runner point (#309)

    The first is almost all pulses.build: at 256² it's 7.7 s of 7.8 s, more than half of it in spatial.admittance, called 32 times. It scales with the transverse nodes (128²: 2.0 s; 256²: 7.2 s; 512²: 28 s). A delay scan passing a formed array doesn't pay it per point, but one passing a pulse does.

  3. jtravs commented on Nov 5, 2026

    @jtravs
    ContributorAuthor

    Where #520 leaves this, at 768 x 768 x 600:

    Before, Intel Xeon Gold 6240 Now, the same NVIDIA H200's host AMD Instinct MI325X's host
    Simulation.from_free with a SpatialPulse 169 s, 179 s 14.9 s 5.31 s 3.41 s
    First translate() 28 s to 30 s 7.2 s to 7.8 s 3.70 s 1.63 s

    The launch builds in threads and forms its admittance once. A replaced input's finiteness pass also runs on threads now, 0.72 s to 0.05 s on the H200's host, and a Local scan on a device keeps its backend between input-only points (#298). So the items here are much smaller, but I haven't profiled the rest of a run's fixed cost as this issue asks, so it stays open. configuration_hash is #309's.

  4. jtravs commented on Nov 8, 2026

    @jtravs
    ContributorAuthor

    Profiled and partly fixed in #585. The breakdown is in that PR's docs/dev/benchmarks.md under "A run's fixed host cost and a fresh process's BLAS".

    The runs were on an Intel Xeon Gold 6240, exclusive, on one socket, with FFTW wisdom warmed. Before → after:

    case build translation second run
    he_rdw_averaged (5 %, 1 thread) 3.47 → 3.17 s 0.18 → 0.18 s 0.28 → 0.28 s
    kerr_beam_384 (whole, 8 threads) 6.48 → 4.68 s 5.20 → 2.83 s 35.7 → 35.9 s

    What changed:

    • The analytic signal no longer imports scipy.signal, which cost 0.7 s.
    • The transverse ramp's column energies and the admittance's column copy now run in threads.
    • _open_run keeps the cached resume key instead of re-serialising and re-hashing the launch arrays. This was the hash cost this issue asked about.
    • Package versions are read once per process.

    Remaining items, and why each stays:

    Left open: neither run's fixed cost has halved, and part of kerr_beam_384's remaining time is not attributed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: backendsAcross backends, and numba_cpuarea: outputOutput files, processing and plottingperformanceSlower or larger than it should be, with no wrong resultpriority: lowWorth doing, no hurry

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions