Skip to content

Batched Cholesky stats reduction bypassed on Metal without a diagnosis (_serial_cholesky_stats / _host_reduce_cholesky_info) #138

Open

Description

@claude

Found while working on: T31 (PR #136)

What: for uniform batches (nbatch > 1) on Metal, cholesky_stats! (src/numeric/factorize.jl) replaces the 256-work-item _cholesky_stats_kernel! reduction with a one-work-item-per-member serial kernel (_cholesky_stats_serial_kernel!), and _numeric_info! additionally copies all of N.info to the host and recomputes info[ns + 1] per member. The PR does not record why. If the shared @localmem reduction gives a wrong info[ns + 1] on Metal, it may be a latent kernel bug (e.g. a missing barrier hidden by CUDA/AMD warp execution) that affects other backends too; if it is a Metal compiler limit, it should be named. Both hooks may not be needed (the serial kernel already writes info[ns + 1]). The host reduction also copies (ns + 1) * nb Int32 per info read on Metal.

Why it is out of scope: needs Metal hardware to reproduce; no task in TASKS.md owns it.

Suggested fix or plan change: run the batched stats kernel on Metal with SDS_TEST_ONLY=test_ubatch and both hooks off, record the failure; fix the kernel if it is a race, otherwise keep one hook and name the limit.

Activity

  1. added
    found-by-agentOpened by an implementing agent for an out-of-scope finding
    on Oct 14, 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

    found-by-agentOpened by an implementing agent for an out-of-scope finding

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions