Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1d7c685
added requirements-tensorflow-tpu.txt and tpu configuration in .kokoro
kharshith-k Jun 16, 2025
19b5e6b
updated .kokoro/github/ubuntu/tpu/build.sh with jax and torch backend…
kharshith-k Jun 16, 2025
d203ca3
Merge branch 'keras-team:master' into tf-tpu
kharshith-k Jun 18, 2025
f45e5d0
Changed the tpu CI config files path to .github from .kokoro
kharshith-k Jun 18, 2025
6771cc0
Added new job in .github/workflows/actions.yml to run TPU tests
kharshith-k Jun 18, 2025
87d36e7
fixed runs-on option in acvtions.yml for tpu_build job to run on self…
kharshith-k Jun 18, 2025
9901298
Added another runner in the actions TPU job
kharshith-k Jun 18, 2025
be97210
Update continuous.cfg
kharshith-k Jun 18, 2025
a1cd5c3
Update presubmit.cfg
kharshith-k Jun 18, 2025
c5e3a5c
Merge branch 'keras-team:master' into tf-tpu
kharshith-k Jun 23, 2025
f0ab676
Update actions.yml
kharshith-k Jun 23, 2025
09161d7
Developed Dockerfile for TPU build job in actions.yml
kharshith-k Jun 24, 2025
9a3948f
Merge branch 'keras-team:master' into tf-tpu
kharshith-k Jun 24, 2025
058fdff
Update actions.yml
kharshith-k Jun 24, 2025
d47e39e
Included few more runners in tpu_build job
kharshith-k Jun 26, 2025
a6a59d7
Merge branch 'keras-team:master' into tf-tpu
kharshith-k Jun 26, 2025
ba4f6ae
Using linux-x86-ct6e-44-1tpu
kharshith-k Jun 26, 2025
a5a3624
Modified requirement-commmon.txt and updated requirements-tensorflow-…
kharshith-k Jun 30, 2025
b9998af
Added Dtypes_TPU_tests.py and requirements-jax-tpu.txt
kharshith-k Jul 22, 2025
f68be97
Progress bar now handles `steps_per_execution`. (#21422)
hertschuh Jun 26, 2025
1018abf
Fix symbolic call of `logsumexp` with int axis. (#21428)
hertschuh Jun 27, 2025
0da77e4
Only allow deserialization of `KerasSaveable`s by module and name. (#…
hertschuh Jun 29, 2025
cb639c5
commented tensorflow deps
kharshith-k Jul 2, 2025
c0d1743
Added log of dtypes_test_tpu.py and the test script for the same
kharshith-k Jul 2, 2025
306e6e7
modified dtypes_test_tpu.py as per pre-commit standards
kharshith-k Jul 2, 2025
4e584fc
Added TPU initiaization and teardown functionalities in conftest.py, …
kharshith-k Jul 3, 2025
bb09e95
Added dtypes_test_TPU.py and dtypes_new_test.py, modified conftest.py
kharshith-k Jul 9, 2025
8a63d09
Added Dcokerfile and tests list command
kharshith-k Jul 23, 2025
4651454
Updated Dockerfile
kharshith-k Jul 28, 2025
40af241
Restored Dockerfile to previous changes
kharshith-k Jul 28, 2025
64420d5
updated actions.yml file to install and configure docker engine on se…
kharshith-k Jul 28, 2025
da84de5
Merge branch 'keras-team:master' into tf-tpu
kharshith-k Jul 28, 2025
d69277d
updated actions.yml file to include container option
kharshith-k Jul 28, 2025
1c307fc
updated actions.yml file to include container option without volume b…
kharshith-k Jul 28, 2025
693886b
updated actions.yml file to change TPU
kharshith-k Jul 28, 2025
e74b851
Updated container path in build-and-test-on-tpu job
kharshith-k Jul 29, 2025
d31b3c4
seperated TPU workflow from actions.yml
kharshith-k Jul 29, 2025
a70d19e
updated trigger condition for TPU tests workflow
kharshith-k Jul 29, 2025
5f5b609
updated container usage configuration for TPU tests workflow
kharshith-k Jul 29, 2025
72e729f
updated env vars for TPU tests workflow
kharshith-k Jul 29, 2025
e129299
updated env vars parsing syntax in TPU tests workflow
kharshith-k Jul 29, 2025
3fe5b57
updated env vars syntax in TPU tests workflow
kharshith-k Jul 29, 2025
10df307
updated env vars syntax in TPU tests workflow
kharshith-k Jul 29, 2025
dd21e09
updated env vars syntax in TPU tests workflow
kharshith-k Jul 29, 2025
328628f
updated env vars syntax in TPU tests workflow
kharshith-k Jul 29, 2025
01f0c17
updated image name in TPU tests workflow
kharshith-k Jul 29, 2025
3e41c37
updated image name with generic ubuntu image
kharshith-k Jul 29, 2025
5e55c2c
updated tpu-tests to use ghcr
kharshith-k Jul 29, 2025
ea9ff88
updated tpu-tests to store built image as local tar
kharshith-k Jul 29, 2025
6d92aa9
updated image name from ubuntu:22.04 to docker:24.0-cli in tpu tests …
kharshith-k Jul 29, 2025
3c75bf8
updated image name from docker:24.0-cli to ubuntu:22.04 in tpu tests…
kharshith-k Jul 29, 2025
1589a75
added volume mount from host in load-and-test-job
kharshith-k Jul 29, 2025
36bd682
Merge branch 'keras-team:master' into tf-tpu
kharshith-k Jul 29, 2025
04112cf
Reverted tpu-tests.yml to version using ghcr.io for image storage
kharshith-k Jul 29, 2025
87d7ad8
Removed custom dtypes_test files for TPU testing and restored origina…
kharshith-k Aug 12, 2025
6cb097c
Updated tpu-tests.yml to pull image from GCP artifact registry
kharshith-k Aug 12, 2025
4829f1b
Resolved conflicts in actions.yml
kharshith-k Aug 12, 2025
a2eb306
Added a workflow to check service accounts associated with self hoste…
kharshith-k Aug 12, 2025
23579c4
Made find_sa.yml specific to linux-x86-ct6e-44-1tpu
kharshith-k Aug 12, 2025
dac6433
Added container tag to find_sa.yml
kharshith-k Aug 12, 2025
05461c1
Checking SA for linux-x86-ct5lp-112-4tpu
kharshith-k Aug 12, 2025
078dcee
Checking SA for linux-x86-ct6e-44-1tpu-nxgm7-runner-vb87c
kharshith-k Aug 12, 2025
016c68d
Using SA for auth in tpu-tests
kharshith-k Aug 12, 2025
02657f0
Updated SA with container tag for auth in tpu-tests
kharshith-k Aug 12, 2025
7167952
Added docker socket mount test
kharshith-k Aug 12, 2025
543cf65
Updated tpu-tests to just pull and test the image from artifact regis…
kharshith-k Aug 14, 2025
a2401c0
Added pytest command to the workflow
kharshith-k Aug 14, 2025
a98c748
added grain installation command
kharshith-k Aug 14, 2025
71c5b8b
Pruned unwanted files
kharshith-k Aug 19, 2025
5522a2b
included grain in requirements.txt
kharshith-k Aug 19, 2025
7173c6d
Updated tpu-tests.yml to use python image and explicitly install spec…
kharshith-k Aug 22, 2025
a7dc789
Renamed tpu-tests to tpu-tests-jax and logging TPU device kind
kharshith-k Aug 22, 2025
e509e6d
Added a step to check gcloud installation
kharshith-k Aug 22, 2025
a7ec63b
Running pytest on generic tpu workflow
kharshith-k Aug 25, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ jobs:
run: |
pip install -r requirements.txt --progress-bar off --upgrade
if [ "${{ matrix.nnx_enabled }}" == "true" ]; then
pip install --upgrade git+https://github.com/google/flax.git
pip install --upgrade flax>=0.11.1
fi
pip uninstall -y keras keras-nightly
pip install -e "." --progress-bar off --upgrade
Expand Down Expand Up @@ -147,4 +147,4 @@ jobs:
pip uninstall -y keras keras-nightly
pip install -e "." --progress-bar off --upgrade
- name: Run pre-commit
run: pre-commit run --all-files --hook-stage manual
run: pre-commit run --all-files --hook-stage manual
104 changes: 104 additions & 0 deletions .github/workflows/tpu-tests-jax.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
# name: TPU Tests

# on:
# push:
# branches: [ master ]
# pull_request:
# release:
# types: [created]

# # Only basic permissions are needed now.
# permissions:
# contents: read

# jobs:
# test-in-container:
# name: Test in Custom Container
# runs-on: linux-x86-ct6e-44-1tpu

# # With the correct IAM policies applied to the runner's underlying service accounts,
# # the runner can now pull this private image directly without any in-workflow auth.
# container:
# image: us-central1-docker.pkg.dev/gtech-rmi-dev/keras-docker-images/keras-jax-tpu-amd64:latest
# # Options are still needed for the container to access the host's TPU hardware.
# options: --privileged --network host

# steps:
# - name: Checkout Repository
# uses: actions/checkout@v4
# # This makes your code available inside the container's workspace.

# - name: Run Verification and Tests
# run: |
# echo "Successfully running inside the private container from GAR!"
# echo "Verifying JAX installation..."
# python3 -c "import jax; print(f'JAX backend: {jax.default_backend()}'); print(f'JAX devices: {jax.devices()}')"
# pip install grain
# pytest keras --ignore keras/src/applications \
# --ignore keras/src/layers/merging/merging_test.py \
# --ignore keras/src/trainers/data_adapters/py_dataset_adapter_test.py \
# --ignore keras/src/backend/jax/distribution_lib_test.py \
# --ignore keras/src/distribution/distribution_lib_test.py \
# --cov=keras \
# --cov-config=pyproject.toml



name: Keras Tests on TPU Runner using JAX Backend

on:
push:
branches: [ master ]
pull_request:
release:
types: [created]

# Only basic permissions are needed now.
permissions:
contents: read

jobs:
test-in-container:
name: Run Keras tests on TPU runner using JAX Backend
runs-on: linux-x86-ct6e-44-1tpu

container:
# The container image is now set to python:3.10-slim
image: python:3.10-slim
# Options are still needed for the container to access the host's TPU hardware.
options: --privileged --network host

steps:
- name: Checkout Repository
uses: actions/checkout@v4

- name: Install System Dependencies
run: |
apt-get update && apt-get install -y --no-install-recommends \
git \
sudo \
&& rm -rf /var/lib/apt/lists/*

- name: Install Dependencies
run: |
pip install --no-cache-dir -U pip setuptools && \
pip install --no-cache-dir -U psutil && \
pip install --no-cache-dir -r requirements-jax-tpu.txt && \
pip uninstall -y keras keras-nightly

- name: Set Keras Backend
run: echo "KERAS_BACKEND=jax" >> $GITHUB_ENV

- name: Run Verification and Tests
run: |
echo "Successfully running inside the public python container!"
echo "Verifying JAX installation..."
python3 -c "import jax; print(f'JAX backend: {jax.default_backend()}'); print(f'JAX devices: {jax.devices()[0].device_kind}')"

pytest keras --ignore keras/src/applications \
--ignore keras/src/layers/merging/merging_test.py \
--ignore keras/src/trainers/data_adapters/py_dataset_adapter_test.py \
--ignore keras/src/backend/jax/distribution_lib_test.py \
--ignore keras/src/distribution/distribution_lib_test.py \
--cov=keras \
--cov-config=pyproject.toml
28 changes: 28 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
FROM --platform=linux/amd64 python:3.10-slim

ENV KERAS_HOME=/github/workspace/.github/workflows/config/jax \
KERAS_BACKEND=jax

RUN apt-get update && apt-get install -y --no-install-recommends \
git \
sudo \
&& rm -rf /var/lib/apt/lists/*

# Copy the entire codebase into the container
COPY . /github/workspace
WORKDIR /github/workspace

# Create and activate venv, install pip/setuptools/psutil, then run tests
# RUN cd ./keras/src/github/keras && \
RUN pip install --no-cache-dir -U pip setuptools && \
pip install --no-cache-dir -U psutil && \
pip install --no-cache-dir -r requirements-jax-tpu.txt && \
pip uninstall -y keras keras-nightly
# python3 -c 'import jax;print(jax.__version__);print(jax.default_backend())' && \
# python3 -c 'import jax;assert jax.default_backend().lower() == "tpu"' && \
# pytest keras --ignore keras/src/applications \
# --ignore keras/src/layers/merging/merging_test.py \
# --cov=keras \
# --cov-config=pyproject.toml

CMD ["/bin/bash"]
2 changes: 1 addition & 1 deletion conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,4 +58,4 @@ def pytest_collection_modifyitems(config, items):


def skip_if_backend(given_backend, reason):
return pytest.mark.skipif(backend() == given_backend, reason=reason)
return pytest.mark.skipif(backend() == given_backend, reason=reason)
2 changes: 1 addition & 1 deletion keras/src/backend/common/dtypes_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,4 +245,4 @@ def test_invalid_float8_dtype(self):
with self.assertRaisesRegex(
ValueError, "There is no implicit conversions from float8 dtypes"
):
dtypes.result_type("float8_e5m2", "bfloat16")
dtypes.result_type("float8_e5m2", "bfloat16")
31 changes: 31 additions & 0 deletions requirements-common-jax-tpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
pre-commit
#namex>=0.0.8
ruff
pytest
#numpy
scipy
scikit-learn
pillow
pandas
#absl-py
#requests
#h5py
#ml-dtypes
#protobuf
tensorboard-plugin-profile
#rich
build
#optree
pytest-cov
#packaging
# for tree_test.py
dm_tree
coverage
# for onnx_test.py
onnxruntime
# TODO(https://github.com/keras-team/keras/issues/21390)
# > 0.3.1 breaks LSTM model export in torch backend.
onnxscript<=0.3.1
openvino
# for grain_dataset_adapter_test.py
grain
6 changes: 1 addition & 5 deletions requirements-common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,8 @@ pytest-cov
packaging
# for tree_test.py
dm_tree
coverage
coverage!=7.6.5 # 7.6.5 breaks CI
# for onnx_test.py
onnxruntime
# TODO(https://github.com/keras-team/keras/issues/21390)
# > 0.3.1 breaks LSTM model export in torch backend.
onnxscript<=0.3.1
openvino
# for grain_dataset_adapter_test.py
grain
14 changes: 14 additions & 0 deletions requirements-jax-tpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Tensorflow cpu-only version (needed for testing).
tensorflow-cpu~=2.18.1
tf2onnx

# Torch cpu-only version (needed for testing).
--extra-index-url https://download.pytorch.org/whl/cpu
torch==2.6.0

# Jax with cuda support.
--find-links https://storage.googleapis.com/jax-releases/libtpu_releases.html
jax[tpu]
flax

-r requirements-common-jax-tpu.txt
14 changes: 14 additions & 0 deletions requirements-tensorflow-tpu.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#tensorflow==2.18.0
#--find-links https://storage.googleapis.com/libtpu-tf-releases/index.html
#tensorflow-tpu==2.18.0

#tf2onnx

# Torch cpu-only version (needed for testing).
--extra-index-url https://download.pytorch.org/whl/cpu
torch==2.6.0

# Jax cpu-only version (needed for testing).
jax

-r requirements-common.txt
Loading