Skip to content

Commit

Permalink
Add pip requirements for end2end test
Browse files Browse the repository at this point in the history
  • Loading branch information
Tombana committed Jun 16, 2024
1 parent 76ef9b6 commit 7d9a935
Show file tree
Hide file tree
Showing 4 changed files with 86 additions and 9 deletions.
5 changes: 4 additions & 1 deletion larq_compute_engine/mlir/BUILD
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@llvm-project//mlir:tblgen.bzl", "gentbl_cc_library", "td_library")
load("@org_tensorflow//tensorflow:tensorflow.bzl", "pybind_extension", "tf_cc_binary")
load("@pypi_lce//:requirements.bzl", lce_requirement = "requirement")

package(
default_visibility = ["//visibility:public"],
Expand Down Expand Up @@ -486,13 +487,13 @@ cc_library(
"@llvm-project//llvm:Support",
"@llvm-project//mlir:IR",
"@llvm-project//mlir:Pass",
"@local_tsl//tsl/platform:statusor",
"@org_tensorflow//tensorflow/compiler/mlir:op_or_arg_name_mapper",
"@org_tensorflow//tensorflow/compiler/mlir/lite:flatbuffer_export",
"@org_tensorflow//tensorflow/compiler/mlir/lite/metrics:error_collector",
"@org_tensorflow//tensorflow/compiler/mlir/lite/quantization:quantization_config",
"@org_tensorflow//tensorflow/compiler/mlir/tensorflow:error_util",
"@org_tensorflow//tensorflow/compiler/mlir/tensorflow/transforms:tf_saved_model_freeze_variables",
"@local_tsl//tsl/platform:statusor",
],
)

Expand Down Expand Up @@ -557,6 +558,8 @@ py_library(
],
deps = [
":_tf_tfl_flatbuffer",
lce_requirement("tensorflow-cpu"),
lce_requirement("flatbuffers"),
],
)

