Skip to content

Compile time of large kernels #322

Open

Description

@berkgeveci

A first streamlines call on the AhmedML volume (231 seeds, CPU) takes 3.98 s with the disk cache off and 0.46 s warm; the tracing is 0.1 s. _advect is 3.75 s of it: 47,849 IR nodes once its device classes and functions are inlined (526 inlined calls, 208 template methods). This matters for first runs, CI, a new Tack version and MPI jobs.

Inside _advect's 3.75 s: lowering 0.75 s, copy propagation 0.73 s, verify_ir (six full passes) 0.6 s, LLVM IR generation 0.33 s, LLVM parse/optimize/JIT 0.26 s; 29% of the time is walk_ir, a recursive generator called 1.28M times.

  • Drop branches that compile-time constants decide, during lowering (13 such branches hold about 14,000 of the 47,849 nodes).
  • Verify less outside debug mode: one or two of the six full verifications.
  • One-pass copy propagation: one substitution map in one walk.
  • A faster IR walker: an explicit stack instead of a recursive generator.

Target: a cold first call of about 1.5 s here. Measure on the GPUs too. #298 (template methods: fewer copied parameters, methods resolved on demand) takes part of this.

Activity

  1. added this to the 0.8 milestone on Nov 4, 2026
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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions