Skip to content
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

Patch for tfx 1.17 #7762

Open
wants to merge 28 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
89c7f2d
Update dependencies.py
vkarampudi Feb 3, 2025
bad38bc
Update ci-test.yml
vkarampudi Feb 3, 2025
4991644
Update pyproject.toml
vkarampudi Feb 3, 2025
56e1504
Update test_constraints.txt
vkarampudi Feb 3, 2025
7062586
Update nightly_test_constraints.txt
vkarampudi Feb 3, 2025
08826cf
Update test_constraints.txt
vkarampudi Feb 3, 2025
2affacc
Update nightly_test_constraints.txt
vkarampudi Feb 3, 2025
c262220
Update nightly_test_constraints.txt
vkarampudi Feb 3, 2025
2d519e9
Update test_constraints.txt
vkarampudi Feb 3, 2025
9ffd09c
Update dependencies.py
vkarampudi Feb 3, 2025
91a30fd
Update test_constraints.txt
vkarampudi Feb 3, 2025
a601b81
Update dependencies.py
vkarampudi Feb 18, 2025
3e8e3b1
Update dependencies.py
vkarampudi Feb 18, 2025
7f846c0
Update dependencies.py
vkarampudi Feb 18, 2025
6dbe680
Update dependencies.py
vkarampudi Feb 18, 2025
bca14a4
Update test_constraints.txt
vkarampudi Feb 18, 2025
d06e9a6
Update test_constraints.txt
vkarampudi Feb 18, 2025
9be632f
Update test_constraints.txt
vkarampudi Feb 19, 2025
ba29a35
Update test_constraints.txt
vkarampudi Feb 19, 2025
981adfc
Update tflite_rewriter_test.py
vkarampudi Feb 19, 2025
c40f94e
Update tflite_rewriter.py
vkarampudi Feb 19, 2025
767dfec
Update rewriter_factory.py
vkarampudi Feb 20, 2025
6baf1b4
Update rewriter_factory_test.py
vkarampudi Feb 20, 2025
0ef3f62
Update rewriter_factory.py
vkarampudi Feb 20, 2025
dc0a0d3
Fix not e2e test
nikelite Mar 19, 2025
95d49dc
fix test
nikelite Mar 19, 2025
57b66b3
test
nikelite Mar 19, 2025
8eb0c93
test
nikelite Mar 19, 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
2 changes: 1 addition & 1 deletion .github/workflows/ci-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:

strategy:
matrix:
python-version: ['3.9', '3.10']
python-version: ['3.9', '3.10', '3.11']
which-tests: ["not e2e", "e2e"]
dependency-selector: ["NIGHTLY", "DEFAULT"]

Expand Down
9 changes: 4 additions & 5 deletions nightly_test_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -168,9 +168,9 @@ jupyterlab_server==2.27.3
jupyterlab_widgets==1.1.10
tf-keras==2.16.0
keras-tuner==1.4.7
kfp==2.5.0
kfp-pipeline-spec==0.2.2
kfp-server-api==2.0.5
# kfp==2.5.0
# kfp-pipeline-spec==0.2.2
# kfp-server-api==2.0.5
kt-legacy==1.0.5
kubernetes==26.1.0
lazy-object-proxy==1.10.0
Expand Down Expand Up @@ -246,7 +246,6 @@ promise==2.3
prompt_toolkit==3.0.48
propcache==0.2.0
proto-plus==1.24.0
protobuf==3.20.3
psutil==6.0.0
ptyprocess==0.7.0
pyarrow-hotfix==0.6
Expand Down Expand Up @@ -315,7 +314,7 @@ tensorflow-decision-forests==1.9.2
tensorflow-estimator==2.15.0
tensorflow-hub==0.15.0
tensorflow-io==0.24.0
tensorflow-io-gcs-filesystem==0.24.0
# tensorflow-io-gcs-filesystem==0.24.0
tensorflow-metadata>=1.16.1
# tensorflow-ranking==0.5.5
tensorflow-serving-api==2.16.1
Expand Down
3 changes: 2 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ classifiers = [
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Scientific/Engineering",
"Topic :: Scientific/Engineering :: Artificial Intelligence",
Expand All @@ -31,7 +32,7 @@ classifiers = [
"Topic :: Software Development :: Libraries :: Python Modules"
]
keywords = ["tensorflow", "tfx"]
requires-python = ">=3.9,<3.11"
requires-python = ">=3.9,<3.12"
[project.urls]
Homepage = "https://www.tensorflow.org/tfx"
Repository = "https://github.com/tensorflow/tfx"
Expand Down
16 changes: 9 additions & 7 deletions test_constraints.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ greenlet==3.1.1
grpc-google-iam-v1==0.13.1
grpc-interceptor==0.15.4
grpcio==1.66.2
grpcio-status==1.48.2
# grpcio-status==1.70.0
gunicorn==23.0.0
h11==0.14.0
h5py==3.12.1
Expand Down Expand Up @@ -168,9 +168,12 @@ jupyterlab_server==2.27.3
jupyterlab_widgets==1.1.10
tf-keras==2.16.0
keras-tuner==1.4.7
kfp==2.5.0
kfp-pipeline-spec==0.2.2
kfp-server-api==2.0.5
# kfp==2.11.0; python_version == "3.11"
# kfp==2.5.0; python_version == "3.10"
# kfp-pipeline-spec==0.6.0; python_version == "3.11"
# kfp-pipeline-spec==0.22.0; python_version == "3.10"
# kfp-server-api==2.3.0; python_version == "3.11"
# kfp-server-api==2.0.5; python_version == "3.10"
kt-legacy==1.0.5
kubernetes==26.1.0
lazy-object-proxy==1.10.0
Expand Down Expand Up @@ -246,7 +249,6 @@ promise==2.3
prompt_toolkit==3.0.48
propcache==0.2.0
proto-plus==1.24.0
protobuf==3.20.3
psutil==6.0.0
ptyprocess==0.7.0
pyarrow-hotfix==0.6
Expand Down Expand Up @@ -315,7 +317,7 @@ tensorflow-decision-forests==1.9.2
tensorflow-estimator==2.15.0
tensorflow-hub==0.15.0
tensorflow-io==0.24.0
tensorflow-io-gcs-filesystem==0.24.0
# tensorflow-io-gcs-filesystem==0.37.1
tensorflow-metadata>=1.16.1
# tensorflow-ranking==0.5.5
tensorflow-serving-api==2.16.1
Expand All @@ -327,7 +329,7 @@ tensorstore==0.1.66
termcolor==2.5.0
terminado==0.18.1
text-unidecode==1.3
tflite-support==0.4.4
# tflite-support==0.4.4
tfx-bsl>=1.16.1
threadpoolctl==3.5.0
time-machine==2.16.0
Expand Down
4 changes: 2 additions & 2 deletions tfx/components/infra_validator/request_builder_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -440,7 +440,7 @@ def setUp(self):
def _PrepareTFServingRequestBuilder(self):
patcher = mock.patch.object(
request_builder, '_TFServingRpcRequestBuilder',
wraps=request_builder._TFServingRpcRequestBuilder)
autospec=True)
builder_cls = patcher.start()
self.addCleanup(patcher.stop)
return builder_cls
Expand All @@ -466,7 +466,7 @@ def testBuildRequests_TFServing(self):
model_name='foo',
signatures={'serving_default': mock.ANY})
builder.ReadExamplesArtifact.assert_called_with(
self._examples,
examples=self._examples,
split_name='eval',
num_examples=1)
builder.BuildRequests.assert_called()
Expand Down
24 changes: 12 additions & 12 deletions tfx/components/trainer/rewriting/rewriter_factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@

