Skip to content

feat: Sync mlia#18

Merged
IsabellaARM merged 37 commits into
mainfrom
feat-sync-mlia
May 19, 2026
Merged

feat: Sync mlia#18
IsabellaARM merged 37 commits into
mainfrom
feat-sync-mlia

Conversation

@IsabellaARM
Copy link
Copy Markdown
Collaborator

No description provided.

Mousius and others added 30 commits May 19, 2026 10:35
This removes Ruby as a dependency for running the pre-commits, as well as giving better error messages:

Markdownlint:
```
README.md:27: MD007 Unordered list indentation
README.md:32: MD007 Unordered list indentation
```

Pymarkdown:
```
/Users/chrsid02/Workspace/mlia/RELEASES.md:224:4: MD007: Unordered list indentation [Expected: 2, Actual=3] (ul-indent)
/Users/chrsid02/Workspace/mlia/RELEASES.md:225:4: MD007: Unordered list indentation [Expected: 2, Actual=3] (ul-indent)
```

Oddly Markdownlint seemed to like 3 space indents whereas Pymarkdown prefers the more sensible 2 space indents.

Change-Id: Iecb390f29d6568d1000f8ce24c414c47deb52c79
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1194657
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Maksims Svecovs <maksims.svecovs@arm.com>
IP-review: Maksims Svecovs <maksims.svecovs@arm.com>
Integrate targets and backends as plugins using entry points. This also
enables external plugins, if they provide the right entry points.

Includes `plugin_interface_version` as part of Plugin interface so we can iterate later.

Adds __eq__ for Installation for testing purposes.

Rely on registry for installation rather than raising an exception if unsupported.

Co-authored-by: Benjamin Klimczak <benjamin.klimczak@arm.com>
Change-Id: I5382aa8319867bc635258c32428743e8703b666d
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1150194
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Maksims Svecovs <maksims.svecovs@arm.com>
IP-review: Maksims Svecovs <maksims.svecovs@arm.com>
Resolves: MLIA-1631

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: If4a71d13c72289b38368d7d6daafb2ba4c4e9127
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185734
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
Changes:
- Add FACT_TYPE_REGISTRY and FactType dataclass for metadata
- Implement @register_fact_type decorator for automatic registration
- Add to_dict() and to_json_schema() methods for serialization
- Create base fact classes: NetworkFact, LayerFact
- Add concrete fact types: LayerCompatibilityIssue, LayerUsesOperator

Resolves: MLIA-1633

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: Ic808283b09200e7476616984f07bb2a96295d2c0
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185735
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
Implement PatternAnalyzer base class to enable detection of high-level
patterns from existing facts. Supports multi-pass workflow where pattern
analyzers run iteratively until no new patterns are detected.

Changes:
- Add get_facts_by_type() helper for type-based fact filtering
- Implement PatternAnalyzer base class with caching for performance
- Add analyze_patterns() abstract method for pattern detection logic
- Add has_already_generated_patterns() hook for deduplication
- Add clear_cache() for resetting state between analysis passes
- Include cached fact lookup via get_facts_by_type_cached()

Resolves: MLIA-1633

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I0280fe3dba5d5ca6d46c58c09387abc3c4b550a1
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185736
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
Implement event system for pattern detection to enable progress
tracking.

Changes:
- Add PatternDetectionStageStartedEvent for stage initialization
- Add PatternDetectionStageFinishedEvent for stage completion
- Add PatternDetectionPassEvent with pass_number and new_facts_count
- Add DetectedPatternEvent with pattern_fact for individual patterns

Resolves: MLIA-1633

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I497a13c47da08fdb5bd09e9e5000170bb98dee37
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185737
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
Add multi-pass pattern detection stage to the workflow execution
pipeline with convergence detection and configurable iteration limits.
Pattern analyzers run iteratively after data analysis, generating
composite facts until no new patterns are detected.

Changes:
- Add pattern_analyzers and max_pattern_passes to DefaultWorkflowExecutor
- Implement detect_patterns() method with multi-pass logic
- Add pattern detection stage between analysis and advice stages
- Clear analyzer caches between passes for fresh analysis
- Publish events for each pass and detected pattern
- Stop iteration when no new facts detected
- Include pattern analyzers in context propagation

