Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,9 +134,10 @@ uv run blueprinting-workbench
blueprinting --help
```

It provides a shared configuration surface for single-point analysis, canonical IR derivation audit, and bounded
TP/PP/DP strategy exploration. Analysis runs outside the UI event loop, and failed candidates remain visible as
structured diagnostics.
It provides a shared configuration surface for single-point analysis, canonical IR derivation audit, bounded
TP/PP/DP strategy exploration, and a read-only performance-evidence lab. The evidence PoC catalogs the pinned
Vidur Phi-2/A100 records and compares exact GEMM samples with the analytical roofline on identical workload facts.
Analysis runs outside the UI event loop, and failed candidates remain visible as structured diagnostics.

The existing Calculon Streamlit tools remain isolated as an optional legacy interface. Floating-point analysis is available in the primary NiceGUI workbench:

Expand Down
8 changes: 8 additions & 0 deletions docs/design/performance/providers.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ The application boundary also accepts `cost_resolver` and `cost_context`, so evi

Inference task queries are derived from canonical `PlanTask.workload`; GEMM dimensions and local attention-head dimensions are derived from model and TP facts. Tensor-parallel collectives and pipeline P2P use the same resolver. All tasks must be covered by an installed provider—normally an exact database followed by roofline—so an unknown task never becomes zero.

## Performance-evidence UI PoC

The NiceGUI workbench's Performance Evidence entry provides a read-only evidence catalog, operation coverage, GEMM characteristic curves, and a query/record inspector. Its first pinned dataset is the Vidur Phi-2/A100 profile, shipped in the base wheel together with its source revision, manifest, and license.

The PoC compares only four GEMM semantics because their selectors can reconstruct `M/N/K`, FLOPs, and bytes without ambiguity. The measured series contains exact sample points and makes no interpolation claim; the analytical series is a compute/memory roofline over the same workload facts, not an event-level simulation. Attention and other operations currently appear only in the coverage catalog rather than receiving a fabricated generic analytical formula.

## Implemented boundary and next steps

Implemented now:
Expand All @@ -183,6 +189,7 @@ Implemented now:
- generic simulator/profiler table ingestion;
- explicit Vidur and four-family AIConfigurator ingestion;
- inference task and pipeline integration with regression tests.
- a read-only evidence catalog and GEMM curve-comparison PoC over the pinned Vidur profile.

Still missing:

Expand All @@ -193,5 +200,6 @@ Still missing:
- contention, overlap, queueing, and plan-level discrete-event simulation;
- energy/power metrics as normalized planner objectives;
- observation ingestion and calibration revisions.
- multi-database repository/registry, user import, and explicit evidence-promotion UI.

These omissions are important: task latency resolution is an evidence layer, not a completed hardware or serving simulator.
8 changes: 8 additions & 0 deletions docs/design/performance/providers.zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,12 @@ Application 入口同样接受 `cost_resolver` 与 `cost_context`,因此导入

Inference task query 直接从 canonical `PlanTask.workload` 推导;GEMM dimension 与 local attention-head dimension 来自 model 和 TP facts。Tensor-parallel collective 与 pipeline P2P 使用同一个 resolver。所有 task 都必须被已安装的 provider 覆盖——通常是 exact database 后接 roofline——unknown task 不会被静默变成零。

## 性能证据界面 PoC

NiceGUI workbench 的“性能证据”入口提供只读 evidence catalog、operation coverage、GEMM 特性曲线和 query/record inspector。首个 pinned dataset 是 Vidur Phi-2/A100 profile;它连同 source revision、manifest 与 license 一起进入 base wheel。

PoC 只对四类 GEMM semantic 绘制 database-versus-roofline 对比,因为这些 selector 可以无歧义地重建 `M/N/K`、FLOPs 与 bytes。Measured series 只显示 exact sample point,不声明插值;analytical series 是相同 workload facts 下的 compute/memory roofline,不是事件级仿真。Attention 与其他 operation 当前只进入 coverage catalog,尚不伪造通用解析对比公式。

## 已实现边界与后续工作

当前已经实现:
Expand All @@ -183,6 +189,7 @@ Inference task query 直接从 canonical `PlanTask.workload` 推导;GEMM dimen
- 通用 simulator/profiler table ingestion;
- 显式 Vidur 与四类 AIConfigurator ingestion;
- inference task/pipeline 接入与回归测试。
- pinned Vidur profile 的只读 evidence catalog 与 GEMM curve comparison PoC。

仍未实现:

Expand All @@ -193,5 +200,6 @@ Inference task query 直接从 canonical `PlanTask.workload` 推导;GEMM dimen
- contention、overlap、queueing 与 plan-level discrete-event simulation;
- 作为 normalized planner objective 的 energy/power metric;
- observation ingestion 与 calibration revision。
- 多数据库 repository/registry、用户导入与显式 evidence promotion UI。

这些边界非常重要:task latency resolution 是 evidence layer,不是已经完成的 hardware simulator 或 serving simulator。
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ packages = ["src/blueprinting", "src/calculon"]
[tool.hatch.build.targets.wheel.force-include]
"data/models" = "blueprinting/presets/models"
"data/systems" = "blueprinting/presets/systems"
"data/validation/vidur/phi2_a100_tp1" = "blueprinting/presets/evidence/vidur/phi2_a100_tp1"

[tool.hatch.envs.default]
features = ["dev", "full"]
Expand Down
21 changes: 16 additions & 5 deletions scripts/check_wheel_contract.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""Verify that the base wheel contains presets but excludes optional evidence."""
"""Verify that the base wheel contains presets and only the pinned PoC evidence slice."""

from __future__ import annotations

Expand All @@ -23,11 +23,22 @@ def main(argv: list[str]) -> int:
for prefix in required_prefixes:
if not any(name.startswith(prefix) and name.endswith(".json") for name in names):
raise SystemExit(f"wheel is missing JSON presets under {prefix}")
forbidden_prefixes = (
"blueprinting/systems/",
"data/evidence/",
"blueprinting/presets/evidence/",
evidence_prefix = "blueprinting/presets/evidence/vidur/phi2_a100_tp1/"
required_evidence = {
f"{evidence_prefix}LICENSE.vidur",
f"{evidence_prefix}attention.csv",
f"{evidence_prefix}manifest.json",
f"{evidence_prefix}mlp.csv",
}
missing_evidence = required_evidence - set(names)
if missing_evidence:
raise SystemExit(f"wheel is missing pinned PoC evidence: {sorted(missing_evidence)!r}")
unexpected_evidence = tuple(
name for name in names if name.startswith("blueprinting/presets/evidence/") and name not in required_evidence
)
if unexpected_evidence:
raise SystemExit(f"wheel contains unapproved evidence: {unexpected_evidence[:3]!r}")
forbidden_prefixes = ("blueprinting/systems/", "data/evidence/")
leaked = tuple(name for name in names if name.startswith(forbidden_prefixes))
if leaked:
raise SystemExit(f"wheel contains optional evidence: {leaked[:3]!r}")
Expand Down
14 changes: 14 additions & 0 deletions src/blueprinting/analysis/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
from .cost import (
AIConfiguratorPerformanceImporter,
AIConfiguratorTable,
CostCurvePoint,
CostCurveReport,
CostEstimate,
CostNotAvailableError,
CostProvider,
Expand All @@ -14,6 +16,8 @@
EstimateMatch,
EstimateMethod,
EstimateUncertainty,
EvidenceCoverage,
EvidenceDatabaseSummary,
EvidenceProvenance,
LatencyUnit,
PerformanceDatabase,
Expand All @@ -23,6 +27,9 @@
SimulatorPerformanceImporter,
TabularImportSpec,
TabularPerformanceImporter,
build_gemm_comparison_curve,
comparable_gemm_semantics,
summarize_performance_database,
)
from .cost_model import (
BlockEstimate,
Expand Down Expand Up @@ -54,6 +61,8 @@
"AIConfiguratorPerformanceImporter",
"AIConfiguratorTable",
"CostEstimate",
"CostCurvePoint",
"CostCurveReport",
"CostNotAvailableError",
"CostProvider",
"CostQuery",
Expand All @@ -65,6 +74,8 @@
"EstimateMethod",
"EstimateUncertainty",
"EvidenceProvenance",
"EvidenceCoverage",
"EvidenceDatabaseSummary",
"InferenceBaseline",
"InferenceCostProvider",
"InferenceEvidenceQuery",
Expand All @@ -82,6 +93,9 @@
"SimulatorPerformanceImporter",
"TabularImportSpec",
"TabularPerformanceImporter",
"build_gemm_comparison_curve",
"comparable_gemm_semantics",
"summarize_performance_database",
"cost_query_for_inference_task",
"estimate_block",
"estimate_inference_phase",
Expand Down
16 changes: 16 additions & 0 deletions src/blueprinting/analysis/cost/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,15 @@

from .aiconfigurator import AIConfiguratorPerformanceImporter, AIConfiguratorTable
from .database import EvidenceProvenance, PerformanceDatabase, PerformanceDatabaseProvider, PerformanceRecord
from .explorer import (
CostCurvePoint,
CostCurveReport,
EvidenceCoverage,
EvidenceDatabaseSummary,
build_gemm_comparison_curve,
comparable_gemm_semantics,
summarize_performance_database,
)
from .importers import (
LatencyUnit,
SimulatorPerformanceImporter,
Expand Down Expand Up @@ -37,6 +46,8 @@
"CostProvider",
"CostQuery",
"CostQueryContext",
"CostCurvePoint",
"CostCurveReport",
"CostResolution",
"CostResolver",
"CostSubject",
Expand All @@ -45,6 +56,8 @@
"EstimateMethod",
"EstimateUncertainty",
"EvidenceProvenance",
"EvidenceCoverage",
"EvidenceDatabaseSummary",
"InvalidCostEvidenceError",
"LatencyUnit",
"PerformanceDatabase",
Expand All @@ -56,4 +69,7 @@
"SupportStatus",
"TabularImportSpec",
"TabularPerformanceImporter",
"build_gemm_comparison_curve",
"comparable_gemm_semantics",
"summarize_performance_database",
]
Loading