Open ScottTodd opened 3 years ago
Python API docs have been started: https://github.com/google/iree/pull/7183
MLIR Dialects
https://google.github.io/iree/Dialects - 404 - Not found
This issue was written before we migrated from our old website to our new website. The page was at that location. It doesn't exist now.
Here's an archive of what we had published for the MLIR dialects: https://github.com/openxla/iree/tree/99c6ce409783eaffb37dd46f3f4a6ef761556f99/docs/Dialects
I just discussed publishing MLIR dialect reference pages with @jpienaar .
https://github.com/openxla/iree/pull/13991 gives reference pages a clear place to go
Preview:
Ideas:
hal.buffer.assert (::mlir::iree_compiler::IREE::HAL::BufferAssertOp)
-> hal.buffer.assert (BufferAssertOp)
MLIR dialect reference pages are published now at https://openxla.github.io/iree/reference/mlir-dialects/
The Python bindings have some documentation support at https://github.com/openxla/iree/tree/main/docs/api_docs/python -> https://iree-python-api.readthedocs.io/en/latest/
That could either be updated / actively maintained as-is, or we could fold it into the main website at e.g. https://openxla.github.io/iree/reference/python/
. I think it's worth testing mkdocstrings or some other integration into the main website. We might be able to keep the same styling as the rest of the website if API docs are easy enough to navigate. Read the Docs doesn't seem to be providing that much extra support (like symbol search) on top of basic pagination and page styling.
I gave mkdocstrings a try, progress at https://github.com/ScottTodd/iree/tree/docs-python-mkdocstrings
Impressions:
.. code-block:: python
, that aren't getting picked up even with the sphinx
docstring styleAh, missed a few dialect pages: https://github.com/openxla/iree/tree/main/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect
iree_input
)iree_linalg_ext
)iree_linalg_transform
)Steps to include:
iree-doc
target: https://github.com/openxla/iree/blob/ccf886b786f70d9bda4e2f7a01fe6825cffc5ab8/docs/website/generate_extra_files.sh#L27-L32--strip-prefix
flag to CMakeLists.txt
files: https://github.com/openxla/iree/blob/ccf886b786f70d9bda4e2f7a01fe6825cffc5ab8/build_tools/cmake/iree_tablegen_doc.cmake#L58-L60llvm-external-projects/iree-dialects
(using the postprocess_dialect_docs.py
script? Or add more information to the dialect summary/description strings?)Adding on to the previous comment, files like https://github.com/openxla/iree/blob/main/llvm-external-projects/iree-dialects/include/iree-dialects/Dialect/LinalgTransform/CMakeLists.txt will need _add_doc
functions, with the logic in add_mlir_doc
(looks like our LLVM_EXTERNAL_PROJECTS
code doesn't use MLIR/LLVM CMake helper functions, at least for tablegen?)
I started adding the llvm-external-project/iree-dialect/
dialects/ops to the website on a branch: https://github.com/ScottTodd/iree/tree/docs-iree-dialects.
StructuredTransformOpsExt.td
is a bit weird to generate a standalone page for (extensions to an existing dialect, missing some high level / summary information) so I'm not sure if it should be included:
We could add some context like how the ops there extend https://mlir.llvm.org/docs/Dialects/Transform/ (either in the .td file somehow or by inserting some text into the .md file that is used by the static site generator)
fyi @ftynse @nicolasvasilache @matthias-springer (How useful would you find a page like https://openxla.github.io/iree/reference/mlir-dialects/Flow/ for the IREE transform extensions? Any suggestions for how to add context?)
I need to double check what remains in there but the idea would be to completely remove it.
It's useful to have IMO. I'm constantly checking the main transform dialect page for syntax and pre/post-conditions of the transforms I'm using. For context, it should be sufficient to link to https://mlir.llvm.org/docs/Dialects/Transform/#overview at the top of the page. There will be an overview and a description of the extension mechanism. Alternatively, split out the "documentation" part of https://github.com/llvm/llvm-project/blob/main/mlir/docs/Dialects/Transform.md into a separate .md file that will be included from Transform.md and into IREE doc somehow.
An idea for C / Python API docs (and possibly MLIR...?): we can publish versions of the docs, with a version matching each stable (or major) release. Having a separate repo like https://github.com/pytorch/pytorch.github.io/tree/site/docs would give us a good place to store generated files without bloating the main repo (and we could also pull in projects like shark-turbine into the generation if that would make sense).
We have enough user-facing APIs to add a dedicated
Reference
section on our user website.Python bindings
Most of our Python classes and functions have docstrings, but the files are scattered throughout our codebase and split across several module namespaces and pip packages.
We could use
mkdocstrings
with our new mkdocs site:https://wiki.python.org/moin/DocumentationTools has more options. Doxygen could be nice, as it supports all the languages we use.
TFLite bindings
TFLite / TFLite Java bindings can probably just link to TFLite's docs for API references, with differences highlighted on our pages.
C API
The API headers are well documented (example:
iree/base/api.h
) but the documentation is split across many files (example:iree/vm/api.h
just exports various headers fromiree/vm/
). Aggregating into reference pages like https://mlir.llvm.org/docs/LangRef/ or https://mlir.llvm.org/doxygen/namespacemlir.html could be helpful.Java bindings
Our Java bindings are experimental and incomplete at the moment. If we develop them into a larger, supported API, we could use Javadoc or Doxygen.
MLIR Dialects
We generate documentation for our MLIR dialects and publish them today at https://google.github.io/iree/Dialects. These are not user-facing (for most, but not all, definitions of "IREE user"), but it's useful to discuss them here too. Tablegen doc generation uses https://github.com/google/iree/blob/main/build_tools/cmake/iree_tablegen_doc.cmake to generate markdown files