Resolves: MLIA-1632

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I09ff5caf5e53f34843622f36b15db68da13c7c19
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185738
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
Tested-by: expkit <svc_expkit@arm.com>
Extend DefaultInferenceAdvisor interface to support pattern analyzers
in workflow configuration. Advisors can now provide pattern analyzers
alongside collectors, analyzers, and advice producers.

Changes:
- Import PatternAnalyzer in advisor module
- Add get_pattern_analyzers() abstract method to DefaultInferenceAdvisor
- Pass pattern analyzers to DefaultWorkflowExecutor configuration
- Allow returning empty list if pattern detection not needed

Resolves: MLIA-1632

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I052b3abf81795630a7a2eb5ee7dcb3db68aa29c5
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185739
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
Tested-by: expkit <svc_expkit@arm.com>
- Add schema-aligned fields
- Add to_schema() method for conversion to schema Advice
- Update add_advice() signature to accept new parameters
- Fix reporters.py to use .message instead of .messages
- Update JSONReporter to place advice in results[].advices array

Resolves: MLIA-1631

Change-Id: Id72fb9dad12ad7044aee98953cd44f9f05fa541a
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1190696
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
Tested-by: expkit <svc_expkit@arm.com>
Extend Ethos-U data analyzer to emit layer-level facts during
compatibility analysis. Creates facts for each operator
with NPU placement and activation function detection.

Changes:
- Add EthosULayerCompatibilityIssue fact type with npu_placement field
- Add EthosULayerUsesLUT fact type for detecting LUT-based operations
- Extend analyze_operator_compatibility() to emit per-operator facts

Resolves: MLIA-1634

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: Ie3970422621c376e7eed95897873ea6bee898156
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185740
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
Tested-by: expkit <svc_expkit@arm.com>
Implement pattern analyzer to detect inefficient LUT-based activation
functions across layers. Generates composite facts with optimization
recommendations when layers use CPU-only activation operations.

Changes:
- Add IneffectiveActivationPattern fact type for composite patterns
- Implement ActivationFunctionPatternAnalyzer class
- Group layers by activation type
- Generate targeted recommendations based on activation type
- Implement deduplication via has_already_generated_patterns()
- Track affected layer names, locations, and counts

Resolves: MLIA-1634

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: Icfa5c8fd7a5c63c5eb2f65517ec8716b94cda6cf
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1185741
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
Implement softmax operator analysis supporting both compatibility and
performance data sources.

Changes:
- Import performance result types (VelaPerformanceResult, etc.)
- Add analyze_data handlers for VelaCompatibilityResult and performance results
- Implement _extract_and_analyze_layerwise_perf() helper to reduce duplication
- Create singledispatch _analyze_softmax() with two implementations
- Remove old LUT detection logic from analyze_operator_compatibility()

Resolves: MLIA-1634

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I3b9ee8678b72a213c23a502a00cfdc518ff107b4
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1188372
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
- Add message, category, severity to Advice class
- Update all advice producers to new API signature
- Include advice in JSON output files

Change-Id: Ia05f495ab67a6b0d84bef87d2c9a1e0116b141b0
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1190697
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Isabella Gottardi <isabella.gottardi@arm.com>
IP-review: Isabella Gottardi <isabella.gottardi@arm.com>
- Change LUT-based naming to bad activation naming
- Add function operator pattern rules
- Replace softmax analysis with general function analysis
- Add message identifying functions that use unsupported operatrions

Change-Id: I1042a151c04344e28cc88ef64779eca52d4baff2
Signed-off-by: Fei-bi Allen <fei-bi.allen@arm.com>
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1195385
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Maksims Svecovs <maksims.svecovs@arm.com>
IP-review: Maksims Svecovs <maksims.svecovs@arm.com>
Ruff is the new de facto standard which encompasses all of these tools, meaning a streamlined and internally consistent linting experience.

