Skip to content

feat(fabric): add --telemetry and repoint --topology to config - #11084

Merged
marifamd merged 1 commit into
developfrom
users/daolivei/amdsmi_aifm_telemetry
Oct 12, 2026
Merged

marifamd merged 1 commit into
developfrom
users/daolivei/amdsmi_aifm_telemetry

Conversation

@oliveiradan

@oliveiradan oliveiradan commented Sep 2, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

IFoE telemetry amd-smi fabric --telemetry absent from amd-smi output

Technical Details

  • Separate the two fabric datasets onto distinct flags so one flag no
    longer serves two different outputs: - --topology now shows device configuration (amdsmi_get_gpu_fabric_info) - --telemetry shows the per-category counters
    (amdsmi_get_fabric_telemetry_data)
  • Keep -i/--info as a deprecated hidden alias for --topology, slated for
    removal in a future ROCm release. --help no longer lists it - Parser (amdsmi_cli/amdsmi_parser.py): - Add -T/--telemetry, repoint the -t/--topology help text, and hide -i/--info with argparse.SUPPRESS - CLI (amdsmi_cli/subcommands/fabric.py): - Route --topology to amdsmi_get_gpu_fabric_info() and --telemetry to amdsmi_get_fabric_telemetry_data() - Fold --info into --topology. Keep the fabric_info output key unchanged - Docs (docs/how-to/amdsmi-cli-tool.md): - Update the fabric --help block for the new flag set - CHANGELOG.md: - Log the breaking fabric CLI flag rework - tests/python/cli/test_fabric.py: - Add a flag-contract test covering the new flag set and the hidden --info alias

Issue Tracking

JIRA ID: ROCM-29630

Test Plan

  • tests/amd_smi_test/unit/gpu/fabric_info_layout_test.cc (new): hardware-free check that the version 1 offsets and size hold, that a version 1 or unrecognized request leaves every byte past the version 1 member untouched, that a version 2 request fills the nested member, and that flatten_v2_to_v1() maps every version 1 field
  • tests/amd_smi_test/unit/gpu/fabric_public_api_test.cc (new): null-handle rejection in amdsmi_get_gpu_fabric_info()
  • tests/amd_smi_test/unit/gpu/fabric_config_roundtrip_test.cc (new): flat read, mask == 0 rejection, non-committing request - tests/amd_smi_test/functional/ifoe/fabric/fabric_write_test.cc (new): null-handle, invalid-mask, and per-device hardware paths - tests/python/cli/test_fabric.py: flag set, each flag's routing to its output key, rejection of --info, which invocations warn, and a skip when the fabric subcommand is not registered

Test Result

  • pre-commit: all hooks pass - cli.test_fabric: 2 tests OK (13.9 s) with the amdgpu driver loaded; both skip cleanly when the fabric subcommand is not registered
  • amd-smi fabric -t --json: warning emitted once on stderr, stdout is valid JSON carrying fabric_info only. --telemetry and the no-flag default emit nothing on stderr. --info and -i exit non-zero
  • Mutation checks: all four guards fail when reverted - amdsmitst --gtest_filter='*Fabric*': 29 tests from 3 suites, 27 passed, 2 skipped, 0 failed (18 ms). All hardware-free coverage passes: the 4 FabricInfoLayout* offset/size/flatten checks, FabricPublicApiGetRejectsNullArguments, the 17 FabricConfig* round-trip and validation checks, and the 3 FabricTelemIdToString* checks
  • The 2 skips are environmental, not failures: IfoeFunctionalReadOnly.TestFabricRead skips with "Fabric (IFoE) not supported on this system", IfoeFunctionalReadWrite.TestFabricWrite skips with "Invalid permission - Must run as super user"
  • Fabric config and counter values: not verified, no IFoE/UALink hardware available. All reads returned N/A

Submission Checklist

@oliveiradan
oliveiradan requested review from a team and a lite review from Copilot September 2, 2026 03:34
@github-actions github-actions Bot added documentation Improvements or additions to documentation project: amdsmi labels Sep 2, 2026
@therock-pr-bot

therock-pr-bot Bot commented Sep 2, 2026

Copy link
Copy Markdown

✅ All Policy Checks Passed

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —

🎉 All policy checks passed!

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

