Repository navigation
Conversation
Add `iree.core.config`, the configuration that is recorded with an imported or compiled model: * `CompileConfig` describes how a model is compiled (target device, flags, flag templates, conditional flags) and what running the compiled artifact requires (drivers, lead allocator, runtime flags). It loads from and saves to JSON. Loading rejects unknown keys, so that a misspelled key does not go unnoticed. * `ImportConfig` is the importer-side configuration. An importer subclasses it to record its own settings and the files it needs at runtime, and registers the subclass for its framework with `register_import_config`, so that the right class can be rebuilt when saved metadata is loaded. A framework has exactly one class: registering a second one is an error instead of depending on import order. Nothing uses these classes yet: the compiler and runtime layers built on them follow. The classes are loaded with dacite, which becomes the first third-party dependency of the iree-base-core wheel. `pyproject.toml` declares it as a version range; builds and CI install it pinned to an exact version with hashes (`requirements.txt`). The requirements of the Bazel pip hub become a generated lock with hashes as well. It pins the dependencies of the wheel and the other packages that Bazel targets use, which `build_tools/bazel/requirements.in` lists: so far only numpy, which the hub already had without a pin. The pkgci unit test job now runs every test of the package against the installed wheel. Assisted-by: Claude Code Signed-off-by: Tobias Fuchs <fuchs@roofline.ai>
Add `iree.core.result`: `ImportResult` and `CompileResult` describe what importing and compiling a model produced. They are saved next to the artifacts as `metadata.json` and loaded back from it. * Artifact paths are stored as file names relative to the metadata file, so that a result directory can be moved or copied as a whole. Saving rejects an artifact that is not directly inside the output directory. * Optional fields that are not set are left out of the file. The configurations are written in full, defaults included, so that a file keeps its meaning if a default changes. * Loading rebuilds the import configuration with the class registered for its framework. If no class is registered and the file holds importer-specific settings, loading fails instead of dropping them. * Both results use the same file name, so the file states its `type`, and loading one as the other is reported as such. It also carries a `schema_version`, so that a later change of the layout is reported instead of misread. A file without these keys is read as version 1 of the requested type. * Loading rejects unknown keys, as for configuration files. Errors while loading name the file. Nothing uses these classes yet: the compiler and runtime layers built on them follow. Assisted-by: Claude Code Signed-off-by: Tobias Fuchs <fuchs@roofline.ai>
devtbi
requested review from
AGindinson,
Manewing,
jschuhmacher,
kuhar and
schuermans-roofline
as code owners
November 26, 2026 13:47
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
stacked on top of #25336 - review first
Why
Compiling and running a model consumes results of previous steps. Currently, a user has to pass these to each step by hand, together with the matching configuration/flags. This enables a compiler/runtime driver to read a json file in an output directory containing paths (relative to a shared output dir) to artifacts and configuration options.
Change
Added Compile and Import result. The result objects record what an import or compile step produced, and the used configuration, in a
metadata.json. The json file is expected to be place inside an output folder where the artifacts reside.