Skip to content

update python to 3.10 and Keras minimum version to 3.8 #2292

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

sachinprasadhs
Copy link
Collaborator

@sachinprasadhs sachinprasadhs commented Jun 6, 2025

Description of the change

  • Updated python version from 3.9 to 3.10
  • Updated Keras version from 3.5 to 3.6, since couple of models use dot_product_attention, which was introduced in keras from 3.6 version.
  • Updated stale script to run only on main repo and skip forked repo and added operations-per-run to cover all the issues and PRs.

Reference

Colab Notebook

Checklist

  • I have added all the necessary unit tests for my change.
  • I have verified that my change does not break existing code and works with all backends (TensorFlow, JAX, and PyTorch).
  • My PR is based on the latest changes of the main branch (if unsure, rebase the code).
  • I have followed the Keras Hub Model contribution guidelines in making these changes.
  • I have followed the Keras Hub API design guidelines in making these changes.
  • I have signed the Contributor License Agreement.

@sachinprasadhs sachinprasadhs added the kokoro:force-run Runs Tests on GPU label Jun 11, 2025
@kokoro-team kokoro-team removed the kokoro:force-run Runs Tests on GPU label Jun 11, 2025
Copy link
Member

@mattdangerw mattdangerw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@@ -20,18 +20,18 @@ jobs:
version: [keras-stable]
include:
- backend: jax
version: keras-3.5
version: keras-3.6
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the oldest version of keras we support. i think it's to bump to up to 3.8 if we want, that version is preinstalled in colab, but whatever we do here we should also reflect in our minimum pip package requirement https://github.com/keras-team/keras-hub/blob/master/pyproject.toml#L30

also, we should do a search over the repo and remove any workarounds we had for keras 3.5 or earlier, like

in short, we should always test against the oldest version of keras we want to support, whatever that is

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sachinprasadhs did you see this comment? Are you still working on this?

Any change to testing should go with bumping the actual minimal version in pyproject.toml and removing old workarounds. Maybe let's try bumping to 3.8 and changing that stuff.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have updated the Keras version to 3.8, but JAX backend is constantly failing with same error, do we have to pin JAX version as well?

Copy link
Collaborator Author

@sachinprasadhs sachinprasadhs Jul 16, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess jax.spmd_mode was deprecated in recent JAX versions and we have it removed in Keras as well from 3.10 version keras-team/keras#21164

@sachinprasadhs sachinprasadhs changed the title update python to 3.10 and Keras to 3.6 update python to 3.10 and Keras minimum version to 3.8 Jul 18, 2025
@sachinprasadhs
Copy link
Collaborator Author

@james77777778 , Could you please check and validate the failing cases with JAX and it's failing for now stable diffusion 3 cases.
Is it something related to Python 3.10 with JAX or SD3?

@james77777778
Copy link
Collaborator

@james77777778 , Could you please check and validate the failing cases with JAX and it's failing for now stable diffusion 3 cases. Is it something related to Python 3.10 with JAX or SD3?

This PR should fix the issue.
#2338

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.

4 participants