It introduces broad ABI/API surface changes (new struct layout selection, new sysfs write APIs, and CLI behavior changes) that warrant final human review for compatibility and operational safety.

Pull request overview

This PR expands the AMD SMI “fabric” surface to support separate configuration vs telemetry reporting in the CLI, and adds a new nested fabric-info layout plus new UALink sysfs-backed write APIs (PPoD/vPoD/station) with accompanying unit/functional tests and binding updates.

Changes:

  • Add --telemetry and repoint --topology to configuration output, including a targeted warning on explicit --topology usage.
  • Introduce amdsmi_fabric_info_v2_t + layout selection via amdsmi_fabric_info_t::fabric_version, and add new fabric configuration write APIs (amdsmi_set_gpu_fabric_*_config).
  • Add new C++ unit/functional test coverage for layout compatibility, sysfs round-trips, and public API argument rejection; update Python CLI tests to lock in flag routing/behavior.
File summaries
File Description
projects/amdsmi/tests/python/cli/test_fabric.py Adds CLI-level flag contract tests for --topology/--telemetry behavior and stderr warning expectations.
projects/amdsmi/tests/amd_smi_test/unit/gpu/fabric_public_api_test.cc New unit test ensuring public fabric getter rejects null arguments.
projects/amdsmi/tests/amd_smi_test/unit/gpu/fabric_info_layout_test.cc New layout/ABI-guard unit tests for v1/v2 fabric info union behavior and bounded writes.
projects/amdsmi/tests/amd_smi_test/unit/gpu/fabric_config_roundtrip_test.cc New hardware-free sysfs round-trip tests for fabric config apply/query seams.
projects/amdsmi/tests/amd_smi_test/main.cc Registers new functional fabric write test suite with privilege gating.
projects/amdsmi/tests/amd_smi_test/functional/ifoe/fabric/fabric_write.h Declares new functional test harness for fabric write paths.
projects/amdsmi/tests/amd_smi_test/functional/ifoe/fabric/fabric_write_test.cc Adds functional coverage for setters’ validation, support gating, and safe round-trips.
projects/amdsmi/tests/amd_smi_test/functional/ifoe/fabric/fabric_read_test.cc Updates functional fabric read test to consume/print v2 layout and adds flat-vs-subtree diagnostics.
projects/amdsmi/src/CMakeLists.txt Adds new fabric UALink implementation source to the build.
projects/amdsmi/src/amd_smi/amd_smi_ualoe.cc Implements new public setter APIs that delegate into AMDSmiGPUDevice.
projects/amdsmi/src/amd_smi/amd_smi_gpu_device.cc Refactors fabric info read path to v2-first gathering + bounded publish to requested layout; adds flatten/publish helpers.
projects/amdsmi/src/amd_smi/amd_smi_fabric_ualink.cc New sysfs serialization/parsing implementation for apply/query of fabric config domains, with commit/divergence diagnostics.
projects/amdsmi/rust-interface/src/amdsmi_wrapper.rs Updates Rust FFI bindings for fabric v2 layout and new fabric config setter APIs/types/constants.
projects/amdsmi/py-interface/amdsmi_wrapper.py Updates Python ctypes bindings for v2 fabric layout and new fabric config APIs/types/constants.
projects/amdsmi/py-interface/amdsmi_interface.py Updates Python high-level API to request/require fabric v2 layout and expose new fields/masks.
projects/amdsmi/include/amd_smi/impl/amd_smi_gpu_device.h Extends device interface for fabric apply/query helpers and publishes bounded-layout helpers for tests.
projects/amdsmi/include/amd_smi/impl/amd_smi_fabric_ualink.h New internal header exposing filesystem-seam apply/query cores for hardware-free testing.
projects/amdsmi/include/amd_smi/amdsmi.h Adds fabric v2 layout + layout selector enum, new fabric config structures/enums, and new setter API declarations/docs.
projects/amdsmi/example/amd_smi_fabric_example.cc Updates example to request and consume fabric v2 layout including station fields and masks.
projects/amdsmi/docs/reference/amdsmi-py-api.md Updates Python API docs for fabric info to reflect v2 layout and additional keys.
projects/amdsmi/docs/how-to/amdsmi-cli-tool.md Updates CLI docs to reflect --topology/--telemetry flag set and semantics.
projects/amdsmi/CHANGELOG.md Documents the breaking CLI flag changes and the new fabric v2 layout + config APIs.
projects/amdsmi/amdsmi_cli/subcommands/fabric.py Routes --topology to config and --telemetry to counters; updates defaults.
projects/amdsmi/amdsmi_cli/amdsmi_parser.py Adds --telemetry, updates --topology help, and implements stderr warning action for explicit --topology.
Review details
  • Files reviewed: 24/24 changed files
  • Comments generated: 0
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@oliveiradan
oliveiradan force-pushed the users/daolivei/amdsmi_aifm_telemetry branch from b93f66a to 5ec1fe8 Compare September 3, 2026 18:18
@amd-josnarlo
amd-josnarlo self-requested a review September 4, 2026 14:07
@oliveiradan
oliveiradan force-pushed the users/daolivei/amdsmi_aifm_telemetry branch from 5ec1fe8 to f14e1ab Compare September 5, 2026 00:51
@marifamd
marifamd force-pushed the users/daolivei/amdsmi_aifm_telemetry branch from f14e1ab to e974f03 Compare September 14, 2026 18:42
@marifamd
marifamd force-pushed the users/daolivei/amdsmi_aifm_telemetry branch 2 times, most recently from 736b305 to 9178df7 Compare September 30, 2026 16:07
@marifamd
marifamd force-pushed the users/daolivei/amdsmi_aifm_telemetry branch from 9178df7 to fa917c6 Compare October 6, 2026 19:34
- Separate the two fabric datasets onto distinct flags so one flag no
  longer serves two different outputs:
  - ``--topology`` now reports device configuration
    (``amdsmi_get_gpu_fabric_info()``), previously shown by ``--info``
  - ``--telemetry`` reports the per-category counters
    (``amdsmi_get_fabric_telemetry_data()``), previously shown by
    ``--topology``
