Skip to content

Conversation

@akramcodez
Copy link

Respect hyperparam_dtype in inject_hyperparams.

If hyperparam_dtype is not provided, injected hyperparameters now default to jnp.float32 rather than inheriting dtypes from parameters/updates. Explicit hyperparam_dtype values continue to be honored. This avoids accidental low-precision hyperparameters (e.g., bfloat16) while preserving explicit control.

  • Files: _inject.py
  • Tests: Local suite passed + targeted schedule tests passed. Also verified via small reproducer: default → float32; explicit hyperparam_dtype=jnp.bfloat16 → bfloat16.
  • Note: A unit test for default dtype is prepared but omitted per instruction; can include if requested.

Fixes: #1414

@google-cla
Copy link

google-cla bot commented Oct 25, 2025

Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

View this failed invocation of the CLA check for more information.

For the most up to date status, view the checks section at the bottom of the pull request.

@akramcodez
Copy link
Author

PTAL @sizhit2

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.

Honor the dtype in the function signature in inject_hyperparams.

1 participant