Skip to content

Commit

Permalink
internal
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 728276097
  • Loading branch information
qdhack authored and Orbax Authors committed Feb 21, 2025
1 parent 7ddcff2 commit 0b4bbd1
Show file tree
Hide file tree
Showing 8 changed files with 43 additions and 6 deletions.
15 changes: 14 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -172,12 +172,25 @@ jobs:
sudo apt-get update
sudo apt-get install -y protobuf-compiler
pip install .
pip install tensorflow
protoc -I=. --python_out=. $(find orbax/experimental/model/ -name "*.proto")
pip install -e .
pip install .[testing] -f https://storage.googleapis.com/jax-releases/libtpu_releases.html
if [[ "${{ matrix.jax-version }}" == "newest" ]]; then
pip install -U jax jaxlib
elif [[ "${{ matrix.jax-version }}" == "nightly" ]]; then
pip install -U --pre jax jaxlib -f https://storage.googleapis.com/jax-releases/jax_nightly_releases.html
else
pip install "jax==${{ matrix.jax-version }}" "jaxlib==${{ matrix.jax-version }}"
fi
- name: Test with pytest
run: |
pytest orbax/experimental/model/core/python/*_test.py
echo "!!! done testing orbax/experimental/model/core/python/*_test.py \n"
pytest orbax/experimental/model/tf2obm/*_test.py
echo "!!! done testing orbax/experimental/model/tf2obm/*_test.py \n"
pytest orbax/experimental/model/jax2obm/*_test.py
echo "!!! done testing orbax/experimental/model/jax2obm/*_test.py \n"
23 changes: 23 additions & 0 deletions model/orbax/experimental/model/conftest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Copyright 2024 The Orbax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""pytest config."""

from typing import Any
from absl import flags


def pytest_configure(config: Any) -> None:
del config
flags.FLAGS.mark_as_parsed()
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from orbax.experimental.model.core.python.saved_model_proto import node_builder
from orbax.experimental.model.core.python.saved_model_proto import nodes

from .net.proto2.contrib.pyutil import compare
from tensorflow.python.util.protobuf import compare
from absl.testing import absltest

Node = nodes.Node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from orbax.experimental.model import core as obm
from orbax.experimental.model.jax2obm import jax_specific_info
from orbax.experimental.model.jax2obm import jax_supplemental_pb2
from .net.proto2.contrib.pyutil import compare
from tensorflow.python.util.protobuf import compare
from google.protobuf import text_format
from absl.testing import absltest

Expand Down
2 changes: 1 addition & 1 deletion model/orbax/experimental/model/jax2obm/main_lib_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
from orbax.experimental.model.jax2obm import jax_supplemental_pb2
from orbax.experimental.model.jax2obm import main_lib

from .net.proto2.contrib.pyutil import compare
from tensorflow.python.util.protobuf import compare
from google.protobuf import text_format
from absl.testing import absltest

Expand Down
2 changes: 1 addition & 1 deletion model/orbax/experimental/model/jax2obm/sharding_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import numpy as np
from orbax.experimental.model import core as obm
from orbax.experimental.model.jax2obm import sharding
from .net.proto2.contrib.pyutil import compare
from tensorflow.python.util.protobuf import compare
from google.protobuf import text_format
from absl.testing import absltest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
from orbax.experimental.model.tf2obm.tf_concrete_functions_to_obm import TF_SAVED_MODEL_SUPPLEMENTAL_NAME
import tensorflow as tf

from .net.proto2.contrib.pyutil import compare
from tensorflow.python.util.protobuf import compare
from google.protobuf import text_format
from absl.testing import absltest

Expand Down
1 change: 1 addition & 0 deletions model/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,4 +46,5 @@ all = [

testing = [
'pytest',
'flax',
]

0 comments on commit 0b4bbd1

Please sign in to comment.