from tfx.components.trainer.rewriting import rewriter

TFLITE_REWRITER = 'TFLiteRewriter'
# TFLITE_REWRITER = 'TFLiteRewriter'
TFJS_REWRITER = 'TFJSRewriter'


def _load_tflite_rewriter():
importlib.import_module('tfx.components.trainer.rewriting.tflite_rewriter')
# def _load_tflite_rewriter():
# importlib.import_module('tfx.components.trainer.rewriting.tflite_rewriter')


def _load_tfjs_rewriter():
Expand All @@ -43,7 +43,7 @@ def _load_tfjs_rewriter():
class _RewriterFactory:
"""Factory class for rewriters."""
_LOADERS = {
TFLITE_REWRITER.lower(): _load_tflite_rewriter,
# TFLITE_REWRITER.lower(): _load_tflite_rewriter,
TFJS_REWRITER.lower(): _load_tfjs_rewriter,
}
_loaded = set()
Expand All @@ -55,14 +55,14 @@ def _maybe_load_public_rewriter(cls, lower_rewriter_type: str):
cls._LOADERS[lower_rewriter_type]()
cls._loaded.add(lower_rewriter_type)

@classmethod
def get_rewriter_cls(cls, rewriter_type: str):
rewriter_type = rewriter_type.lower()
cls._maybe_load_public_rewriter(rewriter_type)
for subcls in rewriter.BaseRewriter.__subclasses__():
if subcls.__name__.lower() == rewriter_type:
return subcls
raise ValueError('Failed to find rewriter: {}'.format(rewriter_type))
# @classmethod
# def get_rewriter_cls(cls, rewriter_type: str):
# rewriter_type = rewriter_type.lower()
# cls._maybe_load_public_rewriter(rewriter_type)
# for subcls in rewriter.BaseRewriter.__subclasses__():
# if subcls.__name__.lower() == rewriter_type:
# return subcls
# raise ValueError('Failed to find rewriter: {}'.format(rewriter_type))


def create_rewriter(rewriter_type: str, *args,
Expand Down
14 changes: 7 additions & 7 deletions tfx/components/trainer/rewriting/rewriter_factory_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,13 @@ def _tfjs_installed():

class RewriterFactoryTest(parameterized.TestCase):

@parameterized.named_parameters(
('TFLite', rewriter_factory.TFLITE_REWRITER))
def testRewriterFactorySuccessfullyCreated(self, rewriter_name):
tfrw = rewriter_factory.create_rewriter(rewriter_name, name='my_rewriter')
self.assertTrue(tfrw)
self.assertEqual(type(tfrw).__name__, rewriter_name)
self.assertEqual(tfrw.name, 'my_rewriter')
# @parameterized.named_parameters(
# ('TFLite', rewriter_factory.TFLITE_REWRITER))
# def testRewriterFactorySuccessfullyCreated(self, rewriter_name):
# tfrw = rewriter_factory.create_rewriter(rewriter_name, name='my_rewriter')
# self.assertTrue(tfrw)
# self.assertEqual(type(tfrw).__name__, rewriter_name)
# self.assertEqual(tfrw.name, 'my_rewriter')

@unittest.skipUnless(_tfjs_installed(), 'tensorflowjs is not installed')
def testRewriterFactorySuccessfullyCreatedTFJSRewriter(self):
Expand Down
Loading
Loading