- Remove ``-i``/``--info``. Its output moved to ``--topology`` under the
  unchanged ``fabric_info`` output key

- Parser (``amdsmi_cli/amdsmi_parser.py``):
  - Replace the ``-i``/``--info`` argument with ``-T``/``--telemetry``
    and swap the two help strings
  - Add ``_WarnTopologySemanticsChange``, an ``argparse.Action`` that
    writes a warning to stderr when ``--topology`` is passed explicitly.
    The flag changed meaning without failing to parse, so a script
    written against the old flag would have silently read configuration
    where it expected counters. Keeping the warning off stdout is what
    leaves ``--json`` and ``--csv`` parseable. The no-flag default sets
    both flags internally and stays quiet

- CLI (``amdsmi_cli/subcommands/fabric.py``):
  - Rename the ``info`` override parameter and ``args.info`` to
    ``telemetry``
  - Gate the ``fabric_info`` block on ``args.topology`` and the
    ``fabric_telemetry`` block on ``args.telemetry``

- Docs (``docs/how-to/amdsmi-cli-tool.md``):
  - Update the ``fabric --help`` block for the new flag set

- ``CHANGELOG.md``:
  - Record the flag rework as breaking, including the ``--info`` removal
    and why ``--topology`` warns

- ``tests/python/cli/test_fabric.py``:
  - Add ``test_flag_contract`` covering the flag set in ``--help``, that
    ``--info`` no longer parses, that each flag routes to its own output
    key, and that the warning reaches stderr for an explicit
    ``--topology`` only
  - Skip in ``setUp`` when the fabric subcommand is not registered, so an
    uninitialized amdgpu driver does not read as a contract failure

Signed-off-by: Oliveira, Daniel <daniel.oliveira@amd.com>
@marifamd
marifamd force-pushed the users/daolivei/amdsmi_aifm_telemetry branch from fa917c6 to 67b15d2 Compare October 12, 2026 17:26
@marifamd
marifamd merged commit 63f0cb1 into develop Oct 12, 2026
123 of 126 checks passed
@marifamd
marifamd deleted the users/daolivei/amdsmi_aifm_telemetry branch October 12, 2026 20:12
@systems-assistant

Copy link
Copy Markdown
Contributor

TheRock Submodule Bump Activity

Newest first

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

Labels

documentation Improvements or additions to documentation organization: ROCm project: amdsmi

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants