Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

`SA` kernel fails for chain method `vectorized`

Open
#2,391 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

@tandede is already working on this.

Since Oct 27, 2026.

  • #2393 by @tandede — open

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
65/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
python

Research direction

Start by tracing SA through NumPyro's MCMC chain handling for chain_method="vectorized", then compare the failing minimal example with the sequential and parallel cases. Run the reproduction with two scalar chains and confirm the vectorized run completes without the reported vmap rank error.

Written by the indexing model from the issue text.

Description

bug
Bug Description

Sampling with the SA kernel with chain_method="vectorized" leads to a crash in most cases.

Steps to Reproduce

Minimal example:

import jax
import numpyro
import numpyro.distributions as dist
from numpyro.infer import MCMC, SA

def model():
    numpyro.sample("x", dist.Normal(0, 1))

mcmc = MCMC(
    SA(model),
    num_warmup=100,
    num_samples=100,
    num_chains=2,
    chain_method="vectorized",
)

mcmc.run(jax.random.key(0))

This raises

ValueError: vmap was requested to map its argument along axis 0, which implies that its rank should be at least 1, but is only 0 (its shape is ())

This problem doesn't occur for chain method sequential or parallel or if the dimension of x coincides with num_chains.

Versions

numpyro 1e42fd58e5d6d60f8a767915c524edb787f2e81b
jax 0.10.2

Expected Behavior

The sampler to run without crashing.

Dominant language
Python
Stars
2.8k
Forks
338
Avg merge
2d 8h
Merged PRs (30d)
67

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from pyro-ppl/numpyro

All issues in pyro-ppl/numpyro

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.