Expand Down
3 changes: 3 additions & 0 deletions larq_compute_engine/requirements.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
tensorflow-cpu
tensorflow-datasets
larq
tqdm
pytest
googleapis-common-protos<2,>=1.52.0 # dependency of tensorflow-datasets, somehow not picked up by pip-compile
76 changes: 70 additions & 6 deletions larq_compute_engine/requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,47 @@
# This file is autogenerated by pip-compile with Python 3.10
# by the following command:
#
# pip-compile --allow-unsafe --no-emit-index-url larq_compute_engine/requirements.in
# pip-compile --allow-unsafe --no-emit-index-url --strip-extras larq_compute_engine/requirements.in
#
absl-py==2.1.0
# via
# array-record
# etils
# keras
# tensorboard
# tensorflow-cpu
# tensorflow-datasets
# tensorflow-metadata
array-record==0.5.1
# via tensorflow-datasets
astunparse==1.6.3
# via tensorflow-cpu
certifi==2024.6.2
# via requests
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via tensorflow-datasets
dm-tree==0.1.8
# via tensorflow-datasets
docstring-parser==0.16
# via simple-parsing
etils==1.7.0
# via
# array-record
# tensorflow-datasets
exceptiongroup==1.2.1
# via pytest
flatbuffers==24.3.25
# via tensorflow-cpu
fsspec==2024.6.0
# via etils
gast==0.5.4
# via tensorflow-cpu
google-pasta==0.2.0
# via tensorflow-cpu
googleapis-common-protos==1.63.1
# via -r larq_compute_engine/requirements.in
grpcio==1.64.1
# via
# tensorboard
Expand All @@ -33,10 +53,16 @@ h5py==3.11.0
# tensorflow-cpu
idna==3.7
# via requests
immutabledict==4.2.0
# via tensorflow-datasets
importlib-resources==6.4.0
# via etils
iniconfig==2.0.0
# via pytest
keras==3.3.3
# via tensorflow-cpu
larq==0.13.3
# via -r larq_compute_engine/requirements.in
libclang==18.1.1
# via tensorflow-cpu
markdown==3.6
Expand All @@ -55,38 +81,57 @@ namex==0.0.8
# via keras
numpy==1.26.4
# via
# etils
# h5py
# keras
# larq
# ml-dtypes
# opt-einsum
# pyarrow
# tensorboard
# tensorflow-cpu
# tensorflow-datasets
opt-einsum==3.3.0
# via tensorflow-cpu
optree==0.11.0
# via keras
packaging==24.1
# via
# larq
# pytest
# tensorflow-cpu
pluggy==1.5.0
# via pytest
protobuf==4.25.3
promise==2.3
# via tensorflow-datasets
protobuf==3.20.3
# via
# googleapis-common-protos
# tensorboard
# tensorflow-cpu
# tensorflow-datasets
# tensorflow-metadata
psutil==5.9.8
# via tensorflow-datasets
pyarrow==16.1.0
# via tensorflow-datasets
pygments==2.18.0
# via rich
pytest==8.2.2
# via -r larq_compute_engine/requirements.in
requests==2.32.3
# via tensorflow-cpu
# via
# tensorflow-cpu
# tensorflow-datasets
rich==13.7.1
# via keras
simple-parsing==0.1.5
# via tensorflow-datasets
six==1.16.0
# via
# astunparse
# google-pasta
# promise
# tensorboard
# tensorflow-cpu
tensorboard==2.16.2
Expand All @@ -95,17 +140,32 @@ tensorboard-data-server==0.7.2
# via tensorboard
tensorflow-cpu==2.16.1
# via -r larq_compute_engine/requirements.in
tensorflow-datasets==4.9.6
# via -r larq_compute_engine/requirements.in
tensorflow-io-gcs-filesystem==0.37.0
# via tensorflow-cpu
tensorflow-metadata==1.15.0
# via tensorflow-datasets
termcolor==2.4.0
# via tensorflow-cpu
# via
# tensorflow-cpu
# tensorflow-datasets
terminaltables==3.1.10
# via larq
toml==0.10.2
# via tensorflow-datasets
tomli==2.0.1
# via pytest
tqdm==4.66.4
# via -r larq_compute_engine/requirements.in
# via
# -r larq_compute_engine/requirements.in
# etils
# tensorflow-datasets
typing-extensions==4.12.2
# via
# etils
# optree
# simple-parsing
# tensorflow-cpu
urllib3==2.2.1
# via requests
Expand All @@ -114,7 +174,11 @@ werkzeug==3.0.3
wheel==0.43.0
# via astunparse
wrapt==1.16.0
# via tensorflow-cpu
# via
# tensorflow-cpu
# tensorflow-datasets
zipp==3.19.2
# via etils

# The following packages are considered to be unsafe in a requirements file:
setuptools==70.0.0
Expand Down
11 changes: 9 additions & 2 deletions larq_compute_engine/tests/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
load("@pypi//:requirements.bzl", tf_requirement = "requirement")
load("@pypi_lce//:requirements.bzl", lce_requirement = "requirement")
load("//larq_compute_engine/tests:qemu_test.bzl", "lce_qemu_test_suite")

package(
default_visibility = ["//visibility:public"],
licenses = ["notice"], # Apache 2.0
Expand All @@ -8,15 +12,18 @@ exports_files([
"test_aarch64_binary.sh",
])

load("//larq_compute_engine/tests:qemu_test.bzl", "lce_qemu_test_suite")

py_test(
name = "end2end_test",
size = "large",
srcs = ["end2end_test.py"],
deps = [
"//larq_compute_engine/mlir:converter",
"//larq_compute_engine/tflite/python:interpreter",
tf_requirement("numpy"),
lce_requirement("larq"),
lce_requirement("pytest"),
lce_requirement("tensorflow-cpu"),
lce_requirement("tensorflow_datasets"),
],
)

Expand Down

0 comments on commit 7d9a935

Please sign in to comment.