Files
derek.holloway 7502bf64a4
CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
Flatten subprojects into a single base monorepo
2026-09-02 16:34:47 -07:00

198 lines
6.4 KiB
Markdown

# ROCProfiler-Compute Configuration Management
This directory contains the authoritative configuration-management system for ROCProfiler-Compute analysis configurations.
It is designed to guarantee:
- **Structural correctness** across GPU architectures
- **Byte-level immutability** of panel YAMLs enforced via hashes
- **CI enforcement** of all invariants
All workflows are orchestrated by a single sequential driver script:
```bash
tools/config_management/master_config_workflow_script.py
```
## Repository Layout
```bash
rocprofiler-compute/
├── src/rocprof_compute_soc/
│ └── analysis_configs/
│ ├── gfx908/
│ │ └── 0000_top_stats.yaml
│ ├── gfx90a/
│ ├── gfx940/
│ ├── gfx950/
│ ├── gfx115x/ # RDNA 3.5 shared analysis configs
│ ├── gfx9_config_template.yaml # CDNA (gfx9) panel contract
│ └── gfx11_config_template.yaml # RDNA 3.5 (gfx115*) panel contract
│
└── tools/config_management/
├── master_config_workflow_script.py
├── parse_config_template.py
├── verify_against_config_template.py
├── hash_manager.py
├── hash_checker.py
├── .config_hashes.json
└── README.md
```
## Core Concepts
### Panel YAMLs
- Live under:
```bash
analysis_configs/<arch>/*.yaml
```
- Must conform strictly to the template schema
- Are edited in-place using ruamel.yaml round-trip mode
### Hash Database
- Stored at:
```bash
tools/config_management/.config_hashes.json
```
- Records md5 hashes of panel YAMLs per arch
- Machine-generated only
- Enforced by the pre-commit `hash-check` hook (see [Automated Testing](#automated-testing))
## Architecture Diagram (End-to-End Flow)
```text
┌──────────────────────────┐
│ analysis_configs/ │
│ gfx9_config_template │
└───────────┬──────────────┘
│
▼
┌───────────────────────────────┐
│ verify_against_config_template│
│ (structural validation) │
└───────────┬───────────────────┘
│
▼
┌───────────────────────────────┐
│ hash_manager.py --compute-all │
│ (refresh .config_hashes.json) │
└───────────┬───────────────────┘
│
▼
┌───────────────────────────────┐
│ hash_checker.py │
│ (panel-file hash consistency) │
└───────────────────────────────┘
```
## Contributor Quick Start
> [!NOTE]
> **Required Python Dependency**
> This configuration management system requires the `ruamel.yaml` Python package.
> It is used to safely modify YAML files while preserving comments, ordering,
> and formatting. The workflow scripts will not function correctly without it.
>
> See [Development dependencies](../../README.md#development-dependencies) for install instructions.
### 1. Validate the current state
Before making **any** config changes:
```bash
python tools/config_management/master_config_workflow_script.py --validate-only
```
This must pass.
### 2. Editing an existing architecture
Edit panel YAMLs **directly** under:
```bash
src/rocprof_compute_soc/analysis_configs/<arch>/
```
Rules:
- Preserve structure
- Preserve ordering
- Use multiline `>-` formatting for metric descriptions
- Do **not** regenerate entire files
After editing:
```bash
python tools/config_management/master_config_workflow_script.py --validate-only
python tools/config_management/hash_manager.py --compute-all src/rocprof_compute_soc/analysis_configs
```
The first command verifies structural conformance. The second refreshes the hash DB so `hash_checker.py` agrees.
### 3. Hash checks (fast local / CI)
```bash
python tools/config_management/master_config_workflow_script.py --hash-only
```
or:
```bash
python tools/config_management/master_config_workflow_script.py --ci
```
This runs panel-file hash validation only.
## Automated Testing
### Pre-commit Hash Consistency Hook
Hash integrity is enforced automatically by the pre-commit `hash-check` hook,
which runs `tools/config_management/hash_checker.py` on every commit touching
the project. The same script can be run manually from the project root:
```bash
python3 tools/config_management/hash_checker.py
```
This check:
- parses `.config_hashes.json`
- verifies **byte-for-byte** integrity of panel YAMLs
- fails on:
- missing files
- changed content
- stale hash DB
## Contributor Rules (Strict)
- Do **not** edit `.config_hashes.json` manually
- Do **not** regenerate full YAMLs unnecessarily
- Use in-place edits (ruamel round-trip)
- Expect CI to reject inconsistent states
## Metric Descriptions
Metric descriptions flow unidirectionally from panel YAMLs to documentation:
```
Panel YAMLs (src/) → Per-Arch YAMLs (tools/) → Docs YAMLs (docs/) → Sphinx HTML
```
**Files:**
```bash
tools/per_arch_metric_definitions/
├── gfx{908,90a,942,950,1151}_metrics_description.yaml # plain + rst + unit
docs/data/metrics/
└── <arch>_metrics.yaml # per-arch rst + unit (generated)
```
**After editing panel `metrics_description` sections:**
```bash
python tools/config_management/metric_description_manager.py --sync-all src/rocprof_compute_soc/analysis_configs
python tools/config_management/metric_description_manager.py --generate-docs
```
To regenerate the docs YAML for a single architecture without rewriting the others:
```bash
python tools/config_management/metric_description_manager.py --generate-docs --docs-arch <arch>
```
**Manual RST edits:** Edit per-arch YAMLs directly. The framework preserves an edit when its `rst` differs from `plain`.