Skip to content

Fix implicit product scans on GPU-backed DArrays - #860

Merged
jpsamaroo merged 2 commits into
masterfrom
jps/fix-gpu-product-scans
Dec 2, 2026
Merged

jpsamaroo merged 2 commits into
masterfrom
jps/fix-gpu-product-scans

Conversation

@jpsamaroo

Copy link
Copy Markdown
Member

GPU-backed cumprod currently scans each partition through generic accumulate(Base.mul_prod, ...). AMDGPU and oneAPI default that operation to a zero initializer, which zeros the products. Use the backend's native cumprod for partitions without an explicit initializer, retaining first-part initialization, carry combination and small-integer promotion.

Adds GPU coverage for both axes and explicit product initialization, plus CPU promotion regressions.

Validation:

  • Matched ROCm and oneAPI DArray controls: master passes 12 type checks but fails all 12 numerical checks; the candidate passes all 24 checks on each backend.
  • CPU: 492 registered mapreduce assertions and 76 additional semantic checks pass, covering promotion, explicit init, empty arrays, nonfinite values and dimensions beyond rank.
  • Ten warm batches and five GC samples: 1,000 implicit CPU helper calls decrease from 1,424,000 bytes / 25,000 allocations to 240,000 / 8,000. Explicit-init allocation counts are unchanged. These are scoped helper measurements, not whole-task or GPU throughput results.
  • Independent non-author source and proof audit completed before publication. Full hosted CI remains pending.

The oneAPI registered accumulate block passes 8/8 on the Arc Pro B60, including real Float64 widening. An additional Float64 scan mismatch observed on master is under separate investigation; the passing candidate run does not establish a fix for it. Generic operator initialization and vendor queue/residency issues remain separate from this product repair.

AMDGPU and oneAPI's generic accumulate defaults to zero, so lowering
cumprod to accumulate(Base.mul_prod) zeroes each partition. Dispatch
implicit product partitions through the backend's native cumprod while
retaining explicit initialization on the first partition and the existing
carry combination. Generic * keeps its distinct promotion behavior.

Add both-axis GPU and small-integer/init CPU regressions. On the pinned
Julia 1.11.9 / AMDGPU 2.1.0 environment, the same DArray checks go from
12 type passes plus 12 numerical failures to 24 passes. Registered CPU
mapreduce passes 492 assertions, with 76 additional helper boundary checks.

After 10 warm batches and five GC-counter samples, minimum allocations for
1,000 CPU helper calls fall from 1,424,000 bytes / 25,000 allocations to
240,000 / 8,000 on the implicit path. The explicit-init control is unchanged
at 1,504,016 bytes / 28,001 allocations. These are scoped helper controls,
not whole-task or GPU throughput measurements; hosted CI is not yet run.

Written by an AI agent on jpsamaroo's review feedback.
@jpsamaroo
jpsamaroo merged commit a7d911c into master Dec 2, 2026
4 of 7 checks passed
@jpsamaroo
jpsamaroo deleted the jps/fix-gpu-product-scans branch December 2, 2026 03:23
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

Successfully merging this pull request may close these issues.

1 participant