Skip to content

feat: add lazy IR scheduling layer POC#4173

Open
ianna wants to merge 4 commits into
mainfrom
ianna/awkward_lazy_ir_poc
Open

feat: add lazy IR scheduling layer POC#4173
ianna wants to merge 4 commits into
mainfrom
ianna/awkward_lazy_ir_poc

Conversation

@ianna

@ianna ianna commented Jul 2, 2026

Copy link
Copy Markdown
Member

This PR completes the stabilization of the lazy‑IR pipeline (migrated from #3792) across both CUDA and CPU backends. It fixes correctness issues, unifies the backend architecture, introduces predictable caching, and provides a benchmark that demonstrates substantial real‑world wins:

backend=cpu  lists=500,000  elements≈4,748,231  best of 5
  build            lazy      0.044 ms   eager     93.726 ms     2130.0x  (graph construction vs full evaluation)
  branch_1of8      lazy     92.199 ms   eager    727.089 ms        7.9x  (only 1 of 8 pipelines materialized)
  shared_subexpr   lazy     82.440 ms   eager    273.835 ms        3.3x  (4-op subexpression shared by 8 results)
  recompute        lazy      0.004 ms   eager     92.874 ms    24135.6x  (second request for the same result)
  fastpath_filter  lazy     49.937 ms   eager     82.759 ms        1.7x  (predicate fast path vs mask + slice)
  straight_line    lazy     91.151 ms   eager     87.561 ms        1.0x  (caveat: single-shot pipeline, expect ~1x)

backend=cuda  lists=500,000  elements≈4,748,231  best of 5
  build            lazy      0.044 ms   eager      8.280 ms      189.1x  (graph construction vs full evaluation)
  branch_1of8      lazy      8.328 ms   eager     63.509 ms        7.6x  (only 1 of 8 pipelines materialized)
  shared_subexpr   lazy     13.843 ms   eager     43.700 ms        3.2x  (4-op subexpression shared by 8 results)
  recompute        lazy      0.005 ms   eager      8.076 ms     1661.8x  (second request for the same result)
  fastpath_filter  lazy      1.677 ms   eager      6.180 ms        3.7x  (predicate fast path vs mask + slice)
  straight_line    lazy      8.368 ms   eager      8.248 ms        1.0x  (caveat: single-shot pipeline, expect ~1x)

AI disclosure

Parts of this PR were developed with AI assistance (per CONTRIBUTING.md).

@github-actions github-actions Bot added the type/feat PR title type: feat (set automatically) label Jul 2, 2026
@codecov

codecov Bot commented Jul 2, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 75.91069% with 205 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.60%. Comparing base (e679c5f) to head (a149e9e).
⚠️ Report is 2 commits behind head on main.
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
src/awkward/_connect/cuda/helpers.py 57.37% 52 Missing ⚠️
src/awkward/_connect/lazy/_layout.py 49.36% 40 Missing ⚠️
src/awkward/_connect/cuda/_segment_algorithms.py 51.94% 37 Missing ⚠️
src/awkward/_connect/lazy/_lazy_impl.py 74.25% 26 Missing ⚠️
src/awkward/_connect/lazy/_ir.py 86.92% 17 Missing ⚠️
src/awkward/_connect/lazy/_executor.py 91.93% 10 Missing ⚠️
src/awkward/_connect/cuda/ir_nodes.py 82.85% 6 Missing ⚠️
src/awkward/_connect/lazy/core.py 91.04% 6 Missing ⚠️
src/awkward/_connect/cpu/helpers.py 92.15% 4 Missing ⚠️
src/awkward/_connect/cuda/_executor.py 0.00% 3 Missing ⚠️
... and 2 more

❌ Your patch check has failed because the patch coverage (75.91%) is below the target coverage (98.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
Files with missing lines Coverage Δ
src/awkward/_connect/cpu/__init__.py 100.00% <100.00%> (ø)
src/awkward/_connect/cpu/ir_nodes.py 100.00% <100.00%> (ø)
src/awkward/_connect/cuda/__init__.py 88.78% <100.00%> (+0.66%) ⬆️
src/awkward/_connect/cuda/_lazy_impl.py 100.00% <100.00%> (ø)
src/awkward/_connect/lazy/__init__.py 100.00% <100.00%> (ø)
src/awkward/__init__.py 97.61% <87.50%> (+0.47%) ⬆️
src/awkward/_connect/cuda/_executor.py 0.00% <0.00%> (ø)
src/awkward/_connect/cuda/_ir.py 0.00% <0.00%> (ø)
src/awkward/_connect/cpu/helpers.py 92.15% <92.15%> (ø)
src/awkward/_connect/cuda/ir_nodes.py 82.85% <82.85%> (ø)
... and 7 more

@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown

The documentation preview is ready to be viewed at http://preview.awkward-array.org.s3-website.us-east-1.amazonaws.com/PR4173

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

Labels

type/feat PR title type: feat (set automatically)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant