├── .DS_Store ├── .github └── ISSUE_TEMPLATE │ └── custom.md ├── CODEOWNERS ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE ├── MEETINGS.md ├── README.md ├── governance ├── SIG-charter-template.md ├── SIG-readme-template.md ├── SIG-request-template.md ├── SIGS.md ├── TF-RFCs.md ├── api-reviews.md ├── code-and-collaboration.md ├── cpp-style.md ├── design-reviews.md └── rfc-admin-guide.md ├── rfcs ├── .DS_Store ├── 20180501-estimator-head.md ├── 20180507-cond-v2.md ├── 20180604-dynamic-kernels.md ├── 20180626-tensor-forest.md ├── 20180726-tf-data-windowing-reducers.md ├── 20180731-dockerfile-assembler.md ├── 20180817-variables-20.md ├── 20180821-differentiable-functional-while.md ├── 20180821-differentiable-functional-while │ ├── while_body.png │ ├── while_cond.png │ ├── while_v1.png │ └── while_v2.png ├── 20180824-tf-print-v2.md ├── 20180827-api-names.md ├── 20180905-deprecate-collections.md ├── 20180907-contrib-sunset.md ├── 20180918-functions-not-sessions-20.md ├── 20180920-unify-rnn-interface.md ├── 20181016-optimizer-unification.md ├── 20181016-replicator.md ├── 20181025-tf-integration-testing.md ├── 20181026-tf-nightly.md ├── 20181116-saved-model.md ├── 20181214-move-to-addons.md ├── 20181217-tf2-random-numbers.md ├── 20181225-tf-raw-ops.md ├── 20190115-dense-attention.md ├── 20190116-embedding-partitioned-variable.md ├── 20190117-tf-module.md ├── 20190208-pybind11.md ├── 20190225-tf-on-demand.md ├── 20190305-modular-tensorflow.md ├── 20190305-modular-tensorflow │ ├── api_picture.png │ ├── big_picture.png │ ├── cpp_module.png │ ├── initial_tf_deps.png │ ├── py_modules.png │ ├── releases.png │ └── simple_package_deps.png ├── 20190308-addons-proxy-maintainership.md ├── 20190315-tflite-control-flow.md ├── 20190315-tflite-control-flow │ ├── if_model.png │ └── while_buffer.png ├── 20190411-string-unification.md ├── 20190411-string-unification │ └── tstring_layout.png ├── 20190411-tensorboard-improved-plugin-ext.md ├── 20190425-keras-premade-models.md ├── 20190430-tokenization-conventions.md ├── 20190501-tf-tensor-cord.md ├── 20190506-filesystem-plugin-modular-tensorflow.md ├── 20190506-filesystem-plugin-modular-tensorflow │ ├── big_picture.png │ ├── env.png │ ├── existing_filesystem_review.md │ └── filesystem.png ├── 20190509-keras-saved-model.md ├── 20190610-resource-variable-semantics.md ├── 20190610-resource-variable-semantics │ ├── load_store_reordering.png │ ├── resource_update_operations.png │ └── simplest_non_trival_example.png ├── 20190610-standardizing-composite_ops.md ├── 20190612-mlir-dialect.md ├── 20190630-tfx-on-kfp.md ├── 20190630-tfx-on-kfp │ ├── tfx-kfp-argo-workflow.png │ ├── tfx-kfp-containers.png │ ├── tfx-kfp-ui.png │ ├── tfx-on-kubeflow.png │ └── tfx-oss-xcom-passing.png ├── 20190718-tfx-orchestration.md ├── 20190718-tfx-orchestration │ ├── tfx-oss-architecture.gif │ ├── tfx-oss-component.gif │ └── tfx-oss-dag.png ├── 20190722-tflite-training.md ├── 20190722-tflite-training │ ├── roadmap.png │ ├── trans1.png │ └── trans2.png ├── 20190726-custom-ops.md ├── 20190802-model-garden-redesign.md ├── 20190814-kernel-and-op-registration.md ├── 20190814-kernel-and-op-registration │ └── device_api_overview.png ├── 20190815-tfdbg-v2-callbacks.md ├── 20190815-tfdbg-v2-callbacks │ └── graph-instrumentation.png ├── 20190815-tfx-notebook.md ├── 20190816-tf-project-versioning.md ├── 20190821-nodejs-saved-model.md ├── 20190828-tfx-resolver.md ├── 20190829-tfx-container-component-execution.md ├── 20190829-tfx-container-component-execution │ ├── tfx-container-execution-classes.png │ ├── tfx-k8s-container-execution.png │ └── tfx-local-container-execution.png ├── 20190904-tfx-generic-container-based-component.md ├── 20190910-struct-tensor.md ├── 20190910-struct-tensor │ ├── arrow_example_1.png │ ├── arrow_example_2.png │ ├── feature_extraction_in_model.png │ ├── integration_with_other_formats.png │ ├── pydict_to_struct_tensor.png │ ├── python_vs_struct_tensor_encoding.png │ ├── recipe_schema.png │ └── struct_5.png ├── 20191016-dlpack-support.md ├── 20191017-tfx-standardized-inputs.md ├── 20191017-tfx-standardized-inputs │ ├── double-translation.png │ ├── impl_tfxio.png │ ├── oss_lib_org.png │ └── overview.png ├── 20191106-tf2-tpu-savedmodel.md ├── 20191106-tf2-tpu-savedmodel │ ├── cpu_graph.png │ ├── customized_embeddings.png │ ├── tpu_graph.png │ └── tpu_result.png ├── 20191127-pip-structure.md ├── 20191127-pip-structure │ ├── circular_dependency.png │ ├── current_structure.png │ ├── modular_structure.png │ └── new_modular_structure.png ├── 20191203-single-eager-graph-path.md ├── 20191203-single-eager-graph-path │ └── 20191203-func-graph-cujs.md ├── 20191206-tensorflow-lattice-v2.md ├── 20191206-tensorflow-lattice-v2 │ ├── calib.png │ ├── cat.png │ ├── graph.png │ ├── lattice.png │ └── pwl.png ├── 20191212-keras-categorical-inputs.md ├── 20200107-tf-data-snapshot.md ├── 20200113-tf-data-service.md ├── 20200117-tfx-combining-model-validator-with-evaluator.md ├── 20200117-tfx-combining-model-validator-with-evaluator │ ├── before-after.png │ ├── change-CI-threshold-a.png │ ├── change-CI-threshold-b.png │ ├── value-CI-threshold-a.png │ └── value-CI-threshold-b.png ├── 20200117-tfx-generic-trainer.md ├── 20200205-standalone-keras-repository.md ├── 20200211-tf-types.md ├── 20200218-tf-c-saved-model.md ├── 20200218-tf-c-saved-model │ └── saved_model_diagram.png ├── 20200306-single-client-parameter-server.md ├── 20200306-single-client-parameter-server │ └── rebuild_arbitrary_future.png ├── 20200411-fuse_recv.md ├── 20200411-fuse_recv │ ├── current_graph_partition_strategy.png │ ├── fuse_recv_procedure.png │ ├── graph_partition_strategy_with_fuse_recv.png │ └── performance_result.png ├── 20200420-tfx-tuner-component.md ├── 20200420-tfx-tuner-component │ ├── cloud.png │ ├── parallel_tuning.png │ └── workflow.png ├── 20200505-transactional-fs.md ├── 20200511-tensorflow-on-directml.md ├── 20200511-tensorflow-on-directml │ └── kernel_migration.png ├── 20200519-csr-sparse-matrix.md ├── 20200519-csr-sparse-matrix │ ├── classes.png │ └── format.png ├── 20200520-tensor-float-32.md ├── 20200525-gelu-migration.md ├── 20200601-tfx-udsl-semantics.md ├── 20200601-tfx-udsl-semantics │ ├── async_pipeline_example.png │ ├── daily_job_abnormal.png │ ├── daily_job_normal.png │ ├── sub_pipeline.png │ └── sync_pipeline_example.png ├── 20200612-stream-executor-c-api.md ├── 20200612-stream-executor-c-api │ └── C_API_versioning_strategy.md ├── 20200616-keras-multihead-attention.md ├── 20200624-pluggable-device-for-tensorflow.md ├── 20200624-pluggable-device-for-tensorflow │ ├── Xspace.png │ ├── design_overview.png │ ├── flow.png │ ├── gpu_example.png │ ├── modular_TensorFlow.png │ ├── profiler_result.png │ ├── sample │ │ ├── .bazelrc │ │ ├── README.md │ │ ├── WORKSPACE │ │ ├── build.sh │ │ ├── configure │ │ ├── configure.py │ │ ├── conv_relu.py │ │ ├── genpip.sh │ │ ├── profiler_result.png │ │ ├── relu.py │ │ ├── tensorflow_plugin │ │ │ ├── BUILD │ │ │ ├── build_config.bzl │ │ │ ├── demo_plugin.bzl │ │ │ ├── python │ │ │ │ ├── __init__.py │ │ │ │ └── test.py │ │ │ ├── src │ │ │ │ ├── BUILD │ │ │ │ ├── device │ │ │ │ │ └── cpu │ │ │ │ │ │ ├── BUILD │ │ │ │ │ │ ├── cpu_device_plugin.cc │ │ │ │ │ │ └── cpu_device_plugin.h │ │ │ │ ├── graph │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── plugin_optimizer.cc │ │ │ │ │ ├── plugin_optimizer.h │ │ │ │ │ ├── tf_buffer.cc │ │ │ │ │ └── tf_buffer.h │ │ │ │ ├── kernels │ │ │ │ │ └── cpu │ │ │ │ │ │ ├── BUILD │ │ │ │ │ │ ├── conv_ops_using_gemm.cc │ │ │ │ │ │ ├── cpu_kernel_init.cc │ │ │ │ │ │ ├── cpu_kernel_init.h │ │ │ │ │ │ ├── gemm_functors.h │ │ │ │ │ │ └── relu_op.cc │ │ │ │ ├── plugin_device.cc │ │ │ │ ├── plugin_device.h │ │ │ │ ├── plugin_graph.cc │ │ │ │ ├── plugin_kernel.cc │ │ │ │ ├── plugin_kernel.h │ │ │ │ ├── plugin_profiler.cc │ │ │ │ ├── profiler │ │ │ │ │ └── cpu │ │ │ │ │ │ ├── BUILD │ │ │ │ │ │ ├── demo_profiler.cc │ │ │ │ │ │ ├── demo_profiler.h │ │ │ │ │ │ └── utils │ │ │ │ │ │ ├── BUILD │ │ │ │ │ │ ├── time_utils.cc │ │ │ │ │ │ ├── time_utils.h │ │ │ │ │ │ ├── timespan.h │ │ │ │ │ │ ├── trace_utils.h │ │ │ │ │ │ ├── xplane_builder.cc │ │ │ │ │ │ ├── xplane_builder.h │ │ │ │ │ │ ├── xplane_utils.cc │ │ │ │ │ │ ├── xplane_utils.h │ │ │ │ │ │ ├── xplane_visitor.cc │ │ │ │ │ │ └── xplane_visitor.h │ │ │ │ └── utils │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── api_def.proto │ │ │ │ │ ├── attr_value.proto │ │ │ │ │ ├── cost_graph.proto │ │ │ │ │ ├── ctstring.h │ │ │ │ │ ├── ctstring_internal.h │ │ │ │ │ ├── device_properties.proto │ │ │ │ │ ├── env_time.cc │ │ │ │ │ ├── env_time.h │ │ │ │ │ ├── function.proto │ │ │ │ │ ├── graph.proto │ │ │ │ │ ├── gtl │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── array_slice.h │ │ │ │ │ ├── flatmap.h │ │ │ │ │ ├── flatrep.h │ │ │ │ │ ├── flatset.h │ │ │ │ │ ├── inlined_vector.h │ │ │ │ │ ├── map_traits.h │ │ │ │ │ └── map_util.h │ │ │ │ │ ├── integral_types.h │ │ │ │ │ ├── logging.cc │ │ │ │ │ ├── logging.h │ │ │ │ │ ├── macros.h │ │ │ │ │ ├── node_def.proto │ │ │ │ │ ├── numeric_types.h │ │ │ │ │ ├── op_def.proto │ │ │ │ │ ├── op_performance_data.proto │ │ │ │ │ ├── platform.h │ │ │ │ │ ├── prefetch.h │ │ │ │ │ ├── protobuf.h │ │ │ │ │ ├── resource_handle.proto │ │ │ │ │ ├── stringpiece.h │ │ │ │ │ ├── tensor.proto │ │ │ │ │ ├── tensor_shape.proto │ │ │ │ │ ├── tstring.h │ │ │ │ │ ├── types.h │ │ │ │ │ ├── types.proto │ │ │ │ │ ├── versions.proto │ │ │ │ │ └── xplane.proto │ │ │ ├── tf_configure.bzl │ │ │ ├── tools │ │ │ │ └── pip_package │ │ │ │ │ ├── BUILD │ │ │ │ │ ├── MANIFEST.in │ │ │ │ │ ├── README │ │ │ │ │ ├── build_pip_package.sh │ │ │ │ │ ├── setup.py │ │ │ │ │ └── simple_console.py │ │ │ └── workspace.bzl │ │ ├── test_profiler.py │ │ └── third_party │ │ │ ├── BUILD │ │ │ ├── build_option │ │ │ ├── BUILD │ │ │ └── gcc_configure.bzl │ │ │ ├── com_google_absl.BUILD │ │ │ ├── common.bzl │ │ │ ├── eigen.BUILD │ │ │ ├── eigen3 │ │ │ ├── BUILD │ │ │ ├── Eigen │ │ │ │ ├── Cholesky │ │ │ │ ├── Core │ │ │ │ ├── Eigenvalues │ │ │ │ ├── LU │ │ │ │ ├── OrderingMethods │ │ │ │ ├── QR │ │ │ │ ├── SVD │ │ │ │ ├── SparseCholesky │ │ │ │ └── SparseCore │ │ │ ├── LICENSE │ │ │ ├── gpu_packet_math.patch │ │ │ └── unsupported │ │ │ │ └── Eigen │ │ │ │ ├── CXX11 │ │ │ │ ├── FixedPoint │ │ │ │ ├── Tensor │ │ │ │ ├── ThreadPool │ │ │ │ └── src │ │ │ │ │ └── FixedPoint │ │ │ │ │ ├── FixedPointTypes.h │ │ │ │ │ ├── MatMatProduct.h │ │ │ │ │ ├── MatMatProductAVX2.h │ │ │ │ │ ├── MatMatProductNEON.h │ │ │ │ │ ├── MatVecProduct.h │ │ │ │ │ ├── PacketMathAVX.h │ │ │ │ │ ├── PacketMathAVX2.h │ │ │ │ │ ├── PacketMathAVX512.h │ │ │ │ │ ├── TypeCastingAVX2.h │ │ │ │ │ └── TypeCastingAVX512.h │ │ │ │ ├── MatrixFunctions │ │ │ │ └── SpecialFunctions │ │ │ ├── protobuf │ │ │ ├── BUILD │ │ │ └── protobuf.patch │ │ │ ├── repo.bzl │ │ │ ├── systemlibs │ │ │ ├── BUILD │ │ │ ├── BUILD.tpl │ │ │ ├── build_defs.bzl.tpl │ │ │ ├── nsync.BUILD │ │ │ ├── protobuf.BUILD │ │ │ ├── protobuf.bzl │ │ │ └── syslibs_configure.bzl │ │ │ ├── tf_dependency │ │ │ ├── BUILD │ │ │ └── BUILD.tpl │ │ │ ├── version_check.bzl │ │ │ └── zlib.BUILD │ ├── scenario1.png │ ├── scenario2.png │ ├── scenario3.png │ ├── scenario4.png │ └── tutorial.md ├── 20200705-tfx-ir.md ├── 20200705-tfx-ir │ ├── data_model_simple.png │ ├── design-structure.png │ ├── resolver-complex.png │ ├── resolver.png │ ├── sub-pipeline-semantic.png │ └── sub-pipeline.png ├── 20200712-tfrt-kernel-fallback.md ├── 20200712-tfrt-kernel-fallback │ ├── KernelFallbackDiagram.png │ ├── KernelFallbackHighLevelDiagram.png │ ├── RuntimeFallbackHighLevelDiagram.png │ ├── kernel_to_unsupported.md │ └── support_priority.md ├── 20200721-extension-types.md ├── 20200804-configurable-filesystems.md ├── 20200810-tf-internal-api.md ├── 20200824-e2e-text-preprocessing.md ├── 20200901-tflite-builtin-code-extension.md ├── 20200903-tensor-float-32-default.md ├── 20200916-sig-tf-js.md ├── 20200921-pickle-for-keras.md ├── 20200928-sharded-variable.md ├── 20200929-keras-mixed-precision.md ├── 20201012-tfx-tf-function-in-tft.md ├── 20201023-sig-models.md ├── 20201023-sig-recommenders.md ├── 20201027-modular-tensorflow-graph-c-api.md ├── 20201027-modular-tensorflow-graph-c-api │ ├── flow.png │ ├── scenario1.png │ ├── scenario2.png │ └── scenario3.png ├── 20201121-keras-model-fit-ps.md ├── 20201201-cpp-gradients.md ├── 20201221-tfmot-compression-api.md ├── 20201221-tfmot-compression-api │ ├── class_graph.png │ ├── compress_training_weights.png │ ├── decompress_weights.png │ ├── get_compressible_weights.png │ ├── init_training_weights.png │ └── project_training_weights.png ├── 20210115-tfx-periodic-training.md ├── 20210115-tfx-periodic-training │ ├── data_selection.png │ ├── new_version.png │ ├── rolling_window.png │ ├── single_span.png │ ├── span_version.png │ ├── timeline.png │ ├── transform.png │ └── workflow.png ├── 20210119-determinism.md ├── 20210218-grpc-fail-fast-use-caller.md ├── 20210302-sig-tfx-addons.md ├── 20210305-tfx-struct2tensor.md ├── 20210305-tfx-struct2tensor │ ├── data_view_components.png │ ├── graph_to_tensor_tfxio.png │ └── tf_example_vs_elwc.png ├── 20210307-tfx-api-artifact-compat.md ├── 20210504-kernel-extension-variable-ops.md ├── 20210513-pluggable-profiler-for-tensorflow.md ├── 20210513-pluggable-profiler-for-tensorflow │ ├── Architecture.png │ └── Xspace.png ├── 20210731-tfjs-named-tensors.md ├── 20210731-tfjs-named-tensors │ ├── gtensor.spec.ts │ └── gtensor.ts ├── 20210930-enable-onednn-ops.md ├── 20210930-enable-onednn-ops │ ├── eigen-contraction-kernel.png │ └── onednn-graph-rewrite-passes.png ├── 20211116-tensorshape-bool.md ├── 20220610-saved-model-fingerprinting.md ├── 20220610-saved-model-fingerprinting │ ├── diff1.png │ └── diff2.png ├── 20220620-tfx-modify-bulkinferrer.md ├── 20220713-sig-open-xla.md ├── 20220719-sig-federated ├── 20221116-enable-stochastic-rounding.md ├── 20230221-tf-distribution-api-dtensor.md ├── 20230621-tf-api-deprecation.md ├── 20230720-unbound-saved-model.md ├── 20231213-checkpoint-sharding-callback.md ├── 20231213-checkpoint-sharding-callback │ ├── .DS_Store │ └── callback-diagram.png ├── README.md └── yyyymmdd-rfc-template.md └── sigs ├── addons ├── CHARTER.md └── RELEASE.md ├── archived └── swift │ └── CHARTER.md ├── build ├── CHARTER.md ├── community-builds.md └── tensorflow-testing.md ├── federated └── CHARTER.md ├── graphics └── CHARTER.md ├── io ├── CHARTER.md └── RELEASE.md ├── jvm ├── CHARTER.md ├── SIG-request.md └── rfcs │ ├── 20190802-java-repositories.md │ └── 20200726-java-ndarray-repository.md ├── keras └── README.md ├── logos ├── README.md ├── SIGAddons.jpg ├── SIGAddons.png ├── SIGBuild.jpg ├── SIGBuild.png ├── SIGFederated.png ├── SIGFederated.svg ├── SIGFederated_Transparent.png ├── SIGIO.jpg ├── SIGIO.png ├── SIGModels.png ├── SIGModels.svg ├── SIGNetworking.jpg ├── SIGNetworking.png ├── SIGRecommenders.png ├── SIGRecommenders.svg ├── SIGRust.jpg ├── SIGRust.png ├── SIGTFX.png ├── SIGTFX.svg ├── SIGTensorboard.jpg └── SIGTensorboard.png ├── micro ├── CHARTER.md └── SIG-request.md ├── mlir └── CHARTER.md ├── models └── CHARTER.md ├── networking └── CHARTER.md ├── openxla └── CHARTER.md ├── recommenders └── CHARTER.md ├── rust └── CHARTER.md ├── tensorboard └── CHARTER.md ├── testing ├── README.md └── faq.md ├── tf.js └── CHARTER.md └── tfx-addons └── CHARTER.md /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/.DS_Store -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/custom.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Custom issue template 3 | about: For community repo issues 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | # Community repo 11 | 12 | The only issues you should file here concern the community's documentation or processes. 13 | 14 | All other bugs should be filed on the appropriate repo, questions directed to the various email groups, or if it's a "how-to" question, StackOverflow. 15 | -------------------------------------------------------------------------------- /CODEOWNERS: -------------------------------------------------------------------------------- 1 | # Owners for community repo 2 | # For syntax, see https://help.github.com/articles/about-codeowners/ 3 | 4 | # This file controls who is asked for a review when PRs are submitted 5 | 6 | # SIGS 7 | 8 | sigs/rust/ @adamcrume 9 | sigs/tensorboard/ @thealamkin @manivaradarajan 10 | sigs/build/ @thealamkin @angerson @perfinion 11 | sigs/addons/ @thealamkin @seanpmorgan @armando-fandango 12 | sigs/networking/ @thealamkin @byronyi @jbedorf @poxvoculi 13 | sigs/io/ @thealamkin @mihaimaruseac @yongtang @dmitrievanthony 14 | sigs/jvm/ @thealamkin @karllessard @tzolov 15 | sigs/micro/ @thealamkin @petewarden 16 | sigs/mlir/ @thealamkin @pkanwar23 17 | sigs/swift/ @thealamkin @saeta @ematejska 18 | sigs/testing/ @thealamkin @dynamicwebpaige 19 | 20 | # RFCs 21 | 22 | rfcs/ @ewilderj @theadactyl @ematejska 23 | -------------------------------------------------------------------------------- /MEETINGS.md: -------------------------------------------------------------------------------- 1 | # TensorFlow Community Meetings 2 | 3 | [TensorFlow SIGs](https://github.com/tensorflow/community/tree/master/sigs) 4 | and other groups hold regular meetings via videoconference. Usually 5 | you will find these added to your calendar after you join the Google Group relevant 6 | to the SIG or community group. 7 | 8 | There is also a master calendar listing all community meetings: 9 | [TensorFlow Community Calendar](https://calendar.google.com/calendar/embed?src=tensorflow.org_14t769n89qhsps949c3l0nhd9c%40group.calendar.google.com). 10 | 11 | Google Calendar users can add the calendar to theirs using the button on the bottom of the master calendar page. If you want 12 | to add the Community Calendar to your own calendar application, use [this iCal link](https://calendar.google.com/calendar/ical/tensorflow.org_14t769n89qhsps949c3l0nhd9c%40group.calendar.google.com/public/basic.ics). 13 | 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Welcome to the TensorFlow Developer Community 2 | 3 | ## This Repository 4 | 5 | The `community` repository stores documents used by the developer community. 6 | 7 | * `rfcs` - design documents used by the design review process 8 | * `sigs` - documentation for each TensorFlow Special Interest group (SIG) 9 | * `governance` - operating processes for the TensorFlow project 10 | 11 | ## Contact 12 | 13 | For questions about this repository, please file an issue or reach out 14 | to Thea Lamkin: thealamkin@google.com. 15 | 16 | ## Further Community Resources 17 | 18 | For a complete overview of the TensorFlow community resources, 19 | please visit [tensorflow.org/community](https://tensorflow.org/community). 20 | -------------------------------------------------------------------------------- /governance/SIG-charter-template.md: -------------------------------------------------------------------------------- 1 | # Proposed name: SIG ??? 2 | 3 | ## Objective 4 | 5 | One or two sentences describing the group's purpose. 6 | 7 | ## Scope 8 | 9 | Provide a brief overview of the scope of contributions/workstreams you intend to 10 | drive through this SIG, and how they might relate to the TensorFlow ecosystem and/or 11 | existing libraries. 12 | 13 | ## Membership 14 | 15 | *Who can join? How can they join? Who can read the group's activity?* 16 | 17 | Example: 18 | 19 | > Everyone involved in the packaging, distributing or embedding of TensorFlow is 20 | > welcome to join the group. To participate, request an invitation to join the 21 | > mailing list. Archives of the mailing list will be publicly accessible. 22 | 23 | ## Resources 24 | 25 | *Links to essential resources: proposed mailing list, Github repo, key documents, etc.* 26 | 27 | ## Contacts 28 | 29 | *Minimum highlight a group leader, and somebody to reach out to for 30 | administrative purposes* 31 | 32 | * *Project lead: A N Other [@githubhandle](https://github.com/githubhandle) - 33 | another at companyname* 34 | * For administrative questions, contact tf-community-team at google 35 | 36 | ## Code of Conduct 37 | 38 | As with all forums and spaces related to TensorFlow, SIG ??? is subject to 39 | the [TensorFlow Code of 40 | Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 41 | -------------------------------------------------------------------------------- /governance/SIG-readme-template.md: -------------------------------------------------------------------------------- 1 | 2 | # :framed_picture: [SIG Logo](https://github.com/tensorflow/community/tree/master/sigs/logos) 3 | 4 | ## SIG description 5 | A short overview of the SIG goals & scope. 6 | 7 | ## Example 8 | A minimal inline primer to quickly expose the library 9 | 10 | ## Docs/API 11 | Link to the appropriate Tensorflow web site page (if applicable) 12 | 13 | ## Badges 14 | Add badges for you repository (pypy, python, gitter, api etc.) 15 | CI/Buid specific badges 16 | 17 | ## TensorFlow compatibility Matrix 18 | Releases compatibility with TF and Python versions or (other languages, cuda, etc.) 19 | 20 | ## Project/Repository structure 21 | A repository overiew with a short description of its tree/modularity 22 | 23 | ## Release policy 24 | Describe the release policy: 25 | 26 | E.g. A release for each Tensorflow release, multiple releases between two Tensorflow releases, etc. 27 | 28 | ## Installation 29 | Quick instruction on how to install the packaged version of the repository 30 | 31 | ## Docker 32 | How to use the library inside a Docker container. 33 | If the specific repo doesn't maintain its own Docker image, consider directing users to install the package inside the Tensorflow official Docker container. 34 | 35 | ## Build from source 36 | Pointer to a specific CONTRIBUTING.md section 37 | 38 | ## Contributing 39 | Link to the CONTRIBUTING.md 40 | 41 | ## Support/Community 42 | Mailing list/Forum 43 | Gitter 44 | 45 | ## Extra info 46 | Please add any extra info or references to important Markdown files or resources in the repo 47 | -------------------------------------------------------------------------------- /governance/SIG-request-template.md: -------------------------------------------------------------------------------- 1 | # Request for SIG 2 | 3 | ## What is this group for? 4 | 5 | Describe the need the group fills. Who is the audience? 6 | Provide evidence that work is already ongoing in this area. 7 | 8 | ## Who will be part of it? 9 | 10 | Describe: 11 | 12 | * group leader 13 | * a second for the leader 14 | * one or more interested parties who will also be in the group -- provide 15 | evidence of the sustainability of the group 16 | 17 | What will be your membership policy? 18 | 19 | ## What initial problems will the group tackle? 20 | 21 | *List potential goals for the group* 22 | 23 | ## What modes of communication do you intend to use? 24 | 25 | *A mailing list is a minimum. We recommend regularly scheduled VC calls to focus 26 | on agenda items. Slack or other chat channels are optional.* 27 | 28 | ## Launch plan 29 | 30 | *Describe how the group will be launched. Example follows* 31 | 32 | ``` 33 | 1. `VC call with initial interested parties to finalize charter and initial group goals` 34 | 1. `SIG set up with initial group members` 35 | 1. `SIG added to community pages on tensorflow.org` 36 | 1. `Write blog post about SIG and its goals` 37 | 1. `Leader starts off mailing list discussion about initial work items` 38 | ``` 39 | 40 | # Charter 41 | 42 | Please draft the SIG's charter using the [SIG Charter Template](SIG-charter-template.md). 43 | 44 | 45 | -------------------------------------------------------------------------------- /governance/cpp-style.md: -------------------------------------------------------------------------------- 1 | # C++ Coding Style 2 | 3 | Tensorflow follows [Google C++ style](https://google.github.io/styleguide/cppguide.html), 4 | with a few additions. 5 | 6 | ## Status 7 | 8 | Functions which can produce an error should return a `tensorflow::Status`. To propagate an 9 | error status, use the `TF_RETURN_IF_ERROR` macro. 10 | 11 | ``` 12 | TF_RETURN_IF_ERROR(f()); 13 | ``` 14 | 15 | ## StatusOr 16 | 17 | `StatusOr` is the union of a `Status` object and a `T` object. It offers a way to use 18 | return values instead of output parameters for functions which may fail. 19 | 20 | For example, consider the code: 21 | 22 | ``` 23 | Output out; 24 | Status s = foo(&out); 25 | if (!s.ok()) { 26 | return s; 27 | } 28 | out.DoSomething(); 29 | ``` 30 | 31 | With `StatusOr`, we can write this as 32 | 33 | ``` 34 | StatusOr result = foo(); 35 | if (!result.ok()) { 36 | return result.status(); 37 | } 38 | result->DoSomething(); 39 | ``` 40 | 41 | **Pros:** 42 | 43 | Return values are 44 | [easier to reason about](https://google.github.io/styleguide/cppguide.html#Output_Parameters) 45 | than output parameters. 46 | 47 | The types returned through `StatusOr` don't need to support empty states. To return a type 48 | as an output parameter, we must either use a `unique_ptr` or support an empty state for the 49 | type so that we can initialize the type before passing it as an output parameter. `StatusOr` 50 | reduces the number of objects we have in an "uninitialized" state. 51 | 52 | **Cons:** 53 | 54 | `StatusOr` adds complexity. It raises questions about what happens when `T` is null and 55 | how `StatusOr` behaves during moves and copies. `StatusOr` also generally comes with 56 | macros such as `ASSIGN_OR_RETURN`, which add additional complexity. 57 | 58 | The current Tensorflow codebase exclusively uses `Status` instead of `StatusOr`, so 59 | switching over would require a significant amount of work. 60 | 61 | **Decision:** 62 | 63 | Tensorflow foregoes the use of `StatusOr<>` because it doesn't add enough value to justify 64 | additional complexity. 65 | -------------------------------------------------------------------------------- /rfcs/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/.DS_Store -------------------------------------------------------------------------------- /rfcs/20180821-differentiable-functional-while/while_body.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20180821-differentiable-functional-while/while_body.png -------------------------------------------------------------------------------- /rfcs/20180821-differentiable-functional-while/while_cond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20180821-differentiable-functional-while/while_cond.png -------------------------------------------------------------------------------- /rfcs/20180821-differentiable-functional-while/while_v1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20180821-differentiable-functional-while/while_v1.png -------------------------------------------------------------------------------- /rfcs/20180821-differentiable-functional-while/while_v2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20180821-differentiable-functional-while/while_v2.png -------------------------------------------------------------------------------- /rfcs/20181225-tf-raw-ops.md: -------------------------------------------------------------------------------- 1 | # `tf.raw_ops` 2 | 3 | | Status | Accepted | 4 | | :------------ | :------------------------------------------------------ | 5 | | **Author** | apassos@google.com | 6 | | **Sponsor** | wicke@google.com | 7 | | **Updated** | 2018-12-21 | 8 | 9 | ## Objective 10 | 11 | Expose a `tf.raw_ops` namespace containing all raw operations in TensorFlow. 12 | 13 | ## Motivation 14 | 15 | Some parts of the TensorFlow Python API, such as variables, optimizers, and 16 | control flow, are currently not implementable by third parties. Moreover, with 17 | the tf.contrib deprecation, there is now no valid Python endpoint from which to 18 | use many TF operations. 19 | 20 | ## Design Proposal 21 | 22 | We'll add a `tf.raw_ops` namespace to TensorFlow with Python bindings to all 23 | non-deprecated TensorFlow ops which is usable in a backwards-compatible 24 | way. This is designed to be consumed by downstream library writers and not end 25 | users. 26 | 27 | ## Detailed Design 28 | 29 | The namespace will be automatically populated with generated bindings for every 30 | operation in TensorFlow. These generated bindings will be similar to the ones 31 | currently used for the python API, with the following differences: 32 | 33 | * All arguments are keyword arguments. 34 | - This allows us to add new attributes to existing ops without breaking users 35 | who call by positional arguments (given that there is an always-last `name` 36 | argument added by the tf op binding generator). 37 | - This also prevents users from assuming that calling conventions from the 38 | existing python bindings apply to the raw versions (we often do argument 39 | reordering in our python bindings, for example). 40 | * Any op marked as deprecated will be in the namespace but will raise an 41 | exception when used. 42 | - This includes ops which take or produce ref tensors. 43 | - This allows us to deprecate ops eventually and to be less strict with the API 44 | here than with the main API. 45 | - This is mostly OK since only library writers are supposed to use these 46 | symbols, and the deprecation messages should include upgrading instructions. 47 | 48 | 49 | ## Questions and Discussion Topics 50 | 51 | * Naming: tf.raw_ops is the name 52 | * Backward compatibility policy: we'll document on tf.org 53 | * Flat namespace vs nested? flat 54 | * Will not include protocol buffers 55 | -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/api_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/api_picture.png -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/big_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/big_picture.png -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/cpp_module.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/cpp_module.png -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/initial_tf_deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/initial_tf_deps.png -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/py_modules.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/py_modules.png -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/releases.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/releases.png -------------------------------------------------------------------------------- /rfcs/20190305-modular-tensorflow/simple_package_deps.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190305-modular-tensorflow/simple_package_deps.png -------------------------------------------------------------------------------- /rfcs/20190315-tflite-control-flow/if_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190315-tflite-control-flow/if_model.png -------------------------------------------------------------------------------- /rfcs/20190315-tflite-control-flow/while_buffer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190315-tflite-control-flow/while_buffer.png -------------------------------------------------------------------------------- /rfcs/20190411-string-unification/tstring_layout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190411-string-unification/tstring_layout.png -------------------------------------------------------------------------------- /rfcs/20190506-filesystem-plugin-modular-tensorflow/big_picture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190506-filesystem-plugin-modular-tensorflow/big_picture.png -------------------------------------------------------------------------------- /rfcs/20190506-filesystem-plugin-modular-tensorflow/env.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190506-filesystem-plugin-modular-tensorflow/env.png -------------------------------------------------------------------------------- /rfcs/20190506-filesystem-plugin-modular-tensorflow/filesystem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190506-filesystem-plugin-modular-tensorflow/filesystem.png -------------------------------------------------------------------------------- /rfcs/20190610-resource-variable-semantics/load_store_reordering.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190610-resource-variable-semantics/load_store_reordering.png -------------------------------------------------------------------------------- /rfcs/20190610-resource-variable-semantics/resource_update_operations.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190610-resource-variable-semantics/resource_update_operations.png -------------------------------------------------------------------------------- /rfcs/20190610-resource-variable-semantics/simplest_non_trival_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190610-resource-variable-semantics/simplest_non_trival_example.png -------------------------------------------------------------------------------- /rfcs/20190630-tfx-on-kfp/tfx-kfp-argo-workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190630-tfx-on-kfp/tfx-kfp-argo-workflow.png -------------------------------------------------------------------------------- /rfcs/20190630-tfx-on-kfp/tfx-kfp-containers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190630-tfx-on-kfp/tfx-kfp-containers.png -------------------------------------------------------------------------------- /rfcs/20190630-tfx-on-kfp/tfx-kfp-ui.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190630-tfx-on-kfp/tfx-kfp-ui.png -------------------------------------------------------------------------------- /rfcs/20190630-tfx-on-kfp/tfx-on-kubeflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190630-tfx-on-kfp/tfx-on-kubeflow.png -------------------------------------------------------------------------------- /rfcs/20190630-tfx-on-kfp/tfx-oss-xcom-passing.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190630-tfx-on-kfp/tfx-oss-xcom-passing.png -------------------------------------------------------------------------------- /rfcs/20190718-tfx-orchestration/tfx-oss-architecture.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190718-tfx-orchestration/tfx-oss-architecture.gif -------------------------------------------------------------------------------- /rfcs/20190718-tfx-orchestration/tfx-oss-component.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190718-tfx-orchestration/tfx-oss-component.gif -------------------------------------------------------------------------------- /rfcs/20190718-tfx-orchestration/tfx-oss-dag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190718-tfx-orchestration/tfx-oss-dag.png -------------------------------------------------------------------------------- /rfcs/20190722-tflite-training/roadmap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190722-tflite-training/roadmap.png -------------------------------------------------------------------------------- /rfcs/20190722-tflite-training/trans1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190722-tflite-training/trans1.png -------------------------------------------------------------------------------- /rfcs/20190722-tflite-training/trans2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190722-tflite-training/trans2.png -------------------------------------------------------------------------------- /rfcs/20190726-custom-ops.md: -------------------------------------------------------------------------------- 1 | # Best practices for custom operations in TensorFlow 2 | 3 | | Status | Accepted | 4 | :-------------- |:---------------------------------------------------- | 5 | | **Author(s)** | Alexandre Passos (apassos@google.com | 6 | | **Sponsor** | Karmel Allison (karmel@google.com) | 7 | | **Updated** | 2019-06-10 | 8 | 9 | For most of TF’s history, it was very expensive for third-party packages or 10 | libraries to release their own tf operations. This created pressure to put ops 11 | in tf core or in tf contrib, which created some uncertainty around support 12 | stories and backwards compatibility. 13 | 14 | Around (but technically not a part of) TF 2.0, however, TensorFlow supports [a 15 | straightforward way for third-party package to build and deploy their own custom 16 | TF ops](https://github.com/tensorflow/custom-op/blob/master/README.md). To 17 | maintain a healthy ecosystem, we recommend the following best practices. 18 | 19 | ## Experimental ops should live out of tree 20 | 21 | Unless some special considerations apply, experimental op development should not 22 | happen inside the core TensorFlow package. Strongly prefer adding experimental 23 | or new operations to libraries and packages downstream from core TensorFlow. Any 24 | op in core TensorFlow is subject to very strict backward and forward 25 | compatibility policies, as TensorFlow is very aggressive about not breaking 26 | existing GraphDefs, and this includes even meant-to-be experimental operations 27 | in the core TensorFlow package. 28 | 29 | Once things are no longer experimental, and once the TensorFlow team determines 30 | it is ok with taking responsibility for the code, it’s fine to propose adding a 31 | new version with the final intended interface and implementation to core 32 | TensorFlow. The intermediate states are best explored in another package. 33 | 34 | This has many advantages: 35 | - downstream packages often have a faster release cadence than core TensorFlow 36 | - each downstream package can choose its own backward and forward compatibility 37 | processes, allowing fine-grained trade-offs between velocity and stability 38 | 39 | ## Out-of-tree ops must be namespaced 40 | 41 | Since an op’s name uniquely identifies it, different TF packages should ensure 42 | their op names are globally unique across the entire TF ecosystem. To do so, 43 | prepend the package’s name to the op’s name and separate with a ‘>’. An op named 44 | “MatMul” inside the “tensorflow_addons” package should be named “Addons>MatMul”, 45 | for example. 46 | 47 | The string used for a package’s component name is any valid op name, but should 48 | be unique to the package. This allows different packages to experiment with ops 49 | without needing a central coordinator to assign unique operation names. Failing 50 | to use unique names will mean two packages are potentially incompatible. 51 | 52 | If a third-party-developed operation is to be integrated in TensorFlow core, it 53 | should be renamed to have no prefix, creating a new op name, and removing any 54 | risk of internal and external versions silently diverging. 55 | 56 | 57 | -------------------------------------------------------------------------------- /rfcs/20190814-kernel-and-op-registration/device_api_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190814-kernel-and-op-registration/device_api_overview.png -------------------------------------------------------------------------------- /rfcs/20190815-tfdbg-v2-callbacks/graph-instrumentation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190815-tfdbg-v2-callbacks/graph-instrumentation.png -------------------------------------------------------------------------------- /rfcs/20190816-tf-project-versioning.md: -------------------------------------------------------------------------------- 1 | # Project versioning in the TensorFlow organization 2 | 3 | | Status | Accepted | 4 | :-------------- |:---------------------------------------------------- | 5 | | **Author(s)** | Edd Wilder-James (ewj@google.com), Martin Wicke (wicke@google.com) | 6 | | **Sponsor** | Kevin Haas (khaas@google.com) | 7 | | **Updated** | 2019-08-16 | 8 | 9 | ## Objective 10 | 11 | This document describes best practices for numbering versions of projects 12 | that form part of the TensorFlow suite of projects. This practice is required for dependent 13 | projects hosted under the [TensorFlow organization](https://github.com/tensorflow) on 14 | GitHub, and advisory for dependent projects hosted elsewhere. 15 | 16 | ## Definitions 17 | 18 | "TensorFlow" in this document refers to the core TensorFlow project, as developed in 19 | GitHub `tensorflow/tensorflow`. 20 | 21 | ## Motivation 22 | 23 | As the number of projects dependent on TensorFlow increases, such as those shipped by 24 | SIG Addons or IO, it is helpful to maintainers to understand the constraints on how 25 | to number their releases. 26 | 27 | ## Versioning Policy 28 | 29 | All projects must follow [semantic versioning](https://semver.org/). 30 | 31 | Until a project reaches 1.0, it does not have to make any backward compatibility guarantees. 32 | 33 | Projects should not try to track major TensorFlow versioning to indicate compatibility 34 | with particular TensorFlow releases. Instead, compatibility must be signalled 35 | by the use of dependencies in `pip`, or whichever package manager is being used by the project. 36 | 37 | Within the constraints of semantic versioning, project maintainers should feel free to do 38 | whatever is best for their projects and users. 39 | 40 | ## Review Feedback 41 | 42 | Included as advisory but not binding. 43 | 44 | * Jason Zaman: It might be a good idea to also mention stability guarantees, and things that are excluded from them. eg TensorFlow itself says anything that's `tf.foo.experimental.bar` is not stable and is allowed to change at anytime, and other projects should think about having a similar mechanism if needed. 45 | -------------------------------------------------------------------------------- /rfcs/20190829-tfx-container-component-execution/tfx-container-execution-classes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190829-tfx-container-component-execution/tfx-container-execution-classes.png -------------------------------------------------------------------------------- /rfcs/20190829-tfx-container-component-execution/tfx-k8s-container-execution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190829-tfx-container-component-execution/tfx-k8s-container-execution.png -------------------------------------------------------------------------------- /rfcs/20190829-tfx-container-component-execution/tfx-local-container-execution.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190829-tfx-container-component-execution/tfx-local-container-execution.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/arrow_example_1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/arrow_example_1.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/arrow_example_2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/arrow_example_2.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/feature_extraction_in_model.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/feature_extraction_in_model.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/integration_with_other_formats.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/integration_with_other_formats.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/pydict_to_struct_tensor.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/pydict_to_struct_tensor.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/python_vs_struct_tensor_encoding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/python_vs_struct_tensor_encoding.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/recipe_schema.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/recipe_schema.png -------------------------------------------------------------------------------- /rfcs/20190910-struct-tensor/struct_5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20190910-struct-tensor/struct_5.png -------------------------------------------------------------------------------- /rfcs/20191017-tfx-standardized-inputs/double-translation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191017-tfx-standardized-inputs/double-translation.png -------------------------------------------------------------------------------- /rfcs/20191017-tfx-standardized-inputs/impl_tfxio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191017-tfx-standardized-inputs/impl_tfxio.png -------------------------------------------------------------------------------- /rfcs/20191017-tfx-standardized-inputs/oss_lib_org.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191017-tfx-standardized-inputs/oss_lib_org.png -------------------------------------------------------------------------------- /rfcs/20191017-tfx-standardized-inputs/overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191017-tfx-standardized-inputs/overview.png -------------------------------------------------------------------------------- /rfcs/20191106-tf2-tpu-savedmodel/cpu_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191106-tf2-tpu-savedmodel/cpu_graph.png -------------------------------------------------------------------------------- /rfcs/20191106-tf2-tpu-savedmodel/customized_embeddings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191106-tf2-tpu-savedmodel/customized_embeddings.png -------------------------------------------------------------------------------- /rfcs/20191106-tf2-tpu-savedmodel/tpu_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191106-tf2-tpu-savedmodel/tpu_graph.png -------------------------------------------------------------------------------- /rfcs/20191106-tf2-tpu-savedmodel/tpu_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191106-tf2-tpu-savedmodel/tpu_result.png -------------------------------------------------------------------------------- /rfcs/20191127-pip-structure/circular_dependency.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191127-pip-structure/circular_dependency.png -------------------------------------------------------------------------------- /rfcs/20191127-pip-structure/current_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191127-pip-structure/current_structure.png -------------------------------------------------------------------------------- /rfcs/20191127-pip-structure/modular_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191127-pip-structure/modular_structure.png -------------------------------------------------------------------------------- /rfcs/20191127-pip-structure/new_modular_structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191127-pip-structure/new_modular_structure.png -------------------------------------------------------------------------------- /rfcs/20191206-tensorflow-lattice-v2/calib.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191206-tensorflow-lattice-v2/calib.png -------------------------------------------------------------------------------- /rfcs/20191206-tensorflow-lattice-v2/cat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191206-tensorflow-lattice-v2/cat.png -------------------------------------------------------------------------------- /rfcs/20191206-tensorflow-lattice-v2/graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191206-tensorflow-lattice-v2/graph.png -------------------------------------------------------------------------------- /rfcs/20191206-tensorflow-lattice-v2/lattice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191206-tensorflow-lattice-v2/lattice.png -------------------------------------------------------------------------------- /rfcs/20191206-tensorflow-lattice-v2/pwl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20191206-tensorflow-lattice-v2/pwl.png -------------------------------------------------------------------------------- /rfcs/20200117-tfx-combining-model-validator-with-evaluator/before-after.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200117-tfx-combining-model-validator-with-evaluator/before-after.png -------------------------------------------------------------------------------- /rfcs/20200117-tfx-combining-model-validator-with-evaluator/change-CI-threshold-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200117-tfx-combining-model-validator-with-evaluator/change-CI-threshold-a.png -------------------------------------------------------------------------------- /rfcs/20200117-tfx-combining-model-validator-with-evaluator/change-CI-threshold-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200117-tfx-combining-model-validator-with-evaluator/change-CI-threshold-b.png -------------------------------------------------------------------------------- /rfcs/20200117-tfx-combining-model-validator-with-evaluator/value-CI-threshold-a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200117-tfx-combining-model-validator-with-evaluator/value-CI-threshold-a.png -------------------------------------------------------------------------------- /rfcs/20200117-tfx-combining-model-validator-with-evaluator/value-CI-threshold-b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200117-tfx-combining-model-validator-with-evaluator/value-CI-threshold-b.png -------------------------------------------------------------------------------- /rfcs/20200218-tf-c-saved-model/saved_model_diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200218-tf-c-saved-model/saved_model_diagram.png -------------------------------------------------------------------------------- /rfcs/20200306-single-client-parameter-server/rebuild_arbitrary_future.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200306-single-client-parameter-server/rebuild_arbitrary_future.png -------------------------------------------------------------------------------- /rfcs/20200411-fuse_recv/current_graph_partition_strategy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200411-fuse_recv/current_graph_partition_strategy.png -------------------------------------------------------------------------------- /rfcs/20200411-fuse_recv/fuse_recv_procedure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200411-fuse_recv/fuse_recv_procedure.png -------------------------------------------------------------------------------- /rfcs/20200411-fuse_recv/graph_partition_strategy_with_fuse_recv.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200411-fuse_recv/graph_partition_strategy_with_fuse_recv.png -------------------------------------------------------------------------------- /rfcs/20200411-fuse_recv/performance_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200411-fuse_recv/performance_result.png -------------------------------------------------------------------------------- /rfcs/20200420-tfx-tuner-component/cloud.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200420-tfx-tuner-component/cloud.png -------------------------------------------------------------------------------- /rfcs/20200420-tfx-tuner-component/parallel_tuning.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200420-tfx-tuner-component/parallel_tuning.png -------------------------------------------------------------------------------- /rfcs/20200420-tfx-tuner-component/workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200420-tfx-tuner-component/workflow.png -------------------------------------------------------------------------------- /rfcs/20200511-tensorflow-on-directml/kernel_migration.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200511-tensorflow-on-directml/kernel_migration.png -------------------------------------------------------------------------------- /rfcs/20200519-csr-sparse-matrix/classes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200519-csr-sparse-matrix/classes.png -------------------------------------------------------------------------------- /rfcs/20200519-csr-sparse-matrix/format.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200519-csr-sparse-matrix/format.png -------------------------------------------------------------------------------- /rfcs/20200601-tfx-udsl-semantics/async_pipeline_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200601-tfx-udsl-semantics/async_pipeline_example.png -------------------------------------------------------------------------------- /rfcs/20200601-tfx-udsl-semantics/daily_job_abnormal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200601-tfx-udsl-semantics/daily_job_abnormal.png -------------------------------------------------------------------------------- /rfcs/20200601-tfx-udsl-semantics/daily_job_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200601-tfx-udsl-semantics/daily_job_normal.png -------------------------------------------------------------------------------- /rfcs/20200601-tfx-udsl-semantics/sub_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200601-tfx-udsl-semantics/sub_pipeline.png -------------------------------------------------------------------------------- /rfcs/20200601-tfx-udsl-semantics/sync_pipeline_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200601-tfx-udsl-semantics/sync_pipeline_example.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/Xspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/Xspace.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/design_overview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/design_overview.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/flow.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/gpu_example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/gpu_example.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/modular_TensorFlow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/modular_TensorFlow.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/profiler_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/profiler_result.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/.bazelrc: -------------------------------------------------------------------------------- 1 | build --define=use_fast_cpp_protos=true 2 | build --define=allow_oversize_protos=true 3 | 4 | build --spawn_strategy=standalone 5 | # build --strategy=Genrule=standalone 6 | build -c opt 7 | 8 | # Default paths for TF_SYSTEM_LIBS 9 | build --define=PREFIX=/usr 10 | build --define=LIBDIR=$(PREFIX)/lib 11 | build --define=INCLUDEDIR=$(PREFIX)/include 12 | 13 | # host build is useless 14 | build --distinct_host_configuration=false 15 | 16 | try-import %workspace%/.tf_plugin_configure.bazelrc 17 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/WORKSPACE: -------------------------------------------------------------------------------- 1 | workspace(name = "org_tensorflow_plugin") 2 | 3 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", "http_file") 4 | load("//third_party:version_check.bzl", "check_bazel_version_at_least") 5 | 6 | check_bazel_version_at_least("3.1.0") 7 | 8 | load("//tensorflow_plugin:tf_configure.bzl", "tf_configure") 9 | 10 | tf_configure(name = "local_config_tf") 11 | 12 | load("//tensorflow_plugin:workspace.bzl", "clean_dep", "demo_plugin_workspace") 13 | 14 | demo_plugin_workspace() 15 | 16 | load( 17 | "@bazel_toolchains//repositories:repositories.bzl", 18 | bazel_toolchains_repositories = "repositories", 19 | ) 20 | 21 | bazel_toolchains_repositories() 22 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | bazel build -c opt //tensorflow_plugin/tools/pip_package:build_pip_package --verbose_failures 3 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/configure: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | 3 | set -e 4 | set -o pipefail 5 | 6 | if [ -z "$PYTHON_BIN_PATH" ]; then 7 | PYTHON_BIN_PATH=$(which python || which python3 || true) 8 | fi 9 | 10 | # Set all env variables 11 | CONFIGURE_DIR=$(dirname "$0") 12 | "$PYTHON_BIN_PATH" "${CONFIGURE_DIR}/configure.py" "$@" 13 | 14 | echo "Configuration finished" 15 | 16 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/conv_relu.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================= 15 | 16 | #!/usr/bin/env python 17 | # coding=utf-8 18 | import tensorflow as tf 19 | import numpy as np 20 | tf.compat.v1.disable_eager_execution() 21 | a = tf.random.normal(shape=[1,10, 10, 8], dtype=tf.float32, seed=1) 22 | w = tf.random.normal(shape=[3, 3, 8, 4], dtype=tf.float32, seed=1) 23 | 24 | a1 = tf.random.normal(shape=[1, 10, 10, 8], dtype=tf.float32, seed=1) 25 | w1 = tf.random.normal(shape=[3, 3, 8, 4], dtype=tf.float32, seed=1) 26 | 27 | 28 | with tf.device("/MY_DEVICE:0"): 29 | b = tf.nn.relu(a) 30 | c = tf.nn.conv2d(b, w, strides=[1, 1, 1, 1], padding='SAME', data_format='NHWC') 31 | 32 | with tf.device("/CPU:0"): 33 | b1 = tf.nn.relu(a1) 34 | c1 = tf.nn.conv2d(b1, w1, strides=[1, 1, 1, 1], padding='SAME', data_format='NHWC') 35 | 36 | 37 | sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(allow_soft_placement=False, log_device_placement=True)) 38 | print(sess.run(tf.reduce_all(tf.less(c - c1, 1e-5)))) 39 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/genpip.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | PACKAGE_PATH=$PWD 3 | bazel-bin/tensorflow_plugin/tools/pip_package/build_pip_package $PACKAGE_PATH 4 | 5 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/profiler_result.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/sample/profiler_result.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/relu.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved. 3 | # 4 | # Licensed under the Apache License, Version 2.0 (the "License"); 5 | # you may not use this file except in compliance with the License. 6 | # You may obtain a copy of the License at 7 | # 8 | # http://www.apache.org/licenses/LICENSE-2.0 9 | # 10 | # Unless required by applicable law or agreed to in writing, software 11 | # distributed under the License is distributed on an "AS IS" BASIS, 12 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | # See the License for the specific language governing permissions and 14 | # limitations under the License. 15 | # ============================================================================= 16 | 17 | 18 | # coding=utf-8 19 | import tensorflow as tf 20 | import numpy as np 21 | tf.compat.v1.disable_eager_execution() 22 | a = tf.random.normal(shape=[10], dtype=tf.float32) 23 | 24 | with tf.device("/MY_DEVICE:0"): 25 | b = tf.nn.relu(a) 26 | 27 | sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(allow_soft_placement=False, log_device_placement=True)) 28 | print(sess.run(b)) 29 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/BUILD: -------------------------------------------------------------------------------- 1 | cc_binary( 2 | name = "libdemo_plugin.so", 3 | linkshared = True, 4 | visibility = ["//visibility:public"], 5 | deps = [ 6 | "//tensorflow_plugin/src:plugin_device", 7 | "//tensorflow_plugin/src:plugin_graph", 8 | "//tensorflow_plugin/src:plugin_kernel", 9 | "//tensorflow_plugin/src:plugin_profiler", 10 | ], 11 | ) 12 | 13 | config_setting( 14 | name = "linux_x86_64", 15 | values = {"cpu": "k8"}, 16 | visibility = ["//visibility:public"], 17 | ) 18 | 19 | cc_library( 20 | name = "core", 21 | visibility = ["//visibility:public"], 22 | deps = [ 23 | "//tensorflow_plugin/src/device/cpu:cpu_device_impl", 24 | "@local_config_tf//:tf_header_lib", 25 | ], 26 | alwayslink = True, 27 | ) 28 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/build_config.bzl: -------------------------------------------------------------------------------- 1 | # Platform-specific build configurations. 2 | 3 | load("@com_google_protobuf//:protobuf.bzl", "proto_gen") 4 | load("//tensorflow_plugin:workspace.bzl", "clean_dep") 5 | load("@rules_cc//cc:defs.bzl", "cc_library") 6 | 7 | def cc_proto(name, src, deps = []): 8 | native.genrule( 9 | name = "%s_cc" % name, 10 | outs = ["%s.pb.cc" % name, "%s.pb.h" % name], 11 | cmd = "echo $(GENDIR); which $(location @com_google_protobuf//:protoc); $(location @com_google_protobuf//:protoc) --cpp_out=$(GENDIR) $<", 12 | srcs = [src], 13 | tools = ["@com_google_protobuf//:protoc"], 14 | ) 15 | native.cc_library( 16 | name = "%s_proto" % name, 17 | srcs = ["%s.pb.cc" % name], 18 | hdrs = ["%s.pb.h" % name], 19 | deps = [ 20 | "@com_google_protobuf//:protobuf_headers", 21 | "@com_google_protobuf//:protobuf", 22 | ] + deps, 23 | copts = ["-I$(GENDIR)"], 24 | ) 25 | 26 | def if_static(extra_deps = [], otherwise = []): 27 | return otherwise 28 | 29 | def tf_protobuf_deps(): 30 | return if_static( 31 | [ 32 | clean_dep("@com_google_protobuf//:protobuf"), 33 | ], 34 | otherwise = [clean_dep("@com_google_protobuf//:protobuf_headers")], 35 | ) 36 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/demo_plugin.bzl: -------------------------------------------------------------------------------- 1 | # Return the options to use for a C++ library or binary build. 2 | # Uses the ":optmode" config_setting to pick the options. 3 | 4 | def if_linux_x86_64(a, otherwise = []): 5 | return select({ 6 | "//conditons:default": otherwise, 7 | }) 8 | 9 | def tf_copts(android_optimization_level_override = "-O2", is_external = False): 10 | # For compatibility reasons, android_optimization_level_override 11 | # is currently only being set for Android. 12 | # To clear this value, and allow the CROSSTOOL default 13 | # to be used, pass android_optimization_level_override=None 14 | return ( 15 | [ 16 | "-Wno-sign-compare", 17 | "-fno-exceptions", 18 | "-ftemplate-depth=900", 19 | "-msse3", 20 | "-pthread", 21 | ] 22 | ) 23 | 24 | def _get_transitive_headers(hdrs, deps): 25 | return depset( 26 | hdrs, 27 | transitive = [dep[CcInfo].compilation_context.headers for dep in deps], 28 | ) 29 | 30 | def _transitive_hdrs_impl(ctx): 31 | outputs = _get_transitive_headers([], ctx.attr.deps) 32 | return struct(files = outputs) 33 | 34 | _transitive_hdrs = rule( 35 | attrs = { 36 | "deps": attr.label_list( 37 | allow_files = True, 38 | providers = [CcInfo], 39 | ), 40 | }, 41 | implementation = _transitive_hdrs_impl, 42 | ) 43 | 44 | def transitive_hdrs(name, deps = [], **kwargs): 45 | _transitive_hdrs(name = name + "_gather", deps = deps) 46 | native.filegroup(name = name, srcs = [":" + name + "_gather"]) 47 | 48 | def cc_header_only_library(name, deps = [], includes = [], extra_deps = [], **kwargs): 49 | _transitive_hdrs(name = name + "_gather", deps = deps) 50 | native.cc_library( 51 | name = name, 52 | srcs = [":" + name + "_gather"], 53 | hdrs = includes, 54 | deps = extra_deps, 55 | **kwargs 56 | ) 57 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/python/__init__.py: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/python/test.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | """This is a module for dummy test.""" 16 | 17 | import os 18 | 19 | if __name__ == '__main__': 20 | print(os.path.realpath('.')) 21 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | licenses = ["notice"], # Apache 2.0 3 | ) 4 | 5 | cc_library( 6 | name = "plugin_device", 7 | srcs = ["plugin_device.cc"], 8 | hdrs = ["plugin_device.h"], 9 | linkstatic = 1, 10 | visibility = ["//visibility:public"], 11 | deps = [ 12 | "//tensorflow_plugin/src/device/cpu:cpu_device_impl", 13 | "@local_config_tf//:tf_header_lib", 14 | ], 15 | alwayslink = True, 16 | ) 17 | 18 | cc_library( 19 | name = "plugin_graph", 20 | srcs = ["plugin_graph.cc"], 21 | linkstatic = 1, 22 | visibility = ["//visibility:public"], 23 | deps = [ 24 | ":plugin_device", 25 | "//tensorflow_plugin/src/graph:plugin_optimizer", 26 | "//tensorflow_plugin/src/kernels/cpu:cpu_kernel_impl", 27 | "@local_config_tf//:tf_header_lib", 28 | ], 29 | alwayslink = True, 30 | ) 31 | 32 | cc_library( 33 | name = "plugin_kernel", 34 | srcs = ["plugin_kernel.cc"], 35 | hdrs = ["plugin_kernel.h"], 36 | linkstatic = 1, 37 | visibility = ["//visibility:public"], 38 | deps = [ 39 | ":plugin_device", 40 | "//tensorflow_plugin/src/kernels/cpu:cpu_kernel_impl", 41 | "@local_config_tf//:tf_header_lib", 42 | ], 43 | alwayslink = True, 44 | ) 45 | 46 | 47 | cc_library( 48 | name = "plugin_profiler", 49 | srcs = ["plugin_profiler.cc"], 50 | hdrs = ["plugin_device.h"], 51 | linkstatic = 1, 52 | visibility = ["//visibility:public"], 53 | deps = [ 54 | "//tensorflow_plugin/src/profiler/cpu:demo_profiler", 55 | "@local_config_tf//:tf_header_lib", 56 | ], 57 | alwayslink = True, 58 | ) 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/device/cpu/BUILD: -------------------------------------------------------------------------------- 1 | package( 2 | licenses = ["notice"], # Apache 2.0 3 | ) 4 | 5 | cc_library( 6 | name = "cpu_device_impl", 7 | srcs = ["cpu_device_plugin.cc"], 8 | hdrs = [ 9 | "cpu_device_plugin.h", 10 | ], 11 | linkstatic = 1, 12 | visibility = ["//visibility:public"], 13 | deps = [ 14 | "@local_config_gcc//:framework_lib", 15 | "@local_config_tf//:tf_header_lib", 16 | ], 17 | alwayslink = True, 18 | ) 19 | 20 | exports_files( 21 | srcs = [ 22 | "cpu_device_plugin.h", 23 | ], 24 | visibility = ["//visibility:public"], 25 | ) 26 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/device/cpu/cpu_device_plugin.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | #ifndef TENSORFLOW_PLUGIN_SRC_DEVICE_CPU_H_ 16 | #define TENSORFLOW_PLUGIN_SRC_DEVICE_CPU_H_ 17 | #include "tensorflow/c/experimental/stream_executor/stream_executor.h" 18 | #include "tensorflow/c/tf_status.h" 19 | 20 | void SE_InitPluginFns(SE_PlatformRegistrationParams* const params, 21 | TF_Status* const status); 22 | 23 | struct SP_Stream_st { 24 | explicit SP_Stream_st(void* stream_h) : stream_handle(stream_h) {} 25 | void* stream_handle; 26 | }; 27 | 28 | struct SP_Event_st { 29 | explicit SP_Event_st(void* event_h) : event_handle(event_h) {} 30 | void* event_handle; 31 | }; 32 | 33 | struct SP_Timer_st { 34 | explicit SP_Timer_st(int id) : timer_handle(id) {} 35 | int timer_handle; 36 | }; 37 | 38 | #endif // TENSORFLOW_PLUGIN_SRC_DEVICE_CPU_H_ 39 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/graph/BUILD: -------------------------------------------------------------------------------- 1 | load( 2 | "//tensorflow_plugin:build_config.bzl", 3 | "tf_protobuf_deps", 4 | ) 5 | 6 | cc_library( 7 | name = "tf_buffer", 8 | srcs = ["tf_buffer.cc"], 9 | hdrs = [ 10 | "tf_buffer.h", 11 | ], 12 | visibility = ["//visibility:public"], 13 | deps = [ 14 | "@local_config_tf//:tf_header_lib", 15 | ] + tf_protobuf_deps(), 16 | ) 17 | 18 | cc_library( 19 | name = "plugin_optimizer", 20 | srcs = ["plugin_optimizer.cc"], 21 | hdrs = ["plugin_optimizer.h"], 22 | visibility = ["//visibility:public"], 23 | deps = [ 24 | "//tensorflow_plugin/src/utils:protos_all", 25 | # "//tensorflow_plugin/src/utils:types_proto", 26 | "tf_buffer", 27 | "@local_config_tf//:tf_header_lib", 28 | ], 29 | alwayslink = True, 30 | ) 31 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/graph/plugin_optimizer.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #include "tensorflow_plugin/src/graph/plugin_optimizer.h" 17 | #include "tensorflow/c/experimental/grappler/grappler.h" 18 | #include "tensorflow_plugin/src/graph/tf_buffer.h" 19 | #include "tensorflow_plugin/src/utils/graph.pb.h" 20 | 21 | namespace demo_plugin { 22 | namespace graph { 23 | 24 | void *Optimizer_Create() { 25 | auto *optimizer = new Optimizer; 26 | return reinterpret_cast(optimizer); 27 | } 28 | 29 | void Optimizer_Destroy(void *optimizer) { 30 | if (optimizer) 31 | delete reinterpret_cast(optimizer); 32 | } 33 | 34 | void Optimizer_Optimize(void *optimizer, const TF_Buffer *graph_buf, 35 | const TF_GrapplerItem *item, 36 | TF_Buffer *optimized_graph_buf, TF_Status *tf_status) { 37 | // Deserialize graph_buf into GraphDef. 38 | GraphDef graph_def; 39 | BufferToMessage(graph_buf, graph_def, tf_status); 40 | if (TF_GetCode(tf_status) != TF_OK) 41 | return; 42 | 43 | // Doing graph transformation. 44 | GraphDef optimized_graph_def = graph_def; 45 | 46 | // Serialize output GraphDef into optimized_graph_buf. 47 | MessageToBuffer(optimized_graph_def, optimized_graph_buf, tf_status); 48 | if (TF_GetCode(tf_status) != TF_OK) 49 | return; 50 | } 51 | 52 | } // namespace graph 53 | } // namespace demo_plugin 54 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/graph/plugin_optimizer.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_GRAPH_PLUGIN_OPTIMIZER_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_GRAPH_PLUGIN_OPTIMIZER_H_ 18 | 19 | #include "tensorflow/c/experimental/grappler/grappler.h" 20 | 21 | namespace demo_plugin { 22 | namespace graph { 23 | 24 | typedef struct Optimizer { 25 | } Optimizer; 26 | 27 | void *Optimizer_Create(); 28 | 29 | void Optimizer_Destroy(void *optimizer); 30 | 31 | void Optimizer_Optimize(void *optimizer, const TF_Buffer *graph_buf, 32 | const TF_GrapplerItem *item, 33 | TF_Buffer *optimized_graph_buf, TF_Status *tf_status); 34 | 35 | } // namespace graph 36 | } // namespace demo_plugin 37 | 38 | #endif // TENSORFLOW_PLUGIN_SRC_GRAPH_PLUGIN_OPTIMIZER_H_ 39 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/graph/tf_buffer.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #include "tensorflow_plugin/src/graph/tf_buffer.h" 17 | #include "tensorflow/c/tf_status.h" 18 | 19 | namespace demo_plugin { 20 | 21 | void MessageToBuffer(const demo_plugin::protobuf::MessageLite& in, 22 | TF_Buffer* out, TF_Status* status) { 23 | if (out->data != nullptr) { 24 | TF_SetStatus(status, TF_Code::TF_INVALID_ARGUMENT, 25 | "Passing non-empty TF_Buffer is invalid."); 26 | return; 27 | } 28 | const size_t proto_size = in.ByteSizeLong(); 29 | void* buf = malloc(proto_size); 30 | if (buf == nullptr) { 31 | TF_SetStatus(status, TF_Code::TF_RESOURCE_EXHAUSTED, 32 | "Failed to allocate memory to serialize message."); 33 | return; 34 | } 35 | if (!in.SerializeWithCachedSizesToArray(static_cast(buf))) { 36 | free(buf); 37 | TF_SetStatus(status, TF_Code::TF_INVALID_ARGUMENT, 38 | "Unable to serialize protocol buffer."); 39 | return; 40 | } 41 | out->data = buf; 42 | out->length = proto_size; 43 | out->data_deallocator = [](void* data, size_t length) { free(data); }; 44 | TF_SetStatus(status, TF_Code::TF_OK, ""); 45 | } 46 | 47 | void BufferToMessage(const TF_Buffer* in, 48 | demo_plugin::protobuf::MessageLite& out, 49 | TF_Status* status) { 50 | if (in == nullptr || !out.ParseFromArray(in->data, in->length)) { 51 | TF_SetStatus(status, TF_Code::TF_INVALID_ARGUMENT, "Unparsable proto."); 52 | return; 53 | } 54 | TF_SetStatus(status, TF_Code::TF_OK, ""); 55 | } 56 | 57 | } // namespace demo_plugin 58 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/graph/tf_buffer.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_GRAPH_UTILS_TF_BUFFER_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_GRAPH_UTILS_TF_BUFFER_H_ 18 | 19 | #include "tensorflow/c/c_api.h" 20 | 21 | // Import whatever namespace protobuf comes from into the 22 | // ::tensorflow::protobuf namespace. 23 | // 24 | // TensorFlow code should use the ::tensorflow::protobuf namespace to 25 | // refer to all protobuf APIs. 26 | 27 | #include "google/protobuf/arena.h" 28 | #include "google/protobuf/descriptor.h" 29 | #include "google/protobuf/descriptor.pb.h" 30 | #include "google/protobuf/dynamic_message.h" 31 | #include "google/protobuf/io/coded_stream.h" 32 | #include "google/protobuf/io/tokenizer.h" 33 | #include "google/protobuf/io/zero_copy_stream.h" 34 | #include "google/protobuf/io/zero_copy_stream_impl_lite.h" 35 | #include "google/protobuf/map.h" 36 | #include "google/protobuf/message.h" 37 | #include "google/protobuf/repeated_field.h" 38 | #include "google/protobuf/text_format.h" 39 | #include "google/protobuf/util/json_util.h" 40 | #include "google/protobuf/util/type_resolver_util.h" 41 | 42 | namespace demo_plugin { 43 | 44 | namespace protobuf = ::google::protobuf; 45 | 46 | void MessageToBuffer(const demo_plugin::protobuf::MessageLite& in, 47 | TF_Buffer* out, TF_Status* status); 48 | 49 | void BufferToMessage(const TF_Buffer* in, 50 | demo_plugin::protobuf::MessageLite& out, 51 | TF_Status* status); 52 | } // namespace demo_plugin 53 | 54 | #endif // TENSORFLOW_PLUGIN_SRC_GRAPH_UTILS_TF_BUFFER_H_ 55 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/kernels/cpu/BUILD: -------------------------------------------------------------------------------- 1 | load("//tensorflow_plugin:demo_plugin.bzl", "tf_copts") 2 | 3 | package( 4 | licenses = ["notice"], # Apache 2.0 5 | ) 6 | 7 | cc_library( 8 | name = "relu_op", 9 | srcs = ["relu_op.cc"], 10 | copts = tf_copts(), 11 | linkstatic = 1, 12 | visibility = ["//visibility:public"], 13 | deps = [ 14 | "//tensorflow_plugin:core", 15 | "@com_google_absl//absl/container:inlined_vector", 16 | ], 17 | alwayslink = True, 18 | ) 19 | 20 | cc_library( 21 | name = "conv2d_op", 22 | srcs = ["conv_ops_using_gemm.cc"], 23 | hdrs = ["gemm_functors.h"], 24 | copts = tf_copts(), 25 | linkstatic = 1, 26 | visibility = ["//visibility:public"], 27 | deps = [ 28 | "//tensorflow_plugin:core", 29 | "@com_google_absl//absl/container:inlined_vector", 30 | "@eigen_archive//:eigen", 31 | "//third_party/eigen3" 32 | ], 33 | alwayslink = True, 34 | ) 35 | 36 | CPU_KERNELS = [ 37 | ":relu_op", 38 | ":conv2d_op", 39 | ] 40 | 41 | cc_library( 42 | name = "cpu_kernel_impl", 43 | srcs = ["cpu_kernel_init.cc"], 44 | hdrs = [ 45 | "cpu_kernel_init.h", 46 | "//tensorflow_plugin/src/device/cpu:cpu_device_plugin.h", 47 | ], 48 | visibility = ["//visibility:public"], 49 | deps = [ 50 | "//tensorflow_plugin:core", 51 | ] + CPU_KERNELS, 52 | alwayslink = True, 53 | ) 54 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/kernels/cpu/cpu_kernel_init.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #include "tensorflow_plugin/src/kernels/cpu/cpu_kernel_init.h" 17 | #include "tensorflow/c/kernels.h" 18 | 19 | void RegisterDeviceKernels(const char* device_type) { 20 | RegisterDeviceRelu(device_type); 21 | RegisterDeviceConv2D(device_type); 22 | } 23 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/kernels/cpu/cpu_kernel_init.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_KERNELS_CPU_KERNEL_INIT_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_KERNELS_CPU_KERNEL_INIT_H_ 18 | 19 | #include 20 | 21 | #include "tensorflow_plugin/src/device/cpu/cpu_device_plugin.h" 22 | 23 | void RegisterDeviceRelu(const char* device_type); 24 | void RegisterDeviceConv2D(const char* device_type); 25 | 26 | void RegisterDeviceKernels(const char* device_type); 27 | #endif // TENSORFLOW_PLUGIN_SRC_KERNELS_GPU_KERNEL_INIT_H_ 28 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/kernels/cpu/gemm_functors.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | Licensed under the Apache License, Version 2.0 (the "License"); 3 | you may not use this file except in compliance with the License. 4 | You may obtain a copy of the License at 5 | 6 | http://www.apache.org/licenses/LICENSE-2.0 7 | 8 | Unless required by applicable law or agreed to in writing, software 9 | distributed under the License is distributed on an "AS IS" BASIS, 10 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 11 | See the License for the specific language governing permissions and 12 | limitations under the License. 13 | ==============================================================================*/ 14 | 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_KERNEL_CPU_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_KERNEL_CPU_H_ 18 | 19 | //#define EIGEN_USE_THREADS 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "third_party/eigen3/unsupported/Eigen/CXX11/Tensor" 26 | 27 | // FixedPoint header must be included after Tensor. 28 | // clang-format off 29 | #include "third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint" 30 | // clang-format on 31 | 32 | template class FastGemmFunctor { 33 | public: 34 | void operator()(size_t m, size_t n, size_t k, const T1 *a, size_t lda, 35 | const T2 *b, size_t ldb, T3 *c, size_t ldc) { 36 | Eigen::array dim_a = {{m, k}}; 37 | Eigen::array dim_b = {{k, n}}; 38 | Eigen::array dim_c = {{m, n}}; 39 | Eigen::TensorMap< 40 | Eigen::Tensor, 41 | Eigen::Aligned> 42 | a_matrix(a, dim_a); 43 | Eigen::TensorMap< 44 | Eigen::Tensor, 45 | Eigen::Aligned> 46 | b_matrix(b, dim_b); 47 | Eigen::TensorMap, 48 | Eigen::Aligned> 49 | c_matrix(c, dim_c); 50 | 51 | Eigen::array, 1> dim_pair; 52 | dim_pair[0].first = 1; 53 | dim_pair[0].second = 0; 54 | Eigen::ThreadPool tp(8); 55 | Eigen::ThreadPoolDevice thread_pool_device(&tp, 8); 56 | c_matrix.device(thread_pool_device) = a_matrix.contract(b_matrix, dim_pair); 57 | } 58 | }; 59 | 60 | #endif // TENSORFLOW_PLUGIN_SRC_KERNEL_CPU_H_ 61 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/plugin_device.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include 17 | 18 | #include "tensorflow/c/experimental/stream_executor/stream_executor.h" 19 | #include "tensorflow_plugin/src/device/cpu/cpu_device_plugin.h" 20 | 21 | #include "plugin_device.h" 22 | 23 | void SE_InitPlugin(SE_PlatformRegistrationParams* const params, 24 | TF_Status* const status) { 25 | params->platform->struct_size = SP_PLATFORM_STRUCT_SIZE; 26 | params->platform->name = DEVICE_NAME; 27 | params->platform->type = DEVICE_TYPE; 28 | SE_InitPluginFns(params, status); 29 | } 30 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/plugin_device.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #ifndef TENSORFLOW_PLUGIN_SRC_PLUGIN_DEVICE_H_ 18 | #define TENSORFLOW_PLUGIN_SRC_PLUGIN_DEVICE_H_ 19 | 20 | constexpr char DEVICE_TYPE[] = "MY_DEVICE"; 21 | constexpr char DEVICE_NAME[] = "FAKE_CPU_DEVICE"; 22 | 23 | #endif // TENSORFLOW_PLUGIN_SRC_PLUGIN_DEVICE_H_ 24 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/plugin_graph.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #include "tensorflow/c/experimental/grappler/grappler.h" 18 | #include "tensorflow_plugin/src/graph/plugin_optimizer.h" 19 | 20 | void TF_InitGraphPlugin(TP_OptimizerRegistrationParams* params, 21 | TF_Status* status) { 22 | params->struct_size = TP_OPTIMIZER_REGISTRATION_PARAMS_STRUCT_SIZE; 23 | params->optimizer_configs->struct_size = TP_OPTIMIZER_CONFIGS_STRUCT_SIZE; 24 | params->optimizer->struct_size = TP_OPTIMIZER_STRUCT_SIZE; 25 | 26 | // Define some configs to turn off existing optimizers. 27 | params->optimizer_configs->remapping = TF_TriState_Off; 28 | params->optimizer_configs->layout_optimizer = TF_TriState_Off; 29 | 30 | // Set functions to create a new optimizer. 31 | params->device_type = "MY_DEVICE"; 32 | params->optimizer->create_func = (demo_plugin::graph::Optimizer_Create); 33 | params->optimizer->optimize_func = (demo_plugin::graph::Optimizer_Optimize); 34 | params->optimizer->destroy_func = (demo_plugin::graph::Optimizer_Destroy); 35 | } 36 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/plugin_kernel.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #include 18 | #include "tensorflow/c/kernels.h" 19 | #include "tensorflow_plugin/src/kernels/cpu/cpu_kernel_init.h" 20 | 21 | #include "plugin_device.h" 22 | 23 | void TF_InitKernel() { RegisterDeviceKernels(DEVICE_TYPE); } 24 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/plugin_kernel.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #ifndef TENSORFLOW_PLUGIN_SRC_PLUGIN_KERNEL_H_ 18 | #define TENSORFLOW_PLUGIN_SRC_PLUGIN_KERNEL_H_ 19 | 20 | void TF_InitKernel(); 21 | 22 | #endif // TENSORFLOW_PLUGIN_SRC_PLUGIN_KERNEL_H_ 23 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/plugin_profiler.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #include "plugin_device.h" 17 | #include "tensorflow/c/experimental/pluggable_profiler/pluggable_profiler.h" 18 | #include "tensorflow_plugin/src/profiler/cpu/demo_profiler.h" 19 | 20 | void TF_InitProfiler(TF_ProfilerRegistrationParams *params, TF_Status *status) { 21 | params->struct_size = TF_PROFILER_REGISTRATION_PARAMS_STRUCT_SIZE; 22 | params->struct_size = TF_PROFILER_REGISTRATION_PARAMS_STRUCT_SIZE; 23 | params->profiler_fns->struct_size = TP_PROFILER_FNS_STRUCT_SIZE; 24 | params->profiler->type = 25 | DEVICE_TYPE; // type is device type, such as GPU, APU.. 26 | TF_InitPluginProfilerFns(params, status); 27 | } 28 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/profiler/cpu/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "demo_profiler", 5 | srcs = ["demo_profiler.cc"], 6 | hdrs = ["demo_profiler.h"], 7 | linkstatic = 1, 8 | visibility = ["//visibility:public"], 9 | deps = [ 10 | "@local_config_tf//:tf_header_lib", 11 | "//tensorflow_plugin/src/utils:protos_all", 12 | "//tensorflow_plugin/src/profiler/cpu/utils:xplane_utils", 13 | ], 14 | alwayslink = True, 15 | ) 16 | 17 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/profiler/cpu/demo_profiler.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #ifndef TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_CPU_PROFILER_PLUGIN_H_ 18 | #define TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_CPU_PROFILER_PLUGIN_H_ 19 | #include "tensorflow/c/experimental/pluggable_profiler/pluggable_profiler.h" 20 | #include "tensorflow/c/tf_status.h" 21 | #include "tensorflow_plugin/src/profiler/cpu/utils/xplane_builder.h" 22 | #include "tensorflow_plugin/src/utils/xplane.pb.h" 23 | namespace demo_plugin { 24 | namespace profiler { 25 | class PerDeviceCollector { 26 | public: 27 | PerDeviceCollector(int device_id, uint64_t start_walltime_ns) 28 | : device_id_(device_id),start_walltime_ns_(start_walltime_ns) {} 29 | 30 | void CreateXEvent(XPlaneBuilder* plane, XLineBuilder* line) { 31 | // Just provide a dummy case here, plugin authors need to get kernel 32 | // execution profing data from their own device runtime. 33 | std::string kernel_name = "DummyKernel"; 34 | XEventMetadata* event_metadata = plane->GetOrCreateEventMetadata(std::move(kernel_name)); 35 | XEventBuilder xevent = line->AddEvent(*event_metadata); 36 | xevent.SetTimestampNs(10000 + start_walltime_ns_); 37 | xevent.SetEndTimestampNs(1000000 + start_walltime_ns_); 38 | 39 | xevent.AddStatValue( 40 | *plane->GetOrCreateStatMetadata(std::string("SIMD width")),8); 41 | } 42 | 43 | void Flush(XPlaneBuilder* device_plane) { 44 | int64_t line_id = 0; 45 | XLineBuilder line = device_plane->GetOrCreateLine(line_id); 46 | line.SetTimestampNs(start_walltime_ns_); 47 | CreateXEvent(device_plane, &line); 48 | 49 | device_plane->ForEachLine([&](XLineBuilder line) { 50 | line.SetName("PluginDevice stream"); 51 | }); 52 | } 53 | 54 | private: 55 | int device_id_; 56 | uint64_t start_walltime_ns_; 57 | }; 58 | 59 | } // namespace profiler 60 | } // namespace demo_plugin 61 | void TF_InitPluginProfilerFns(TF_ProfilerRegistrationParams* params, TF_Status* status); 62 | 63 | 64 | 65 | #endif // TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_CPU_PROFILER_PLUGIN_H_ 66 | 67 | 68 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/profiler/cpu/utils/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | 4 | 5 | cc_library( 6 | name = "time_utils_impl", 7 | srcs = [ 8 | "time_utils.cc", 9 | "time_utils.h", 10 | ], 11 | deps = [ 12 | "@com_google_absl//absl/time", 13 | "//tensorflow_plugin/src/utils:logging", 14 | "//third_party/eigen3", 15 | ], 16 | alwayslink = True, 17 | ) 18 | 19 | cc_library( 20 | name = "xplane_builder", 21 | srcs = ["xplane_builder.cc"], 22 | hdrs = ["xplane_builder.h"], 23 | visibility = ["//visibility:public"], 24 | deps = [ 25 | ":time_utils", 26 | ":timespan", 27 | "//tensorflow_plugin/src/utils:protos_all", 28 | "//tensorflow_plugin/src/utils:logging", 29 | "@com_google_absl//absl/container:flat_hash_map", 30 | "@com_google_absl//absl/strings", 31 | "@com_google_absl//absl/types:optional", 32 | ], 33 | ) 34 | 35 | 36 | cc_library( 37 | name = "xplane_visitor", 38 | srcs = ["xplane_visitor.cc"], 39 | hdrs = ["xplane_visitor.h"], 40 | visibility = ["//visibility:public"], 41 | deps = [ 42 | ":time_utils", 43 | ":timespan", 44 | "//tensorflow_plugin/src/utils:protos_all", 45 | "@com_google_absl//absl/container:flat_hash_map", 46 | "@com_google_absl//absl/strings", 47 | "@com_google_absl//absl/types:optional", 48 | ], 49 | ) 50 | 51 | cc_library( 52 | name = "time_utils", 53 | hdrs = ["time_utils.h"], 54 | deps = [ 55 | ":time_utils_impl", 56 | ], 57 | ) 58 | 59 | 60 | cc_library( 61 | name = "trace_utils", 62 | hdrs = ["trace_utils.h"], 63 | deps = [ 64 | ], 65 | ) 66 | 67 | 68 | cc_library( 69 | name = "timespan", 70 | hdrs = ["timespan.h"], 71 | deps = [ 72 | ":time_utils", 73 | "@com_google_absl//absl/strings", 74 | ], 75 | ) 76 | 77 | 78 | cc_library( 79 | name = "xplane_utils", 80 | srcs = ["xplane_utils.cc"], 81 | hdrs = ["xplane_utils.h"], 82 | visibility = ["//visibility:public"], 83 | deps = [ 84 | ":time_utils", 85 | ":timespan", 86 | ":trace_utils", 87 | ":xplane_builder", 88 | ":xplane_visitor", 89 | "//tensorflow_plugin/src/utils:protos_all", 90 | "@com_google_absl//absl/container:flat_hash_map", 91 | "@com_google_absl//absl/container:flat_hash_set", 92 | "@com_google_absl//absl/strings", 93 | "//third_party/eigen3", 94 | ], 95 | ) 96 | 97 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/profiler/cpu/utils/time_utils.cc: -------------------------------------------------------------------------------- 1 | #include "tensorflow_plugin/src/profiler/cpu/utils/time_utils.h" 2 | 3 | #include "absl/time/clock.h" 4 | #include "absl/time/time.h" 5 | 6 | namespace demo_plugin { 7 | namespace profiler { 8 | 9 | int64_t GetCurrentTimeNanos() { 10 | // absl::GetCurrentTimeNanos() is much faster than EnvTime::NowNanos(). 11 | // It is wrapped under tensorflow::profiler::GetCurrentTimeNanos to avoid ODR 12 | // violation and to allow switching to yet another implementation if required. 13 | return absl::GetCurrentTimeNanos(); 14 | } 15 | 16 | void SleepForNanos(int64_t ns) { absl::SleepFor(absl::Nanoseconds(ns)); } 17 | 18 | void SpinForNanos(int64_t ns) { 19 | if (ns <= 0) return; 20 | int64_t deadline = GetCurrentTimeNanos() + ns; 21 | while (GetCurrentTimeNanos() < deadline) { 22 | } 23 | } 24 | 25 | } // namespace profiler 26 | } // namespace demo_plugin 27 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/profiler/cpu/utils/time_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2019 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_UTILS_TIME_UTILS_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_UTILS_TIME_UTILS_H_ 18 | 19 | #include "tensorflow_plugin/src/utils/types.h" 20 | 21 | namespace demo_plugin { 22 | namespace profiler { 23 | 24 | // Converts among different time units. 25 | // NOTE: We use uint64 for picoseconds and nanoseconds, which are used in 26 | // storage, and double for other units that are used in the UI. 27 | inline double PicosToNanos(uint64 ps) { return ps / 1E3; } 28 | inline double PicosToMicros(uint64 ps) { return ps / 1E6; } 29 | inline double PicosToMillis(uint64 ps) { return ps / 1E9; } 30 | inline double PicosToSeconds(uint64 ps) { return ps / 1E12; } 31 | inline uint64 NanosToPicos(uint64 ns) { return ns * 1000; } 32 | inline double NanosToMicros(uint64 ns) { return ns / 1E3; } 33 | inline double MicrosToNanos(double us) { return us * 1E3; } 34 | inline double MicrosToMillis(double us) { return us / 1E3; } 35 | inline uint64 MillisToPicos(double ms) { return ms * 1E9; } 36 | inline uint64 MillisToNanos(double ms) { return ms * 1E6; } 37 | inline double MillisToSeconds(double ms) { return ms / 1E3; } 38 | inline uint64 SecondsToNanos(double s) { return s * 1E9; } 39 | 40 | // Returns the current CPU wallclock time in nanoseconds. 41 | int64_t GetCurrentTimeNanos(); 42 | 43 | // Sleeps for the specified duration. 44 | void SleepForNanos(int64_t ns); 45 | inline void SleepForMicros(int64_t us) { SleepForNanos(us * 1000); } 46 | inline void SleepForMillis(int64_t ms) { SleepForNanos(ms * 1000000); } 47 | inline void SleepForSeconds(int64_t s) { SleepForNanos(s * 1000000000); } 48 | 49 | // Spins to simulate doing some work instead of sleeping, because sleep 50 | // precision is poor. For testing only. 51 | void SpinForNanos(int64_t ns); 52 | inline void SpinForMicros(int64_t us) { SpinForNanos(us * 1000); } 53 | 54 | } // namespace profiler 55 | } // namespace demo_plugin 56 | 57 | #endif // TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_UTILS_TIME_UTILS_H_ 58 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/profiler/cpu/utils/trace_utils.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2020 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_UTILS_TRACE_UTILS_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_UTILS_TRACE_UTILS_H_ 18 | 19 | #include "tensorflow_plugin/src/utils/integral_types.h" 20 | namespace demo_plugin { 21 | namespace profiler { 22 | 23 | // Constants used as trace_viewer PID (device_id in trace_events.proto). 24 | // PID 0 is unused. 25 | // Support up to 500 accelerator devices. 26 | constexpr uint32 kFirstDeviceId = 1; 27 | constexpr uint32 kLastDeviceId = 500; 28 | // Host threads are shown as a single fake device. 29 | constexpr uint32 kHostThreadsDeviceId = kLastDeviceId + 1; 30 | 31 | // Constants used as trace_viewer TID (resource_id in trace_events.proto). 32 | constexpr int kThreadIdDerivedMin = 0xdeadbeef; 33 | constexpr int kThreadIdStepInfo = kThreadIdDerivedMin; 34 | constexpr int kThreadIdKernelLaunch = kThreadIdDerivedMin + 1; 35 | constexpr int kThreadIdTfNameScope = kThreadIdDerivedMin + 2; 36 | constexpr int kThreadIdTfOp = kThreadIdDerivedMin + 3; 37 | constexpr int kThreadIdHloModule = kThreadIdDerivedMin + 4; 38 | constexpr int kThreadIdHloOp = kThreadIdDerivedMin + 5; 39 | constexpr int kThreadIdOverhead = kThreadIdDerivedMin + 6; 40 | constexpr int kThreadIdSource = kThreadIdDerivedMin + 7; 41 | constexpr int kThreadIdDerivedMax = kThreadIdSource; 42 | 43 | static inline bool IsDerivedThreadId(int thread_id) { 44 | return thread_id >= kThreadIdDerivedMin && thread_id <= kThreadIdDerivedMax; 45 | } 46 | 47 | } // namespace profiler 48 | } // namespace demo_plugin 49 | 50 | #endif // TENSORFLOW_PLUGIN_SRC_PROFILER_CPU_UTILS_TRACE_UTILS_H_ 51 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/attr_value.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package demo_plugin; 4 | 5 | import "tensorflow_plugin/src/utils/tensor.proto"; 6 | import "tensorflow_plugin/src/utils/tensor_shape.proto"; 7 | import "tensorflow_plugin/src/utils/types.proto"; 8 | 9 | option cc_enable_arenas = true; 10 | option java_outer_classname = "AttrValueProtos"; 11 | option java_multiple_files = true; 12 | option java_package = "org.tensorflow.framework"; 13 | option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/attr_value_go_proto"; 14 | 15 | // Protocol buffer representing the value for an attr used to configure an Op. 16 | // Comment indicates the corresponding attr type. Only the field matching the 17 | // attr type may be filled. 18 | message AttrValue { 19 | // LINT.IfChange 20 | message ListValue { 21 | repeated bytes s = 2; // "list(string)" 22 | repeated int64 i = 3 [packed = true]; // "list(int)" 23 | repeated float f = 4 [packed = true]; // "list(float)" 24 | repeated bool b = 5 [packed = true]; // "list(bool)" 25 | repeated DataType type = 6 [packed = true]; // "list(type)" 26 | repeated TensorShapeProto shape = 7; // "list(shape)" 27 | repeated TensorProto tensor = 8; // "list(tensor)" 28 | repeated NameAttrList func = 9; // "list(attr)" 29 | } 30 | // LINT.ThenChange(https://www.tensorflow.org/code/tensorflow/c/c_api.cc) 31 | 32 | oneof value { 33 | bytes s = 2; // "string" 34 | int64 i = 3; // "int" 35 | float f = 4; // "float" 36 | bool b = 5; // "bool" 37 | DataType type = 6; // "type" 38 | TensorShapeProto shape = 7; // "shape" 39 | TensorProto tensor = 8; // "tensor" 40 | ListValue list = 1; // any "list(...)" 41 | 42 | // "func" represents a function. func.name is a function's name or 43 | // a primitive op's name. func.attr.first is the name of an attr 44 | // defined for that function. func.attr.second is the value for 45 | // that attr in the instantiation. 46 | NameAttrList func = 10; 47 | 48 | // This is a placeholder only used in nodes defined inside a 49 | // function. It indicates the attr value will be supplied when 50 | // the function is instantiated. For example, let us suppose a 51 | // node "N" in function "FN". "N" has an attr "A" with value 52 | // placeholder = "foo". When FN is instantiated with attr "foo" 53 | // set to "bar", the instantiated node N's attr A will have been 54 | // given the value "bar". 55 | string placeholder = 9; 56 | } 57 | } 58 | 59 | // A list of attr names and their values. The whole list is attached 60 | // with a string name. E.g., MatMul[T=float]. 61 | message NameAttrList { 62 | string name = 1; 63 | map attr = 2; 64 | } 65 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/device_properties.proto: -------------------------------------------------------------------------------- 1 | /* Copyright 2017 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | syntax = "proto3"; 17 | 18 | package demo_plugin; 19 | 20 | option cc_enable_arenas = true; 21 | option java_outer_classname = "DevicePropertiesProtos"; 22 | option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/protobuf/for_core_protos_go_proto"; 23 | 24 | message DeviceProperties { 25 | // Device type (CPU, GPU, ...) 26 | string type = 1; 27 | // Vendor (Intel, nvidia, ...) 28 | string vendor = 2; 29 | // Model (Haswell, K40, ...) 30 | string model = 3; 31 | // Core Frequency in Mhz 32 | int64 frequency = 4; 33 | // Number of cores 34 | int64 num_cores = 5; 35 | // Version of the tools and libraries used with this device (e.g. gcc 4.9, 36 | // cudnn 5.1) 37 | map environment = 6; 38 | // Number of registers per core. 39 | int64 num_registers = 7; 40 | // L1 cache size in bytes 41 | int64 l1_cache_size = 8; 42 | // L2 cache size in bytes 43 | int64 l2_cache_size = 9; 44 | // L3 cache size in bytes 45 | int64 l3_cache_size = 10; 46 | // Shared memory size per multiprocessor in bytes. This field is 47 | // applicable to GPUs only. 48 | int64 shared_memory_size_per_multiprocessor = 11; 49 | // Memory size in bytes 50 | int64 memory_size = 12; 51 | // Memory bandwidth in KB/s 52 | int64 bandwidth = 13; 53 | } 54 | 55 | message NamedDevice { 56 | string name = 1; 57 | DeviceProperties properties = 2; 58 | } 59 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/env_time.cc: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #include 18 | #include 19 | 20 | #include "tensorflow_plugin/src/utils/env_time.h" 21 | 22 | namespace demo_plugin { 23 | 24 | /* static */ 25 | uint64 EnvTime::NowNanos() { 26 | struct timespec ts; 27 | clock_gettime(CLOCK_REALTIME, &ts); 28 | return (static_cast(ts.tv_sec) * kSecondsToNanos + 29 | static_cast(ts.tv_nsec)); 30 | } 31 | 32 | } // namespace demo_plugin 33 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/env_time.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_ENV_TIME_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_UTILS_ENV_TIME_H_ 18 | 19 | #include 20 | 21 | #include "tensorflow_plugin/src/utils/types.h" 22 | 23 | namespace demo_plugin { 24 | 25 | /// \brief An interface used by the tensorflow implementation to 26 | /// access timer related operations. 27 | class EnvTime { 28 | public: 29 | static constexpr uint64 kMicrosToPicos = 1000ULL * 1000ULL; 30 | static constexpr uint64 kMicrosToNanos = 1000ULL; 31 | static constexpr uint64 kMillisToMicros = 1000ULL; 32 | static constexpr uint64 kMillisToNanos = 1000ULL * 1000ULL; 33 | static constexpr uint64 kNanosToPicos = 1000ULL; 34 | static constexpr uint64 kSecondsToMillis = 1000ULL; 35 | static constexpr uint64 kSecondsToMicros = 1000ULL * 1000ULL; 36 | static constexpr uint64 kSecondsToNanos = 1000ULL * 1000ULL * 1000ULL; 37 | 38 | EnvTime() = default; 39 | virtual ~EnvTime() = default; 40 | 41 | /// \brief Returns the number of nano-seconds since the Unix epoch. 42 | static uint64 NowNanos(); 43 | 44 | /// \brief Returns the number of micro-seconds since the Unix epoch. 45 | static uint64 NowMicros() { return NowNanos() / kMicrosToNanos; } 46 | 47 | /// \brief Returns the number of seconds since the Unix epoch. 48 | static uint64 NowSeconds() { return NowNanos() / kSecondsToNanos; } 49 | 50 | /// \brief A version of NowNanos() that may be overridden by a subclass. 51 | virtual uint64 GetOverridableNowNanos() const { return NowNanos(); } 52 | 53 | /// \brief A version of NowMicros() that may be overridden by a subclass. 54 | virtual uint64 GetOverridableNowMicros() const { 55 | return GetOverridableNowNanos() / kMicrosToNanos; 56 | } 57 | 58 | /// \brief A version of NowSeconds() that may be overridden by a subclass. 59 | virtual uint64 GetOverridableNowSeconds() const { 60 | return GetOverridableNowNanos() / kSecondsToNanos; 61 | } 62 | }; 63 | 64 | } // namespace demo_plugin 65 | 66 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_ENV_TIME_H_ 67 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/graph.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package demo_plugin; 4 | 5 | import "tensorflow_plugin/src/utils/function.proto"; 6 | import "tensorflow_plugin/src/utils/node_def.proto"; 7 | import "tensorflow_plugin/src/utils/versions.proto"; 8 | 9 | option cc_enable_arenas = true; 10 | option java_outer_classname = "GraphProtos"; 11 | option java_multiple_files = true; 12 | option java_package = "org.tensorflow.framework"; 13 | option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/graph_go_proto"; 14 | 15 | // Represents the graph of operations 16 | message GraphDef { 17 | repeated NodeDef node = 1; 18 | 19 | // Compatibility versions of the graph. See core/public/version.h for version 20 | // history. The GraphDef version is distinct from the TensorFlow version, and 21 | // each release of TensorFlow will support a range of GraphDef versions. 22 | VersionDef versions = 4; 23 | 24 | // Deprecated single version field; use versions above instead. Since all 25 | // GraphDef changes before "versions" was introduced were forward 26 | // compatible, this field is entirely ignored. 27 | int32 version = 3 [deprecated = true]; 28 | 29 | // "library" provides user-defined functions. 30 | // 31 | // Naming: 32 | // * library.function.name are in a flat namespace. 33 | // NOTE: We may need to change it to be hierarchical to support 34 | // different orgs. E.g., 35 | // { "/google/nn", { ... }}, 36 | // { "/google/vision", { ... }} 37 | // { "/org_foo/module_bar", { ... }} 38 | // map named_lib; 39 | // * If node[i].op is the name of one function in "library", 40 | // node[i] is deemed as a function call. Otherwise, node[i].op 41 | // must be a primitive operation supported by the runtime. 42 | // 43 | // 44 | // Function call semantics: 45 | // 46 | // * The callee may start execution as soon as some of its inputs 47 | // are ready. The caller may want to use Tuple() mechanism to 48 | // ensure all inputs are ready in the same time. 49 | // 50 | // * The consumer of return values may start executing as soon as 51 | // the return values the consumer depends on are ready. The 52 | // consumer may want to use Tuple() mechanism to ensure the 53 | // consumer does not start until all return values of the callee 54 | // function are ready. 55 | FunctionDefLibrary library = 2; 56 | } 57 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/gtl/BUILD: -------------------------------------------------------------------------------- 1 | cc_library( 2 | name = "gtl_libs", 3 | srcs = glob([ 4 | "*.cc", 5 | ]), 6 | hdrs = glob([ 7 | "*.h", 8 | ]), 9 | linkstatic = 1, 10 | visibility = ["//visibility:public"], 11 | deps = [ 12 | "//tensorflow_plugin/src/utils:prefetch", 13 | "//tensorflow_plugin/src/utils:types", 14 | "@com_google_absl//absl/container:inlined_vector", 15 | "@com_google_absl//absl/strings", 16 | "@com_google_absl//absl/types:span", 17 | ], 18 | ) 19 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/gtl/array_slice.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_GTL_ARRAY_SLICE_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_UTILS_GTL_ARRAY_SLICE_H_ 18 | 19 | #include "absl/types/span.h" 20 | // TODO(Intel-tf): This is kept only because lots of targets transitively depend 21 | // on it. Remove all targets' dependencies. 22 | #include "tensorflow_plugin/src/utils/gtl/inlined_vector.h" 23 | 24 | namespace demo_plugin { 25 | namespace gtl { 26 | 27 | template 28 | using ArraySlice = absl::Span; 29 | 30 | template 31 | using MutableArraySlice = absl::Span; 32 | 33 | } // namespace gtl 34 | } // namespace demo_plugin 35 | 36 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_GTL_ARRAY_SLICE_H_ 37 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/gtl/inlined_vector.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_GTL_INLINED_VECTOR_H_ 18 | #define TENSORFLOW_PLUGIN_SRC_UTILS_GTL_INLINED_VECTOR_H_ 19 | 20 | #include "absl/container/inlined_vector.h" 21 | 22 | namespace demo_plugin { 23 | namespace gtl { 24 | using absl::InlinedVector; 25 | 26 | } // namespace gtl 27 | } // namespace demo_plugin 28 | 29 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_GTL_INLINED_VECTOR_H_ 30 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/gtl/map_traits.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_GTL_MAP_TRAITS_H_ 18 | #define TENSORFLOW_PLUGIN_SRC_UTILS_GTL_MAP_TRAITS_H_ 19 | 20 | #include 21 | 22 | // Traits classes for performing uniform lookup on different map value types. 23 | // 24 | // The access is computed as follows: 25 | // 26 | // 1. If T has a `first` or `second` field, use them. 27 | // 2. Otherwise if it has `key()` or `value()` methods, use them. 28 | // 3. Otherwise the program is ill-formed. 29 | namespace demo_plugin { 30 | namespace gtl { 31 | namespace subtle { 32 | namespace internal_map_traits { 33 | struct Rank1 {}; 34 | struct Rank0 : Rank1 {}; 35 | 36 | template 37 | auto GetKey(V&& v, Rank0) -> decltype((std::forward(v).first)) { 38 | return std::forward(v).first; 39 | } 40 | template 41 | auto GetKey(V&& v, Rank1) -> decltype(std::forward(v).key()) { 42 | return std::forward(v).key(); 43 | } 44 | 45 | template 46 | auto GetMapped(V&& v, Rank0) -> decltype((std::forward(v).second)) { 47 | return std::forward(v).second; 48 | } 49 | template 50 | auto GetMapped(V&& v, Rank1) -> decltype(std::forward(v).value()) { 51 | return std::forward(v).value(); 52 | } 53 | 54 | } // namespace internal_map_traits 55 | 56 | // Accesses the `key_type` from a `value_type`. 57 | template 58 | auto GetKey(V&& v) 59 | -> decltype(internal_map_traits::GetKey(std::forward(v), 60 | internal_map_traits::Rank0())) { 61 | return internal_map_traits::GetKey(std::forward(v), 62 | internal_map_traits::Rank0()); 63 | } 64 | 65 | // Accesses the `mapped_type` from a `value_type`. 66 | template 67 | auto GetMapped(V&& v) 68 | -> decltype(internal_map_traits::GetMapped(std::forward(v), 69 | internal_map_traits::Rank0())) { 70 | return internal_map_traits::GetMapped(std::forward(v), 71 | internal_map_traits::Rank0()); 72 | } 73 | 74 | } // namespace subtle 75 | } // namespace gtl 76 | } // namespace demo_plugin 77 | 78 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_GTL_MAP_TRAITS_H_ 79 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/integral_types.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_INTEGRAL_TYPES_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_UTILS_INTEGRAL_TYPES_H_ 18 | 19 | namespace demo_plugin { 20 | 21 | typedef signed char int8; 22 | typedef short int16; 23 | typedef int int32; 24 | 25 | // for compatible with int64_t 26 | typedef long int64; 27 | 28 | typedef unsigned char uint8; 29 | typedef unsigned short uint16; 30 | typedef unsigned int uint32; 31 | typedef unsigned long long uint64; 32 | 33 | } // namespace demo_plugin 34 | 35 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_INTEGRAL_TYPES_H_ 36 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/platform.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_PLATFORM_DEFINE_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_UTILS_PLATFORM_DEFINE_H_ 18 | 19 | #define PLATFORM_POSIX 20 | 21 | // Look for both gcc/clang and Visual Studio macros indicating we're compiling 22 | // for an x86 device. 23 | #if defined(__x86_64__) || defined(__amd64__) || defined(_M_IX86) || \ 24 | defined(_M_X64) 25 | #define PLATFORM_IS_X86 26 | #endif 27 | 28 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_PLATFORM_DEFINE_H_ 29 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/prefetch.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | 17 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_PLATFORM_PREFETCH_H_ 18 | #define TENSORFLOW_PLUGIN_SRC_UTILS_PLATFORM_PREFETCH_H_ 19 | 20 | #include "tensorflow_plugin/src/utils/platform.h" 21 | 22 | namespace demo_plugin { 23 | namespace port { 24 | 25 | // Prefetching support 26 | // 27 | // Defined behavior on some of the uarchs: 28 | // PREFETCH_HINT_T0: 29 | // prefetch to all levels of the hierarchy (except on p4: prefetch to L2) 30 | // PREFETCH_HINT_NTA: 31 | // p4: fetch to L2, but limit to 1 way (out of the 8 ways) 32 | // core: skip L2, go directly to L1 33 | // k8 rev E and later: skip L2, can go to either of the 2-ways in L1 34 | enum PrefetchHint { 35 | PREFETCH_HINT_T0 = 3, // More temporal locality 36 | PREFETCH_HINT_T1 = 2, 37 | PREFETCH_HINT_T2 = 1, // Less temporal locality 38 | PREFETCH_HINT_NTA = 0 // No temporal locality 39 | }; 40 | template void prefetch(const void *x); 41 | 42 | // --------------------------------------------------------------------------- 43 | // Inline implementation 44 | // --------------------------------------------------------------------------- 45 | template inline void prefetch(const void *x) { 46 | // Check of COMPILER_GCC macro below is kept only for backward-compatibility 47 | // reasons. COMPILER_GCC3 is the macro that actually enables prefetch. 48 | #if defined(__llvm__) || defined(COMPILER_GCC) || defined(COMPILER_GCC3) 49 | __builtin_prefetch(x, 0, hint); 50 | #else 51 | // You get no effect. Feel free to add more sections above. 52 | #endif 53 | } 54 | 55 | } // namespace port 56 | } // namespace demo_plugin 57 | 58 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_PLATFORM_PREFETCH_H_ 59 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/resource_handle.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package demo_plugin; 4 | 5 | import "tensorflow_plugin/src/utils/tensor_shape.proto"; 6 | import "tensorflow_plugin/src/utils/types.proto"; 7 | 8 | option cc_enable_arenas = true; 9 | option java_outer_classname = "ResourceHandle"; 10 | option java_multiple_files = true; 11 | option java_package = "org.tensorflow.framework"; 12 | option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/resource_handle_go_proto"; 13 | 14 | // Protocol buffer representing a handle to a tensorflow resource. Handles are 15 | // not valid across executions, but can be serialized back and forth from within 16 | // a single run. 17 | message ResourceHandleProto { 18 | // Unique name for the device containing the resource. 19 | string device = 1; 20 | 21 | // Container in which this resource is placed. 22 | string container = 2; 23 | 24 | // Unique name of this resource. 25 | string name = 3; 26 | 27 | // Hash code for the type of the resource. Is only valid in the same device 28 | // and in the same execution. 29 | uint64 hash_code = 4; 30 | 31 | // For debug-only, the name of the type pointed to by this handle, if 32 | // available. 33 | string maybe_type_name = 5; 34 | 35 | // Protocol buffer representing a pair of (data type, tensor shape). 36 | message DtypeAndShape { 37 | DataType dtype = 1; 38 | TensorShapeProto shape = 2; 39 | } 40 | 41 | // Data types and shapes for the underlying resource. 42 | repeated DtypeAndShape dtypes_and_shapes = 6; 43 | 44 | reserved 7; 45 | } 46 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/stringpiece.h: -------------------------------------------------------------------------------- 1 | /* Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | ==============================================================================*/ 15 | 16 | #ifndef TENSORFLOW_PLUGIN_SRC_UTILS_STRINGPIECE_H_ 17 | #define TENSORFLOW_PLUGIN_SRC_UTILS_STRINGPIECE_H_ 18 | 19 | #include "absl/strings/string_view.h" // IWYU pragma: export 20 | 21 | // StringPiece is a simple structure containing a pointer into some external 22 | // storage and a size. The user of a StringPiece must ensure that the slice 23 | // is not used after the corresponding external storage has been 24 | // deallocated. 25 | // 26 | // Multiple threads can invoke const methods on a StringPiece without 27 | // external synchronization, but if any of the threads may call a 28 | // non-const method, all threads accessing the same StringPiece must use 29 | // external synchronization. 30 | 31 | namespace demo_plugin { 32 | 33 | using StringPiece = absl::string_view; 34 | 35 | } // namespace demo_plugin 36 | 37 | #endif // TENSORFLOW_PLUGIN_SRC_UTILS_STRINGPIECE_H_ 38 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/tensor_shape.proto: -------------------------------------------------------------------------------- 1 | // Protocol buffer representing the shape of tensors. 2 | 3 | syntax = "proto3"; 4 | option cc_enable_arenas = true; 5 | option java_outer_classname = "TensorShapeProtos"; 6 | option java_multiple_files = true; 7 | option java_package = "org.tensorflow.framework"; 8 | option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/tensor_shape_go_proto"; 9 | 10 | package demo_plugin; 11 | 12 | // Dimensions of a tensor. 13 | message TensorShapeProto { 14 | // One dimension of the tensor. 15 | message Dim { 16 | // Size of the tensor in that dimension. 17 | // This value must be >= -1, but values of -1 are reserved for "unknown" 18 | // shapes (values of -1 mean "unknown" dimension). Certain wrappers 19 | // that work with TensorShapeProto may fail at runtime when deserializing 20 | // a TensorShapeProto containing a dim value of -1. 21 | int64 size = 1; 22 | 23 | // Optional name of the tensor dimension. 24 | string name = 2; 25 | }; 26 | 27 | // Dimensions of the tensor, such as {"input", 30}, {"output", 40} 28 | // for a 30 x 40 2D tensor. If an entry has size -1, this 29 | // corresponds to a dimension of unknown size. The names are 30 | // optional. 31 | // 32 | // The order of entries in "dim" matters: It indicates the layout of the 33 | // values in the tensor in-memory representation. 34 | // 35 | // The first entry in "dim" is the outermost dimension used to layout the 36 | // values, the last entry is the innermost dimension. This matches the 37 | // in-memory layout of RowMajor Eigen tensors. 38 | // 39 | // If "dim.size()" > 0, "unknown_rank" must be false. 40 | repeated Dim dim = 2; 41 | 42 | // If true, the number of dimensions in the shape is unknown. 43 | // 44 | // If true, "dim.size()" must be 0. 45 | bool unknown_rank = 3; 46 | }; 47 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/src/utils/versions.proto: -------------------------------------------------------------------------------- 1 | syntax = "proto3"; 2 | 3 | package demo_plugin; 4 | 5 | option cc_enable_arenas = true; 6 | option java_outer_classname = "VersionsProtos"; 7 | option java_multiple_files = true; 8 | option java_package = "org.tensorflow.framework"; 9 | option go_package = "github.com/tensorflow/tensorflow/tensorflow/go/core/framework/versions_go_proto"; 10 | 11 | // Version information for a piece of serialized data 12 | // 13 | // There are different types of versions for each type of data 14 | // (GraphDef, etc.), but they all have the same common shape 15 | // described here. 16 | // 17 | // Each consumer has "consumer" and "min_producer" versions (specified 18 | // elsewhere). A consumer is allowed to consume this data if 19 | // 20 | // producer >= min_producer 21 | // consumer >= min_consumer 22 | // consumer not in bad_consumers 23 | // 24 | message VersionDef { 25 | // The version of the code that produced this data. 26 | int32 producer = 1; 27 | 28 | // Any consumer below this version is not allowed to consume this data. 29 | int32 min_consumer = 2; 30 | 31 | // Specific consumer versions which are disallowed (e.g. due to bugs). 32 | repeated int32 bad_consumers = 3; 33 | } 34 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/tools/pip_package/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Tools for building the TensorFlow pip package. 3 | 4 | package(default_visibility = ["//visibility:private"]) 5 | 6 | load( 7 | "//tensorflow_plugin:demo_plugin.bzl", 8 | "transitive_hdrs", 9 | ) 10 | load( 11 | "@local_config_syslibs//:build_defs.bzl", 12 | "if_not_system_lib", 13 | ) 14 | 15 | # This returns a list of headers of all public header libraries (e.g., 16 | # framework, lib), and all of the transitive dependencies of those 17 | # public headers. Not all of the headers returned by the filegroup 18 | # are public (e.g., internal headers that are included by public 19 | # headers), but the internal headers need to be packaged in the 20 | # pip_package for the public headers to be properly included. 21 | # 22 | # Public headers are therefore defined by those that are both: 23 | # 24 | # 1) "publicly visible" as defined by bazel 25 | # 2) Have documentation. 26 | # 27 | # This matches the policy of "public" for our python API. 28 | 29 | COMMON_PIP_DEPS = [ 30 | "MANIFEST.in", 31 | "README", 32 | "setup.py", 33 | "//tensorflow_plugin:libdemo_plugin.so", 34 | ] 35 | 36 | py_binary( 37 | name = "simple_console", 38 | srcs = ["simple_console.py"], 39 | srcs_version = "PY2AND3", 40 | deps = [], 41 | ) 42 | 43 | sh_binary( 44 | name = "build_pip_package", 45 | srcs = ["build_pip_package.sh"], 46 | data = ["simple_console"] + COMMON_PIP_DEPS, 47 | ) 48 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/tools/pip_package/MANIFEST.in: -------------------------------------------------------------------------------- 1 | include README 2 | recursive-include * *.py 3 | recursive-include * *.pyd 4 | recursive-include * *.pd 5 | recursive-include * *.so 6 | recursive-include * *.so.[0-9] 7 | recursive-include * *.dylib 8 | recursive-include * *.dll 9 | recursive-include * *.lib 10 | recursive-include * *.csv 11 | recursive-include * *.h 12 | recursive-include * *.hpp -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/tools/pip_package/README: -------------------------------------------------------------------------------- 1 | demo_plugin 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/tensorflow_plugin/tools/pip_package/simple_console.py: -------------------------------------------------------------------------------- 1 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved. 2 | # 3 | # Licensed under the Apache License, Version 2.0 (the "License"); 4 | # you may not use this file except in compliance with the License. 5 | # You may obtain a copy of the License at 6 | # 7 | # http://www.apache.org/licenses/LICENSE-2.0 8 | # 9 | # Unless required by applicable law or agreed to in writing, software 10 | # distributed under the License is distributed on an "AS IS" BASIS, 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | # See the License for the specific language governing permissions and 13 | # limitations under the License. 14 | # ============================================================================== 15 | 16 | 17 | """Start a simple interactive console with TensorFlow available.""" 18 | 19 | from __future__ import absolute_import 20 | from __future__ import division 21 | from __future__ import print_function 22 | 23 | import code 24 | import sys 25 | 26 | 27 | def main(_): 28 | """Run an interactive console.""" 29 | code.interact() 30 | return 0 31 | 32 | 33 | if __name__ == '__main__': 34 | sys.exit(main(sys.argv)) 35 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/test_profiler.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | # coding=utf-8 3 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved. 4 | # 5 | # Licensed under the Apache License, Version 2.0 (the "License"); 6 | # you may not use this file except in compliance with the License. 7 | # You may obtain a copy of the License at 8 | # 9 | # http://www.apache.org/licenses/LICENSE-2.0 10 | # 11 | # Unless required by applicable law or agreed to in writing, software 12 | # distributed under the License is distributed on an "AS IS" BASIS, 13 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | # See the License for the specific language governing permissions and 15 | # limitations under the License. 16 | # ============================================================================= 17 | 18 | 19 | import tensorflow as tf 20 | import numpy as np 21 | import os 22 | tf.compat.v1.disable_eager_execution() 23 | 24 | profile_options = tf.profiler.experimental.ProfilerOptions( 25 | host_tracer_level = 3, 26 | device_tracer_level = 1) 27 | 28 | logpath = os.path.join('data', 'logs', 'profiler_demo') 29 | 30 | a = tf.random.normal(shape=[1,10, 10, 8], dtype=tf.float32, seed=1) 31 | w = tf.random.normal(shape=[3, 3, 8, 4], dtype=tf.float32, seed=1) 32 | 33 | a1 = tf.random.normal(shape=[1, 10, 10, 8], dtype=tf.float32, seed=1) 34 | w1 = tf.random.normal(shape=[3, 3, 8, 4], dtype=tf.float32, seed=1) 35 | 36 | 37 | with tf.device("/MY_DEVICE:0"): 38 | tf.profiler.experimental.start(logpath) 39 | b = tf.nn.relu(a) 40 | c = tf.nn.conv2d(b, w, strides=[1, 1, 1, 1], padding='SAME', data_format='NHWC') 41 | tf.profiler.experimental.stop() 42 | with tf.device("/CPU:0"): 43 | b1 = tf.nn.relu(a1) 44 | c1 = tf.nn.conv2d(b1, w1, strides=[1, 1, 1, 1], padding='SAME', data_format='NHWC') 45 | 46 | 47 | sess = tf.compat.v1.Session(config=tf.compat.v1.ConfigProto(allow_soft_placement=False, log_device_placement=True)) 48 | print(sess.run(tf.reduce_all(tf.less(c - c1, 1e-5)))) 49 | 50 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/build_option/BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/build_option/gcc_configure.bzl: -------------------------------------------------------------------------------- 1 | _TF_SHARED_LIBRARY_DIR = "TF_SHARED_LIBRARY_DIR" 2 | 3 | def _cpu_autoconf_imp(repository_ctx): 4 | tf_lib_path = repository_ctx.os.environ[_TF_SHARED_LIBRARY_DIR] 5 | repository_ctx.symlink(tf_lib_path, "proper") 6 | repository_ctx.file("BUILD", """ 7 | cc_import( 8 | name = "framework_lib", 9 | shared_library = "proper/libtensorflow_framework.so.2", 10 | # interface_library = "libtensorflow_framework.so", 11 | # system_provided = 1, 12 | visibility = ['//visibility:public'], 13 | ) 14 | """) 15 | 16 | gcc_configure = repository_rule( 17 | implementation = _cpu_autoconf_imp, 18 | local = True, 19 | ) 20 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/com_google_absl.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) # Apache 4 | 5 | exports_files(["LICENSE"]) 6 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/common.bzl: -------------------------------------------------------------------------------- 1 | # Rule for simple expansion of template files. This performs a simple 2 | # search over the template file for the keys in substitutions, 3 | # and replaces them with the corresponding values. 4 | # 5 | # Typical usage: 6 | # load("/tools/build_rules/template_rule", "expand_header_template") 7 | # template_rule( 8 | # name = "ExpandMyTemplate", 9 | # src = "my.template", 10 | # out = "my.txt", 11 | # substitutions = { 12 | # "$VAR1": "foo", 13 | # "$VAR2": "bar", 14 | # } 15 | # ) 16 | # 17 | # Args: 18 | # name: The name of the rule. 19 | # template: The template file to expand 20 | # out: The destination of the expanded file 21 | # substitutions: A dictionary mapping strings to their substitutions 22 | 23 | def template_rule_impl(ctx): 24 | ctx.actions.expand_template( 25 | template = ctx.file.src, 26 | output = ctx.outputs.out, 27 | substitutions = ctx.attr.substitutions, 28 | ) 29 | 30 | template_rule = rule( 31 | attrs = { 32 | "src": attr.label( 33 | mandatory = True, 34 | allow_single_file = True, 35 | ), 36 | "substitutions": attr.string_dict(mandatory = True), 37 | "out": attr.output(mandatory = True), 38 | }, 39 | # output_to_genfiles is required for header files. 40 | #output_to_genfiles = True, 41 | implementation = template_rule_impl, 42 | ) 43 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen.BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Eigen is a C++ template library for linear algebra: vectors, 3 | # matrices, and related algorithms. 4 | 5 | licenses([ 6 | # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. 7 | # We've taken special care to not reference any restricted code. 8 | "reciprocal", # MPL2 9 | "notice", # Portions BSD 10 | ]) 11 | 12 | exports_files(["COPYING.MPL2"]) 13 | 14 | # License-restricted (i.e. not reciprocal or notice) files inside Eigen/... 15 | EIGEN_RESTRICTED_FILES = [ 16 | "Eigen/src/OrderingMethods/Amd.h", 17 | "Eigen/src/SparseCholesky/**", 18 | ] 19 | 20 | # Notable transitive dependencies of restricted files inside Eigen/... 21 | EIGEN_RESTRICTED_DEPS = [ 22 | "Eigen/Eigen", 23 | "Eigen/IterativeLinearSolvers", 24 | "Eigen/MetisSupport", 25 | "Eigen/Sparse", 26 | "Eigen/SparseCholesky", 27 | "Eigen/SparseLU", 28 | ] 29 | 30 | EIGEN_FILES = [ 31 | "Eigen/**", 32 | "unsupported/Eigen/CXX11/**", 33 | "unsupported/Eigen/FFT", 34 | "unsupported/Eigen/KroneckerProduct", 35 | "unsupported/Eigen/src/FFT/**", 36 | "unsupported/Eigen/src/KroneckerProduct/**", 37 | "unsupported/Eigen/MatrixFunctions", 38 | "unsupported/Eigen/SpecialFunctions", 39 | "unsupported/Eigen/src/MatrixFunctions/**", 40 | "unsupported/Eigen/src/SpecialFunctions/**", 41 | ] 42 | 43 | # List of files picked up by glob but actually part of another target. 44 | EIGEN_EXCLUDE_FILES = [ 45 | "Eigen/src/Core/arch/AVX/PacketMathGoogleTest.cc", 46 | ] 47 | 48 | # Files known to be under MPL2 license. 49 | EIGEN_MPL2_HEADER_FILES = glob( 50 | EIGEN_FILES, 51 | exclude = EIGEN_EXCLUDE_FILES + 52 | EIGEN_RESTRICTED_FILES + 53 | EIGEN_RESTRICTED_DEPS + [ 54 | # Guarantees any file missed by excludes above will not compile. 55 | "Eigen/src/Core/util/NonMPL2.h", 56 | "Eigen/**/CMakeLists.txt", 57 | ], 58 | ) 59 | 60 | cc_library( 61 | name = "eigen", 62 | hdrs = EIGEN_MPL2_HEADER_FILES, 63 | defines = [ 64 | # This define (mostly) guarantees we don't link any problematic 65 | # code. We use it, but we do not rely on it, as evidenced above. 66 | "EIGEN_MPL2_ONLY", 67 | "EIGEN_MAX_ALIGN_BYTES=64", 68 | "EIGEN_HAS_TYPE_TRAITS=0", 69 | "EIGEN_USE_THREADS=1", 70 | ], 71 | includes = ["."], 72 | visibility = ["//visibility:public"], 73 | ) 74 | 75 | filegroup( 76 | name = "eigen_header_files", 77 | srcs = EIGEN_MPL2_HEADER_FILES, 78 | visibility = ["//visibility:public"], 79 | ) 80 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/BUILD: -------------------------------------------------------------------------------- 1 | # Description: 2 | # Eigen is a C++ template library for linear algebra: vectors, 3 | # matrices, and related algorithms. 4 | 5 | licenses([ 6 | # Note: Eigen is an MPL2 library that includes GPL v3 and LGPL v2.1+ code. 7 | # We've taken special care to not reference any restricted code. 8 | "reciprocal", # MPL2 9 | "notice", # Portions BSD 10 | ]) 11 | 12 | exports_files(["LICENSE"]) 13 | 14 | #load("//third_party/mkl:build_defs.bzl", "if_mkl") 15 | 16 | EIGEN3_THIRD_PARTY_HEADERS = [ 17 | "Eigen/Core", 18 | "Eigen/LU", 19 | "Eigen/Cholesky", 20 | "Eigen/Eigenvalues", 21 | "Eigen/OrderingMethods", 22 | "Eigen/QR", 23 | "Eigen/SparseCholesky", 24 | "Eigen/SparseCore", 25 | "Eigen/SVD", 26 | "unsupported/Eigen/MatrixFunctions", 27 | "unsupported/Eigen/SpecialFunctions", 28 | "unsupported/Eigen/CXX11/ThreadPool", 29 | "unsupported/Eigen/CXX11/Tensor", 30 | "unsupported/Eigen/CXX11/FixedPoint", 31 | ] + glob(["unsupported/Eigen/CXX11/src/FixedPoint/*.h"]) 32 | 33 | cc_library( 34 | name = "eigen3", 35 | hdrs = EIGEN3_THIRD_PARTY_HEADERS, 36 | includes = [], #+ if_mkl(["./mkl_include"]), 37 | visibility = ["//visibility:public"], 38 | deps = [ 39 | "@eigen_archive//:eigen", 40 | ], 41 | ) 42 | 43 | filegroup( 44 | name = "all_files", 45 | srcs = glob( 46 | ["**/*"], 47 | exclude = ["**/OWNERS"], 48 | ), 49 | visibility = ["//tensorflow_plugin:__subpackages__"], 50 | ) 51 | 52 | filegroup( 53 | name = "eigen_third_party_header_files", 54 | srcs = EIGEN3_THIRD_PARTY_HEADERS, 55 | visibility = ["//visibility:public"], 56 | ) 57 | 58 | genrule( 59 | name = "install_eigen_headers", 60 | srcs = [ 61 | "@eigen_archive//:eigen_header_files", 62 | ":eigen_third_party_header_files", 63 | ], 64 | outs = ["include"], 65 | cmd = """ 66 | mkdir $@ 67 | for f in $(SRCS); do 68 | d="$${f%/*}" 69 | d="$${d#*external/eigen_archive/}" 70 | 71 | mkdir -p "$@/$${d}" 72 | cp "$${f}" "$@/$${d}/" 73 | done 74 | """, 75 | tags = ["manual"], 76 | ) 77 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/Cholesky: -------------------------------------------------------------------------------- 1 | #include "Eigen/Cholesky" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/Core: -------------------------------------------------------------------------------- 1 | #include "Eigen/Core" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/Eigenvalues: -------------------------------------------------------------------------------- 1 | #include "Eigen/Eigenvalues" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/LU: -------------------------------------------------------------------------------- 1 | #include "Eigen/LU" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/OrderingMethods: -------------------------------------------------------------------------------- 1 | #include "Eigen/OrderingMethods" -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/QR: -------------------------------------------------------------------------------- 1 | #include "Eigen/QR" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/SVD: -------------------------------------------------------------------------------- 1 | #include "Eigen/SVD" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/SparseCholesky: -------------------------------------------------------------------------------- 1 | #include "Eigen/SparseCholesky" -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/Eigen/SparseCore: -------------------------------------------------------------------------------- 1 | #include "Eigen/SparseCore" -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/gpu_packet_math.patch: -------------------------------------------------------------------------------- 1 | diff -ru a/Eigen/src/Geometry/arch/Geometry_SSE.h b/Eigen/src/Geometry/arch/Geometry_SSE.h 2 | --- a/Eigen/src/Geometry/arch/Geometry_SSE.h 3 | +++ b/Eigen/src/Geometry/arch/Geometry_SSE.h 4 | @@ -33,13 +33,14 @@ 5 | Packet4f b = be.template packet(0); 6 | Packet4f s1 = pmul(vec4f_swizzle1(a,1,2,0,2),vec4f_swizzle1(b,2,0,1,2)); 7 | Packet4f s2 = pmul(vec4f_swizzle1(a,3,3,3,1),vec4f_swizzle1(b,0,1,2,1)); 8 | - pstoret( 9 | - &res.x(), 10 | - padd(psub(pmul(a,vec4f_swizzle1(b,3,3,3,3)), 11 | - pmul(vec4f_swizzle1(a,2,0,1,0), 12 | - vec4f_swizzle1(b,1,2,0,0))), 13 | - pxor(mask,padd(s1,s2)))); 14 | - 15 | + pstoret( 16 | + &res.x(), 17 | + padd( 18 | + psub(pmul(a, vec4f_swizzle1(b, 3, 3, 3, 3)), 19 | + pmul(vec4f_swizzle1(a, 2, 0, 1, 0), 20 | + vec4f_swizzle1(b, 1, 2, 0, 0))), 21 | + pxor(mask, padd(s1, s2)))); 22 | + 23 | return res; 24 | } 25 | }; 26 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/unsupported/Eigen/CXX11/FixedPoint: -------------------------------------------------------------------------------- 1 | // This file is part of Eigen, a lightweight C++ template library 2 | // for linear algebra. 3 | // 4 | // Copyright (C) 2015 Benoit Steiner 5 | // 6 | // This Source Code Form is subject to the terms of the Mozilla 7 | // Public License v. 2.0. If a copy of the MPL was not distributed 8 | // with this file, You can obtain one at http://mozilla.org/MPL/2.0/. 9 | 10 | #ifndef EIGEN_CXX11_FIXED_POINT_MODULE 11 | #define EIGEN_CXX11_FIXED_POINT_MODULE 12 | 13 | #include 14 | #include 15 | 16 | /** \defgroup CXX11_FixedPoint_Module Fixed Point Module 17 | * 18 | * This module provides common core features for all modules that 19 | * explicitly depend on C++11. Currently, this is only the Tensor 20 | * module. Note that at this stage, you should not need to include 21 | * this module directly. 22 | * 23 | * It also provides a limited fallback for compilers that don't support 24 | * CXX11 yet, such as nvcc. 25 | * 26 | * \code 27 | * #include 28 | * \endcode 29 | */ 30 | 31 | #include "src/FixedPoint/FixedPointTypes.h" 32 | 33 | // Use optimized implementations whenever available 34 | #if defined (EIGEN_VECTORIZE_AVX512DQ) || defined (EIGEN_VECTORIZE_AVX512BW) 35 | #include "src/FixedPoint/PacketMathAVX512.h" 36 | #include "src/FixedPoint/TypeCastingAVX512.h" 37 | 38 | #elif defined EIGEN_VECTORIZE_AVX2 39 | #define EIGEN_USE_OPTIMIZED_INT8_UINT8_MAT_MAT_PRODUCT 40 | #define EIGEN_USE_OPTIMIZED_INT16_INT16_MAT_MAT_PRODUCT 41 | #include "src/FixedPoint/PacketMathAVX2.h" 42 | #include "src/FixedPoint/MatMatProductAVX2.h" 43 | #include "src/FixedPoint/TypeCastingAVX2.h" 44 | 45 | #elif defined EIGEN_VECTORIZE_AVX 46 | #include "src/FixedPoint/PacketMathAVX.h" 47 | 48 | #elif defined EIGEN_VECTORIZE_NEON 49 | #define EIGEN_USE_OPTIMIZED_INT8_UINT8_MAT_MAT_PRODUCT 50 | #include "src/FixedPoint/MatMatProductNEON.h" 51 | #endif 52 | 53 | // Use the default implementation when no optimized code is available 54 | #include "src/FixedPoint/MatMatProduct.h" 55 | #include "src/FixedPoint/MatVecProduct.h" 56 | 57 | 58 | #endif // EIGEN_CXX11_FIXED_POINT_MODULE 59 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/unsupported/Eigen/CXX11/Tensor: -------------------------------------------------------------------------------- 1 | 2 | #include "unsupported/Eigen/CXX11/Tensor" 3 | 4 | #ifdef _WIN32 5 | #ifndef SLEEP_FUNC_HEADER_GUARD 6 | #define SLEEP_FUNC_HEADER_GUARD 7 | inline void sleep(unsigned int seconds) { Sleep(1000*seconds); } 8 | #endif 9 | 10 | // On Windows, Eigen will include Windows.h, which defines various 11 | // macros that conflict with TensorFlow symbols. Undefine them here to 12 | // prevent clashes. 13 | #undef DeleteFile 14 | #undef ERROR 15 | #endif // _WIN32 16 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/unsupported/Eigen/CXX11/ThreadPool: -------------------------------------------------------------------------------- 1 | #include "unsupported/Eigen/CXX11/ThreadPool" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/unsupported/Eigen/MatrixFunctions: -------------------------------------------------------------------------------- 1 | #include "unsupported/Eigen/MatrixFunctions" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/eigen3/unsupported/Eigen/SpecialFunctions: -------------------------------------------------------------------------------- 1 | #include "unsupported/Eigen/SpecialFunctions" 2 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/protobuf/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/protobuf/BUILD -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/protobuf/protobuf.patch: -------------------------------------------------------------------------------- 1 | diff --git a/BUILD b/BUILD 2 | index dbae719ff..87dc38470 100644 3 | --- a/BUILD 4 | +++ b/BUILD 5 | @@ -23,7 +23,7 @@ config_setting( 6 | # ZLIB configuration 7 | ################################################################################ 8 | 9 | -ZLIB_DEPS = ["@zlib//:zlib"] 10 | +ZLIB_DEPS = ["@zlib"] 11 | 12 | ################################################################################ 13 | # Protobuf Runtime Library 14 | @@ -143,6 +143,7 @@ cc_library( 15 | copts = COPTS, 16 | includes = ["src/"], 17 | linkopts = LINK_OPTS, 18 | + alwayslink = 1, 19 | visibility = ["//visibility:public"], 20 | ) 21 | 22 | @@ -213,6 +214,7 @@ cc_library( 23 | copts = COPTS, 24 | includes = ["src/"], 25 | linkopts = LINK_OPTS, 26 | + alwayslink = 1, 27 | visibility = ["//visibility:public"], 28 | deps = [":protobuf_lite"] + PROTOBUF_DEPS, 29 | ) 30 | diff --git a/protobuf.bzl b/protobuf.bzl 31 | index e0653321f..253d9cbb5 100644 32 | --- a/protobuf.bzl 33 | +++ b/protobuf.bzl 34 | @@ -84,7 +84,9 @@ def _proto_gen_impl(ctx): 35 | 36 | for dep in ctx.attr.deps: 37 | import_flags += dep.proto.import_flags 38 | deps += dep.proto.deps 39 | + import_flags = depset(import_flags).to_list() 40 | + deps = depset(deps).to_list() 41 | 42 | if not ctx.attr.gen_cc and not ctx.attr.gen_py and not ctx.executable.plugin: 43 | return struct( -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/BUILD -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/BUILD.tpl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/BUILD.tpl -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/build_defs.bzl.tpl: -------------------------------------------------------------------------------- 1 | # -*- Python -*- 2 | """Skylark macros for system libraries. 3 | """ 4 | 5 | SYSTEM_LIBS_ENABLED = %{syslibs_enabled} 6 | 7 | SYSTEM_LIBS_LIST = [ 8 | %{syslibs_list} 9 | ] 10 | 11 | 12 | def if_any_system_libs(a, b=[]): 13 | """Conditional which evaluates to 'a' if any system libraries are configured.""" 14 | if SYSTEM_LIBS_ENABLED: 15 | return a 16 | else: 17 | return b 18 | 19 | 20 | def if_system_lib(lib, a, b=[]): 21 | """Conditional which evaluates to 'a' if we're using the system version of lib""" 22 | 23 | if SYSTEM_LIBS_ENABLED and lib in SYSTEM_LIBS_LIST: 24 | return a 25 | else: 26 | return b 27 | 28 | 29 | def if_not_system_lib(lib, a, b=[]): 30 | """Conditional which evaluates to 'a' if we're using the system version of lib""" 31 | 32 | return if_system_lib(lib, b, a) 33 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/nsync.BUILD: -------------------------------------------------------------------------------- 1 | licenses(["notice"]) # BSD 3-Clause 2 | 3 | filegroup( 4 | name = "LICENSE", 5 | visibility = ["//visibility:public"], 6 | ) 7 | 8 | cc_library( 9 | name = "nsync_headers", 10 | visibility = ["//visibility:public"], 11 | ) 12 | 13 | cc_library( 14 | name = "nsync", 15 | linkopts = ["-lnsync"], 16 | visibility = ["//visibility:public"], 17 | ) 18 | 19 | cc_library( 20 | name = "nsync_cpp", 21 | linkopts = ["-lnsync_cpp"], 22 | visibility = ["//visibility:public"], 23 | ) 24 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/systemlibs/protobuf.BUILD: -------------------------------------------------------------------------------- 1 | load( 2 | "@com_google_protobuf//:protobuf.bzl", 3 | "cc_proto_library", 4 | "proto_gen", 5 | "py_proto_library", 6 | ) 7 | 8 | licenses(["notice"]) 9 | 10 | filegroup( 11 | name = "LICENSE", 12 | visibility = ["//visibility:public"], 13 | ) 14 | 15 | HEADERS = [ 16 | "google/protobuf/any.pb.h", 17 | "google/protobuf/any.proto", 18 | "google/protobuf/arena.h", 19 | "google/protobuf/compiler/importer.h", 20 | "google/protobuf/descriptor.h", 21 | "google/protobuf/descriptor.pb.h", 22 | "google/protobuf/descriptor.proto", 23 | "google/protobuf/duration.pb.h", 24 | "google/protobuf/duration.proto", 25 | "google/protobuf/dynamic_message.h", 26 | "google/protobuf/empty.pb.h", 27 | "google/protobuf/empty.proto", 28 | "google/protobuf/field_mask.pb.h", 29 | "google/protobuf/field_mask.proto", 30 | "google/protobuf/io/coded_stream.h", 31 | "google/protobuf/io/zero_copy_stream.h", 32 | "google/protobuf/io/zero_copy_stream_impl_lite.h", 33 | "google/protobuf/map.h", 34 | "google/protobuf/repeated_field.h", 35 | "google/protobuf/text_format.h", 36 | "google/protobuf/timestamp.pb.h", 37 | "google/protobuf/timestamp.proto", 38 | "google/protobuf/util/json_util.h", 39 | "google/protobuf/util/type_resolver_util.h", 40 | "google/protobuf/wrappers.pb.h", 41 | "google/protobuf/wrappers.proto", 42 | ] 43 | 44 | genrule( 45 | name = "link_headers", 46 | outs = HEADERS, 47 | cmd = """ 48 | for i in $(OUTS); do 49 | f=$${i#$(@D)/} 50 | mkdir -p $(@D)/$${f%/*} 51 | ln -sf $(INCLUDEDIR)/$$f $(@D)/$$f 52 | done 53 | """, 54 | ) 55 | 56 | cc_library( 57 | name = "protobuf", 58 | hdrs = HEADERS, 59 | linkopts = ["-lprotobuf"], 60 | visibility = ["//visibility:public"], 61 | ) 62 | 63 | cc_library( 64 | name = "protobuf_headers", 65 | hdrs = HEADERS, 66 | linkopts = ["-lprotobuf"], 67 | visibility = ["//visibility:public"], 68 | ) 69 | 70 | cc_library( 71 | name = "protoc_lib", 72 | linkopts = ["-lprotoc"], 73 | visibility = ["//visibility:public"], 74 | ) 75 | 76 | genrule( 77 | name = "protoc", 78 | outs = ["protoc.bin"], 79 | cmd = "which protoc; pwd; ln -s $$(which protoc) $@", 80 | executable = 1, 81 | visibility = ["//visibility:public"], 82 | ) 83 | 84 | cc_proto_library( 85 | name = "cc_wkt_protos", 86 | hdrs = HEADERS, 87 | internal_bootstrap_hack = 1, 88 | protoc = ":protoc", 89 | visibility = ["//visibility:public"], 90 | ) 91 | 92 | proto_gen( 93 | name = "protobuf_python_genproto", 94 | includes = ["."], 95 | protoc = "@com_google_protobuf//:protoc", 96 | visibility = ["//visibility:public"], 97 | ) 98 | 99 | py_library( 100 | name = "protobuf_python", 101 | data = [":link_headers"], 102 | srcs_version = "PY2AND3", 103 | visibility = ["//visibility:public"], 104 | ) 105 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/tf_dependency/BUILD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/tf_dependency/BUILD -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/tf_dependency/BUILD.tpl: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | cc_library( 4 | name = "tf_header_lib", 5 | hdrs = [":tf_header_include"], 6 | includes = ["include"], 7 | visibility = ["//visibility:public"], 8 | ) 9 | 10 | %{TF_HEADER_GENRULE} 11 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/version_check.bzl: -------------------------------------------------------------------------------- 1 | """ Helpers to check minimum version of bazel.""" 2 | 3 | def _extract_version_number(bazel_version): 4 | """Extracts the semantic version number from a version string 5 | 6 | Args: 7 | bazel_version: the version string that begins with the semantic version 8 | e.g. "1.2.3rc1 abc1234" where "abc1234" is a commit hash. 9 | 10 | Returns: 11 | The semantic version string, like "1.2.3". 12 | """ 13 | for i in range(len(bazel_version)): 14 | c = bazel_version[i] 15 | if not (c.isdigit() or c == "."): 16 | return bazel_version[:i] 17 | return bazel_version 18 | 19 | # Parse the bazel version string from `native.bazel_version`. 20 | # e.g. 21 | # "0.10.0rc1 abc123d" => (0, 10, 0) 22 | # "0.3.0" => (0, 3, 0) 23 | def _parse_bazel_version(bazel_version): 24 | """Parses a version string into a 3-tuple of ints 25 | 26 | int tuples can be compared directly using binary operators (<, >). 27 | 28 | Args: 29 | bazel_version: the Bazel version string 30 | 31 | Returns: 32 | An int 3-tuple of a (major, minor, patch) version. 33 | """ 34 | 35 | version = _extract_version_number(bazel_version) 36 | return tuple([int(n) for n in version.split(".")]) 37 | 38 | def check_bazel_version_at_least(minimum_bazel_version): 39 | if "bazel_version" not in dir(native): 40 | fail("\nCurrent Bazel version is lower than 0.2.1, expected at least %s\n" % minimum_bazel_version) 41 | elif not native.bazel_version: 42 | print("\nCurrent Bazel is not a release version, cannot check for compatibility.") 43 | print("Make sure that you are running at least Bazel %s.\n" % minimum_bazel_version) 44 | return 45 | 46 | if _parse_bazel_version(native.bazel_version) < _parse_bazel_version(minimum_bazel_version): 47 | fail("\nCurrent Bazel version is {}, expected at least {}\n".format( 48 | native.bazel_version, 49 | minimum_bazel_version, 50 | )) 51 | 52 | parse_bazel_version = _parse_bazel_version 53 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/sample/third_party/zlib.BUILD: -------------------------------------------------------------------------------- 1 | package(default_visibility = ["//visibility:public"]) 2 | 3 | licenses(["notice"]) # BSD/MIT-like license (for zlib) 4 | 5 | cc_library( 6 | name = "zlib", 7 | srcs = [ 8 | "adler32.c", 9 | "compress.c", 10 | "crc32.c", 11 | "crc32.h", 12 | "deflate.c", 13 | "deflate.h", 14 | "gzclose.c", 15 | "gzguts.h", 16 | "gzlib.c", 17 | "gzread.c", 18 | "gzwrite.c", 19 | "infback.c", 20 | "inffast.c", 21 | "inffast.h", 22 | "inffixed.h", 23 | "inflate.c", 24 | "inflate.h", 25 | "inftrees.c", 26 | "inftrees.h", 27 | "trees.c", 28 | "trees.h", 29 | "uncompr.c", 30 | "zconf.h", 31 | "zutil.c", 32 | "zutil.h", 33 | ], 34 | hdrs = ["zlib.h"], 35 | copts = [ 36 | "-Wno-shift-negative-value", 37 | "-DZ_HAVE_UNISTD_H", 38 | ], 39 | includes = ["."], 40 | ) 41 | -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/scenario1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/scenario1.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/scenario2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/scenario2.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/scenario3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/scenario3.png -------------------------------------------------------------------------------- /rfcs/20200624-pluggable-device-for-tensorflow/scenario4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200624-pluggable-device-for-tensorflow/scenario4.png -------------------------------------------------------------------------------- /rfcs/20200705-tfx-ir/data_model_simple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200705-tfx-ir/data_model_simple.png -------------------------------------------------------------------------------- /rfcs/20200705-tfx-ir/design-structure.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200705-tfx-ir/design-structure.png -------------------------------------------------------------------------------- /rfcs/20200705-tfx-ir/resolver-complex.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200705-tfx-ir/resolver-complex.png -------------------------------------------------------------------------------- /rfcs/20200705-tfx-ir/resolver.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200705-tfx-ir/resolver.png -------------------------------------------------------------------------------- /rfcs/20200705-tfx-ir/sub-pipeline-semantic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200705-tfx-ir/sub-pipeline-semantic.png -------------------------------------------------------------------------------- /rfcs/20200705-tfx-ir/sub-pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200705-tfx-ir/sub-pipeline.png -------------------------------------------------------------------------------- /rfcs/20200712-tfrt-kernel-fallback/KernelFallbackDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200712-tfrt-kernel-fallback/KernelFallbackDiagram.png -------------------------------------------------------------------------------- /rfcs/20200712-tfrt-kernel-fallback/KernelFallbackHighLevelDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200712-tfrt-kernel-fallback/KernelFallbackHighLevelDiagram.png -------------------------------------------------------------------------------- /rfcs/20200712-tfrt-kernel-fallback/RuntimeFallbackHighLevelDiagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20200712-tfrt-kernel-fallback/RuntimeFallbackHighLevelDiagram.png -------------------------------------------------------------------------------- /rfcs/20201027-modular-tensorflow-graph-c-api/flow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201027-modular-tensorflow-graph-c-api/flow.png -------------------------------------------------------------------------------- /rfcs/20201027-modular-tensorflow-graph-c-api/scenario1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201027-modular-tensorflow-graph-c-api/scenario1.png -------------------------------------------------------------------------------- /rfcs/20201027-modular-tensorflow-graph-c-api/scenario2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201027-modular-tensorflow-graph-c-api/scenario2.png -------------------------------------------------------------------------------- /rfcs/20201027-modular-tensorflow-graph-c-api/scenario3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201027-modular-tensorflow-graph-c-api/scenario3.png -------------------------------------------------------------------------------- /rfcs/20201221-tfmot-compression-api/class_graph.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201221-tfmot-compression-api/class_graph.png -------------------------------------------------------------------------------- /rfcs/20201221-tfmot-compression-api/compress_training_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201221-tfmot-compression-api/compress_training_weights.png -------------------------------------------------------------------------------- /rfcs/20201221-tfmot-compression-api/decompress_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201221-tfmot-compression-api/decompress_weights.png -------------------------------------------------------------------------------- /rfcs/20201221-tfmot-compression-api/get_compressible_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201221-tfmot-compression-api/get_compressible_weights.png -------------------------------------------------------------------------------- /rfcs/20201221-tfmot-compression-api/init_training_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201221-tfmot-compression-api/init_training_weights.png -------------------------------------------------------------------------------- /rfcs/20201221-tfmot-compression-api/project_training_weights.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20201221-tfmot-compression-api/project_training_weights.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/data_selection.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/data_selection.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/new_version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/new_version.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/rolling_window.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/rolling_window.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/single_span.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/single_span.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/span_version.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/span_version.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/timeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/timeline.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/transform.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/transform.png -------------------------------------------------------------------------------- /rfcs/20210115-tfx-periodic-training/workflow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210115-tfx-periodic-training/workflow.png -------------------------------------------------------------------------------- /rfcs/20210305-tfx-struct2tensor/data_view_components.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210305-tfx-struct2tensor/data_view_components.png -------------------------------------------------------------------------------- /rfcs/20210305-tfx-struct2tensor/graph_to_tensor_tfxio.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210305-tfx-struct2tensor/graph_to_tensor_tfxio.png -------------------------------------------------------------------------------- /rfcs/20210305-tfx-struct2tensor/tf_example_vs_elwc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210305-tfx-struct2tensor/tf_example_vs_elwc.png -------------------------------------------------------------------------------- /rfcs/20210513-pluggable-profiler-for-tensorflow/Architecture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210513-pluggable-profiler-for-tensorflow/Architecture.png -------------------------------------------------------------------------------- /rfcs/20210513-pluggable-profiler-for-tensorflow/Xspace.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210513-pluggable-profiler-for-tensorflow/Xspace.png -------------------------------------------------------------------------------- /rfcs/20210930-enable-onednn-ops/eigen-contraction-kernel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210930-enable-onednn-ops/eigen-contraction-kernel.png -------------------------------------------------------------------------------- /rfcs/20210930-enable-onednn-ops/onednn-graph-rewrite-passes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20210930-enable-onednn-ops/onednn-graph-rewrite-passes.png -------------------------------------------------------------------------------- /rfcs/20220610-saved-model-fingerprinting/diff1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20220610-saved-model-fingerprinting/diff1.png -------------------------------------------------------------------------------- /rfcs/20220610-saved-model-fingerprinting/diff2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20220610-saved-model-fingerprinting/diff2.png -------------------------------------------------------------------------------- /rfcs/20231213-checkpoint-sharding-callback/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20231213-checkpoint-sharding-callback/.DS_Store -------------------------------------------------------------------------------- /rfcs/20231213-checkpoint-sharding-callback/callback-diagram.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/rfcs/20231213-checkpoint-sharding-callback/callback-diagram.png -------------------------------------------------------------------------------- /rfcs/README.md: -------------------------------------------------------------------------------- 1 | # TensorFlow RFCs 2 | 3 | This directory stores approved RFCs. 4 | 5 | ## Process 6 | 7 | Please read carefully the [TensorFlow RFC 8 | process](https://github.com/tensorflow/community/blob/master/governance/TF-RFCs.md). 9 | 10 | ## Template 11 | 12 | Use [this template](yyyymmdd-rfc-template.md) 13 | to draft an RFC. 14 | -------------------------------------------------------------------------------- /sigs/addons/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG Addons 2 | 3 | ## Objective 4 | 5 | TensorFlow natively supports a larger number of operators, layers, metrics, losses, and optimizers. However, in a fast moving field like ML, there are many interesting new developments that cannot be integrated into core TensorFlow (because they are experimental, or their significance is not yet clear). 6 | 7 | This special interest group maintains a repository of bleeding edge contributions that conform to well-established API patterns, but implement new functionality not available in core TensorFlow. 8 | 9 | ## Scope 10 | 11 | This group maintains the [tensorflow/addons](https://github.com/tensorflow/addons) repository. It contains additional functionality which fits the following criteria: 12 | 13 | * The functionality is not otherwise available in TensorFlow 14 | * The functionality conforms to an established API pattern in TensorFlow. For instance, it could be an additional subclass of an existing interface (new Layer, Metric, or Optimizer subclasses), or an additional Op or OpKernel implementation. 15 | * Addons have to be compatible with TensorFlow 2.x. 16 | * The addon conforms to the code and documentation standards defined by the group. These policies are detailed in the project's [README](https://github.com/tensorflow/addons/blob/master/README.md) 17 | * The addon is useful for a large number of users (e.g., an implenentation used in widely cited paper, or a utility with broad applicability) 18 | 19 | The group is responsible for reviewing new additions to the repository, including evaluating designs and implementations. 20 | 21 | ## Membership 22 | 23 | Everybody with an interest in helping extend TensorFlow with new types of Ops, Layers, etc. is welcome to join the SIG. To participate, request an invitation to join the mailing list. Maintainer status for the repository will be conferred by consensus of the existing members. Archives of the mailing list are publicly accessible. 24 | 25 | ## Resources 26 | 27 | * SIG Addons mailing list: [addons@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/addons) 28 | * Repository maintained by SIG Addons: [github.com/tensorflow/addons](https://github.com/tensorflow/addons) 29 | 30 | ## Contacts 31 | 32 | * Project leads: 33 | * Sean Morgan [@seanpmorgan](https://github.com/seanpmorgan) 34 | * Stefano Fabri [@bhack](https://github.com/bhack) 35 | * TensorFlow technical contact [@tomerk](https://github.com/tomerk) - kaftan@google.com 36 | * For administrative questions, contact tf-community-team at google 37 | 38 | ## Archive 39 | 40 | * Leads Emeritus: 41 | * Yan Facai (颜发才) [@facaiy](https://github.com/facaiy) 42 | * Tzu-Wei Sung [@WindQaQ](https://github.com/windqaq) 43 | * Armando Fandango [@armando-fandango](https://github.com/armando-fandango) 44 | 45 | ## Code of Conduct 46 | 47 | As with all forums and spaces related to TensorFlow, SIG Addons is subject to the [TensorFlow Code of Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 48 | -------------------------------------------------------------------------------- /sigs/addons/RELEASE.md: -------------------------------------------------------------------------------- 1 | # SIG Addons Releases 2 | 3 | SIG Addons release process consists of the folowing steps: 4 | 1. Create new rX.X branch on tensorflow/addons 5 | 2. Create and merge a new PR into the release branch 6 | * Set the correct version and suffix in [version.py](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/version.py) 7 | * Ensure the proper minimum and maximum tested versions of TF are set in [version.py](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/version.py) 8 | * Ensure the proper minimum and maximum ABI compatibility versions are set in [resource_loader.py](https://github.com/tensorflow/addons/blob/master/tensorflow_addons/utils/resource_loader.py) 9 | * Ensure proper supported python libraries are set in [setup.py](https://github.com/tensorflow/addons/blob/master/setup.py) 10 | 3. Create and merge a new PR which [sets the build docker image](https://github.com/tensorflow/addons/blob/master/tools/docker/build_wheel.Dockerfile#L3) to match the tensorflow dependency 11 | * We keep the "latest" image on nightly, but for building old TFA versions we should pin to the proper container for that release. 12 | 4. Publish and tag a [release on Github](https://github.com/tensorflow/addons/releases) 13 | * Add updates for new features, enhancements, bug fixes 14 | * Add contributors using `git shortlog ..HEAD -s` 15 | * **NOTE: This will trigger a GitHub action to release the wheels on PyPi** 16 | 17 | 18 | ## SIG Addons Release Team 19 | 20 | Current Release Team: 21 | - Sean Morgan - GitHub: [@seanpmorgan](https://github.com/seanpmorgan) - PyPI: [seanmorgan](https://pypi.org/user/seanmorgan/) 22 | - Yan Facai(颜发才) - GitHub: [@facaiy](https://github.com/facaiy) - PyPI: [facaiy](https://pypi.org/user/facaiy/) 23 | 24 | -------------------------------------------------------------------------------- /sigs/archived/swift/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG Swift (This SIG is now archived and no longer active) 2 | 3 | ## Objective 4 | 5 | The purpose of this special interest group is to host design reviews; discuss upcoming API changes; share the project roadmap; and encourage collaboration in the Swift for TensorFlow (S4TF) open-source community. Members of the S4TF community are encouraged to attend the weekly design sessions, and to share feedback on the project mailing list. 6 | 7 | ## Membership 8 | 9 | Anyone involved in or interested in Swift for TensorFlow is welcome to join the group. To participate, please join the mailing list (swift@tensorflow.org) at the link listed below. Archives of the mailing list will be publicly accessible via the Google Group. 10 | 11 | ## Resources 12 | 13 | * Mailing list: [swift@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/swift) 14 | * Github repo: [tensorflow/swift](https://github.com/tensorflow/swift) 15 | 16 | ## Collaboration 17 | 18 | We plan to have a one hour weekly meeting with a public Google Video Conference for S4TF-related discussion. Every subscriber to the swift@tensorflow.org mailing list will be invited. We will publish a document for all interested members to add topics. The main goals of these meetings will include, but not be restricted to: 19 | 20 | 1. Discussion and review of language decision and API changes. 21 | 2. Roadmap discussions. 22 | 3. Issues, bugs, and compatibility concerns. 23 | 4. Community contributions and ways to get involved. 24 | 25 | ## Contacts 26 | * Program manager: Ewa Matejska - ematejska at google 27 | * Project lead: Brennan Saeta - saeta at google 28 | * Product manager: Paige Bailey - webpaige at google 29 | * For administrative questions, contact Edd Wilder-James [@ewilderj](https://github.com/ewilderj) - ewj at google 30 | 31 | ## Code of Conduct 32 | 33 | As with all forums and spaces related to TensorFlow, SIG Swift is subject to 34 | the [TensorFlow Code of 35 | Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 36 | -------------------------------------------------------------------------------- /sigs/build/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG-Build - TensorFlow Distributors & Packagers Group 2 | 3 | ## Objective 4 | 5 | For discussion and collaboration around the building, testing, packaging, and 6 | distribution of TensorFlow. 7 | 8 | ## Membership 9 | 10 | Everyone involved in the building, testing, packaging, distributing or embedding 11 | of TensorFlow is welcome to join the group. To participate, request an invitation 12 | join the mailing list. 13 | 14 | Archives of the mailing list will be publicly accessible. 15 | 16 | ## Resources 17 | 18 | * [sig-build mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/build) 19 | 20 | ## Contacts 21 | 22 | * Project leads: Jason Zaman [@perfinion](https://github.com/perfinion), Austin Anderson [@angerson](https://github.com/angerson) 23 | * For administrative questions, contact Edd Wilder-James @ewilderj - ewj at 24 | google 25 | 26 | ## Code of Conduct 27 | 28 | As with all forums and spaces related to TensorFlow, SIG-Build is subject to the [TensorFlow Code of Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 29 | -------------------------------------------------------------------------------- /sigs/io/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG IO - TensorFlow data formats and file systems group 2 | 3 | ## Objective 4 | 5 | TensorFlow has built-in support for accessing a small set of file systems and 6 | data formats. This SIG aims to add support for more file systems and file 7 | formats. 8 | 9 | The group evaluates proposals and designs in this area and maintains code in the 10 | `tensorflow/io` repository. The repository should contain only subclasses of 11 | `tf.data.Dataset` and TensorFlow filesystems, as well as supporting code. 12 | 13 | ## Membership 14 | 15 | Everybody with an interest in improving TensorFlow interoperability is welcome 16 | to join the SIG. To participate, request an invitation to join the mailing list. 17 | Archives of the mailing list are publicly accessible. 18 | 19 | ## Resources 20 | 21 | * SIG IO mailing list: [io@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/io) 22 | * Gitter room: [tensorflow/sig-io](https://gitter.im/tensorflow/sig-io) 23 | * Github repository: [github.com/tensorflow/io](https://github.com/tensorflow/io) 24 | * Python package repository: [tensorflow-io](https://pypi.org/project/tensorflow-io) 25 | * R package repository: [tfio](https://cran.r-project.org/package=tfio) 26 | 27 | ## Releases 28 | 29 | Information about SIG IO releases and the release team could be found in [RELEASE.md](RELEASE.md). 30 | 31 | ## Contacts 32 | 33 | * Project leads: 34 | - Yong Tang [@yongtang](https://github.com/yongtang) - yong.tang.github@outlook.com 35 | - Anthony Dmitriev [@dmitrievanthony](https://github.com/dmitrievanthony) - dmitrievanthony@gmail.com 36 | * TensorFlow technical contact [@jsimsa](https://github.com/jsimsa) - jsimsa@google.com 37 | * For administrative questions, contact Edd Wilder-James 38 | [@ewilderj](https://github.com/ewilderj) - ewj at google 39 | 40 | ## Code of Conduct 41 | 42 | As with all forums and spaces related to TensorFlow, SIG-I/O is subject to the [TensorFlow Code of Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 43 | -------------------------------------------------------------------------------- /sigs/jvm/CHARTER.md: -------------------------------------------------------------------------------- 1 | # Proposed name: SIG JVM 2 | 3 | ## Objective 4 | 5 | Establish an official communication channel for discussions and suggestions related to TensorFlow in Java, or any other languages running on JVMs. 6 | 7 | Develop and maintain the TensorFlow Java client and a set of additional tools to enhance the support of machine learning development in JVM languages. 8 | 9 | ## Membership 10 | 11 | Everyone interested in promoting Java or other JVM languages for training, running or serving TensorFlow models is welcome to join the group, whether it is for contributing to the code or simply for proposing ideas. To participate, request an invitation to join the mailing list. Archives of the mailing list will be publicly accessible. 12 | 13 | ## Resources 14 | 15 | * Mailing list: TensorFlow SIG JVM [jvm@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/jvm) 16 | * Gitter chat: [tensorflow/sig-jvm](https://gitter.im/tensorflow/sig-jvm) 17 | * Repositories: *might change depending on the outcome of the initial discussions* 18 | * `tensorflow-jvm`: Main repository for new TensorFlow JVM-related projects 19 | * `tensorflow`: Actual Java client to be moved out of the main repository 20 | * `tensorflow-utils`: high-level API and utilities on top of TensorFlow Java client 21 | * `tensorflow-models`: pretrained models from TensorFlow adapted to Java 22 | 23 | ## Contacts 24 | 25 | * Project lead: Karl Lessard [@karllessard](https://github.com/karllessard) - karllessard at gmail 26 | * Second for the leader: Adam Pocock [@craigacp](https://github.com/craigacp) - adam.pocock at oracle 27 | * TensorFlow team technical contact: Rajagopal Ananthanarayanan - ananthr at google 28 | * For administrative questions, contact: 29 | * Joana Carrasqueira [@joanafilipa](https://github.com/joanafilipa) - joanafilipa at google 30 | * Thea Lamkin [@theadactyl](https://github.com/theadactyl) - thealamkin at google 31 | 32 | ## Code of Conduct 33 | 34 | As with all forums and spaces related to TensorFlow, SIG JVM is subject to 35 | the [TensorFlow Code of Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 36 | -------------------------------------------------------------------------------- /sigs/jvm/rfcs/20200726-java-ndarray-repository.md: -------------------------------------------------------------------------------- 1 | # Java NdArray Repository 2 | | Status | Proposed | 3 | :-------------- |:---------------------------------------------------- | 4 | | **Author(s)** | Karl Lessard (karl.lessard@gmail.com) | 5 | | **Sponsored** | Joana Carrasqueira (joanafilipa@google.com), Rajagopal Ananthanarayanan (ananthr@google.com) | 6 | | **Updated** | 2020-07-29 | 7 | 8 | ## Objective 9 | 10 | Create a new repository under the TensorFlow GitHub organization to host the code of the NdArray Java library used by TensorFlow and 11 | maintained by SIG JVM. 12 | 13 | ## Motivation 14 | 15 | SIG JVM has developed a library called [`NdArray`](https://github.com/tensorflow/java/tree/master/ndarray) to improve the 16 | support of n-dimensional data structures on the JVM (e.g. tensors in TensorFlow). 17 | 18 | While this library is intensively used by the TensorFlow Java bindings, it does not have any dependency to the 19 | TensorFlow runtime itself, making it an interesting option for any Java developer interested in fast and efficient I/O accesses 20 | to continuous native memory in a n-dimensional space. 21 | 22 | To promote the adoption of this library beyond the scope of TensorFlow users, SIG JVM would like to move it into a distinct 23 | GitHub repository. 24 | 25 | ## User Benefit 26 | 27 | N-dimensional memory access in Java is poorly supported by the JDK and while there are already a few initiatives involving different 28 | parties to standardize such API, it will take time before it gets released to the public. The NdArray Java Library is now a good option for 29 | all kind of Java projects and since it does not depend on the TensorFlow runtime, it is very lightweight and portable. 30 | 31 | Also, having a distinct repository for the NdArray Java Library development will simplify the task for its collaborators as they will not need 32 | anymore to checkout and build the whole TensorFlow Java project, a process which tends to be heavy since it also runs a Bazel build 33 | of the TensorFlow core sources that can take many hours. 34 | 35 | ## Design Proposal 36 | 37 | The current request is for the creation of the following repository: `/tensorflow/java-ndarray` 38 | 39 | This new repository will only host the code of the NdArray Java Library, which will be moved out of `tensorflow/java`. 40 | Everything else related to TensorFlow Java depends on the TensorFlow runtime and shall remain under their actual 41 | repositories. 42 | 43 | The NdArray Java Library will now have its own release cycle and group of collaborators, independently from the TensorFlow Java bindings, while 44 | remaining under the jurisdiction of SIG JVM. 45 | -------------------------------------------------------------------------------- /sigs/keras/README.md: -------------------------------------------------------------------------------- 1 | # SIG Keras 2 | 3 | The Keras API is stewarded by SIG Keras. Its charter and related documents 4 | can be found in the [Keras governance repository](https://github.com/keras-team/governance/blob/master/README.md). 5 | -------------------------------------------------------------------------------- /sigs/logos/README.md: -------------------------------------------------------------------------------- 1 | These are the official logos for TensorFlow SIGs. If you need a new logo making, please file an issue and assign to @ewilderj. 2 | 3 | Each logo has a PNG version with a transparent background, and a JPEG with a white background. 4 | 5 | -------------------------------------------------------------------------------- /sigs/logos/SIGAddons.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGAddons.jpg -------------------------------------------------------------------------------- /sigs/logos/SIGAddons.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGAddons.png -------------------------------------------------------------------------------- /sigs/logos/SIGBuild.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGBuild.jpg -------------------------------------------------------------------------------- /sigs/logos/SIGBuild.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGBuild.png -------------------------------------------------------------------------------- /sigs/logos/SIGFederated.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGFederated.png -------------------------------------------------------------------------------- /sigs/logos/SIGFederated_Transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGFederated_Transparent.png -------------------------------------------------------------------------------- /sigs/logos/SIGIO.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGIO.jpg -------------------------------------------------------------------------------- /sigs/logos/SIGIO.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGIO.png -------------------------------------------------------------------------------- /sigs/logos/SIGModels.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGModels.png -------------------------------------------------------------------------------- /sigs/logos/SIGModels.svg: -------------------------------------------------------------------------------- 1 | SIG Models -------------------------------------------------------------------------------- /sigs/logos/SIGNetworking.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGNetworking.jpg -------------------------------------------------------------------------------- /sigs/logos/SIGNetworking.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGNetworking.png -------------------------------------------------------------------------------- /sigs/logos/SIGRecommenders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGRecommenders.png -------------------------------------------------------------------------------- /sigs/logos/SIGRecommenders.svg: -------------------------------------------------------------------------------- 1 | SIG Recommenders -------------------------------------------------------------------------------- /sigs/logos/SIGRust.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGRust.jpg -------------------------------------------------------------------------------- /sigs/logos/SIGRust.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGRust.png -------------------------------------------------------------------------------- /sigs/logos/SIGTFX.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGTFX.png -------------------------------------------------------------------------------- /sigs/logos/SIGTFX.svg: -------------------------------------------------------------------------------- 1 | SIG TFX -------------------------------------------------------------------------------- /sigs/logos/SIGTensorboard.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGTensorboard.jpg -------------------------------------------------------------------------------- /sigs/logos/SIGTensorboard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/tensorflow/community/185530183d8f3734795beb520d02b8265c230a12/sigs/logos/SIGTensorboard.png -------------------------------------------------------------------------------- /sigs/micro/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG Micro - TensorFlow Embedded Group 2 | 3 | ## Objective 4 | 5 | For discussion and collaborations around running TensorFlow models on microcontrollers, DSPs, and other highly-resource constrained embedded devices. There are no hard rules about what counts as embedded, but this group concentrates on the challenges of running on devices that may only have hundreds or even tens of kilobytes of memory and storage. 6 | 7 | ## Membership 8 | 9 | We welcome everyone involved in machine learning in embedded environments to join the group! To participate, request an invitation to join the mailing list. 10 | 11 | Archives of the mailing list will be publicly available. 12 | 13 | ## Resources 14 | 15 | * [SIG Micro mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/micro) 16 | * [SIG Micro Gitter chat channel](https://gitter.im/tensorflow/sig-micro) 17 | * [TensorFlow Micro code](https://github.com/tensorflow/tensorflow/tree/master/tensorflow/tflite-micro) 18 | * [SIG Micro monthly meeting notes and agenda](https://goo.gle/tf-micro-notes) 19 | 20 | ## Contacts 21 | 22 | * Project leads: Neil Tan [@neil-tan](https://github.com/neil-tan), Arm, and Pete Warden [@petewarden](https://github.com/petewarden), [Advait Jain](https://github.com/advaitjain), Google 23 | * For administrative questions, contact Joana Carrasqueira - joanafilipa at google. 24 | 25 | ## Code of Conduct 26 | 27 | As with all forums and spaces related to TensorFlow, SIG Micro is subject to 28 | the [TensorFlow Code of 29 | Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 30 | -------------------------------------------------------------------------------- /sigs/micro/SIG-request.md: -------------------------------------------------------------------------------- 1 | # Request for SIG 2 | 3 | ## What is this group for? 4 | 5 | For discussion and collaborations around running TensorFlow models on microcontrollers, DSPs, and other highly-resource constrained embedded devices. There are no hard rules about what counts as embedded, but this group concentrates on the challenges of running on devices that may only have hundreds or even tens of kilobytes of memory and storage. 6 | 7 | The TensorFlow Lite for Microcontrollers project was launched at the Dev Summit in March 2019 and has already attracted interest from many hardware and product partners outside of Google. 8 | 9 | ## Who will be part of it? 10 | 11 | Describe: 12 | 13 | * Neil Tan from Arm will lead the group. 14 | * Pete Warden from Google will act as his second. 15 | * Multiple hardware and toolchain partners have expressed interest in joining the group. 16 | * Anyone interested in building embedded solutions with TensorFlow is welcome. 17 | 18 | Membership will be entirely public. 19 | 20 | ## What initial problems will the group tackle? 21 | 22 | Create and prioritize the roadmap for development. 23 | Divide up high priority work between contributors. 24 | Share support and help between contributors. 25 | 26 | ## What modes of communication do you intend to use? 27 | 28 | We have a mailing list, will arrange a monthly VC call, and will be use the Gitter chat channel at https://gitter.im/tensorflow/sig-micro 29 | 30 | ## Launch plan 31 | 32 | 33 | 1. VC call with initial interested parties to finalize charter and initial group goals. 34 | 2. SIG set up with initial group members. 35 | 3. SIG added to community pages on tensorflow.org. 36 | 4. Write blog post about SIG and its goals. 37 | 5. Leader starts off mailing list discussion about initial work items. 38 | 39 | # Charter 40 | 41 | Please see draft charter in this folder. 42 | 43 | -------------------------------------------------------------------------------- /sigs/mlir/CHARTER.md: -------------------------------------------------------------------------------- 1 | # MLIR 2 | 3 | ## Objective 4 | 5 | The purpose of this group is to enable collaboration and open discussions about: 6 | 7 | 1. High Performance Compilers and Optimization techniques that can be applied to TensorFlow graphs. 8 | 2. Code generation 9 | 10 | Our overarching goal is to create common intermediate representation (IR) that reduces the cost to bring up new hardware, and improve usability for existing TensorFlow users. 11 | 12 | ## Membership 13 | 14 | Anyone involved in or interested in high performance compilers and their applications to TensorFlow graphs are welcome to join the group. To participate, request an invitation to join the mailing list. Archives of the mailing list will be publicly accessible. 15 | 16 | ## Resources 17 | 18 | * Mailing list: [mlir@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/mlir) 19 | * GitHub repo: [tensorflow/mlir](https://github.com/tensorflow/mlir) 20 | * [Agenda document](https://docs.google.com/document/d/1y_9f1AbfgcoVdJh4_aM6-BaSHvrHl8zuA5G4jv_94K8) containing the meeting notes and recordings. 21 | 22 | ## Collaboration 23 | 24 | We plan to start by focusing on the Graph Compiler. As such, we’ll have a 45 min meeting every week. In the near future, we also plan on adding another 45 min slot focussed on Code Generation. Everyone on the mailing list will be invited. We will publish a document for interested members to add topics. The main goals of these meetings will include, but not restricted to: 25 | 26 | 1. Design discussions and reviews of upcoming changes. 27 | 2. Roadmap discussions. 28 | 3. Discussions around platform support. 29 | 4. Important issues & bugs. 30 | 31 | ## Contacts 32 | 33 | * Project lead: Tatiana Shpeisman [@tatianashp](https://github.com/tatianashp) - shpeisman at google 34 | * Project manager: Pankaj Kanwar [@pkanwar23](https://github.com/pkanwar23) - pkanwar at google 35 | * For administrative questions, contact Edd Wilder-James 36 | [@ewilderj](https://github.com/ewilderj) - ewj at google 37 | 38 | ## Code of Conduct 39 | 40 | As with all forums and spaces related to TensorFlow, SIG MLIR is subject to 41 | the [TensorFlow Code of 42 | Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 43 | -------------------------------------------------------------------------------- /sigs/networking/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG Networking Charter 2 | 3 | ## Objective 4 | 5 | TensorFlow has built-in support for communicating intermediate results across the network using gRPC. SIG Networking aims to add support for different network fabrics and protocols. 6 | 7 | The group evaluates proposals and designs in this area and maintains code in the `tensorflow/networking` repository. 8 | 9 | ## Membership 10 | 11 | Everybody with an interest in making TensorFlow work (better) on differrent types of networks or underlying drivers and libraries is welcome to join the SIG. To participate, request an invitation to join the mailing list. Archives of the mailing list are publicly accessible. 12 | 13 | ## Resources 14 | 15 | * SIG Networking mailing list: [networking@tensorflow.org](https://groups.google.com/a/tensorflow.org/forum/#!forum/networking) 16 | * Repository maintained by SIG Networking: [github.com/tensorflow/networking](https://github.com/tensorflow/networking) 17 | 18 | ## Contacts 19 | 20 | * SIG leads: Bairen Yi [@byronyi](https://github.com/byronyi) - byronyi@connect.ust.hk, Jeroen Bédorf [@jbedorf](https://github.com/jbedorf) - jeroen@minds.ai 21 | * TensorFlow technical contact: Paul Tucker [@poxvoculi](https://github.com/poxvoculi) - tucker@google.com 22 | * For administrative questions, contact Edd Wilder-James [@ewilderj](https://github.com/ewilderj) - ewj at google 23 | 24 | ## Code of Conduct 25 | 26 | As with all forums and spaces related to TensorFlow, SIG Networking is subject to the [TensorFlow Code of Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 27 | -------------------------------------------------------------------------------- /sigs/rust/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG-Rust 2 | ## Objective 3 | 4 | For users and contributors to collaborate on the TensorFlow Rust bindings 5 | project. 6 | 7 | ## Membership 8 | 9 | Everyone involved in using or developing the TensorFlow Rust bindings is welcome 10 | to join the group. To participate, join the mailing list. 11 | 12 | Archives of the mailing list will be publicly accessible. 13 | 14 | ## Resources 15 | 16 | * [sig-rust mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/sig-rust) 17 | * Github [tensorflow/rust](https://github.com/tensorflow/rust) 18 | 19 | 20 | ## Contacts 21 | * Project lead: Adam Crume [@adamcrume](https://github.com/adamcrume) - acrume 22 | at google 23 | * For administrative questions, contact Edd Wilder-James 24 | [@ewilderj](https://github.com/ewilderj) - ewj at google 25 | 26 | ## Code of Conduct 27 | 28 | As with all forums and spaces related to TensorFlow, SIG-TensorBoard is subject 29 | to the [TensorFlow Code of 30 | Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 31 | -------------------------------------------------------------------------------- /sigs/tensorboard/CHARTER.md: -------------------------------------------------------------------------------- 1 | # SIG TensorBoard 2 | 3 | ## Objective 4 | 5 | For discussion and collaboration around TensorBoard, the visualization tool for TensorFlow. 6 | 7 | ## Membership 8 | 9 | Everyone interested in developing TensorBoard is welcome to join the group. To participate, request an invitation to join the mailing list. 10 | 11 | Archives of the mailing list will be publicly accessible. 12 | 13 | ## Resources 14 | 15 | * [SIG TensorBoard mailing list](https://groups.google.com/a/tensorflow.org/forum/#!forum/sig-tensorboard) 16 | * GitHub [tensorflow/tensorboard](https://github.com/tensorflow/tensorboard) 17 | 18 | * [Writing a TensorBoard plugin](https://github.com/tensorflow/tensorboard-plugin-example/blob/master/README.md) 19 | 20 | ## Contacts 21 | * Project leads: 22 | * Mani Varadarajan [@maniv](https://github.com/manivaradarajan) - maniv at google 23 | * Nick Felt [@nfelt](https://github.com/nfelt) - nickfelt at google 24 | * Stan Bileschi [@bileschi](https://github.com/bileschi) - bileschi at google 25 | * For administrative questions, contact Edd Wilder-James [@ewilderj](https://github.com/ewilderj) - ewj at google 26 | 27 | ## Code of Conduct 28 | 29 | As with all forums and spaces related to TensorFlow, SIG-TensorBoard is subject 30 | to the [TensorFlow Code of 31 | Conduct](https://github.com/tensorflow/tensorflow/blob/master/CODE_OF_CONDUCT.md). 32 | -------------------------------------------------------------------------------- /sigs/testing/README.md: -------------------------------------------------------------------------------- 1 | # TensorFlow 2.0 Testing 2 | 3 | A key element of the evolution of TensorFlow is TF 2.0, which is primarily focused on: 4 | 5 | * Cleaning up and standardizing the high-level API surface 6 | * Making TensorFlow more intuitive and easier to debug; and 7 | * Continuing to enable scalable production deployment. 8 | 9 | **TF 2.0 is just in the beginning of this transition.** 10 | 11 | You can experiment with the alpha release today! Please let us know what you create, and what the experience is like. Over the next few months, we will be focused on making it RC/production ready both internally and externally; making TF 2.0 compatible with the rest of TensorFlow ecosystem; and sharing that journey with you. 12 | 13 | _We’d love for you to join us and help us!_ 14 | 15 | ## Installation Instructions 16 | 17 | You can install the alpha release of TensorFlow 2.0 with: 18 | 19 | ``` 20 | pip install tensorflow==2.0.0-alpha0 21 | ``` 22 | 23 | For more detailed and platform-specific instructions, check [here](https://www.tensorflow.org/install). 24 | 25 | ## Testing Stand-ups and Migration Support 26 | 27 | We run a weekly testing stand-up on Tuesdays at 2:00pm (Pacific Time), and will be launching a migration support hour soon on Mondays at 10:00am (Pacific Time). 28 | 29 | * [Join the user group.](https://groups.google.com/a/tensorflow.org/forum/#!forum/testing) 30 | * [Review previous meeting notes.](https://docs.google.com/document/d/1i9_Ey9rYtslS6fryZ5Wm0vWWbrpScW3oh9bTRNVQ87Q/edit?usp=sharing) 31 | * [How to write a great friction log or issue report.](https://github.com/tensorflow/community/blob/master/sigs/build/tensorflow-testing.md) 32 | --------------------------------------------------------------------------------