Change-Id: If2d7c9ce479fc35ac173ac92034aab2e48e610e1
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1195689
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Maksims Svecovs <maksims.svecovs@arm.com>
IP-review: Maksims Svecovs <maksims.svecovs@arm.com>
Resolve: MLIA-1657

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
Change-Id: I3b32cffa31dd16d91c7c73e684504626ea5816fd
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia/+/1192686
Tested-by: expkit <svc_expkit@arm.com>
Reviewed-by: Maksims Svecovs <maksims.svecovs@arm.com>
IP-review: Maksims Svecovs <maksims.svecovs@arm.com>
Removes all specific backends and targets as they are now split into
different projects each focusing on their own functionality.

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
Change-Id: I5f20d11c943300a1326e311b75018894c2743a0d
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia-core/+/1215760
In the port to the plugin-repos this was changed to return 'all'. This
reverts it back to return 'any'.

Signed-off-by: Logan Scully <logan.scully@arm.com>
Change-Id: I6f483ef8b45055b8e020bf6a4d13586efc3da08e
Reviewed-on: https://eu-gerrit-2.euhpc.arm.com/c/ml/ecosystem/mlia-core/+/1217370
Reviewed-by: Maksims Svecovs <maksims.svecovs@arm.com>
IP-review: Maksims Svecovs <maksims.svecovs@arm.com>
* Moves projec to use UV
* Adds CI workflows
* feat:  Added selectable backends and listed dependencies when help or list.

Resolve: MLIA-1481

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
Change-Id: I79b0e5e9e0debe5b62e6ac1bd6e92181b9fa89c9

* fix: Use generic backend names in tests

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>

* Update src/mlia/target/registry.py

Co-authored-by: logan-scully-arm <logan.scully@arm.com>

* fix: Removed the side-by-side monorepo heuristic
Also  made the test environment-agnostic in tests as it
no longer requires target_profiles directory to physically
exist in the local checkout.

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>

---------

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
Co-authored-by: logan-scully-arm <logan.scully@arm.com>
Signed-off-by: Logan Scully <logan.scully@arm.com>
-Added LayerPerformanceIssue class.
-Added a key to LayerFact for quick identificaiton of the layers that caused the fact to be emitted.

Signed-off-by: Fei-bi Allen <fei-bi.allen@arm.com>
Signed-off-by: Logan Scully <logan.scully@arm.com>
* feat: Add Python API for MLIA analysis and discovery

- Add run_advisor for programmatic MLIA analysis
- Add discovery helpers for targets, target profiles, backends and
  backend options
- Add in-memory standardized output capture with validation modes
- Add API logging/output behavior for the core package
- Expose dynamic constants for installed targets, target profiles and
  backends
- Add unit and regression tests for the Python API

Resolves: MLIA-1626
Signed-off-by: James Edgar <james.edgar@arm.com>
Fixes backend installation from vendored artifacts when the vendor directory contains an archived backend (e.g., *.tar.gz) rather than an already-unpacked directory.

Adds vendor-archive resolution during InstallFromVendorPackage by extracting a single *.tar.gz and validating its structure.
Refactors archive extraction into a shared helper used by both downloaded and vendored artifact installation flows.
Adds a pytest regression test that installs a backend from a vendored tar.gz and verifies the extracted files are installed into the backend repository.
* test: Migrate to shared pytest-native e2e framework

Pull the generic MLIA end-to-end test framework out of mlia-ethos-u and integrate it into the core mlia repo.

This replaces the older bespoke tests_e2e harness with a reusable pytest-native helper under src/mlia/testing/e2e.py and moves repo-facing e2e coverage into normal tests/ modules.

- add src/mlia/testing/e2e.py with shared MLIA e2e helpers
- add src/mlia/testing/__init__.py exports and README documentation
- add tests/test_e2e.py as the thin repo-facing e2e suite
- add tests/test_e2e_helpers.py for focused helper coverage
- remove the legacy tests_e2e/ harness

The new framework is driven by environment variables instead of a custom config-file runner:

- MLIA_E2E_EXECUTIONS describes concrete CLI execution blocks in JSON
- MLIA_E2E_ARTIFACTS points at the prepared artifact tree
- MLIA_E2E_BACKENDS lists globally installed backends to prepare once
- MLIA_E2E_SHARD_INDEX and MLIA_E2E_SHARD_COUNT support test sharding

