Move Colab notebooks from colab/ to samples/colab/. (#8988)
These notebooks are all "samples", so moving here makes sense and lets us have one less top level directory.
diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS
index 70592f3..0aac245 100644
--- a/.github/CODEOWNERS
+++ b/.github/CODEOWNERS
@@ -53,7 +53,6 @@
/llvm-external-projects/iree-dialects/test/iree_linalgext @hanhanW @MaheshRavishankar
# Other Top-Level Directories
-/colab/ @ScottTodd
/docs/ @ScottTodd
diff --git a/docs/website/docs/bindings/python.md b/docs/website/docs/bindings/python.md
index 042cc98..9fc16b7 100644
--- a/docs/website/docs/bindings/python.md
+++ b/docs/website/docs/bindings/python.md
@@ -115,9 +115,9 @@
[readthedocs](https://iree-python-api.readthedocs.io/en/latest/).
Check out the samples in IREE's
-[colab/ directory](https://github.com/google/iree/tree/main/colab) and the
-[iree-samples repository](https://github.com/google/iree-samples) for examples
-using the Python APIs.
+[samples/colab/ directory](https://github.com/google/iree/tree/main/samples/colab)
+and the [iree-samples repository](https://github.com/google/iree-samples) for
+examples using the Python APIs.
<!-- ## Troubleshooting -->
diff --git a/docs/website/docs/blog/2021-07-19-tflite-tosa.md b/docs/website/docs/blog/2021-07-19-tflite-tosa.md
index 9da0139..07e83f7 100644
--- a/docs/website/docs/blog/2021-07-19-tflite-tosa.md
+++ b/docs/website/docs/blog/2021-07-19-tflite-tosa.md
@@ -34,7 +34,7 @@
## Examples
TFLite with IREE is available in Python and Java. We have a
-[colab notebook](https://colab.research.google.com/github/google/iree/blob/main/colab/tflite_text_classification.ipynb)
+[colab notebook](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/tflite_text_classification.ipynb)
that shows how to use IREE’s python bindings and TFLite compiler tools to
compile a pre-trained TFLite model from a flatbuffer and run using IREE. We
also have an
diff --git a/docs/website/docs/getting-started/index.md b/docs/website/docs/getting-started/index.md
index 2429f1e..203f70a 100644
--- a/docs/website/docs/getting-started/index.md
+++ b/docs/website/docs/getting-started/index.md
@@ -27,9 +27,10 @@
## Samples
-Check out the samples in IREE's [colab/directory](https://github.com/google/iree/tree/main/colab),
-as well as the [iree-samples repository](https://github.com/google/iree-samples)
-respository, which contains workflow comparisons across frameworks.
+Check out the samples in IREE's
+[samples/colab/ directory](https://github.com/google/iree/tree/main/colab),
+as well as the [iree-samples repository](https://github.com/google/iree-samples),
+which contains workflow comparisons across frameworks.
## Import
@@ -42,7 +43,7 @@
* Validate only IREE compatible operations remain
* Write the remaining IR to a file
-This fully legalized form can then be compiled without dependencies on the
+This fully legalized form can then be compiled without dependencies on the
source model language.
## Compilation
diff --git a/docs/website/docs/getting-started/tensorflow.md b/docs/website/docs/getting-started/tensorflow.md
index e112fc4..3774542 100644
--- a/docs/website/docs/getting-started/tensorflow.md
+++ b/docs/website/docs/getting-started/tensorflow.md
@@ -97,10 +97,10 @@
| Colab notebooks | |
| -- | -- |
-Training an MNIST digits classifier | [](https://colab.research.google.com/github/google/iree/blob/main/colab/mnist_training.ipynb)
-Edge detection module | [](https://colab.research.google.com/github/google/iree/blob/main/colab/edge_detection.ipynb)
-Pretrained ResNet50 inference | [](https://colab.research.google.com/github/google/iree/blob/main/colab/resnet.ipynb)
-TensorFlow Hub Import | [](https://colab.research.google.com/github/google/iree/blob/main/colab/tensorflow_hub_import.ipynb)
+Training an MNIST digits classifier | [](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/mnist_training.ipynb)
+Edge detection module | [](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/edge_detection.ipynb)
+Pretrained ResNet50 inference | [](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/resnet.ipynb)
+TensorFlow Hub Import | [](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/tensorflow_hub_import.ipynb)
End-to-end execution tests can be found in IREE's
[integrations/tensorflow/e2e/](https://github.com/google/iree/tree/main/integrations/tensorflow/e2e)
diff --git a/docs/website/docs/getting-started/tflite.md b/docs/website/docs/getting-started/tflite.md
index 9f56962..ddb8f01 100644
--- a/docs/website/docs/getting-started/tflite.md
+++ b/docs/website/docs/getting-started/tflite.md
@@ -130,11 +130,11 @@
## Troubleshooting
-Failures during the import step usually indicate a failure to lower from
+Failures during the import step usually indicate a failure to lower from
TensorFlow Lite's operations to TOSA, the intermediate representation used by
IREE. Many TensorFlow Lite operations are not fully supported, particularly
those than use dynamic shapes. File an issue to IREE's TFLite model support
-[project](https://github.com/google/iree/projects/42).
+[project](https://github.com/google/iree/projects/42).
## Additional Samples
@@ -152,7 +152,7 @@
| Colab notebooks | |
| -- | -- |
-Text classification with TFLite and IREE | [](https://colab.research.google.com/github/google/iree/blob/main/colab/tflite_text_classification.ipynb)
+Text classification with TFLite and IREE | [](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/tflite_text_classification.ipynb)
!!! todo
@@ -161,4 +161,3 @@
[Java TFLite bindings](https://github.com/google/iree/tree/main/bindings/tflite/java),
once it is complete at
[not-jenni/iree-android-tflite-demo](https://github.com/not-jenni/iree-android-tflite-demo).
-
diff --git a/iree/test/e2e/models/edge_detection.mlir b/iree/test/e2e/models/edge_detection.mlir
index 5a3bff0..39f66ab 100644
--- a/iree/test/e2e/models/edge_detection.mlir
+++ b/iree/test/e2e/models/edge_detection.mlir
@@ -2,7 +2,8 @@
// RUN: iree-run-mlir --iree-input-type=mhlo -iree-hal-target-backends=dylib-llvm-aot %s -function-input="1x128x128x1xf32" | FileCheck %s
// RUN: [[ $IREE_VULKAN_DISABLE == 1 ]] || (iree-run-mlir --iree-input-type=mhlo -iree-hal-target-backends=vulkan-spirv %s -function-input="1x128x128x1xf32" | FileCheck %s)
-// Image edge detection module generated by iree/colab/edge_detection.ipynb.
+// Image edge detection module generated by.
+// https://github.com/google/iree/blob/main/samples/colab/edge_detection.ipynb.
//
// Input : a single 128x128 pixel image as a tensor<1x128x128x1xf32>, with pixels in [0.0, 1.0]
// Output: a single image in the same format after running edge detection
diff --git a/colab/README.md b/samples/colab/README.md
similarity index 88%
rename from colab/README.md
rename to samples/colab/README.md
index 34bbc76..5c7a53d 100644
--- a/colab/README.md
+++ b/samples/colab/README.md
@@ -7,19 +7,19 @@
Constructs a TF module for performing image edge detection and runs it using
IREE
-[](https://colab.research.google.com/github/google/iree/blob/main/colab/edge_detection.ipynb)
+[](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/edge_detection.ipynb)
### [low_level_invoke_function\.ipynb](low_level_invoke_function.ipynb)
Shows off some concepts of the low level IREE python bindings
-[](https://colab.research.google.com/github/google/iree/blob/main/colab/low_level_invoke_function.ipynb)
+[](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/low_level_invoke_function.ipynb)
### [mnist_training\.ipynb](mnist_training.ipynb)
Compile, train and execute a TensorFlow Keras neural network with IREE
-[](https://colab.research.google.com/github/google/iree/blob/main/colab/mnist_training.ipynb)
+[](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/mnist_training.ipynb)
### [resnet\.ipynb](resnet.ipynb)
@@ -27,7 +27,7 @@
[ResNet50](https://www.tensorflow.org/api_docs/python/tf/keras/applications/ResNet50)
model and runs it using IREE
-[](https://colab.research.google.com/github/google/iree/blob/main/colab/resnet.ipynb)
+[](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/resnet.ipynb)
### [tensorflow_hub_import\.ipynb](tensorflow_hub_import.ipynb)
@@ -35,7 +35,7 @@
[MobileNet V2](https://tfhub.dev/google/tf2-preview/mobilenet_v2/classification)
model, pre-processes it for import, then compiles it using IREE
-[](https://colab.research.google.com/github/google/iree/blob/main/colab/tensorflow_hub_import.ipynb)
+[](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/tensorflow_hub_import.ipynb)
### [tflite_text_classification\.ipynb](tflite_text_classification.ipynb)
@@ -43,7 +43,7 @@
[TFLite text classification](https://www.tensorflow.org/lite/examples/text_classification/overview)
model, and runs it using TFLite and IREE
-[](https://colab.research.google.com/github/google/iree/blob/main/colab/tflite_text_classification.ipynb)
+[](https://colab.research.google.com/github/google/iree/blob/main/samples/colab/tflite_text_classification.ipynb)
## Working with GitHub
diff --git a/colab/dummy.py b/samples/colab/dummy.py
similarity index 100%
rename from colab/dummy.py
rename to samples/colab/dummy.py
diff --git a/colab/edge_detection.ipynb b/samples/colab/edge_detection.ipynb
similarity index 100%
rename from colab/edge_detection.ipynb
rename to samples/colab/edge_detection.ipynb
diff --git a/colab/low_level_invoke_function.ipynb b/samples/colab/low_level_invoke_function.ipynb
similarity index 100%
rename from colab/low_level_invoke_function.ipynb
rename to samples/colab/low_level_invoke_function.ipynb
diff --git a/colab/mnist_training.ipynb b/samples/colab/mnist_training.ipynb
similarity index 100%
rename from colab/mnist_training.ipynb
rename to samples/colab/mnist_training.ipynb
diff --git a/colab/resnet.ipynb b/samples/colab/resnet.ipynb
similarity index 100%
rename from colab/resnet.ipynb
rename to samples/colab/resnet.ipynb
diff --git a/colab/tensorflow_hub_import.ipynb b/samples/colab/tensorflow_hub_import.ipynb
similarity index 100%
rename from colab/tensorflow_hub_import.ipynb
rename to samples/colab/tensorflow_hub_import.ipynb
diff --git a/colab/test_notebooks.py b/samples/colab/test_notebooks.py
similarity index 96%
rename from colab/test_notebooks.py
rename to samples/colab/test_notebooks.py
index af545b8..c1ef330 100644
--- a/colab/test_notebooks.py
+++ b/samples/colab/test_notebooks.py
@@ -33,7 +33,7 @@
"build_tools/testing/run_python_notebook.sh")
# Create a test case for each notebook in this folder.
- notebooks_path = os.path.join(repo_root, "colab/")
+ notebooks_path = os.path.join(repo_root, "samples/colab/")
for notebook_path in glob.glob(notebooks_path + "*.ipynb"):
notebook_name = os.path.basename(notebook_path)
diff --git a/colab/tflite_text_classification.ipynb b/samples/colab/tflite_text_classification.ipynb
similarity index 100%
rename from colab/tflite_text_classification.ipynb
rename to samples/colab/tflite_text_classification.ipynb
diff --git a/samples/models/mnist.mlir b/samples/models/mnist.mlir
index 7e69a1c..b367abc 100644
--- a/samples/models/mnist.mlir
+++ b/samples/models/mnist.mlir
@@ -1,5 +1,5 @@
// Trained MNIST model generated by
-// https://github.com/google/iree/blob/main/colab/mnist_tensorflow.ipynb.
+// https://github.com/google/iree/blob/main/samples/colab/mnist_training.ipynb.
//
// Model structure is from tf.keras:
//