This patch fixes issues related to logging verbosity in the MLGO python
scripts. This was an oversight when converting from absl.logging to the
python logging API as absl natively supports a --verbosity flag to set
the desired logging level. This patch adds a flag to support similar
functionality in Python's logging library and additionally updates
docstrings where relevant to point to the new values.
This patch adds spaces at the end of lines in multiline strings in the
extract_ir script. Without this patch, the warning/info messages will be
printed without spaces between words when there is a line break in the
source which looks/reads weird.
This patch bumps the MLGO utilities python package version to v20 in
sync with the rest of the project. This should be automated later in the
version update script, but this needs to be updated even while a patch
for that lands.
The MLGO executable scripts were previously set up incorrectly with the
entrypoints. This patch corrects the entrypoints so that the scripts
work as expected rather than throwing import errors in the wrapper.
This patch adjusts the versioning/package name for mlgo-utils to match
what is on Pypi. I did this before because we uploaded a package before
the 18 branch, but apparently never committed the changes.
We will have to special case actual releases in the future, but for now
development versions are fine.
The mlgo-utils README contained a comment about a deviation in the
python version requirement for itself and the rest of the project. Now
that the global LLVM minimum python version is 3.8, this comment is no
longer valid so remove it.
This patch drops the python version cap for mlgo-utils. I have validated
that everything works as expected in Python 3.12, and we have no
dependencies when the library is used, so we should be fairly resiliant
against changes in Python.
Previously, we had a python-38 flag for the mlgo-utils tests as they
needed a python version higher than what LLVM required by default due to
type annotations. Now that LLVM's default Python version minimum is 3.8,
we can remove this flag.
Update the folder titles for targets in the monorepository that have not
seen taken care of for some time. These are the folders that targets are
organized in Visual Studio and XCode
(`set_property(TARGET <target> PROPERTY FOLDER "<title>")`)
when using the respective CMake's IDE generator.
* Ensure that every target is in a folder
* Use a folder hierarchy with each LLVM subproject as a top-level folder
* Use consistent folder names between subprojects
* When using target-creating functions from AddLLVM.cmake, automatically
deduce the folder. This reduces the number of
`set_property`/`set_target_property`, but are still necessary when
`add_custom_target`, `add_executable`, `add_library`, etc. are used. A
LLVM_SUBPROJECT_TITLE definition is used for that in each subproject's
root CMakeLists.txt.
Currently this test is assuming that ~/.local/bin (or wherever the
Python binaries are installed to) is on the path. This is not a valid
assumption in most cases, and it also means we might not find the
version of pytype associated with the Python interpreter being used to
test LLVM, which could create some inconsistencies. This patch fixes
that by invoking pytype through the Python interpreter passed to lit.
This patch adds a pytype test to the mlgo-utils lit test suite to
prevent regressions in typing while we wait to setup precommit CI for
this specific project.
This is somewhat hacky, but is a temporary fix and will be pulled out
soonish. It also should only impact the ML buildbots as they are the
only ones that should have `pytype` installed.
This test is currently failing as the order that the files end up in the
corpus description is somewhat dependent upon platform and the check is
checking for a specific order. This patch switches to using the
CHECK-DAG directive to make the checks order invariant to fix the broken
bots.
This patch removes the absl dependency from the mlgo-utils scripts. We
were only using absl.logging, and absl.flags, so this patch just
consists of mechanically converting the absl flags parsing to Python's
builtin argparse as Python's logging is a drop in replacement for
absl.logging.
This patch adds integration tests for the script entry points. The tests
don't exercise all functionality, as that case is better covered by the
unit testing already checked in. This ensures that things like flag
parsing work and that the scripts are syntactically valid.
This patch disables the mlgo-utils tests on Windows builders. MLGO is
not currently supported on Windows.
These tests were failing as some of them look for specific file paths
and the path conventions are different between Linux and Windows.
The library files in the new mlgo-utils utilities folder only depend on
absl.logging. The builtin Python logging library is a direct drop-in
replacement here, so we can just change the include and drop the test
dependency.