Each parametrized case now represents exactly one MLIA CLI invocation. Cases are expanded at collection time, staged into a temporary workdir, and executed independently.

* fix: Make e2e helper validation lazy and secure artifact staging

* fix: Format import test file

* fix: Ruff ruff!
…esses (#17)

* refactor: Remove in-process e2e CLI validation and trust mlia subprocesses

Drop helper-side command-name and argparse validation from the pytest-native
e2e helpers and let the real  subprocess remain the single source of
truth for command validation.

This avoids duplicated CLI parsing logic inside the test helper, prevents
state-leakage bugs from reused parser internals, and keeps collection focused
on execution payload structure and artifact resolution only.

* fix: Monkeypatch mlia.cli.main later
* docs: Run OpenSpec init for Co-Pilot and Codex

Add REUSE sidecar metadata for generated OpenSpec prompts and skills so SPDX headers do not add avoidable context bloat to prompt-facing content. Keep openspec/config.yaml inline because YAML comments are cheap and readable.

Update the copyright header pre-commit hook to support generic sidecars, avoid nested .license lookups, and detect conflicting inline versus sidecar copyright headers, with focused regression coverage for the new behavior.

* docs: Add AGENTS.md to help our agent friends

* fix: Exclude AGENTS.md from Pymarkdown and add .license sidecar
This PR migrates the repository documentation from a Sphinx-based setup to a MkDocs (Material) site and refreshes the top-level README to better reflect the split core/plugin architecture.

Changes:

Replace Sphinx doc dependencies/config with MkDocs + MkDocs Material configuration and Markdown content pages.
Add a dedicated GitHub Actions workflow to validate docs builds on PRs/pushes.
Restructure README.md to point to the new docs tree and reduce embedded reference material.

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
IsabellaARM and others added 6 commits May 19, 2026 10:35
Resolve: MLIA-1824

Signed-off-by: Isabella Gottardi <isabella.gottardi@arm.com>
Expose shared e2e helpers for installing configured backends
and resolving prepared artifacts. This lets plugin repos
reuse the common e2e setup path instead of duplicating
environment parsing, backend installation, and artifact-root
handling locally.

Signed-off-by: James Edgar <james.edgar@arm.com>
Add ensure_backends_available() for API e2e cases with explicit
backend requirements. The helper checks required backends
against MLIA_E2E_BACKENDS, installs missing required backends,
and verifies they are available. Document the intended usage
and add tests.

Signed-off-by: James Edgar <james.edgar@arm.com>
This PR adds “auto-install on first use” for MLIA backends, shifting default-backend validation from “must already be installed” toward “install if missing,” while providing EULA-handling controls for API vs CLI usage (MLIA-1819).

Changes:

* Add backend auto-install orchestration in mlia.backend.manager and invoke it from mlia.api.get_advice().
* Update CLI backend selection to list selectable backends even when not yet installed.
* Add test coverage for auto-install and ensure some CLI commands (e.g., backend listing) don’t trigger installs.

Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
@IsabellaARM IsabellaARM changed the title Feat sync mlia feat: Sync mlia May 19, 2026
@IsabellaARM IsabellaARM requested a review from max-shvetsov May 19, 2026 09:47
@IsabellaARM IsabellaARM marked this pull request as ready for review May 19, 2026 09:47
Copilot AI review requested due to automatic review settings May 19, 2026 09:47
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot wasn't able to review this pull request because it exceeds the maximum number of files (300). Try reducing the number of changed files and requesting a review from Copilot again.

Comment thread tests/test_api_output_capture.py Outdated
Comment thread tests/test_backend_auto_install.py Outdated
Comment thread tests/test_cli_command_validators.py Outdated
Comment thread tests/test_cli_command_validators.py Outdated
Signed-off-by: Maksims Svecovs <maksims.svecovs@arm.com>
@IsabellaARM IsabellaARM requested a review from max-shvetsov May 19, 2026 14:55
@IsabellaARM IsabellaARM merged commit cbd74f3 into main May 19, 2026
4 checks passed
@IsabellaARM IsabellaARM deleted the feat-sync-mlia branch May 19, 2026 15:55
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.

7 participants