Skip to content

[Core] Add configuration objects to iree.core - #25336

Open
devtbi wants to merge 1 commit into
iree-org:mainfrom
devtbi:core-config-objects
Open

devtbi wants to merge 1 commit into
iree-org:mainfrom
devtbi:core-config-objects

Conversation

@devtbi

@devtbi devtbi commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Why

Importing, compiling and running a model requires matched settings/arguments. It is currently a responsibility of the user to pass the correctly matched arguments between the steps. The configuration enables a compiler/runtime "driver"/tooling to exchange the information in a structured format.

Change

  • CompileConfig: any settings relevant to compile & runtime, e.g. device, driver, additional flags
  • ImportConfig: base class for an importer's settings and the files it needs at runtime

The classes are loaded with dacite, which becomes a third-party dependency of the iree-base-core wheel.

Assisted-by: Claude Code

@devtbi devtbi changed the title [Python] Add configuration objects to iree.core [Core] Add configuration objects to iree.core Nov 25, 2026
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>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants