Skip to content

Preserve residual keyword arguments in fake_pmap - #484

Open
DiadkoShmek wants to merge 1 commit into
google-deepmind:mainfrom
DiadkoShmek:lezo3-fake-pmap-keywords
Open

DiadkoShmek wants to merge 1 commit into
google-deepmind:mainfrom
DiadkoShmek:lezo3-fake-pmap-keywords

Conversation

@DiadkoShmek

Copy link
Copy Markdown

chex.fake_pmap can drop keyword-only values, **kwargs and arguments after an omitted default. It binds the call but forwards only BoundArguments.args, so valid native-pmap calls either raise or silently use a default. In a two-replica SGD check, native pmap updates [2, -1] to [1.25, -1.375], while the base fake path silently leaves the parameters unchanged.

Forward both positional and residual keyword arguments. Retain kwargs through the static-argument wrapper and add the synthetic parallel axis to both argument trees. Public transform signatures are unchanged.

All 12 new regression cases fail on exact base and pass with the fix. The selected fake/variants suite passes 170 tests, including those regressions, on two CPU devices. A separate closed-form least-squares gradient/pmean check agrees with native pmap and fixed fake execution in eager/JIT modes. Independent checks also cover default gaps, static Python branches, None, trees/collectives, explicit axes, synthetic axes, native-invalid cases and context restoration.

Validation uses real CPU JAX package imports; no pmap/math stand-ins or GPU/distributed-performance claim. Nearby open out_axes/static-argument/input-axis proposals remain separate from this dropped-kwargs fix.

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