diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.agentic-kernel.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.agentic-kernel.json new file mode 100644 index 000000000..1904707d4 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.agentic-kernel.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Agentic Kernel Optimization: pinned original-source extraction", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md", + "sha256": "7190573b85f94a4391bb0d887ccbd37a31b3f08bb0531114ad7afd72fe1567a7" + } + ], + "id": "performance-ceiling-analysis.agentic-kernel", + "kind": "knowledge", + "entrypoint": "agentic-kernel.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md", + "byte_range": [ + 0, + 41353 + ], + "sha256": "7190573b85f94a4391bb0d887ccbd37a31b3f08bb0531114ad7afd72fe1567a7" + } + } + }, + "content": { + "agentic-kernel.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.bounds-predictions-and-decisions.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.bounds-predictions-and-decisions.json new file mode 100644 index 000000000..e3a833de3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.bounds-predictions-and-decisions.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Keep bounds, predictions and observations distinct", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md", + "sha256": "5780d6eb5257612ec45deb94f85f334a6ecabf7e466d1678706041f6549bda79" + } + ], + "id": "performance-ceiling-analysis.bounds-predictions-and-decisions", + "kind": "knowledge", + "entrypoint": "bounds-predictions-and-decisions.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md", + "byte_range": [ + 0, + 5297 + ], + "sha256": "5780d6eb5257612ec45deb94f85f334a6ecabf7e466d1678706041f6549bda79" + } + } + }, + "content": { + "bounds-predictions-and-decisions.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.decision-cases.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.decision-cases.json new file mode 100644 index 000000000..c98ebd03f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.decision-cases.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Candidate decision cases", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md", + "sha256": "781a675a6533e0a18c044aaaee0d010da7013b6504654b8b8292a35176db801e" + } + ], + "id": "performance-ceiling-analysis.decision-cases", + "kind": "knowledge", + "entrypoint": "decision-cases.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md", + "byte_range": [ + 0, + 5491 + ], + "sha256": "781a675a6533e0a18c044aaaee0d010da7013b6504654b8b8292a35176db801e" + } + } + }, + "content": { + "decision-cases.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.flashvector.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.flashvector.json new file mode 100644 index 000000000..1098b6b5a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.flashvector.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "FlashVector: source audit and mechanisms", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md", + "sha256": "3926369acd88ff3c370bee5718e74dd15f3219c3e4f6311095e30e917bffa4cf" + } + ], + "id": "performance-ceiling-analysis.flashvector", + "kind": "knowledge", + "entrypoint": "flashvector.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md", + "byte_range": [ + 0, + 9830 + ], + "sha256": "3926369acd88ff3c370bee5718e74dd15f3219c3e4f6311095e30e917bffa4cf" + } + } + }, + "content": { + "flashvector.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.flexgen-offload-feasibility.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.flexgen-offload-feasibility.json new file mode 100644 index 000000000..7216ec3a3 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.flexgen-offload-feasibility.json @@ -0,0 +1,92 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "FlexGen: conditional feasibility of throughput-oriented offload", + "attribution": [ + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + } + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/flexgen-offload-feasibility.md", + "sha256": "5c72ae959c6cc72aa9e96a17a2934d6bfcfb055b25fda3221c99382dc09910d9" + }, + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + } + ], + "id": "performance-ceiling-analysis.flexgen-offload-feasibility", + "kind": "knowledge", + "entrypoint": "flexgen-offload-feasibility.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/flexgen-offload-feasibility.md", + "byte_range": [ + 0, + 8087 + ], + "sha256": "5c72ae959c6cc72aa9e96a17a2934d6bfcfb055b25fda3221c99382dc09910d9" + } + } + }, + "content": { + "flexgen-offload-feasibility.md": { + "path": "playbooks/performance-ceiling-analysis/references/flexgen-offload-feasibility.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.govern-optimization-experiments-procedure.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.govern-optimization-experiments-procedure.json new file mode 100644 index 000000000..59c5e1a56 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.govern-optimization-experiments-procedure.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Govern optimization experiments", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md", + "sha256": "ce036a4d8a0908da204515c47e2ff9623548d09de264fa65bd58fedce52a78a0" + } + ], + "id": "performance-ceiling-analysis.govern-optimization-experiments-procedure", + "kind": "knowledge", + "entrypoint": "procedure.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md", + "byte_range": [ + 0, + 3823 + ], + "sha256": "ce036a4d8a0908da204515c47e2ff9623548d09de264fa65bd58fedce52a78a0" + } + } + }, + "content": { + "procedure.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.govern-optimization-experiments-source-notes.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.govern-optimization-experiments-source-notes.json new file mode 100644 index 000000000..b50199f9b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.govern-optimization-experiments-source-notes.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "InferenceBench: source audit and mechanisms", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md", + "sha256": "f9a8254e45473ddb2b73e576957b6d3db83c62b99dff1922f4d1e606e569559e" + } + ], + "id": "performance-ceiling-analysis.govern-optimization-experiments-source-notes", + "kind": "knowledge", + "entrypoint": "source-notes.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md", + "byte_range": [ + 0, + 21659 + ], + "sha256": "f9a8254e45473ddb2b73e576957b6d3db83c62b99dff1922f4d1e606e569559e" + } + } + }, + "content": { + "source-notes.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.huggingarch-checkpoint-anchor.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.huggingarch-checkpoint-anchor.json new file mode 100644 index 000000000..a8f93998b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.huggingarch-checkpoint-anchor.json @@ -0,0 +1,129 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Checkpoint anchor for L1 weight demand", + "attribution": [ + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + } + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md", + "sha256": "ca03747be29a93b579849ee361b67632e541218a68310e0f3369868c6a45da7e" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT", + "revision_precision": "full" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + } + ], + "id": "performance-ceiling-analysis.huggingarch-checkpoint-anchor", + "kind": "knowledge", + "entrypoint": "huggingarch-checkpoint-anchor.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md", + "byte_range": [ + 0, + 18645 + ], + "sha256": "ca03747be29a93b579849ee361b67632e541218a68310e0f3369868c6a45da7e" + } + } + }, + "content": { + "huggingarch-checkpoint-anchor.md": { + "path": "playbooks/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.huggingarch-source-identity.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.huggingarch-source-identity.json new file mode 100644 index 000000000..44a47ca45 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.huggingarch-source-identity.json @@ -0,0 +1,129 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "HuggingArch source identity and read scope", + "attribution": [ + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + } + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/huggingarch-source-identity.json", + "sha256": "c4c000cf25e990d5fedbfaa206c9ee1e48429da50251c0553975ac2ff3efe0b5" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT", + "revision_precision": "full" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + } + ], + "id": "performance-ceiling-analysis.huggingarch-source-identity", + "kind": "knowledge", + "entrypoint": "huggingarch-source-identity.json", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/huggingarch-source-identity.json", + "byte_range": [ + 0, + 5913 + ], + "sha256": "c4c000cf25e990d5fedbfaa206c9ee1e48429da50251c0553975ac2ff3efe0b5" + } + } + }, + "content": { + "huggingarch-source-identity.json": { + "path": "playbooks/performance-ceiling-analysis/references/huggingarch-source-identity.json" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.inferencebench.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.inferencebench.json new file mode 100644 index 000000000..489c1c153 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.inferencebench.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "InferenceBench: source audit and mechanisms", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md", + "sha256": "21f47111197a0b7f8d6384ea918d139dc8318a62ca3313ce060048271f50b639" + } + ], + "id": "performance-ceiling-analysis.inferencebench", + "kind": "knowledge", + "entrypoint": "inferencebench.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md", + "byte_range": [ + 0, + 9294 + ], + "sha256": "21f47111197a0b7f8d6384ea918d139dc8318a62ca3313ce060048271f50b639" + } + } + }, + "content": { + "inferencebench.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.integration-notes.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.integration-notes.json new file mode 100644 index 000000000..ace8e45ca --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.integration-notes.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Pack A integration notes", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md", + "sha256": "083e462e0a204dce599362d46712fcfb392d053c5cda56216e22e28d4b8fa0fa" + } + ], + "id": "performance-ceiling-analysis.integration-notes", + "kind": "knowledge", + "entrypoint": "INTEGRATION_NOTES.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md", + "byte_range": [ + 0, + 7349 + ], + "sha256": "083e462e0a204dce599362d46712fcfb392d053c5cda56216e22e28d4b8fa0fa" + } + } + }, + "content": { + "INTEGRATION_NOTES.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.mechanisms.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.mechanisms.json new file mode 100644 index 000000000..282adbd8d --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.mechanisms.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Pack A: model, shortlist, measure, redirect", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md", + "sha256": "742c249082ceca230326f4407a40130fe624553b796ae5a157a8a4c15a7e1398" + } + ], + "id": "performance-ceiling-analysis.mechanisms", + "kind": "knowledge", + "entrypoint": "MECHANISMS.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md", + "byte_range": [ + 0, + 4003 + ], + "sha256": "742c249082ceca230326f4407a40130fe624553b796ae5a157a8a4c15a7e1398" + } + } + }, + "content": { + "MECHANISMS.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.mooncake-prefix-reuse-feasibility.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.mooncake-prefix-reuse-feasibility.json new file mode 100644 index 000000000..0695f6b6f --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.mooncake-prefix-reuse-feasibility.json @@ -0,0 +1,90 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Mooncake: prefix reuse as a conditional cost comparison", + "attribution": [ + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + } + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md", + "sha256": "6df0843a5fbe7cc6b05e58835b65976db5ce9fff526e9c7ed9a9d70c021c71bc" + }, + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + } + ], + "id": "performance-ceiling-analysis.mooncake-prefix-reuse-feasibility", + "kind": "knowledge", + "entrypoint": "mooncake-prefix-reuse-feasibility.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md", + "byte_range": [ + 0, + 6229 + ], + "sha256": "6df0843a5fbe7cc6b05e58835b65976db5ce9fff526e9c7ed9a9d70c021c71bc" + } + } + }, + "content": { + "mooncake-prefix-reuse-feasibility.md": { + "path": "playbooks/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.original.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.original.json new file mode 100644 index 000000000..fe53198eb --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.original.json @@ -0,0 +1,333 @@ +{ + "authority": "checkout", + "metadata": { + "id": "performance-ceiling-analysis.original", + "kind": "knowledge", + "entrypoint": "guide.md", + "title": "Estimate optimization headroom before modifying an inference system. Produces a three-level ceiling model (analytical, empirical component, end-to-end) and a prioritized measurement plan. Use to formulate acceptance targets when the user has not supplied them, assess a requested speedup, or identify the binding bottleneck.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/SKILL.md", + "sha256": "baeab73fb1fbf09da6ae0930b380720c66d9dc8085f8ccd1fb61381bb894799f" + }, + { + "url": "https://github.com/NVIDIA/TensorRT-LLM", + "commit": "f33e0e5fd55b", + "paths": [ + ".claude/skills/perf-analysis/SKILL.md", + ".claude/skills/perf-nsight-compute-analysis/references/roofline-analysis.md", + ".claude/skills/perf-workload-profiling/SKILL.md", + ".claude/skills/perf-optimization/SKILL.md", + ".claude/skills/perf-optimization-casebook/SKILL.md", + ".claude/skills/exec-env-check/SKILL.md", + ".claude/skills/exec-remote-slurm/SKILL.md", + ".claude/agents/perf-profiling-specialist.md" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/hahnyuan/LLM-Viewer", + "commit": "1893e4b5705d", + "paths": [ + "roofline_model.py", + "model_analyzer.py", + "hardwares/hardware_params.py", + "configs/DiT.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/ebugger/Empirical-Roofline-Toolkit", + "commit": "0771fa9621d0", + "paths": [ + "Empirical_Roofline_Tool-1.1.0/README.md", + "Empirical_Roofline_Tool-1.1.0/Drivers/driver1.c", + "Empirical_Roofline_Tool-1.1.0/Kernels/kernel1.c", + "Empirical_Roofline_Tool-1.1.0/Scripts/roofline.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + }, + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT", + "revision_precision": "full" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + }, + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices", + "revision_precision": "full" + } + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [ + { + "url": "https://github.com/NVIDIA/TensorRT-LLM", + "commit": "f33e0e5fd55b", + "paths": [ + ".claude/skills/perf-analysis/SKILL.md", + ".claude/skills/perf-nsight-compute-analysis/references/roofline-analysis.md", + ".claude/skills/perf-workload-profiling/SKILL.md", + ".claude/skills/perf-optimization/SKILL.md", + ".claude/skills/perf-optimization-casebook/SKILL.md", + ".claude/skills/exec-env-check/SKILL.md", + ".claude/skills/exec-remote-slurm/SKILL.md", + ".claude/agents/perf-profiling-specialist.md" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/hahnyuan/LLM-Viewer", + "commit": "1893e4b5705d", + "paths": [ + "roofline_model.py", + "model_analyzer.py", + "hardwares/hardware_params.py", + "configs/DiT.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/ebugger/Empirical-Roofline-Toolkit", + "commit": "0771fa9621d0", + "paths": [ + "Empirical_Roofline_Tool-1.1.0/README.md", + "Empirical_Roofline_Tool-1.1.0/Drivers/driver1.c", + "Empirical_Roofline_Tool-1.1.0/Kernels/kernel1.c", + "Empirical_Roofline_Tool-1.1.0/Scripts/roofline.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + }, + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + }, + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices" + } + ], + "empirical_validation": "not_run", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/SKILL.md", + "byte_range": [ + 0, + 30244 + ], + "sha256": "baeab73fb1fbf09da6ae0930b380720c66d9dc8085f8ccd1fb61381bb894799f" + } + } + }, + "content": { + "guide.md": { + "path": "playbooks/performance-ceiling-analysis.md" + } + }, + "parts": { + "navigation": { + "skill_section": "navigation", + "layer": "L0", + "byte_range": [ + 0, + 383 + ], + "sha256": "2abcfa965e3dcead1835ac2e08215b8f878405f32cd66ecdf6ff142de155176e" + }, + "decision": { + "skill_section": "decision", + "layer": "L1", + "byte_range": [ + 0, + 10153 + ], + "sha256": "c920ca29787007b9f51859bb29194669ea500527ea263454b02ed63cb0d70973" + }, + "procedure": { + "skill_section": "procedure", + "layer": "L2", + "byte_range": [ + 10153, + 30244 + ], + "sha256": "d147dfe002b6d3507602f2052eee93ec585c795b2a705d852c836e5941a76174" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.prior-coverage.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.prior-coverage.json new file mode 100644 index 000000000..33af56df2 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.prior-coverage.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Prior coverage and incremental delta", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md", + "sha256": "35d47ac078591221fcb666219bcd824f9400fc17aafecdc0499d8336f7178238" + } + ], + "id": "performance-ceiling-analysis.prior-coverage", + "kind": "knowledge", + "entrypoint": "prior-coverage.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md", + "byte_range": [ + 0, + 3254 + ], + "sha256": "35d47ac078591221fcb666219bcd824f9400fc17aafecdc0499d8336f7178238" + } + } + }, + "content": { + "prior-coverage.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.readme.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.readme.json new file mode 100644 index 000000000..f6b99b8aa --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.readme.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Pack A — optimization modeling and experiment governance", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/README.md", + "sha256": "17b2d1c7c14124d59ac8a0d5ad4200ad2803d991e784a1a98cd97188cc364999" + } + ], + "id": "performance-ceiling-analysis.readme", + "kind": "knowledge", + "entrypoint": "README.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/README.md", + "byte_range": [ + 0, + 1204 + ], + "sha256": "17b2d1c7c14124d59ac8a0d5ad4200ad2803d991e784a1a98cd97188cc364999" + } + } + }, + "content": { + "README.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/README.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.readset.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.readset.json new file mode 100644 index 000000000..c1ef19266 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.readset.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Pack A exact readset and provenance", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/READSET.md", + "sha256": "66459ce393858b2b2160f1e2973373bfc4b9902a12644631934b4ebe3140296a" + } + ], + "id": "performance-ceiling-analysis.readset", + "kind": "knowledge", + "entrypoint": "READSET.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/READSET.md", + "byte_range": [ + 0, + 3937 + ], + "sha256": "66459ce393858b2b2160f1e2973373bfc4b9902a12644631934b4ebe3140296a" + } + } + }, + "content": { + "READSET.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/READSET.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.redirect-cross-layer-optimization-procedure.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.redirect-cross-layer-optimization-procedure.json new file mode 100644 index 000000000..d15dea81a --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.redirect-cross-layer-optimization-procedure.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Redirect cross-layer optimization", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md", + "sha256": "6593a63fce9c474b515663a560c94b7df048dc5f6e77a95b8e54e4a64cd10a09" + } + ], + "id": "performance-ceiling-analysis.redirect-cross-layer-optimization-procedure", + "kind": "knowledge", + "entrypoint": "procedure.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md", + "byte_range": [ + 0, + 3648 + ], + "sha256": "6593a63fce9c474b515663a560c94b7df048dc5f6e77a95b8e54e4a64cd10a09" + } + } + }, + "content": { + "procedure.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.redirect-cross-layer-optimization-source-notes.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.redirect-cross-layer-optimization-source-notes.json new file mode 100644 index 000000000..265555ca8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.redirect-cross-layer-optimization-source-notes.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "FlashVector: source audit and mechanisms", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md", + "sha256": "6ff3a7bc31f1172db92aedaf7df1f1aac688bf769227b583a4cd82bfad52da67" + } + ], + "id": "performance-ceiling-analysis.redirect-cross-layer-optimization-source-notes", + "kind": "knowledge", + "entrypoint": "source-notes.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md", + "byte_range": [ + 0, + 26469 + ], + "sha256": "6ff3a7bc31f1172db92aedaf7df1f1aac688bf769227b583a4cd82bfad52da67" + } + } + }, + "content": { + "source-notes.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline-contract.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline-contract.json new file mode 100644 index 000000000..56cf40b91 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline-contract.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Pure Roofline helper contract", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/roofline-contract.md", + "sha256": "419ec4bcaec45ac579a133bce083d4f48779f26e664d7a86f720fa65f343b1d1" + } + ], + "id": "performance-ceiling-analysis.roofline-contract", + "kind": "knowledge", + "entrypoint": "roofline-contract.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/roofline-contract.md", + "byte_range": [ + 0, + 7091 + ], + "sha256": "419ec4bcaec45ac579a133bce083d4f48779f26e664d7a86f720fa65f343b1d1" + } + } + }, + "content": { + "roofline-contract.md": { + "path": "playbooks/performance-ceiling-analysis/references/roofline-contract.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline-example.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline-example.json new file mode 100644 index 000000000..dfdad250e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline-example.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Synthetic Roofline example inputs", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/roofline-example.json", + "sha256": "597cd3205df043cff3ae9d15924c77934e8d8eb300c00c4840f6bb2921f90faf" + } + ], + "id": "performance-ceiling-analysis.roofline-example", + "kind": "knowledge", + "entrypoint": "roofline-example.json", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/roofline-example.json", + "byte_range": [ + 0, + 2015 + ], + "sha256": "597cd3205df043cff3ae9d15924c77934e8d8eb300c00c4840f6bb2921f90faf" + } + } + }, + "content": { + "roofline-example.json": { + "path": "playbooks/performance-ceiling-analysis/references/roofline-example.json" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline.json new file mode 100644 index 000000000..d7b7fefa8 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.roofline.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Pure, internal single-resource Roofline arithmetic; no execution or acceptance.", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/scripts/roofline.py", + "sha256": "524de48a6764401695fe1444f1fa3d38f363069b0cd2fba4715a86ca4b28a5d4" + } + ], + "id": "performance-ceiling-analysis.roofline", + "kind": "knowledge", + "entrypoint": "roofline.py", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/scripts/roofline.py", + "byte_range": [ + 0, + 9004 + ], + "sha256": "524de48a6764401695fe1444f1fa3d38f363069b0cd2fba4715a86ca4b28a5d4" + } + } + }, + "content": { + "roofline.py": { + "path": "playbooks/performance-ceiling-analysis/scripts/roofline.py" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.static-checks.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.static-checks.json new file mode 100644 index 000000000..b869ee2d2 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.static-checks.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Static packaging checks", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md", + "sha256": "cb0aa7d148352ebb7b1678fc42a557a099575054716a341dfa25b6a998029064" + } + ], + "id": "performance-ceiling-analysis.static-checks", + "kind": "knowledge", + "entrypoint": "STATIC_CHECKS.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md", + "byte_range": [ + 0, + 1111 + ], + "sha256": "cb0aa7d148352ebb7b1678fc42a557a099575054716a341dfa25b6a998029064" + } + } + }, + "content": { + "STATIC_CHECKS.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.vidur.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.vidur.json new file mode 100644 index 000000000..29e8a2f0b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.vidur.json @@ -0,0 +1,63 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "Vidur: source audit and mechanisms", + "attribution": [], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/vidur.md", + "sha256": "d38602af5219f5feeb49e6cd6bf53d66098c77fad141dae676f1d8a6743cf25d" + } + ], + "id": "performance-ceiling-analysis.vidur", + "kind": "knowledge", + "entrypoint": "vidur.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/vidur.md", + "byte_range": [ + 0, + 7736 + ], + "sha256": "d38602af5219f5feeb49e6cd6bf53d66098c77fad141dae676f1d8a6743cf25d" + } + } + }, + "content": { + "vidur.md": { + "path": "playbooks/performance-ceiling-analysis/references/papers-20261015/references/vidur.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.xllm-pd-handoff.json b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.xllm-pd-handoff.json new file mode 100644 index 000000000..611aad8e4 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/performance-ceiling-analysis.xllm-pd-handoff.json @@ -0,0 +1,105 @@ +{ + "authority": "checkout", + "metadata": { + "origin": [ + "external" + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "empirical_validation": "not_run", + "title": "xLLM on Ascend: accounting for prefill reuse and decode transfer", + "attribution": [ + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices" + } + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/xllm-pd-handoff.md", + "sha256": "66226190ab90cab2057cdd867714725a084396fa9ccaa87efab8b14ca021bd2a" + }, + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices", + "revision_precision": "full" + } + ], + "id": "performance-ceiling-analysis.xllm-pd-handoff", + "kind": "knowledge", + "entrypoint": "xllm-pd-handoff.md", + "atom": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "layer": "L3", + "source_span": { + "source_index": 0, + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/references/xllm-pd-handoff.md", + "byte_range": [ + 0, + 6679 + ], + "sha256": "66226190ab90cab2057cdd867714725a084396fa9ccaa87efab8b14ca021bd2a" + } + } + }, + "content": { + "xllm-pd-handoff.md": { + "path": "playbooks/performance-ceiling-analysis/references/xllm-pd-handoff.md" + } + } +} diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis.md new file mode 100644 index 000000000..48542c287 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis.md @@ -0,0 +1,605 @@ +--- +name: performance-ceiling-analysis +description: 'Estimate optimization headroom before modifying an inference system. Produces a three-level ceiling model (analytical, empirical component, end-to-end) and a prioritized measurement plan. Use to formulate acceptance targets when the user has not supplied them, assess a requested speedup, or identify the binding bottleneck. + + ' +metadata: + inferrsi: | + { + "schema_version": 1, + "status": "candidate", + "sources": [ + { + "url": "https://github.com/NVIDIA/TensorRT-LLM", + "commit": "f33e0e5fd55b", + "paths": [ + ".claude/skills/perf-analysis/SKILL.md", + ".claude/skills/perf-nsight-compute-analysis/references/roofline-analysis.md", + ".claude/skills/perf-workload-profiling/SKILL.md", + ".claude/skills/perf-optimization/SKILL.md", + ".claude/skills/perf-optimization-casebook/SKILL.md", + ".claude/skills/exec-env-check/SKILL.md", + ".claude/skills/exec-remote-slurm/SKILL.md", + ".claude/agents/perf-profiling-specialist.md" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/hahnyuan/LLM-Viewer", + "commit": "1893e4b5705d", + "paths": [ + "roofline_model.py", + "model_analyzer.py", + "hardwares/hardware_params.py", + "configs/DiT.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/ebugger/Empirical-Roofline-Toolkit", + "commit": "0771fa9621d0", + "paths": [ + "Empirical_Roofline_Tool-1.1.0/README.md", + "Empirical_Roofline_Tool-1.1.0/Drivers/driver1.c", + "Empirical_Roofline_Tool-1.1.0/Kernels/kernel1.c", + "Empirical_Roofline_Tool-1.1.0/Scripts/roofline.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + }, + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + }, + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices" + } + ], + "verification": { + "locally_verified": false, + "evidence_level": "source_grounded", + "note": "Historical repository methods plus reviewed paper extensions: references/papers-20261015/READSET.md records exact paper versions and inspection scope. Physical/conditional bounds, observed envelopes, simulator predictions and application measurements remain distinct. The bundled pure helper computes supplied L1 counts only; no automatic workload estimation, local accelerator measurements or E2E qualification. references/huggingarch-checkpoint-anchor.md records the checkpoint gates and the two-threshold rule from HuggingArch at a full commit, with per-file digests and inspection scope in references/huggingarch-source-identity.json; per-rank weight bytes are anchored only after the second gate passes." + }, + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "tags": [ + "performance", + "roofline", + "profiling", + "bottleneck", + "inference" + ], + "profile": "local-skill-v1", + "kind": "skill", + "origin": [ + "external" + ], + "empirical_validation": "not_run", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time." + ], + "provenance_readsets": [ + "references/flexgen-offload-feasibility.md", + "references/huggingarch-checkpoint-anchor.md", + "references/huggingarch-source-identity.json", + "references/mooncake-prefix-reuse-feasibility.md", + "references/papers-20261015/cases/decision-cases.md", + "references/papers-20261015/govern-optimization-experiments/procedure.md", + "references/papers-20261015/govern-optimization-experiments/references/source-notes.md", + "references/papers-20261015/INTEGRATION_NOTES.md", + "references/papers-20261015/knowledge/bounds-predictions-and-decisions.md", + "references/papers-20261015/MECHANISMS.md", + "references/papers-20261015/README.md", + "references/papers-20261015/READSET.md", + "references/papers-20261015/redirect-cross-layer-optimization/procedure.md", + "references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md", + "references/papers-20261015/references/agentic-kernel.md", + "references/papers-20261015/references/flashvector.md", + "references/papers-20261015/references/inferencebench.md", + "references/papers-20261015/references/prior-coverage.md", + "references/papers-20261015/references/vidur.md", + "references/papers-20261015/STATIC_CHECKS.md", + "references/xllm-pd-handoff.md" + ], + "consumption_mode": "packaged", + "recommendations": [ + "Use supplied acceptance criteria unchanged. When absent, follow references/acceptance-criteria.md to derive targets from matching baseline, calibrated attainable performance and uncertainty; retain partial requirements and label derived fields.", + "Read the full procedure and linked resources; preserve the distinction between analytical bounds, observed attainable envelopes, predictions and measured application outcomes." + ] + } +--- + +# Performance Ceiling Analysis + +Status: candidate. Procedures have not been evaluated against a real campaign. + +## When to use this skill + +Use this skill before modifying an inference serving system when you need to +answer: *does meaningful headroom exist, where is it, and is a requested +speedup such as 2× plausible?* + +When preparing a task, preserve user-provided acceptance criteria. If none were +supplied, follow [acceptance-criteria preparation](references/acceptance-criteria.md) +to derive and freeze targets from this analysis. Preserve partial requirements, +label derived fields and retain evidence gaps; a theoretical ceiling alone does +not establish an attainable target or a quality tolerance. + +Do not use it to benchmark or compare two already-built candidates — that is +the job of InferRSI's AB/BA harness and `rsi-evidence` skill. + +For whole-model prefill and decode composition, use [model-sol-analysis](../model-sol-analysis/SKILL.md). + +## Evidence to inspect first + +Before profiling, gather what you can analytically: + +1. Model architecture config (layer counts, hidden dims, attention heads, + batch sizes, sequence/frame lengths, codec/VAE structure). +2. Hardware specification: peak FP16/BF16/INT8 FLOP/s, peak memory bandwidth, + L2 size. For NVIDIA B300: INSUFFICIENT_EVIDENCE (no local datasheet values; + must be resolved via vendor documentation or an empirical measurement). +3. Existing benchmark numbers if available: throughput frames/s, TTFA p50/p95, + RTF mean. Label their provenance (author-reported, local measurement, etc.). +4. The checkpoint, whenever L1 prices weight traffic. Of the two gates in + [checkpoint anchoring](references/huggingarch-checkpoint-anchor.md), pass + Gate 1 before reporting any figure derived from weight bytes, and also + Gate 2 before reporting any per-rank or per-degree weight figure: + - **Gate 1, the per-tensor join.** Every tensor in the safetensors headers + must be selected by a name in the analysis, and every non-buffer name must + select a header tensor. Report both residuals. For each name, sum the stored + tensors that share it and compare physical elements with the header; a packed + format counts its container's elements. Only the byte totals, compared after + the join, switch to bytes. They are a checksum: equal totals do not pass a + join with a residual or a mismatch. + - **Gate 2, the per-rank weight ledger.** Gate 1 needs no layout, so passing + it says nothing about per-rank bytes. Before any per-rank or per-degree + weight figure, every stored weight needs a declared placement per stored axis + (replicated, or split on a named parallel world with its part count) and a + format. A degree that does not divide the part count follows a declared + policy: refuse, co-own or pad. Never substitute a divisor that divides. + Gate 2 checks the declared layout and format, not the placement a framework + uses at run time. + + A gate that cannot be judged, such as an unreadable header or a weight with no + placement, counts as failed; the dependent figure is `INSUFFICIENT_EVIDENCE`. + The anchor covers stored weights only. A sliding-window and a global attention + with the same head dimensions have byte-identical weights, so KV size and + growth need their own evidence. + +## Three-level ceiling model + +### L1 — Analytical ceiling + +Requires model config and a hardware table entry. A figure derived from weight +bytes additionally requires the checkpoint to pass Gate 1, the global per-tensor +join, which needs no parallelism layout. A per-rank or per-degree weight figure +also requires Gate 2, the per-rank weight ledger, which needs a declared layout. +Both gates are in item 4 of *Evidence to inspect first*; a gate that cannot be +judged leaves the dependent figure `INSUFFICIENT_EVIDENCE`. + +For supplied single-resource work/traffic counts, the bundled +[pure helper](scripts/roofline.py) implements the arithmetic under an explicit +[input/output contract and synthetic attachment example](references/roofline-contract.md). +It preserves sources and unknowns; it does not collect hardware facts, estimate +model work or establish attainable speedup, goal acceptance or E2E performance. + +For a remotely reusable input prefix, the +[Mooncake source comparison](references/mooncake-prefix-reuse-feasibility.md) +relates KV loading time to saved prefill work. Its paper-specific inequality +screens a candidate; current cache validity, effective rates, exposed costs and +service outcomes still require evidence. + +For disaggregated prefill and decode, the [xLLM handoff procedure](references/xllm-pd-handoff.md) separates prefill work saved through prefix reuse from decode-side reservation and KV transfer. Account for failed restoration before estimating headroom. + +For throughput-oriented offline inference with CPU/disk offload, use the +[FlexGen feasibility comparison](references/flexgen-offload-feasibility.md) to +check joint weights/KV/activation placement, resident plus working-memory peaks, +and exposed transfer/CPU costs against the latency objective. Its fitted, +overlap-dependent prediction is separate from the L1 helper and requires +current resource and execution evidence before a throughput recommendation. + +**FLOPs per forward pass:** + +For a linear projection of shape (batch × seq, in_channels, out_channels): +``` +FLOPs = 2 × batch × seq × in_channels × out_channels +``` +For multi-head attention QK projection + softmax + SV projection: +``` +FLOPs_QK = 2 × batch × heads × seq² × head_dim +FLOPs_SV = 2 × batch × heads × seq² × head_dim +FLOPs_attn ≈ 4 × batch × heads × seq² × head_dim +``` +For a DiT model, the dominant stages are the attention and MLP blocks inside +each transformer layer, plus the VAE encoder/decoder. LLM-Viewer's +`model_analyzer.py` (function `analyze_model`) walks each layer type and sums +FLOPs using these formulas. +Source: `hahnyuan/LLM-Viewer` @ 1893e4b5, `model_analyzer.py`. + +**Memory traffic per forward pass:** + +Traffic = bytes read (weights + KV) + bytes written (activations). For +inference with a frozen model, weight traffic dominates; KV cache traffic +dominates in decode-heavy workloads. Use bytes_per_element = 2 for FP16/BF16, +1 for INT8/FP8. + +**Arithmetic intensity (AI):** +``` +AI = FLOPs / bytes_transferred +``` + +**Roofline bound:** +``` +perf_roof = min(peak_FLOP_s, AI × peak_bandwidth) +ridge_point = peak_FLOP_s / peak_bandwidth # FLOP/byte +``` +If `AI < ridge_point` → memory-bound; if `AI > ridge_point` → compute-bound. + +**Adding a new hardware entry (NPU or B300):** +LLM-Viewer's `hardware_params.py` uses a flat dict keyed by device name. Each +entry requires: +```python +{ + "name": str, # display name + "peak_flops": float, # theoretical peak FLOP/s (FP16 or target dtype) + "memory_bandwidth": float, # peak DRAM bandwidth (bytes/s) + "memory_capacity": float, # total DRAM (bytes); optional +} +``` +All values must be FP16 (or the dtype you measure at). Use vendor datasheet +peaks. For empirically-measured roofs, see L2 below. +Source: `hahnyuan/LLM-Viewer` @ 1893e4b5, `hardwares/hardware_params.py`. + +**DiT vs decoder LLM differences:** +- DiT models process full-frame tokens in every denoising step, not a growing + KV cache. Sequence length is fixed (number of spatial tokens per frame). +- Each denoising step is a full forward pass; the performance measure is + steps/second × frames/step, or directly frames/second. +- The VAE decoder adds a significant one-time cost per output; it must be + included in the E2E breakdown (see L3). +- For an audio model such as fishaudio/drama-3, add vocoder/codec decode cost. +Source: `hahnyuan/LLM-Viewer` @ 1893e4b5, `configs/DiT.py`, `model_params/DiT.py`. + +**Known L1 limitations:** +- L1 uses vendor datasheet peaks as conditional bounds for a stated algorithm, + dtype, memory hierarchy and work/traffic count. No universal achievable + percentage follows; calibrate a workload-specific attainable envelope in L2. +- L1 treats the full model as one roof; it cannot distinguish kernel-level + variation, mixed operation-class throughput or scheduling overhead. Changing + the algorithm can change both work and traffic, so proximity to the old roof + does not rule out improvement. +- L1 never looks at the model again after counting, so a wrong count reaches the + floor unchallenged. The checkpoint gates (item 4 of *Evidence to inspect first*) anchor stored weight + bytes only. KV size and growth, activation traffic, collectives and achieved + rates stay unanchored by them. + +**Measurements against L1.** Reject a measured row only when it contradicts its +own record: its work over its time exceeds the peak it recorded, so its +numerator or its peak is wrong. A row faster than a separately computed L1 floor +is flagged, not rejected; re-derive the count (through the checkpoint gates) and +the peak (at the clock the device actually ran). Any tolerance for the flag +belongs to the acceptance issue. The source rule and its reading are in +[the two-threshold rule](references/huggingarch-checkpoint-anchor.md#which-bound-may-reject-a-measurement-the-two-threshold-rule). + +### L2 — Empirical component ceiling + +Requires hardware access. All values in this section are REMOTE MEASUREMENTS +to be taken; none can be filled in on a machine with no accelerator. + +**What to measure:** + +| Metric | Method | Required | +|--------|--------|---------| +| Empirical peak FLOP/s | ERT-style kernel sweep (see below) | REMOTE | +| Empirical peak memory bandwidth | ERT-style bandwidth kernel sweep | REMOTE | +| Kernel SOL% (Speed of Light) | nsys + ncu (CUDA) or vendor profiler (NPU) | REMOTE | +| SM/CU occupancy | ncu `sm__warps_active` or vendor equivalent | REMOTE | +| L1/L2/DRAM bandwidth per kernel | ncu hierarchical roofline section | REMOTE | +| Host-GPU/CPU-NPU transfer time | profiler timeline | REMOTE | + +**Empirical peak measurement procedure (ERT method):** +The Empirical Roofline Toolkit (ERT) measures peak FLOP/s by running a FMA +loop kernel with variable trial counts; the alpha-update `alpha *= (1 - 1e-8)` +prevents compiler elimination. Peak is the maximum observed across a sweep of +working-set sizes and GFlops configurations. The config file (`Config/`) must +supply: compiler, GPU/NPU API, working set range, number of ERT trials, output +directory. For NPU, the `driver1.c` CUDA kernel must be ported to the vendor +compute API (CANN, Triton-Ascend, etc.); this is an open design decision. +Source: `ebugger/Empirical-Roofline-Toolkit` @ 0771fa9621d0, +`Empirical_Roofline_Tool-1.1.0/Drivers/driver1.c`, +`Empirical_Roofline_Tool-1.1.0/Scripts/roofline.py`. + +**Bottleneck classification from profiler counters (CUDA / Nsight Compute):** + +| Counter / metric | Bottleneck | +|-----------------|-----------| +| Memory SOL% high, Compute SOL% low | memory-bound | +| Compute SOL% high, Memory SOL% low | compute-bound | +| Both SOL% low, many small kernels, high CPU time | launch-overhead | +| Both SOL% low, significant collective operation time | communication-bound | +| Both SOL% low, excessive CPU-GPU sync events | sync-bound | + +SOL% (Speed of Light %) = actual throughput / hardware peak throughput × 100. +Source: `NVIDIA/TensorRT-LLM` @ f33e0e5f, +`.claude/skills/perf-analysis/SKILL.md`, +`.claude/skills/perf-nsight-compute-analysis/references/roofline-analysis.md`. + +### L3 — End-to-end ceiling + +Requires at minimum wall-clock tracing of each stage. + +**Stage breakdown for a diffusion serving system:** + +| Stage | What to measure | Can be estimated? | +|-------|----------------|-------------------| +| Request scheduling | Time from request arrival to first GPU submission | CPU timer | +| Prefill (prompt encode) | Conditional encode time | profiler | +| Denoising steps | Per-step time × num_steps | profiler | +| Attention per step | QKV projection + attention kernel time | profiler | +| MLP per step | Linear projection time | profiler | +| AdaLN/conditioning | Conditioning injection time | profiler | +| VAE decode | VAE decoder latency | profiler | +| Audio/vocoder | Vocoder/codec decode time | profiler | +| Communication (multi-device) | NCCL/HCCL allreduce time | profiler | +| Serialization/transfer | Token/frame encode, network send time | profiler | +| Idle gaps | GPU idle between requests | profiler | + +**Amdahl-style speedup formula:** + +Given per-stage fractions of total time f_i (Σ f_i = 1), and a speedup s_i +achievable on each stage: +``` +S_total = 1 / Σ_i (f_i / s_i) +``` + +Headroom attributed to stage i: +``` +H_i = f_i × (1 - 1/s_i) # fraction of total time recovered if s_i is achieved +``` + +Example (INSUFFICIENT_EVIDENCE — all values are placeholders): +If denoising steps = 70% of time with achievable speedup 1.4×, VAE = 15% with +1.2×, scheduling = 10% at 1.0×, other = 5% at 1.0×: +``` +S = 1 / (0.70/1.4 + 0.15/1.2 + 0.10/1.0 + 0.05/1.0) = 1.26× +``` +Without real profiling, this formula cannot produce a trustworthy number. + +## Escalation rule: L1 → L2 → L3 + +Escalate from L1 to L2 when: +- The L1 roof predicts headroom but you cannot determine whether the system is + memory-bound or compute-bound analytically (AI is near the ridge point). +- You need to confirm that a specific kernel is the bottleneck before + committing to an optimization. + +Escalate from L2 to L3 when: +- Kernel-level L2 measurements show individual kernels near their ceilings + but E2E throughput is still lower than expected (scheduler, communication, + or serialization losses). +- A single stage (e.g. VAE decode) dominates the Amdahl estimate and you need + its real fraction. + +Do not escalate unless the question requires it. L1 alone is often enough to +decide whether a 2× claim is plausible. + +## How to express uncertainty + +Never report a single speedup number without stating: +- Which ceiling level the estimate comes from (L1/L2/L3). +- The evidence basis: source-grounded analysis, author-reported, CPU test, + device measurement, or end-to-end measurement. +- The assumptions (hardware peaks, stage fractions, whether profiler numbers + came from the actual deployment configuration). +- A range: if stage fractions are ±20%, compute the best-case and worst-case + Amdahl speedup explicitly. + +Mark any empirical field as `INSUFFICIENT_EVIDENCE` when no accelerator +measurement exists. Do not interpolate from a different hardware SKU. + +## Measurement plan: drama-3 / B300 case + +This is a plan only. No empirical values exist on the local machine. +All "REMOTE" fields require execution on the target B300 system. + +```yaml +baseline: + model: fishaudio/drama-3 # diffusion audio/speech model + engines: + - vLLM-Omni (revision: TBD, freeze before measurement) + - SGLang-Omni (revision: TBD, freeze before measurement) + hardware: single NVIDIA B300 + concurrency_levels: [1, 2, 4, 8, 16] # to be determined from capacity + +workload: + metrics: + - throughput_frames_per_s + - ttfa_p50_ms + - ttfa_p95_ms + - rtf_mean + repetitions: ≥3 per concurrency level + warmup: required; exclude from statistics + +analytical_roof: + status: INSUFFICIENT_EVIDENCE + blocker: B300 peak FP16 FLOP/s and memory bandwidth not on this machine + action: resolve from NVIDIA B300 datasheet or measure empirically via ERT + +empirical_roof: + status: INSUFFICIENT_EVIDENCE + action: > + REMOTE: run ERT-style FMA kernel sweep on B300; record empirical peak + FLOP/s and peak memory bandwidth; compare to datasheet; record achievable + fraction for this workload, without assuming a universal percentage. + +stage_breakdown: + status: INSUFFICIENT_EVIDENCE + action: > + REMOTE: run nsys to capture full timeline; extract per-stage wall-clock + fractions for denoising, VAE, conditioning, communication, scheduling, + idle. Report as f_i values for Amdahl formula. + +bottlenecks: + status: INSUFFICIENT_EVIDENCE + action: > + REMOTE: run ncu on the denoising kernel and VAE kernel; record SOL%, + arithmetic intensity, bottleneck classification, occupancy. + +headroom: + speedup_range: INSUFFICIENT_EVIDENCE + action: compute Amdahl S_total from measured f_i and achievable s_i + +target_feasibility: + verdict: INSUFFICIENT_EVIDENCE + note: > + A 2× E2E speedup requires either the dominant stage (likely denoising) + to achieve >2× improvement (which implies near-doubling compute or + memory efficiency), or several stages together to contribute. This is + analytically possible but cannot be confirmed without stage fractions. + +recommended_experiments: + - hypothesis: Denoising step is memory-bound; fusing AdaLN conditioning + reduces memory traffic. + evidence: INSUFFICIENT_EVIDENCE (measure AI and SOL% first) + expected_gain: unknown + measurement: REMOTE — ncu AI vs ridge point on denoising kernel + priority: 1 + + - hypothesis: VAE decode fraction is significant; offloading or tiling + reduces peak latency. + evidence: INSUFFICIENT_EVIDENCE (measure VAE fraction of E2E first) + expected_gain: unknown + measurement: REMOTE — nsys stage fraction for VAE decode + priority: 2 + + - hypothesis: Multi-engine scheduling introduces idle gaps at concurrency>1. + evidence: INSUFFICIENT_EVIDENCE + measurement: REMOTE — nsys idle gap analysis at concurrency 4 and 8 + priority: 3 +``` + +## How to decide whether further optimization is worthwhile + +1. Compare the conditional Amdahl headroom with the actual target and measured + uncertainty. Use nonoverlapping exposed-time fractions; a sum of overlapping + kernel durations is not an end-to-end decomposition. +2. Check the dominant stage against operation-specific attainable envelopes. + High utilization can constrain local tuning of the current algorithm while + fusion, materialization removal, work ownership or a different algorithm + changes its work and traffic. No universal SOL% cutoff establishes saturation. +3. Treat low utilization as a question: distinguish work supply, scalar versus + matrix work, dependency stalls, launch overhead and memory movement before + selecting a change. Occupancy, throughput and utilization are different metrics. +4. Keep four evidence types separate: physical/conditional bound, observed + attainable envelope, empirical simulator prediction, and measured application + outcome. A predictor needs a matching calibration domain and held-out load + coverage, especially near capacity; prediction error does not establish a bound. +5. Redirect when the expected removable time cannot exceed locally measured + noise, or when a change exposes a new owner. Preserve a valid incumbent and + verify the final artifact under the application objective and all SLOs. + +### Reviewed paper resources + +The [modeling comparison](references/papers-20261015/MECHANISMS.md), +[exact readset](references/papers-20261015/READSET.md), +[bounds and predictions](references/papers-20261015/knowledge/bounds-predictions-and-decisions.md), +[cross-layer procedure](references/papers-20261015/redirect-cross-layer-optimization/procedure.md) +and [decision cases](references/papers-20261015/cases/decision-cases.md) retain +paper-specific costs, counter-signals and unresolved metric discrepancies. +Use [simulator calibration](../calibrate-serving-simulation/SKILL.md) for a +prediction-based shortlist and [attention diagnosis](../../../systems/platforms/cuda/diagnose-attention-bottlenecks/SKILL.md) +for algorithm/operation-class changes. These remain candidate guidance, not local +performance measurements. The bundled helper only computes explicitly supplied +L1 inputs under the contract above. + +### Reviewed implementation source + +[Checkpoint anchoring](references/huggingarch-checkpoint-anchor.md) distills the +checkpoint gates and the two-threshold rule from HuggingArch's validator and +measured calibration, read at one full commit. The +[source identity record](references/huggingarch-source-identity.json) gives each +file's digests and the part that was read. Claims carry `[code]`, `[doc]`, +`[tree]` or `[blog]` markers with locators. HuggingArch was not run, and no +predicted figure was compared with a measurement. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/flexgen-offload-feasibility.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/flexgen-offload-feasibility.md new file mode 100644 index 000000000..937228e46 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/flexgen-offload-feasibility.md @@ -0,0 +1,135 @@ +# FlexGen: conditional feasibility of throughput-oriented offload + +Use this reference when an offline inference proposal frees accelerator memory +by moving state to CPU memory or disk. Check whether the complete placement, +working storage and exposed execution cost fit the workload's resource and +latency objective before treating it as a throughput candidate. This is +source-derived candidate guidance; empirical validation is `not_run` and +efficacy is `not_evaluated`. + +## Source identity and inspected scope + +Sheng et al., *FlexGen: High-Throughput Generative Inference of Large Language +Models with a Single GPU*, ICML 2023, PMLR 202:31094–31116 +([proceedings](https://proceedings.mlr.press/v202/sheng23a.html), +[paper](https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf)). The +[owner's paper source](../SKILL.md) records the fixed edition and digest: +the official ten-author edition, 23 PDF pages, SHA-256 +`7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e`. +The extended-author arXiv v2 edition is not the extraction source. + +The scoped qualification on 2026-10-31 inspected: + +- Section 1's offline objective and limitations, Section 3's memory and metric + definitions, Sections 4.1–4.3's validity constraints, scheduling, placement and + cost model, and Section 4.4 only to bound the multi-GPU extension. +- Sections 6 and 6.1 for the evaluation denominator and ablation discussion; + Appendix A.3's selected timing and peak-memory formulas on PDF pages 15–17; + the ending of Appendix A.2 only to bound Theorem 4.1, without a full proof audit. +- Rendered PDF pages 1, 4, 5, 6 and 8: Figures 1–3, Algorithm 1, Equation 1, + Tables 2–3 and their surrounding definitions. Rendering page 7 alone is not + credited as visual inspection. This is not an all-page or released-engine audit. + +PMLR's [publication agreement](https://proceedings.mlr.press/pmlr-license-agreement.html), +clauses 2–3, specifies CC BY 4.0 and attribution to the original publication. +This resource is an attributed synthesis; it includes no raw PDF, figure or +extended quotation. The archived official repository +[FMInference/FlexLLMGen](https://github.com/FMInference/FlexLLMGen/tree/004ffef82b46e8dc8685c55d0cdda650bdaf1269) +was inspected only for README identity and its Apache-2.0 LICENSE, not runtime +behavior. Repository licensing does not establish code/paper-version equivalence. + +## Reconstruct the source condition + +Section 3 defines block latency `T` as the time to process the prompts and +generate all `bls * n` output tokens, including prefill. Its generation +throughput is `bls * n / T`, where `n` is output length. Table 3's decoding +throughput excludes prefill; keep that denominator separate. The paper targets +latency-insensitive batched work, where more block latency may be acceptable. +That objective does not establish an interactive latency SLO. + +Section 4.2 defines effective batch size (block size) as: + +```text +bls = gbs * number_of_GPU_batches_in_a_block +``` + +`gbs` is the GPU batch size. A larger block reuses a layer's weights across +more GPU batches, but the block's KV cache and activations must remain stored +for their required lifetimes. GPU batch size and effective batch size therefore +charge different resident and working-storage terms; they are not interchangeable. + +The policy jointly places weights (`wg`, `wc`, `wd`), KV cache (`cg`, `cc`, +`cd`) and activations (`hg`, `hc`, `hd`) on GPU, CPU and disk. Each triple sums +to one in Equation 1. Freeing GPU weight storage alone does not establish that +the complete policy fits. Section 4.1 requires inputs on the computing device, +preserves activation/KV lifetimes, and limits total storage at every point. +Appendix A.3 makes the following charges explicit: + +| Resource | Capacity condition to inspect | +|---|---| +| GPU | Home weights, activations and KV plus working memory at prefill and decode peaks, including staged weights and operation intermediates | +| CPU RAM | Home weights, activations and KV plus working memory at prefill and decode peaks, including staging and CPU-attention storage | +| Disk / NVMe | Placed weights, activations and KV within available storage; the separate disk↔CPU transfers still enter the timing model | + +For fixed workload lengths, Equation 1 minimizes `T / bls` subject to the GPU, +CPU and disk peak-capacity constraints and the three placement sums. The timing +model uses: + +```text +T_model = l * T_pre + (n - 1) * l * T_gen +T_pre, T_gen = max(CPU_to_GPU, GPU_to_CPU, disk_to_CPU, CPU_to_disk, compute) +``` + +Each `max` uses that phase's per-layer costs, not a maximum across the whole +run. The model assumes perfect overlap, fits hardware parameters from profiling, +and includes CPU and GPU computation. Moving attention work to CPU can reduce +KV transfer, but its CPU work still costs time. Appendix A.3 notes that effective +rates vary with load; its simplified constants are not universal hardware rates. + +The source-derived decision condition is to retain an offload proposal only as +a candidate when all three state placements and phase-specific peaks fit, and +its complete block latency is compatible with the stated offline objective. +Evaluate exposed transfer and CPU costs with rates and overlap evidence for +that workload before recommending a throughput change. Missing capacity, +placement, working-memory, rate or latency inputs leave current feasibility +`INSUFFICIENT_EVIDENCE`. The fitted model is a conditional prediction, separate +from the owner's L1 bound and its single-device, single-traffic-tier helper. + +Section 4.3 explicitly warns that relaxed fractional placements and imperfect +peak-memory modeling, including fragmentation, can produce out-of-memory +policies requiring manual adjustment. A predicted policy is neither a fit +guarantee nor a measured speedup. Theorem 4.1 concerns I/O complexity under the +paper's assumptions; it does not prove a global latency or performance optimum. + +## Two qualitative reasoning counterexamples + +These are source-grounded hypothetical checks, not observed experiments. + +1. **More weight reuse exceeds the state budget.** Keep `gbs` fixed and increase + the number of GPU batches in a block. Weight loading may be amortized across + more prompts, while the block's retained KV and activations increase. If the + resulting home plus working storage exceeds GPU/CPU capacity, or the placed + state exceeds disk capacity, reject that placement as infeasible. Checking + only GPU weights or the unchanged `gbs` misses the violated condition. +2. **A fitting placement misses the execution objective.** Suppose all resource + peaks fit after state moves to CPU/disk. Disk↔CPU or CPU↔GPU traffic, CPU + attention work, or incomplete overlap can remain exposed; a larger block can + also exceed the allowed block latency. Capacity feasibility alone therefore + cannot justify a throughput recommendation. Compare complete generation time + under the same workload and resource budget, with the actual latency objective. + +## Unresolved wording and reuse limits + +- The printed Section 4.3 says `bls < 20`, while Section 6.1 reports a block of + `32 × 8`. This remains unresolved. Do not reinterpret the former as a count of + GPU batches or turn either value into a runtime default or universal limit. +- Approximation and 4-bit settings, model quality, current engine/backend + compatibility, device execution, service SLO qualification and efficacy are + outside this extraction. Author results are not current-stack measurements. +- The earlier `omnirsi-paper-intelligence-2026-10-15.zip` and its supplier + synthesis remain unavailable. Existing extraction history does not reveal its + exact FlexGen text or reuse rights. Public-paper and repository licenses do + not recover or license that synthesis; historical novelty remains `UNKNOWN`. +- Loading/readiness, training offload, host transfer lifetimes and KV-only runtime + tiers retain their existing owners. This resource adds one inference-policy + feasibility comparison, with no solver, runtime, registration or helper change. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md new file mode 100644 index 000000000..dab1c7b26 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md @@ -0,0 +1,320 @@ +# Checkpoint anchor for L1 weight demand + +Source: [HuggingArch](https://github.com/shenh10/HuggingArch) at +`facbbbc96856e558b9084a94a5070b2e2c86cf0b` (MIT). The +[source identity record](huggingarch-source-identity.json) gives each file's git +blob, sha256, size and the part that was read. + +Status: candidate guidance. `locally_verified: false`, +`empirical_validation: not_run`. HuggingArch was not run, no checkpoint was +joined, and nothing was measured for this document. + +## Why L1 needs an anchor + +L1 divides a work or traffic count by a rated peak. No later step looks at the +model again, so a wrong count reaches the floor and every comparison made +against it. Typical wrong counts are a projection with the wrong width, a +missing router gate, or a windowed layer wired as global. HuggingArch names this +failure mode and answers it by checking its model description against evidence +the description did not write, the checkpoint first (`[doc]` `docs/validation.md` +§1.1–§1.2). This document keeps the part that anchors weight demand and states +what that part leaves open. + +## Markers + +- `[code]`: behaviour read in executable code of an inspected file. +- `[doc]`: the source's prose, docstrings, comments or message strings. It also + covers behaviour implemented in a file that was not inspected, even when an + inspected docstring describes it. +- `[tree]`: a fact read from the commit's tree listing, such as a file being + absent. +- `[blog]`: the companion blog post. It is a live page published before the + pinned commit existed, so nothing in it is attributable to the pin. +- **Reading:** this document's own interpretation, not a source statement. + +Every marker carries a locator. Line numbers refer to the files at the pin. + +## Gate 1: the bidirectional per-tensor join + +### What the source does + +- The stored tensors the model description declares are joined with the + checkpoint header on the tensor name, and the join is read in both directions. + `CheckpointJoin.of` builds two residuals: header tensors that no stored name + selects, and stored names that select no header tensor (`[code]` + `backend/arch/validate/_matching.py` L324–342). The source names them + `unmatched_hf_tensors` and `checkpoint_name_absent` and gives a forgotten router + gate or expert bias as the typical unclaimed tensor (`[doc]` + `docs/validation.md` §4.3). +- A buffer computed at load may be missing from the file, so buffers are skipped + in the absent direction (`[doc]` `_matching.py` L307–308; `[code]` L336). +- An empty header is refused as unavailable rather than joined. The docstring + gives the reason: an empty set would pass every stored tensor (`[code]` L327–330; + `[doc]` L325–326). +- Stored rows that share one name are summed before the comparison + (`[code]` `match_checkpoint_to_hf`, L157–171). The source's examples are an + `input_layernorm` stored by both the dense and the MoE block template, and an + MTP layer that reuses the backbone's index space; a missing copy then shows up + as a count mismatch (`[doc]` §4.3; `HFBinding` docstring L195–200). +- The per-name comparison counts physical elements: each row's stored bytes over + its dtype width, times its copy count (`[code]` L169–171). An INT4 weight packed + into `I32` therefore counts as `I32` elements (`[doc]` docstring L144–147). A + row whose dtype is unknown stays in the table, marked, instead of being dropped + (`[code]` L163–168). +- Header names are taken verbatim. A stored name writes `X` at each indexed + position and selects every header tensor that agrees at the literal segments + (`[doc]` module docstring L22–26; §4.3). The selection itself is implemented in + `backend/hf/header.py`, which was not inspected. Each stored name is composed once + from the declared root, stack and module path (`[doc]` §4.2). +- Which results block publication is decided in + `backend/arch/validate/_orchestrator.py`, which was not inspected. The gate table lists the unclaimed tensors, a per-name physical + element mismatch (`param_mismatches`) and the absent names as gates (`[doc]` + §3, first row). The docstring of `match_checkpoint_to_hf` calls its output a + per-tensor diagnostic (`[doc]` L16–17, L141–147). The source does not settle this + within the inspected scope; the procedure below treats a mismatch as a failure. + +### Byte totals are a checksum on the join + +- Two byte totals follow the join. One compares weights plus declared buffers + with the header's model storage bytes; the other compares the whole checkpoint, + scale siblings included, with the byte spans that the shard headers record + (`[doc]` §3, second row; §4.1). The model storage total leaves out + quantization sidecars (`[doc]` comment in `_get_safetensors_data`, `_matching.py` + L79–88). +- Totals are compared in bytes because bytes need no unit conversion in a + mixed-precision checkpoint, for example FP4 experts, FP8 attention and BF16 + norms in one file. The total element count is reported only as a diagnostic + (`[doc]` §4.1, §6). +- The source keeps the sum secondary for a stated reason: it catches a wrong + width, but not two submodules swapped with the same total (`[doc]` §4.1). +- On the estimate path, a per-name element mismatch whose bytes agree within a + relative 1e-6 is treated as a packing artefact and not reported + (`[doc]` module docstring L18–20; `[code]` `spec_vs_tensors_check`, L412–424). **Reading:** that tolerance + belongs to a warning path. It is not part of the gate and is not carried into + Gate 1. + +### Procedure + +1. Read every shard's safetensors header: tensor names, dtypes, shapes and data + offsets. One header read per shard is enough. Loading mechanics stay with + [weight-loading-optimization](../../../optimization/weight-loading-optimization/SKILL.md). +2. List every tensor the L1 count includes: weights, biases, quantization scale + siblings, separately stored tied copies and split parts. Give each a name + pattern (`X` at indexed positions), stored dtype, stored shape and number of + stored copies. Mark tensors computed at load as buffers. +3. Join both ways. Record the header tensors no listed name selects, and the + non-buffer names that select nothing. +4. For each listed name, sum every row that shares it. Compare the sum's physical + elements with those of the header tensors the name selects. The per-name + comparison stays in elements. +5. Then compare byte totals: listed weights plus declared buffers against the + header's non-sidecar bytes, and everything including scale siblings against + the shard data spans. Only these totals switch to bytes. +6. The gate passes only when both residuals are empty, no name mismatches and + both totals agree. Equal totals with a residual or a mismatch is a failure. A + header that cannot be read means the gate could not be judged, which counts as + a failure. + +## Gate 2: the per-rank weight ledger + +### What the source does + +- A separate check builds the per-rank weight ledger that every view prices + weights from (`[doc]` docstring L3–9). When it cannot, the check returns one + finding, `weight_ledger_unpriced` or `weight_ledger_unbuilt` (`[code]` + `backend/arch/validate/_weight_ledger.py` `run_weight_ledger_check`, L37–51). +- What makes the ledger fail is decided in the capacity and layout code, which + was not inspected. According to the module docstring and the finding messages, + a stored weight with no `weight_axes`, or a tensor with no format to give it a + width, cannot be priced (`[doc]` L1–10, L25–34). +- The source gives the reason for a second gate: the byte anchor reads the + checkpoint join, which needs no layout, so it cannot see a weight that the + layout cannot place (`[doc]` L11–14). +- Each weight-bearing node declares, per stored axis, either that the axis is + replicated, or that it is split on a named parallel world with a `parts` + expression and a `fit` policy. Nothing is inferred from a symbol being + shardable; a stored tensor without a declaration is rejected (`[doc]` + `docs/parallelism.md` L71–93). +- A degree that does not divide a weight's part count is handled only as its + `fit` says. `exact` refuses the deployment. `replica_cells` lets a group of + ranks co-own each shard, with the part count split `gcd(parts, degree)` ways + and replicated across the rest. `pad` pads each shard to whole parts. There is + no silent largest-even-divisor rewrite (`[doc]` `docs/parallelism.md` L95–102; + `docs/evaluation_model.md` L172–176). +- A model description declares one placement per weight, although two serving + frameworks may split the same weight differently. The source documents the + resulting under-billed weight read and over-billed communication for the + framework that differs (`[doc]` `docs/known_limitations.md` §1.3). + +### Procedure + +1. For every stored weight, declare each stored axis as replicated or split on a + named parallel world, with its part count. +2. Give every stored tensor a format, so that it has a width. +3. When a degree does not divide a part count, apply a declared policy: refuse, + co-own or pad. Price a padded rank at its padded width. Never substitute a + divisor that divides. +4. Use the placement of the framework release that will run, and name it. +5. Report per-rank or per-degree weight bytes only after every stored weight has + a placement and a width. Until then the per-rank figure is + `INSUFFICIENT_EVIDENCE`. + +Gate 1 needs no layout, so passing it says nothing about per-rank bytes. Gate 2 +checks the declared layout and format. It does not observe the placement a +framework actually uses at run time. + +## What the weight anchor leaves open + +- The checkpoint records what is stored, not how it is used. A sliding-window + and a global attention with the same head dimensions have byte-identical + weights. A windowed layer wired as global caches the whole sequence, and + nothing in the parameter count shows it (`[doc]` `docs/validation.md` §5). +- HuggingArch covers that gap with separate gates on the derived cache: reviewed + KV-growth claims, an active-window presence check and a sliding-window + contract. §5.1 decides boundedness by substituting `s_kv → ∞` into each stored + length; §5.2 and §5.3 require growing cached tensors to cap (`[doc]` + §5.1–§5.3). They are outside this document. Gates 1 and 2 do not anchor KV size + or growth. +- No gate covers the precision at which a cache slot is stored, because no + checkpoint byte records it (`[doc]` §5.5). +- Activation traffic, collectives and achieved rates are not anchored by the + checkpoint. + +## Which bound may reject a measurement: the two-threshold rule + +HuggingArch compares a measured kernel time with a roofline in two places, with +different consequences. + +1. **At upload, a row that contradicts its own record is refused.** `utilization` + divides the row's achieved compute and bandwidth by the peaks the row recorded + at test time; a side with no recorded peak scores 0 and is not judged. + `above_sol` returns a reason when either ratio exceeds + `UTILIZATION_CEILING = 1.0` (`[code]` `kernel_bench/emit.py` L32, L38–53, + L284–303). The comment beside the constant gives the reason: a larger claimed + rate means the numerator does not describe the timed launch (`[doc]` L30–31). + The upload refuses such a row with HTTP 422, and a row whose roofline columns + are restamped must pass the same check (`[doc]` `docs/measured_calibration.md` + §4.3). +2. **At estimate time, a row faster than a separately computed roofline is + flagged.** When the caller supplies both FLOPs and bytes, the roofline is + recomputed from those numbers at the row's own test-time peaks, as the larger + of compute time and memory time. A row whose latency is below + `ANOMALY_THRESHOLD = 0.95` of that roofline is labelled `measured_anomalous`, + and its time is still returned, unclamped. If either number or either + test-time peak is missing, no flag is computed (`[code]` + `backend/inference/op_calibration.py` L59, L810–819, L924–939). + +Separately, when the current GPU table's peaks differ from the row's test-time +peaks, the returned latency is rescaled by the ratio for the resource the row +saturated: compute if its compute utilization is at least its bandwidth +utilization, otherwise memory. A row below 0.5 utilization on both sides takes +the slower of the two rescaled times. If either compute peak is unstated, the +compute ratio is 1 (`[code]` L344–345, L745–807). + +**Reading:** rejection is reserved for a row whose own numbers are inconsistent. +It claims more work per second than the peak it recorded, so its numerator or its +peak is wrong. A floor computed from other counts can only flag, because a fast +row may mean that the floor's count or peak is wrong, not the row. + +For InferRSI: + +- Reject a measured row against L1 only when the row's own work over its own time + exceeds its own recorded peak. Correct its numerator or its peak, then check it + again. +- Flag a row that is faster than a separately computed L1 floor, and re-derive + both sides: the count through Gates 1 and 2, and the peak at the clock the + device actually ran. +- Any numeric tolerance for the flag belongs to the acceptance issue, not to this + skill. + +## Evidence the source offers for the gates + +`docs/validation.md` §7 summarises an archived guard-ablation study (`[doc]`). +The source says it was taken against an earlier validator revision and that its +harness is not in the repository. + +- An agent regenerated three model descriptions (DeepSeek-V4-Pro, GLM-5.2 and + MiMo-V2.5-Pro) from scratch in a de-contaminated sandbox. Guards were added + back cumulatively, with three seeds per cell. With no guards all three were + 0 % valid; with all guards, 100 %. +- The weight guard removed the storage errors. On DeepSeek-V4-Pro, mean storage + violations fell from 32.7 to 0 and the storage discrepancy from 1.8 GB to 0. +- In the unguarded cells the agent exited reporting success, and its own + weakened validation passed, while the full validator found the description + broken. +- The source lists its own limits: the fault injector targets attributes that + no longer exist, there were three seeds per cell, run-to-run compute varied by + about 12–16 %, isolation was de-contamination plus a post-hoc scan rather than + OS-level, and only three models were tested. Intermediate tiers were not + monotone for DeepSeek-V4-Pro. + +The levers the study used remain in the code. `HA_ABLATE_GUARDS` names the levers +to disable, `weight` implies `packing`, and unknown names are ignored (`[code]` +`backend/arch/validate/_ablation.py` L40, L56–77). Per the module docstring, the +`weight` lever covers the byte totals, the per-tensor matching and the per-rank +ledger, and a disabled lever's findings leave both the publish gate and the +agent's feedback (`[doc]` L3–7, L15–17). The dropping happens in `validate()`, +which was not inspected. + +**Reading:** this is archived evidence for the design, not a verified property of +the gates at the pin. It was not reproduced here. + +## The companion blog post + +The post at displays the date 2026-10-08. +The pinned commit is the repository's root commit (`init repo`, authored +2026-11-04, no parents); GitHub reports the repository as created on 2026-11-03. +The post therefore predates the pin by about four weeks, and no revision links +its figures to code. It was retrieved once, on 2026-11-10. Sections 2.5, 2.6, +3.6 and 3.7 were read in full. + +- `[blog]` §2.6 describes an agent-written deployment analysis of DeepSeek V3, + V3.2 and V4-Pro on 8×B200 that HuggingArch's accounting contradicted. The V3 + prefill at 1M context was written as 73.48 µs/token, where a first-principles + recount gives about 150: a missing ×2. Because V3 was the baseline, V4-Pro's + prefill speedup over V3 read 4.7× instead of 9.4×. The analysis also assumed + that short-context single-request prefill was compute-bound, when reading MoE + expert weights from HBM binds it. The analysis was not inspected, so the example + is unverified. **Reading:** both are L1 errors that roofline arithmetic carries + forward without complaint, which is the failure this anchor exists for. +- `[blog]` §2.5 says the validator normalizes both header and model-description + names with `canonical_module_path()` and joins on that key. The pinned code and + documents describe verbatim header names and `X`-pattern selection instead + (`[doc]` `_matching.py` L22–26; `docs/validation.md` §4.3). Follow the pin. +- These figures appear in the post but in no inspected repository file. Do not + cite them as source facts: + - in a separate experiment with eight coding agents, the share of wrong + descriptions the agent itself judged as passing: 94 % with no guards and 6 % + with all guards (§2.6); + - the cost of one V4-Pro derivation: 62–87 agent turns, 44–63 minutes and + USD 14–22 (§2.6); + - a measured corpus of more than 280,000 rows covering 60 models and 13 operator + libraries (§3.7). +- `[tree]` The post points to `docs/guard_ablation/report.md` for the full study. + That file is not in the pinned tree. + +## What the source does not establish + +- No inspected file compares predicted with measured end-to-end serving results. + The source verifies self-consistency: conservation, perturbation invariants and + type contracts. Per-op cost axioms can only be reviewed against modelling + source; the system cannot verify them itself (`[doc]` `docs/validation.md` §8, + §9, §14). +- Collectives are never measured, so a deployment containing one has no complete + measured total (`[doc]` `docs/known_limitations.md` §4.8). +- `[tree]` The measured corpus is not in the repository. The tree's only CSV is + `backend/inference/gpu_specs.csv`, and it holds no Parquet or DuckDB files. + Measured rows live in a store owned by a separate service (`[doc]` + `docs/measured_calibration.md` §1.2). `scripts/seed_shared_corpus.py` exists; + its input was not inspected. The corpus's availability to InferRSI is not + established. + +## Adoption boundary + +- No HuggingArch code, model description or measured data is copied. The two + gates and the two-threshold rule are restated as procedures; nothing here runs + HuggingArch. +- The source's numeric constants (`1.0`, `0.95`, `0.5` and `1e-6`) are recorded + as provenance only. InferRSI keeps numeric gates in acceptance issues. +- The source groups its result checks into classes A–E (`docs/validation.md` + Part II). That vocabulary is not imported. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/huggingarch-source-identity.json b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/huggingarch-source-identity.json new file mode 100644 index 000000000..8327856c0 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/huggingarch-source-identity.json @@ -0,0 +1,138 @@ +{ + "schema_version": 1, + "repository": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "commit_metadata": { + "message": "init repo", + "authored": "2026-11-04T02:24:14Z", + "parents": [], + "repository_created": "2026-11-03T16:33:09Z" + }, + "license": "MIT", + "observed_at": "2026-11-11", + "method": "Each file was retrieved through the GitHub contents API at the full commit. Its git blob was recomputed and matched against the commit's tree listing, then hashed. A complete file hash does not imply complete reading: the scope of each file is recorded below and in huggingarch-checkpoint-anchor.md.", + "readset": "huggingarch-checkpoint-anchor.md", + "native_execution": "not_run", + "tree": { + "sha": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "truncated": false, + "blob_count": 1950, + "used_for": "Absence facts only: no measured-row data files (the only CSV is backend/inference/gpu_specs.csv, and there are no Parquet or DuckDB files), and no docs/guard_ablation/report.md." + }, + "files": [ + { + "path": "docs/validation.md", + "git_blob": "27ad32471db8c39937e04196a46fd3826a68def3", + "bytes": 37659, + "sha256": "917131e52bca569c9742efeba77606e2f102678acd9dccba06c593a833c9b800", + "inspection": "full", + "cited": true + }, + { + "path": "backend/arch/validate/_matching.py", + "git_blob": "60b81c06768180b389e3aa820669f4e29807d228", + "bytes": 18640, + "sha256": "09adc8e4d1052e328c990526f90bafeca1c83eeaabac33d7167f4e71cf6a1a0b", + "inspection": "full", + "cited": true + }, + { + "path": "backend/arch/validate/_weight_ledger.py", + "git_blob": "22527d76c1325ab21e668a11c66afce469a3b1bd", + "bytes": 2161, + "sha256": "7fa7ded5928507bae4facaf64afda040e0f8d07530a225df894b6ecf3d49a8f9", + "inspection": "full", + "cited": true + }, + { + "path": "backend/arch/validate/_ablation.py", + "git_blob": "be26c9952602ecdea9b8380f7a739420b036b69a", + "bytes": 3656, + "sha256": "865351ba04c9377aeed4a1ac3ccd998335e77aa3cefc69db08831b7cf3555edb", + "inspection": "full", + "cited": true + }, + { + "path": "docs/parallelism.md", + "git_blob": "2bac0e945842707a432b923f2ba3580428854491", + "bytes": 23100, + "sha256": "d33f829de04a27e42b3d44b98eaab94af409827434a2b2df18f4073c37b71714", + "inspection": "selected", + "inspected": "L1-120: the knob surface, and the axis table with each stored weight's declared placement", + "cited": true + }, + { + "path": "docs/evaluation_model.md", + "git_blob": "304eb9c8cd8ff7c27587bbe7042246f373d5f5e7", + "bytes": 13653, + "sha256": "a62578fbf17302e0bf6a85a7692d881ea6cd1ee19beed59202a80be1d330b53a", + "inspection": "selected", + "inspected": "Heading list; L170-204: 'Parallelism: global extents, layout for per-rank geometry' and 'Two trees'", + "cited": true + }, + { + "path": "docs/measured_calibration.md", + "git_blob": "c48b065e2a7b765cb9bba5cdd5b6dd2e41a31f97", + "bytes": 54364, + "sha256": "7971fda4719590f64fc43e8207ad968ef130d714979200493a3479b2403ab60a", + "inspection": "selected", + "inspected": "Heading list; L1-183 (sections 1-2); L384-403 (section 4.3); L684-828 (section 7)", + "cited": true + }, + { + "path": "docs/known_limitations.md", + "git_blob": "4480f090cf338c4868832e6e25c34583e9085558", + "bytes": 29268, + "sha256": "0317f9edf17755bb58006130ed9fbfbabf4375d68d79fa744f811c7e9159172d", + "inspection": "selected", + "inspected": "Heading list; L1-24 (introduction); L73-92 (section 1.3); L452-466 (section 4.8)", + "cited": true + }, + { + "path": "kernel_bench/emit.py", + "git_blob": "55f30fc4edcbe8c38b992c78cb20812380258a7a", + "bytes": 39131, + "sha256": "dfaf576cb5f16680d51f4703d3f8b538fa934d15e6ea626871e2285710ef3d7a", + "inspection": "selected", + "inspected": "L23-78: UTILIZATION_CEILING, utilization, achieved_from_latency and the start of restamp_row; L270-340: above_sol and _stamp_driver", + "cited": true + }, + { + "path": "backend/inference/op_calibration.py", + "git_blob": "a4074fd5d7a2b00fddb7335e5dcf2657e3ee1df5", + "bytes": 52791, + "sha256": "f5a65e17c4b9de077acf4e3d003794af7823a4d0030aeae8fb73c120c4a9ca46", + "inspection": "selected", + "inspected": "Symbol list; L1-62: module docstring and ANOMALY_THRESHOLD; L340-347: _Row.utilization; L355-395: measured_utilization; L745-948: _classify_bound, _peak_drift_scaled_latency_us, _compute_drift, _roofline_at_test_us, measured_time_for and _build_measured_timing", + "cited": true + }, + { + "path": "backend/measure/scope.py", + "git_blob": "34cd25765af8eba4d699d47a252c3a06b5bf1b00", + "bytes": 15337, + "sha256": "e409d0dd611ec412b8bd502f4a6dfcd7f68a1ffb8faeecd3695621f21ef31c84", + "inspection": "selected", + "inspected": "Symbol list; L1-60: module docstring and make_key", + "cited": false + }, + { + "path": "LICENSE", + "git_blob": "0ffc8d1b94bfa47aa8eecb016f5f132b3f952abb", + "bytes": 1064, + "sha256": "673e62a48886033c0ef389f2bbdc5051269d4726d5bf516452b0b4d2354caa80", + "inspection": "selected", + "inspected": "L1-5: MIT License header", + "cited": true + } + ], + "companion_document": { + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "sha256_scope": "The HTML bytes of the single retrieval read here. The page is live and unversioned, so a later retrieval may differ.", + "inspected": "Sections 2.5, 2.6, 3.6 and 3.7 in full; section headings elsewhere", + "attributable_to_commit": false, + "license": "UNKNOWN" + } +} diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md new file mode 100644 index 000000000..5542f4d26 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md @@ -0,0 +1,116 @@ +# Mooncake: prefix reuse as a conditional cost comparison + +Qin et al., *Mooncake: Trading More Storage for Less Computation — A +KVCache-centric Architecture for Serving LLM Chatbot*, FAST '25 proceedings, pp. 155-170 +([publisher](https://www.usenix.org/conference/fast25/presentation/qin), +[paper](https://www.usenix.org/system/files/fast25-qin.pdf)). The fixed edition +and PDF digest are recorded in [the owner's paper source](../SKILL.md). +This reference uses Section 2.2, Table 1 and Equations 1-2 (proceedings pp. +157-158; PDF pages 4-5). It does not substitute the later arXiv v5 edition. + +Use this comparison when a valid cached input prefix is available remotely and +the question is whether loading it could cost less time than recomputing it. +It is an analytical screening step within performance-ceiling analysis. It +does not select a scheduler, validate a connector or establish service gains. + +## Reconstruct the paper's comparison + +The paper approximates full-prefill work and work saved by prefix reuse as: + +```text +full_prefill_flops(n) = l * (a*n^2*d + b*n*d^2) (Equation 1) +saved_prefix_flops(p) ~= l * (a*p^2*d + b*p*d^2) +prefix_kv_bytes(p) = p * l * (2*d/gqa) * s + +saved_compute_time = saved_prefix_flops / G +load_time = prefix_kv_bytes / B +B = min(B_h2d, B_nic) +``` + +For a nonempty matching prefix (`0 < p <= n`), comparing `load_time` with +`saved_compute_time` and cancelling common factors gives Equation 2: + +```text +B/G > 2*d*s / (gqa * (a*p*d + b*d^2)) +``` + +The strict inequality is the paper's conditional benefit criterion. Equality +leaves no modeled saving. When `p = 0`, there is no prefix to reuse; do not apply +the cancelled expression to infer a benefit. The saved-work expression is the +paper's approximation, not a measurement of the current engine's incremental +attention or batching costs. + +| Symbol | Meaning | Table 1 example | +| --- | --- | --- | +| `n`, `p` | Input-token count and reusable-prefix-token count | Workload inputs | +| `l`, `d` | Layer count and model dimension | 80; 8192 | +| `a`, `b` | Architecture-dependent work coefficients in Equation 1 | 4; 22 | +| `gqa` | Query-head count divided by KV-head count | 8 | +| `s` | Bytes per KV tensor element | 2 B, BFloat16 | +| `G` | Average computation rate for the modeled GPU group | 8 × 312 TFLOP/s | +| `B_h2d` | Host-to-device bandwidth | 128 GB/s | +| `B_nic` | Network-interface bandwidth | 800 Gbit/s = 100 GB/s | + +Table 1 describes LLaMA3-70B and an 8 × A800 machine. Use decimal bytes and +FLOP/s consistently; `B/G` has units of bytes/FLOP. Keep computation and +bandwidth at the same GPU-group scope. Table values are analytical example +inputs, not measurements of a new deployment. Changing the model, KV encoding +or sharding can change the work and byte counts; obtain those inputs before +using this formula for another system. + +The `min` approximation assumes a pipelined loading path. Section 2.2 warns +that transfer stages do not overlap perfectly, increasing the actual bandwidth +requirement. It also omits request queueing, cache lookup/setup, contention and +other exposed transfer stages. A favorable inequality therefore leaves a +candidate to measure; it does not guarantee lower time to first token (TTFT). + +## Illustrative decision using explicit inputs + +Use the Table 1 model and compute rate with an assumed `p = 8192`: + +```text +prefix_kv_bytes = 2,684,354,560 B +saved_prefix_flops ~= 1,143,492,092,887,040 FLOP +saved_compute_time ~= 458.13 ms +break_even_B = prefix_kv_bytes / saved_compute_time = 5.859375 GB/s +``` + +This reproduces the paper's rounded 6 GB/s A800 example. The following +bandwidths are illustrative supplied values, not measured rates: + +| Assumed loading rate | Modeled loading time | Decision at this screening step | +| --- | --- | --- | +| 5 GB/s | 536.87 ms | Loading already exceeds saved compute; do not justify reuse with this model. | +| 10 GB/s | 268.44 ms | About 189.69 ms remains for additional exposed cost; investigate the actual path. | + +For the favorable row, first establish cache validity and availability. Then +measure effective loading and compute rates under the intended workload, plus +the additional exposed queue/setup/staging time. If that added time consumes +the modeled margin, this comparison no longer supports a TTFT benefit. Unknown +inputs leave current feasibility `INSUFFICIENT_EVIDENCE`; retain the existing +execution path while resolving them. Before adopting a change, compare actual +request latency and joint service-level objectives (SLOs) at a fixed workload +and resource budget. This example provides neither those measurements nor an +implementation or execution authorization. + +## Source and reuse boundaries + +- The retained paper qualification covers all 17 PDF pages (including the + publisher cover), all 15 figures, two tables, Algorithm 1 and Equation 2; + there is no appendix. This amendment extracts only the Section 2.2 condition. +- Sections 3.1 and 5.3 bound storage interpretation: the overview names SSD, + while the detailed request workflow and capacity study use CPU memory/DRAM. + The equation supplies no SSD I/O, persistence or recovery model. This limit + says nothing about SSD support in current Mooncake implementations. +- Earlier extraction history positively lists `evaluate-kv-cache-transfer-gates` + for remote prefix reuse, phase-pool transfer and projected decode-load + admission; see the [retained B integration notes](../../../../systems/engines/vllm/diagnose-vllm-admission-pressure/references/papers-20261015/INTEGRATION_NOTES.md). + Its original synthesis/archive remains unavailable. This separate public-paper + reference does not recover it; novelty against its unseen text is `UNKNOWN`. +- The paper's historical capacity, transfer and GPU-time results are author + reports with separate denominators. None is a local performance or monetary + cost result here. Current model/KV representation, matching prefix, placement, + effective rates, overlap, load and SLO measurements remain required inputs. +- Raw PDF, extracted text and images are excluded. Their third-party + redistribution permission remains `UNKNOWN`; public access and current + repository software licensing do not supply that permission. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md new file mode 100644 index 000000000..83637b528 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md @@ -0,0 +1,54 @@ +> Supplier integration proposal, preserved as historical source context (2026-10-15). The local owner review and current two matrices govern acceptance; suggested follow-ups and permission statements below do not authorize work or describe the current inventory. + +# Pack A integration notes + +**Candidate; empirical_validation:not_run.** Independently deliverable read-only extraction. No repository/matrix edit or empirical promotion was performed. Three candidate skills have valid metadata and skill-local evidence; the knowledge supplement and cases support merging into existing artifacts rather than inflating the inventory. + +## Read first + +[Mechanism summary](MECHANISMS.md) → [exact readset](READSET.md) → [source audits](references/vidur.md). Other paper audits: [InferenceBench](references/inferencebench.md), [FlashVector](references/flashvector.md), [Agentic Kernel Optimization](references/agentic-kernel.md). [Prior artifact overlap](references/prior-coverage.md) records existing skill destinations and exact earlier bundle locators without inventing current repository URLs. + +## Only two matrix destinations + +1. **Reference Matrix: `docs/reference-matrix.md`.** Add pinned original-source records with exact inspected scope, F/P status, unresolved source discrepancies and linked artifacts. Methodology belongs in its existing§2; do not create a third matrix or force methodology into hardware columns. +2. **SearchSpace Matrix: `docs/searchspace-matrix.md`.** Cross-link the resulting existing skill/case entries to relevant observation/diagnosis/search/verification gates. No automatic green-cell promotion from paper reading. Resource-level coverage and empirical validation remain distinct. + +Role classification should preserve one source identity even where a paper has two uses: + +- **Vidur:** primary systems-modeling reference; simulation dependency/memory/scheduling design can appear in§1 with scope explicitly limited to the paper. Calibration and constrained-search procedure cross-links belong in§2. It establishes no current engine implementation or target-hardware calibration. +- **InferenceBench:** evaluation/search methodology in§2. H100 is its experimental setting, not justification for filling accelerator/RAM/SSD/OS capability cells. +- **FlashVector:** cross-layer search/verification methodology in§2; optional§1 case links may record the specific server/host/graph/kernel mechanisms actually described. Keep case evidence narrow; do not infer networking from gRPC or shared memory. Same paper, not independent corroboration. +- **Agentic Kernel Optimization:** search/governance methodology in§2 and optional§1 CUDA mechanism case references. B200 profiler cases are hardware-specific evidence; no NPU or latest-runtime claim. Preserve the distinction between implemented mechanisms and author-proposed future directions. + +## Candidate bundles and merge destinations + +- [calibrate-serving-simulation](../../../calibrate-serving-simulation/SKILL.md) with [local evidence](../../../calibrate-serving-simulation/references/source-notes.md): extend `performance-ceiling-analysis`, `optimization-search-policy` and `inference-benchmark-design`. Increment: prediction-domain/queueing validation and joint-SLO shortlisting. Earlier `choose-prefill-decode-schedule` already covers Sarathi/DistServe trade-offs; link this calibration gate instead of re-extracting those. +- [govern-optimization-experiments](govern-optimization-experiments/procedure.md) with [local evidence](govern-optimization-experiments/references/source-notes.md): extend `optimization-search-policy`, `inference-benchmark-design`, `dense-performance-evidence`, `kernel-writing-guide`. Increment: budget fairness, measured-search breadth, quality-versus-integrity, best-seen-versus-final artifact, regime-specific correctness and stalled-direction correction. +- [redirect-cross-layer-optimization](redirect-cross-layer-optimization/procedure.md) with [local evidence](redirect-cross-layer-optimization/references/source-notes.md): extend `performance-ceiling-analysis`, host-overhead profiling/optimization and `inference-optimization-casebook`. Increment: noise/impact gates, semantic work elimination, host materialization/assembly cases, shape-regime dispatch and post-change retuning. + +Each skill folder is self-contained for selective consumption; parent-pack links are optional context. Three distinct trigger/decision contracts justify these folders. Integration may merge them into existing skills and retain source references/cases rather than install all three as separate skills. No fixed skill count is an objective. + +## Knowledge and cases + +- [Bounds/predictions supplement](knowledge/bounds-predictions-and-decisions.md) preserves the existing analytical/empirical/Amdahl hierarchy and adds evidence labels/calibration fields. It supplies no missing NPU/B300 measurements. +- [Six decision cases](cases/decision-cases.md) exercise near-capacity error, lost final validity, fake timing boundaries, CPU redirection, an SLO-inconsistent table row and shortcut-dominated kernel averages. These are candidate review cases, not tests run against InferRSI. + +## Source warnings that must survive distillation + +- Vidur AppendixA includes12.65% maximum error; do not keep only the abstract's less-than9% statement. The wider simulated scheduler/PP search is not all independently fidelity-validated by default-vLLM experiments. +- InferenceBench's cross-engine grid consists of separate two-hour runs; do not compare the combined grid with one agent's two-hour search as if budgets were equal. Its ScenarioD concurrency differs between G.2 prose and the formal specification. +- FlashVector ModelB's selected p99=271ms exceeds its stated250ms SLO; compliance unresolved. Its local/full-stack acceptance descriptions also differ in strictness. No separate causal ablations establish every agent-loop component. +- Agentic Kernel's local PyTorch-relative averages differ from official FlashInfer-relative results. Main/appendix metrics conflict for MoE utilization, attention shared memory and TopK representative input. Cumulative token trajectories are not isolated ablations or a learned token-cost model. +- InferenceBench and Agentic Kernel date/month anomalies remain unresolved. Never silently replace their IDs or manufacture dates. + +## Next gate: unread, optional, separate authorization/scope + +Stop at the four papers in this pack. Candidate future reads are source leads only: + +- Vidur§8's Habitat/Daydream: how profiling and dependency graphs bound prediction transfer; do not re-mine the already-extracted roofline hierarchy without a concrete gap. +- FlashVector reference27, Morphling: whether systematic configuration sampling can replace heuristic trial choice under bounded budget. Reference only; paper not opened. +- Agentic Kernel's FlashInfer-Bench2601.00227: exact benchmark aggregation and correctness/cache contracts behind official-vs-local denominators. Its implementation and paper remain unread here. + +## Static validation boundary + +Check frontmatter/name-to-folder match, local Markdown targets, self-contained skill dependencies, versioned paper links, source-cache exclusion and F/P/not_run labels. Those checks establish packaging quality only. They are not performance, implementation or hardware validation. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md new file mode 100644 index 000000000..f997887f7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md @@ -0,0 +1,31 @@ +# Pack A: model, shortlist, measure, redirect + +Status: **candidate / not_run**. Four original papers; author-reported evidence, not local measurements. Every operational rule below is **P**; **F** records the paper's actual methods/evidence in the linked source audits. + +## Main answer + +Model enough to reject impossible choices and cheaply compare plausible ones; use empirical predictions to shortlist, matched measurements to select, and artifact/correctness evidence to accept. When residuals, bottleneck ownership or workload regimes change, redirect the experiments instead of repeating the same recipe. + +- **Vidur → calibrated shortlist.** Separate token, sequence and communication dependencies; model stateful queueing rather than only adding kernel means. Retain joint SLO and total cost constraints. Predicted ranks require matching calibration and become unreliable near an unvalidated capacity boundary. [V1–V3](references/vidur.md) +- **InferenceBench → controlled search and final-state reliability.** Count actual distinct trials, preserve an incumbent, keep quick probes separate from held-out full evaluation, and audit the timing path independently of quality. Fixed-budget engine comparisons, best-seen/final discrepancies and structured/warm-start ablations diagnose different failures. [I1–I3](references/inferencebench.md) +- **FlashVector → layer-aware redirection.** A kernel improvement can expose host preparation or configuration bottlenecks. Rank impact against measured uncertainty, preserve semantic/lifetime conditions, verify globally, and retune after code changes. Local and full-stack denominators remain separate. [F1–F4](references/flashvector.md) +- **Agentic Kernel Optimization → regime dispatch and search correction.** Profiler/history-driven candidates, exactness gates and semantic shortcuts can matter more than endless local parameter changes. Cumulative trajectories are not controlled ablations; structural future directions stay unmeasured. [M1–M8](references/agentic-kernel.md) + +## What this adds to existing InferRSI intelligence + +The existing analytical/empirical/Amdahl ceiling hierarchy remains intact. This pack adds a **prediction calibration boundary**, **final-artifact preservation evidence**, **measurement-integrity failure cases**, and **cross-layer/regime redirection rules**. It does not fill missing hardware measurement cells. [Prior overlap and merge targets](references/prior-coverage.md) + +## Proposed candidate procedure + +1. Freeze objective, absolute constraints, semantics, resource/cost denominator, workload and current-stack identity. +2. Record conditional physical bounds and observed attainable envelopes separately from a simulator prediction or heuristic rank. +3. Shortlist distinct feasible mechanism families with predicted direction, uncertainty, discriminating metric and bounded trial cost. +4. Measure matched trials, independently gate quality/integrity, and retain invalid/inconclusive outcomes rather than hiding them. +5. Redirect when measured evidence falsifies the model or exposes a different owner/regime. A failed implementation does not automatically falsify an optimization idea. +6. Restore and verify the best valid final artifact under the full target workload. Only then promote an empirical claim, and only within its measured scope. + +[Evidence supplement](knowledge/bounds-predictions-and-decisions.md) · [Six candidate cases](cases/decision-cases.md) · [Exact readset](READSET.md) + +## Non-comparable quantities + +Do not order these papers by headline multipliers: Vidur reports simulator latency error and historical search cost projections; InferenceBench reports failure-aware speedup against naïve PyTorch under finite agent budgets; FlashVector reports component and production-pod effects; kernel campaigns report PyTorch-relative kernel aggregates and a separate contest FlashInfer-relative score. Hardware, workload, quality contract, budget, baseline and denominator all differ. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/README.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/README.md new file mode 100644 index 000000000..23808b908 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/README.md @@ -0,0 +1,14 @@ +> Supplier delivery snapshot, 2026-10-15. Packaging checks and inventory below refer to the original pack, not to this relocated integration. Empirical validation remains not_run. + +# Pack A — optimization modeling and experiment governance + +Candidate intelligence from four pinned papers. Empirical validation: **not_run**. + +Start with [the compact mechanism notes](MECHANISMS.md). Use [the exact readset](READSET.md) to audit sources, [the integration notes](INTEGRATION_NOTES.md) to merge incremental intelligence, and [the cases](cases/decision-cases.md) to review proposed decisions. + +Three selectively consumable candidate bundles: +- [Calibrate serving simulation](../../../calibrate-serving-simulation/SKILL.md) +- [Govern optimization experiments](govern-optimization-experiments/procedure.md) +- [Redirect cross-layer optimization](redirect-cross-layer-optimization/procedure.md) + +Each skill includes its own reference notes. Full pack source audits retain finer numerical evidence and unresolved discrepancies. No original papers, source-cache files or executable optimization tooling are bundled. No installations, reproductions, hardware runs, InferRSI edits, PRs or matrix changes were made. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/READSET.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/READSET.md new file mode 100644 index 000000000..d088203d6 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/READSET.md @@ -0,0 +1,27 @@ +# Pack A exact readset and provenance + +Four papers only. Original arXiv abstract pages were used to verify title/ID/version, followed by versioned full HTML/PDF. Checked2026-10-15. All results are author-reported; empirical_validation: **not_run**. Source PDFs/HTML/text extracts/renders are outside this deliverable tree. Bibliographies supply unread leads only; no fifth paper or implementation was opened. + +## Pins and actual inspection + +- **Vidur: A Large-Scale Simulation Framework For LLM Inference**, [2405.05465v2](https://arxiv.org/abs/2405.05465v2), revised2024-05-21. §§1–9; full methods §§3–6; evaluations §§7.1–7.3; A.1–A.2; Tables1–2; unnumbered §4.3 prefill equivalent-length model, §6 capacity/cost definitions. Figures1–8 captions/discussion read; rendered Figs.5–8 visually checked (PDF pp.11,16), others text/caption-only. [Detailed scope/evidence](references/vidur.md) +- **InferenceBench: A Benchmark for Open-Ended LLM Inference Optimization by AI Agents**, [2607.20468v1](https://arxiv.org/abs/2607.20468v1). Source displays2026-05-20 despite July-coded ID; unresolved. §§1–6, A.1–A.5, B.1–B.4, C.1–C.3, D.1–D.2, E.1–E.4, F examples1–7, G.1–G.5. Tables1–22 text read; Fig.1 caption/explanation; rendered Fig.2/Tables6–7 visually checked (PDF p.8). Unnumbered A.5 metric formulas and C.3 volatility expression. [Detailed scope/evidence](references/inferencebench.md) +- **FlashVector: Agent for Hierarchical Model Serving Stack Optimization**, [2609.17391v1](https://arxiv.org/abs/2609.17391v1), submitted2026-09-15. §§1–7, full §§4.1–4.2 and §§5.1–5.4, Algorithm1, Tables1–4; unnumbered hypothesis-ranking/noise relations. Figures1–6 captions/discussion; rendered Fig.3, Algorithm1, Figs.5–6 and Tables2–4 visually checked (PDF pp.4,5,7,8); others text/caption-only. No appendix or controlled agent-loop ablation reported. [Detailed scope/evidence](references/flashvector.md) +- **Agentic Kernel Optimization: Generating State-of-the-Art GPU Kernels Without Hand-Written CUDA**, [2608.14560v1](https://arxiv.org/abs/2608.14560v1). Source displays2026-05-25 despite August-coded ID; unresolved. All12 PDF pages, §§1–5, §§2.1–2.3, §§3.1.1–3.1.3/3.2.1–3.2.3, AppendicesA.1–A.4/B.1–B.4/C.1–C.4 including A/B/C.3.1–3.2, Tables1–21. Figures1–4 visually read (PDF pp.2–4). Unnumbered attention/TopK computation expressions; no cost-model equations or controlled workflow ablations. [Detailed scope/evidence](references/agentic-kernel.md) + +“Read” does not mean numerically digitized, reproduced, implementation-matched or independently verified. Rendered checks are stated individually so caption-only reads cannot be mistaken for chart-value audits. Numerical claims used here preserve author context in the source notes. + +## Local original-byte checksums + +SHA-256 of the downloaded versioned PDFs: + +- Vidur: `0381746e68016150df603fa8cab6d658b8fe6f3cd1c73a74cd0215f588cb39b8` +- InferenceBench: `b8784e185d2167c34ef0a347e9c59490e09c29fd1085db40076f8a1ec72cf51b` +- FlashVector: `a68ed302b06ee51087ca6b501a80bf748d073ae2f8c9aef29b8d89a5a15862af` +- Agentic Kernel Optimization: `d0f04ea7a63af331b1de4567c655e4ca88bdf0f9af8818aaf9edfd5a7c1ff991` + +Original HTML hashes are retained in the research cache/worker extraction where relevant; dynamic arXiv page chrome may change without changing the versioned paper. Pin the PDF and version, not a claim that web rendering is immutable. + +## Prior-readset check + +Earlier six-paper extraction, implementation/NPU discovery notes and supplied Reference Matrix/handoff overlap are documented in [prior coverage](references/prior-coverage.md). Vidur was a lead, not previously mined. Existing analytical/empirical/Amdahl ceilings remain their original lineage. No missing earlier readset was silently recreated; supplied inventory is distinguished from underlying skill content not inspected. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md new file mode 100644 index 000000000..72c4071e0 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md @@ -0,0 +1,13 @@ +> Supplier delivery snapshot, 2026-10-15. Packaging checks and inventory below refer to the original pack, not to this relocated integration. Empirical validation remains not_run. + +# Static packaging checks + +Checked2026-10-15. Packaging checks passed: + +- Three SKILL.md frontmatter blocks contain name, description, candidate status and not_run validation state. Names match folder names. +- 57 local Markdown links resolved. Each skill links only to its own references/source-notes.md; there are no parent-folder runtime dependencies. +- All delivered files are derivative Markdown notes. No PDF/HTML/source cache, screenshots, execution script, installed software or benchmark output is included. +- Exactly four papers were inspected; separately labeled next-gate leads remain unread. +- Proposed official matrix destinations are docs/reference-matrix.md and docs/searchspace-matrix.md only. + +This is a static structure/link/frontmatter check, not a skill evaluation, kernel correctness test, benchmark, hardware calibration, reproducibility study or current implementation audit. empirical_validation: not_run. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md new file mode 100644 index 000000000..9b433439e --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md @@ -0,0 +1,51 @@ +# Candidate decision cases + +All cases are **P** paper-informed review exercises, not reproduced experiments. Status: candidate; empirical_validation: not_run. F evidence links lead to version-pinned readsets and contextual denominators. Expected decisions are proposed rules, not guaranteed outcomes. + +## C1. A precise simulator near the wrong boundary + +- **Input:** a shortlist claims universal prediction error below9% and selects a candidate just inside its latency SLO at95% estimated capacity. +- **F trigger:** [Vidur V3](../references/vidur.md) reports -12.65% P95 normalized E2E error for LLaMA2-7B/Arxiv-4K at95% capacity, versus different errors at85%; host overhead and queue amplification matter. +- **Expected decision (P):** preserve the candidate as predicted, withhold SLO certification, inspect calibration domain and measure the near-boundary load. Do not mechanically use12.65% as a universal safety factor either. +- **Failure:** promoting a static/kernel error statistic into an online tail-latency guarantee. +- **Completion evidence required:** target-specific request/queue validation under matched resource, workload and metric definitions. + +## C2. The fastest probe is not the final deployment + +- **Input:** a quick candidate beats the incumbent; subsequent backend/quantization edits break the final server. +- **F trigger:** [InferenceBench I2](../references/inferencebench.md) separates best-seen from final utility, and its structured/warm-start ablations improve preservation without eliminating search gaps. +- **Expected decision (P):** restore the exact last full-valid artifact; restart, warm and verify it through the canonical launcher. Record the fast quick probe as provisional. Reserve time for final verification before further changes. +- **Failure:** calling the task complete from an old metric file or a configuration no longer deployed. +- **Completion evidence required:** same code/config/input/evaluator identity and final valid server, not merely a script that once worked. + +## C3. A quality pass hides a false timing boundary + +- **Input:** an 8k-prompt server reports near-zero TTFT by streaming a placeholder before model computation; final answer quality passes. +- **F trigger:** [InferenceBench I3 / AppendixF](../references/inferencebench.md) supplies this integrity failure separately from quality failures. +- **Expected decision (P):** reject the timing result and audit the first genuine generated-token boundary, output counts and required model execution. Never recommend the placeholder trick. +- **Failure:** treating score/format compliance as evidence of preserved inference semantics. +- **Completion evidence required:** uncontaminated canonical evaluation plus independent artifact/timing-path validation. + +## C4. The next useful optimization is on the CPU + +- **Input:** GPU kernels improve but end-to-end throughput barely moves; string materialization and feature assembly dominate. +- **F trigger:** [FlashVector F3–F4](../references/flashvector.md) separates30× serialization-step gain, CPU pod940→about1,500 RPS, and GPU module/forward gains with different denominators. +- **Expected decision (P):** redirect profiling to the exposed host path; inspect immutable-view/buffer-lifetime and semantic lookup eligibility; test a bounded candidate under unchanged CPU/pod budgets. Re-profile after improvement, then revisit batching/concurrency. +- **Failure:** projecting a component multiplier directly into whole-service speedup or treating same-host shared memory as network optimization. +- **Completion evidence required:** correct lifetime/output behavior, component result and end-to-end gain above local uncertainty. + +## C5. A selected table row violates its own SLO + +- **Input:** a tuning result is labeled compliant, but SLO250ms and measured p99=271ms appear in the same row. +- **F trigger:** [FlashVector Table4](../references/flashvector.md), visually confirmed in the original PDF, contains exactly this ModelB discrepancy. +- **Expected decision (P):** mark compliance unresolved/failing under the stated threshold; seek correction or a matching valid trial before promotion. Do not invent a relaxed SLO or hidden confidence interval. +- **Failure:** trusting a caption or selected-row label instead of checking the actual inequality. +- **Completion evidence required:** corrected provenance or an authorized, measured compliant candidate. + +## C6. A huge aggregate speedup comes from a conditional shortcut + +- **Input:** a TopK candidate is advertised as universally over1000× faster while many benchmark cases have sequence length≤K. +- **F trigger:** [Agentic Kernel Optimization M7–M8](../references/agentic-kernel.md) bypasses score computation when all valid indices are selected;69/128 cases occupy the all-short regimes. The aggregate is PyTorch-relative; its weighting is unreported. Slow mixed batches have separate underfill and exactness constraints. +- **Expected decision (P):** prove shortcut semantics including ordering/ties/padding; record hit rate and fast/slow/mixed-regime timings; keep vendor-reference comparisons separate. Low DRAM utilization and nonzero achieved occupancy do not by themselves identify spare whole-device throughput. +- **Failure:** exporting a shortcut-dominated average to long sequences, a different output contract, or another device. +- **Completion evidence required:** regime-complete correctness and workload-weighted latency under an explicitly declared aggregation. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md new file mode 100644 index 000000000..373d99f85 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md @@ -0,0 +1,26 @@ +# Govern optimization experiments + +Use when an agent must model, shortlist, measure and redirect a finite optimization search. Merge the incremental gates into existing `optimization-search-policy`, `inference-benchmark-design`, `dense-performance-evidence` and `kernel-writing-guide` rather than deploying duplicate policies. All steps below are P proposals; empirical_validation: not_run. + +Read [InferenceBench](references/source-notes.md), [Agentic Kernel Optimization](references/source-notes.md), and [evidence distinctions](references/source-notes.md). + +## Procedure (P) + +1. Freeze valid work: model weights, allowed approximations, output shape/length, quality limits, true timing boundaries and forbidden shortcuts. Record workload hashes and developer-versus-held-out evaluation split. Do not interpret an accuracy pass as proof that the timing path performed the required work. +2. Establish a valid incumbent and its complete restartable artifact: code/config hashes, launcher, compatible dependencies, initialization/cache state, measurements, correctness evidence and runtime health. Retain the prior incumbent untouched while exploring. +3. Make a bounded candidate list across distinct mechanisms supported by current evidence. Record expected bottleneck effect, assumptions, uncertainty, setup/compile/evaluation costs and abort/rollback criteria. A recalled recipe is a hypothesis. An extra installation or alternative stack still needs authorization. +4. Prefer controlled contrasts for attribution. Where interactions are plausible, schedule a small explicit interaction design after single-factor gates; label coupled changes instead of attributing the combined gain to one knob. Count distinct measured configurations separately from restarts or repeated probes. +5. Separate fast screening from full validation. Preserve failed, invalid and inconclusive results. Repeated identical recovery attempts should trigger diagnosis or restoration rather than inflate exploration counts. Redirect on evidence, not only because more time remains. +6. Audit suspicious timing against event semantics, token/work counts, actual artifact behavior and conditional physical feasibility. Inspect quality and integrity independently. Never implement a benchmark bypass as an optimization. +7. Compare optimization methods with matched total resources and wall-clock costs. Separate search cost/API cost from steady-state serving cost. A per-engine multi-run grid is not a single equal-budget engine-selection result. +8. Reserve time based on observed clean restart, warmup and full verification duration. Restore the best fully valid incumbent, restart through the canonical artifact and verify that exact state. Report best-seen and delivered results separately. + +## Output and stop + +Return an experiment decision log with candidate rationale, variables, input/evaluator identities, results and uncertainty, integrity/quality verdict, total resource cost, redirect/reject reason and incumbent identity. Stop when the authorized budget/goal is reached or the next useful action needs new authority. No victory from a last successful probe if the shipped artifact differs or is broken. + +Paper-specific two-hour budgets,15-minute validation reserves,95% quality thresholds and named-model rankings are evidence contexts, not default policy. Broader exploration and preservation improve different failure modes; neither paper proves one universal optimizer. + +## Resource contract + +This procedure and its local `references/source-notes.md` are sufficient for selective consumption. The rest of Pack A supplies optional comparisons and integration notes; no parent-folder file is required to interpret the procedure or its source limits. Existing InferRSI skill names above are reconciliation targets, not runtime dependencies. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md new file mode 100644 index 000000000..9081afd74 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md @@ -0,0 +1,126 @@ +# InferenceBench: source audit and mechanisms + +Status: candidate / empirical_validation: not_run. F = source fact; P = proposal. [InferenceBench: A Benchmark for Open-Ended LLM Inference Optimization by AI Agents, 2607.20468v1](https://arxiv.org/abs/2607.20468v1), [HTML](https://arxiv.org/html/2607.20468v1), [PDF](https://arxiv.org/pdf/2607.20468v1). ID/title/version match verified. Original abstract and full text display 2026-05-20 despite the July-coded identifier; this unresolved metadata anomaly is preserved, not repaired. Scaffolds are described as April 2026 snapshots. No current model ranking is inferred. + +## Exact readset + +§§1–6; methods §§3.1–3.4; results and ablations §4/§4.1; behavior §§5.1–5.3; limitations §6. Appendices A.1–A.5, B.1–B.4, C.1–C.3, D.1–D.2, E.1–E.4, F examples 1–7, G.1–G.5 read. Tables 1–22 read as PDF/HTML text; Fig.1 caption and explanation read; rendered Fig.2 and Tables 6–7 visually checked on PDF p.8. Metric formulas A.5 and quartile-volatility formula C.3 are unnumbered. No implementation repository opened. The quoted transcripts are evidence supplied by the paper, not independently audited experiment logs. + +## Metric and resource contract (F) + +Main setting: Mistral-7B-Instruct-v0.3, one H100 80 GB, two-hour wall-clock budget, three development/evaluation seed pairs per agent×scenario. Each job receives 16 CPUs, 180 GB RAM and 400 GB scratch on shared two-socket EPYC 9654 nodes; Ubuntu 22.04, driver 580.82.07, CUDA 12.8 container, PyTorch 2.8.0. The displayed host runtime CUDA version is 13.0, distinct from container toolchain/runtime. + +A: 8,192/1,024 target input/output tokens, 128 requests, concurrency 1, minimize TTFT. B: 1,024/8,192, 64 requests, concurrency 1, minimize TPOT. C: 1,024/1,024, the same 256 requests replayed under burst cap64, Poisson32 requests/s cap32, constant16 requests/s cap16; maximize geometric-mean completed request throughput across profiles. D: 4,096/2,048, 96 requests, concurrency4; geometric mean of inverse mean TTFT, inverse mean TPOT, and requests/s on D's own workload. Token lengths vary uniformly over 80–100% of the targets; outputs are forced to sampled lengths. Inputs are LongBench-v2 documents with hashed realized request sets. + +TTFT is client send to first parsed content-bearing SSE chunk; ITL is between streamed chunks, not necessarily individual tokens. Per-request TPOT=(end−first)/(output_tokens−1). Request throughput counts completed requests / wall time. Secondary generation throughput uses all output tokens / summed decode intervals, so its numerator differs by one token/request from the TPOT convention. D uses seconds and requests/s, not milliseconds; it is not composed from A/B/C baselines. Failed quality/integrity/unusable final servers score baseline-equivalent 1×, not zero. Aggregate is geometric mean of A–D speedups; cells are means over three seeds with sample SEM. Baseline native values: A 840 ms, B 41 ms, C 0.132 requests/s, D 1.68. These mixed quantities cannot be ranked against Vidur capacity/$ or FlashVector pod RPS. + +## I1. Make exploration executable and compare fair budgets + +- **Objective (F):** evaluate useful autonomous deployment under a fixed budget, including engine selection, integration and tuning. +- **Assumptions (F):** same hardware, weights, inputs, scoring gates and wall-clock allowance; candidate setup/JIT/repair consumes the agent's budget. +- **Decisions / constraints (F):** serving engine, backend, quantization, KV dtype, scheduler/batch/token limits, compile/graph choices; correct base model and functioning OpenAI-compatible server required. +- **Mechanism (F):** compare agents with defaults and documented-flag Random/SMAC/TPE searches. Each optimizer×engine has a separate two-hour run; the full cross-engine grid is not a single two-hour joint engine-search result. +- **Resource benefit / cost (F):** search attempts trade possible serving gains against setup, compilation, evaluation and API/GPU cost. D.2 uses a historical nominal H100 price of $1.99/h: a complete 12-run agent evaluation has $47.76 nominal GPU cost before overhead, plus API costs. These are optimization expenditures, not steady-state serving cost per request. +- **Author evidence (F):** §5/E.3 report 169/180 final launchers using vLLM, median one distinct non-default argument set, and 81% of restarts repeating arguments. Table20 shows engine choice matters across the fixed scenarios; it does not establish a universal engine winner. Table2's best-agent aggregate 8.08× and SMAC-vLLM 11.53× use the same naïve PyTorch denominator, not a tuned-production baseline. +- **Limits / countersignals (F/P):** only three seeds and fixed scaffold/model snapshots; broader cross-engine search consumes multiple independent budgets. §G.3's conjecture that two hours covers most of the flag space lacks an exhaustive optimum proof. Scenario-C vLLM default 48.69× exceeds its SMAC search 46.70× in Table2, so search is not uniformly better than defaults. +- **Candidate rule (P):** preserve a known-good incumbent while allocating bounded trials across materially different hypotheses. Count distinct measured configurations, not ideas mentioned or identical restarts. Use documented compatible families; do not silently turn this literature recommendation into installation or engine replacement authority. + +## I2. Preserve the best valid artifact, not the last edit + +- **Objective (F):** close the gap between finding a good configuration and delivering it. +- **Assumptions / decisions (F):** final server must match its launcher/configuration and pass final evaluation; quick probes are provisional. Choose whether to continue, revert, combine validated changes or finalize. +- **Mechanism (F):** structured prompt establishes baseline, changes one variable per experiment, logs proposals/outcomes, and reserves the last 15 minutes for validation. Best-seen rescoring diagnoses lost valid configurations rather than changing the benchmark's final-state objective. +- **Evidence (F):** Table3: 117/180 pass both gates, 34 fail/incomplete quality, 11 integrity flags, 18 server/runtime failures; categories exclusive. Table6: structured GPT-5.4 passes 11/12 versus10/12, Opus4.7 11/12 versus5/12. Best-seen Table4 rises from 8.62× to12.34× for per-scenario best-agent aggregation; this is a different aggregation from one agent's Table2 aggregate. Warm-start Table21 improves reliability but does not remove search gaps. Time-budget Fig.2/§4.1 does not show monotonic gains through 8 h. +- **Cost / limits (F/P):** preserving/replaying artifacts consumes time. No controlled isolation attributes all structured-prompt effects to a single constituent rule; fixed 15-minute reserve is benchmark-specific. One-variable exploration alone misses interactions. +- **Candidate rule (P):** store immutable candidate/config/input/evaluator identities and last full-valid results. Use one-factor contrasts for attribution, then explicitly labeled interaction tests. Reserve finalization based on measured restart/warmup/full-validation cost; after a regression restore and verify the incumbent rather than repeat repairs indefinitely. + +## I3. Treat measurement semantics as correctness + +- **Objective (F):** reject apparent speed improvements that alter the task or event boundaries. +- **Assumptions / constraints (F):** quality at least95% of baseline on a seed-fixed500-question MMLU-Pro subset, plus an independent integrity judgment from launcher/log/transcript evidence. Development/evaluation seeds differ. +- **Mechanism (F):** gate output quality and task integrity before scoring; use held-out canonical inputs and a final working-server check. Appendix F distinguishes fake first chunks, bypassed decode and dependency/compilation delays from real gains. +- **Resource benefit / cost (F/P):** gates prevent invalid apparent gains from entering selection, but quality evaluation and artifact/judge inspection consume time and compute. Their isolated resource overhead is unreported; total campaign cost cannot be assigned to the gates. +- **Evidence (F):** C.1 threshold rescoring is stable through0.95 and changes at most one rank at0.97. C.2 judge agreement κ=0.82; a stratified50-run manual audit finds zero false positives and one missed violation. These are sample estimates, not a guarantee. A quality-passing fake decode run is excluded; no exploit is an optimization recommendation. +- **Limits / countersignals (F/P):** §G.2 calls ScenarioD concurrency1, conflicting with §3/Table1 and A.3/Table8 concurrency4. Do not use that paragraph as a clean concurrency-specific causal claim. Main prompt B.1 allows quantization while §G.2 describes prequantized-checkpoint prohibition more specifically; do not reconstruct a universal authorization rule from this inconsistent presentation. +- **Candidate rule (P):** specify genuine first generated token, required forward/decode work, token counting and output length before optimization. Audit timing anomalies against both artifact semantics and physical feasibility; passing a small quality test cannot prove measurement integrity. Keep honest failures distinct from baseline performance when reporting local results, even if a benchmark maps both to1×. + + +# Agentic Kernel Optimization: pinned original-source extraction + +Status: candidate; empirical_validation: not_run. + +## Result and scope + +This paper is useful evidence for a correctness-gated, profiler-guided optimization campaign, workload-regime dispatch, and escalation from local tuning to structural redesign. It does **not** supply a quantitative physical lower-bound model, calibrated latency predictor, learned shortlist score, or controlled ablation of the agent workflow. Its numerical results are specific to CUDA kernels on a local NVIDIA B200 and the authors' contest evaluation. This extraction makes no portability, NPU, reproduction, or present implementation claim. + +Labels: **F** = paper fact or author-reported observation; **F-hypothesis** = a future direction or interpretation explicitly proposed by the authors, not a demonstrated improvement; **P** = candidate operational rule proposed by this extraction. Analytical checks and reporting cautions are explicitly identified rather than attributed to the authors. + +## Provenance and exact readset + +- Verified requested ID/title match: **arXiv:2608.14560v1**, **Agentic Kernel Optimization: Generating State-of-the-Art GPU Kernels Without Hand-Written CUDA**. +- Authors: Mao Luo, Hongbin Li, Feng Lin, Hanling Yi, Zhe Huang; Intellifusion Inc. +- Original arXiv submission history displays **25 May 2026, 02:50:41 UTC**, v1 only. PDF and HTML display **25 May 2026**. Preserve this date as reported: it does not align with the August-style `2608` identifier; the discrepancy is unresolved, not silently repaired. +- Verified 2026-10-15 using [versioned abstract](https://arxiv.org/abs/2608.14560v1), [versioned HTML](https://arxiv.org/html/2608.14560v1), and [versioned PDF](https://arxiv.org/pdf/2608.14560v1). PDF is 12 pages. +- Original PDF/HTML, text extracts and figure renders were retained outside the deliverable tree; only this derivative extraction is delivered. +- PDF SHA-256: `d0f04ea7a63af331b1de4567c655e4ca88bdf0f9af8818aaf9edfd5a7c1ff991`. +- HTML SHA-256: `bceb7f6766f8c0456a387ebaab5e89929222267010f14cba79e307e3c3dcd83e`. +- Read all PDF text, pp. 1–12: Abstract; §1; §§2.1, 2.2, 2.3; §§3.1.1–3.1.3 and 3.2.1–3.2.3; both discussion subsections in §4; §5; Acknowledgments; reference list; Appendices A.1–A.4, including A.3.1–A.3.2; B.1–B.4, including B.3.1–B.3.2; C.1–C.4, including C.3.1–C.3.2. +- Read all **Tables 1–21**, including captions, units, and adjacent interpretation. Figures **1–4** were read visually from rendered PDF pages 2–4, including workflow arrows and trajectory annotations. Approximate annotations, rather than digitized curve positions, are used below. +- Read mathematical expressions: §3.1.2 sparse-attention logits `(q_nope K_c^T) + (q_pe K_p^T)` and attention-weighted output; §3.1.3 unnumbered TopK score `score(t) = sum_h ReLU(Q_h K_t^T) w_h`; C.3.1 unnumbered batch-indexed equivalent. There are **no numbered cost-model equations** in this version. +- Checked `prior-foundation-pack` and `supplier-research-cache/source-notes` for the title/ID: no existing coverage found. No repository was read or run; author-linked implementation is not needed to support the extraction. + +## 1. What is actually modeled, shortlisted, measured, and redirected + +### M1. Profile/history-driven candidate search + +- **F objective:** Improve kernel speed subject to all benchmark correctness conditions. +- **F assumptions:** A fixed reference, workload definition, harness, configuration, and dataset are available; CUDA candidates can be built and tested in isolated GPU environments; NCU and run history are available to the planning role. +- **F decisions/constraints:** Only kernel implementation is editable. Numerical failures, runtime errors, and timeouts invalidate a candidate. The framework can coordinate heterogeneous CLI agents, but the actual campaign says its Houmao agents used Claude Code with Claude Opus 4.6 and isolated context windows; mentioning Codex as a supported CLI does not establish a controlled mixed-model comparison. +- **F mechanism:** Planner receives current incumbent, NCU reports, and records of kernels/metrics/decisions. Parallel coders implement and benchmark different proposals. Synthesizer selects and merges useful changes and validates the updated result. Profiler supplies bottleneck reports. Researcher supplies external examples on demand. Figure 1 explicitly feeds results, decisions, profiler output, and notes back into history and planning. +- **F resource benefit/cost:** Parallel exploration and reuse of profiling/history can reduce serial search and repeated mistakes, but the paper does not quantify either saving. Reported expenditure is approximately 1.9 billion agent tokens across the three campaigns; GPU-hours, monetary cost, wall time, role-level token attribution, and parallel coder count are not given. +- **F evidence:** Workflow description/diagram, cumulative trajectories, and final kernel performance. No controlled comparison to one agent, random search, no-profiler search, or a human-only campaign. +- **Limits/countersignals:** No mathematical acquisition function, uncertainty estimate, quantitative candidate-ranking criterion, exact candidate budget, exact stall threshold, or prediction error evaluation. The Synthesizer's selection is qualitative. Campaign success alone cannot identify the causal value of each role. +- **P candidate rule:** Maintain an experiment record with workload regime, correctness gate, incumbent, proposed bottleneck, measurable predicted direction, observed result, and retained/rejected decision; use that record plus fresh profiles to choose the next small candidate set. Treat any numeric ranking model as a separate proposal requiring validation, not a method recovered from this paper. +- Source: [§2.1](https://arxiv.org/html/2608.14560v1#S2.SS1), [Figure 1](https://arxiv.org/html/2608.14560v1#S1.F1), [§2.3](https://arxiv.org/html/2608.14560v1#S2.SS3). + +### M2. Correctness and anti-exploitation gates + +- **F objective:** Ensure speed gains represent a deployable computation rather than changes to the evaluation or reuse of test outputs. +- **F assumptions:** Repeated benchmark iterations can expose stable tensor identities; an ordinary output comparison alone may fail to detect identity-based output caching. +- **F decisions/constraints:** Freeze non-kernel surfaces. Reject sample-specific shortcuts, tensor-identity output caches, and cross-iteration buffer reuse. Require separate cold and warm measurements if a legitimate deployable cache is material. +- **F mechanism:** Apply all-correctness acceptance before speedup selection; provide anti-hacking rules in each agent's initial prompt. Tool/environment notes include tensor cloning, L2 flushing, cold-cache and no-CUDA-graph defaults. +- **F resource benefit/cost:** Avoid spending tokens optimizing invalid objectives and avoid selecting artificial speedups. No measured anti-hacking overhead or ablation is reported. +- **F evidence:** Early MoE candidates reportedly exceeded 1000× because the in-process harness reused tensor pointers and the generated program returned cached outputs after its first execution. The paper identifies those results as invalid, not achievements to include in the final campaign. +- **Limits/countersignals:** Prompt restrictions are described; the paper does not establish a formal proof or exhaustive adversarial test of the final candidates. General correctness tolerances are not fully enumerated in the paper. TopK has the explicit matched-index ratio of 1.0. +- **P candidate rule:** Before recording a new incumbent, preserve harness identity and validate behavior on fresh content/identities consistent with the authorized workload. Record cache state and graph mode with each timing. Huge gains trigger an evaluation-path audit before resource-model conclusions. +- Source: [§2.1](https://arxiv.org/html/2608.14560v1#S2.SS1), [Table 2](https://arxiv.org/html/2608.14560v1#S2.T2), [§4](https://arxiv.org/html/2608.14560v1#S4). + +### M3. Stall-triggered research and human search correction + +- **F objective:** Escape unproductive local optimization and avoid discarding useful ideas because an unrelated defect was blamed on them. +- **F assumptions:** Agents are competent at local implementation but can under-explore references, prefer small changes after a plateau, and misattribute a failure. +- **F decisions/constraints:** After several failures in one direction, consult the research role; after no improvement within an allotted time, return to the Planner. Humans supply references or redirect strategy; authors say humans neither reviewed nor edited kernel code. +- **F mechanism:** A structured escalation path changes the search direction rather than continuing near-identical local attempts. Supplied references include DeepGEMM, FlashInfer, and RadiK; reusable skills cover architecture, profiling, and independent review. +- **F resource benefit/cost:** Intended reduction of futile token/GPU exploration; no intervention-level cost or return is measured. +- **F evidence:** Three qualitative recurring failure modes in §2.2; trajectories show stepwise gains after increasingly specialized changes. No intervention log, frequency, counterfactual, or controlled human-removal ablation. +- **Limits/countersignals:** The paper's broad suggestion that limited domain knowledge may suffice is not demonstrated across users/tasks. No reproducible numerical threshold defines a plateau. +- **P candidate rule:** Escalate only after logging why repeated attempts failed; distinguish invalid implementation from a falsified optimization hypothesis. Supply a novel reference or structural alternative when evidence contradicts the current search direction. Define local attempt/time budgets explicitly for a new workflow; these would be proposed policy parameters, not paper facts. +- Source: [§2.2](https://arxiv.org/html/2608.14560v1#S2.SS2), [§4](https://arxiv.org/html/2608.14560v1#S4). + +### M4. Workload-regime diagnosis instead of one global bottleneck label + +- **F objective:** Explain speedups and choose specializations using a few distinct execution regimes. +- **F assumptions:** Shape/sequence metadata separates different launch, occupancy, arithmetic, and data-movement behavior. Authors choose one representative per regime. +- **F decisions/constraints:** MoE regimes are based on sequence length; attention on query-token count; TopK on maximum pages/length. All benchmark workloads still face correctness acceptance; representative profiling is not evidence that every workload has identical counters. +- **F mechanism:** Group cases, profile representative hot paths with NCU, connect measured limitations to dispatch boundaries, then retain workload-specific fast paths. +- **F resource benefit/cost:** Smaller profiling focus and better shape-specific decisions are plausible benefits, but profiling-cost reduction is not measured. Specialization increases implementation/dispatch complexity. +- **F evidence:** Tables 3–5 enumerate all 19/23/128 cases by regime; Appendices A–C provide detailed slow-case evidence. +- **Limits/countersignals:** No formal clustering algorithm, sampling adequacy test, held-out workload validation, or cross-hardware validation. See reported conflicts below between main-text representatives and appendices. +- **P candidate rule:** Keep regime-specific correctness and latency records. Do not use a single averaged speedup or one profile as a universal kernel cost model. Reprofile when the shape mix or hardware changes. +- Source: [§3.2](https://arxiv.org/html/2608.14560v1#S3.SS2). + + + +# P: shared evidence boundary + +Keep analytical physical constraints, measured attainable envelopes and conditional Amdahl impact separate from empirical predictions or heuristic ranks. The existing performance-ceiling-analysis hierarchy is reused, not replaced. A learned runtime is not a physical lower bound; a profiler throughput percentage is not a guaranteed speedup. Queueing, overlap and bottleneck migration invalidate naive summation of component time. The task's own semantic/quality/SLO contract governs; paper thresholds are historical evidence. No local benchmark, installation, hardware measurement, implementation change, matrix edit or promotion was performed. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md new file mode 100644 index 000000000..c81dfb4e9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md @@ -0,0 +1,33 @@ +# Keep bounds, predictions and observations distinct + +Status: candidate; empirical_validation: not_run. This is a **P** integration supplement to the existing `performance-ceiling-analysis` three levels (analytical, empirical, Amdahl), not a fourth ceiling or a replacement. Existing lineage is recorded in the supplied Reference Matrix at revision4d61d2c: LLM-Viewer1893e4b, ERT0771fa9 and TensorRT-LLMf33e0e5fd. Those underlying artifacts were not re-mined here. + +## Four evidence labels, without changing the existing ceiling hierarchy + +1. **Conditional physical lower bound / capacity bound.** State workload, required FLOPs/bytes, datatype, resource, topology and assumptions. A roofline-style runtime floor max(required FLOPs/peak FLOP/s, required bytes/peak bytes/s) is conditional on those counts and peak definitions. It does not predict queueing, launch overhead, synchronization or realized utilization. Changing semantics, caching, sparsity or mandatory traffic changes the bound itself. Do not add compute and transfer floors when their overlap is unknown; do not call an observed bandwidth peak a universal physical limit. +2. **Empirical attainable envelope.** A measured roofline or best known kernel is hardware/software/workload-specific evidence. It may be useful for headroom, but a microbenchmark envelope is neither a proof of global optimality nor a guaranteed application target. Nothing in this pack supplies missing B300 or NPU peak/bandwidth measurements. +3. **Conditional whole-system impact.** For an unchanged serial decomposition with fraction f accelerated s-fold, Amdahl's expression1/((1−f)+f/s) translates local improvement into conditional end-to-end speedup. The maximum removable fraction f is useful for triage. Concurrent traces, queueing, batching and bottleneck migration violate a naive additive-time interpretation; identify exposed critical-path time before applying it. +4. **Empirical prediction or search heuristic.** Vidur's learned latency estimates, its equivalent-prefill reduction, FlashVector's time-share×expected-gain ranking, and an agent's extrapolated benefit are predictions/heuristics. They are not additional physical ceilings. Preserve calibration domain, uncertainty and observed validation errors beside every predicted shortlist rank. + +These labels answer different questions: impossible under the stated work/resource contract; attained by a matching measurement; possible whole-system impact under a decomposition; predicted candidate worth measuring. A candidate may have all four records, but one never substitutes for another. + +## Incremental requirements from this pack + +- **[Vidur V1–V3](../references/vidur.md):** attach phase/dependency signatures, request-state/queueing regime, interpolation versus extrapolation, and calibration residuals. A low operator error cannot certify near-capacity SLOs. +- **[InferenceBench I1–I3](../references/inferencebench.md):** final deployment validity, evaluation integrity and equal optimization budgets matter independently of peak speed. An impossible-looking measurement triggers an audit; it is not itself sufficient evidence of cheating. +- **[FlashVector F1–F4](../references/flashvector.md):** local time share, measurable noise and full-stack behavior gate promotion. Re-profile after changes; include host preprocessing and retune instance/batch settings when the bottleneck moves. +- **[Agentic Kernel Optimization](../references/agentic-kernel.md):** shape/regime-specific paths and empirical profile evidence can redirect search. Vendor-kernel comparisons and PyTorch comparisons require separate denominators. + +## P: minimal candidate decision record + +Record objective and absolute constraints; valid-work/quality contract; exact input/model/hardware/software identities; physical feasibility assumptions; empirical envelope provenance; predicted effect plus domain/uncertainty; measured exposed time share; candidate family and changed variables; setup/compile/measurement/finalization cost; rollback artifact; source locator; status. + +Use statuses `unmodeled`, `predicted`, `measured-invalid`, `measured-inconclusive`, `measured-valid`, `final-artifact-verified` only as proposed local vocabulary. Pack contents remain candidate/not_run and do not instantiate any of those measured states. No new workflow engine or tracker is proposed. + +## P: stopping and redirection rules + +- Stop claiming a rank when predicted differences are smaller than known error or when either candidate lies outside calibration coverage. Request the next discriminating observation. +- If even the conditional removable fraction is below the locally established detection threshold, park that target and inspect a larger exposed component. Keep setup cost and uncertainty explicit. +- If measurements reverse the predicted bottleneck, revise the model rather than tuning the same family harder by default. Do not discard a whole technique because one incompatible configuration fails. +- If an experiment regresses quality, semantics or final validity, restore the last valid artifact. A small fast probe is not final acceptance. +- If improvement disappears in a matched full-stack workload, report a local gain and reject service-level promotion. An honest null result is useful knowledge. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md new file mode 100644 index 000000000..f99d79a64 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md @@ -0,0 +1,26 @@ +# Redirect cross-layer optimization + +Use when a local kernel improvement does not improve serving, or a previous improvement changes the dominant cost. This is a proposed extension to `performance-ceiling-analysis`, `host-overhead-profiling`, `host-overhead-optimization` and `inference-optimization-casebook`. It adds no profiler installation, framework or automated production loop. + +Sources: [FlashVector](references/source-notes.md), [Agentic Kernel Optimization](references/source-notes.md), [bounds and predictions](references/source-notes.md). + +## Procedure (P) + +1. Fix the service objective, request semantics, absolute SLO, resource budget and correctness type. Snapshot representative baseline inputs/outputs and configuration identity. Keep request-level and candidate-row batch counts distinct. +2. Attribute exposed time to actual owners: kernel, graph/dispatch, server serialization, feature materialization/assembly, queue/batch scheduling. Do not add overlapping time shares or infer an owner merely from a tool's stack label. +3. Estimate conditional whole-system headroom, then rank hypotheses by plausible service impact, uncertainty and experiment cost. FlashVector's time-share×expected-gain score is a heuristic. Random layer sampling is its reported design, not a requirement or proven optimum. +4. If the potential removable share cannot beat locally measured uncertainty, redirect or explicitly justify more samples. Repeated measurements must test drift/correlation; never copy the paper's±6% or1/sqrt(k) behavior as a universal noise law. +5. Choose semantic transformations from evidence: expose fusion-hidden operations; reuse invariant work; eliminate needless host materialization; preallocate assembly; or choose a regime-specific kernel family. For views/shared memory, require lifetime/immutability/fallback evidence. For fusion, record register/shared-memory/occupancy trade-offs. +6. Validate the exact rewrite contract locally. Require full-stack replay under identical resources and workload before service-level acceptance. The proposed default acceptance is correctness plus a reproducible E2E improvement without any SLO regression; weaker non-regression-only acceptance must be separately justified by the user's goal. +7. Re-profile accepted changes and reopen configuration tuning. Vary instance count and batching under the same resource and SLO contract; more concurrency is not inherently better. Verify each selected row's measured inequalities. +8. Store model/workload/hardware-scoped accepted and rejected hypotheses. Refresh only when the approved task warrants it; paper descriptions of always-on behavior do not authorize a recurring task. + +## Output and stop + +Deliver before/after bottleneck ownership, candidate mechanism and trade-offs, correctness contract, component versus full-stack measurements, noise assumptions, SLO arithmetic, resource denominator and next redirected hypothesis. Stop on unresolved ownership, missing semantic/lifetime guarantees, sub-noise gain, unmeasured integration effects or unauthorized deployment. + +Do not convert FlashVector's30× serialization-step result into a30× service claim. Table4 ModelB has p99 above its stated SLO; it is a counterexample to accepting a caption without arithmetic. + +## Resource contract + +This procedure and its local `references/source-notes.md` are sufficient for selective consumption. The rest of Pack A supplies optional comparisons and integration notes; no parent-folder file is required to interpret the procedure or its source limits. Existing InferRSI skill names above are reconciliation targets, not runtime dependencies. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md new file mode 100644 index 000000000..932613bb7 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md @@ -0,0 +1,143 @@ +# FlashVector: source audit and mechanisms + +Status: candidate / empirical_validation: not_run. F = paper fact; P = proposed use. [FlashVector: Agent for Hierarchical Model Serving Stack Optimization, 2609.17391v1](https://arxiv.org/abs/2609.17391v1), submitted 2026-09-15. [Pinned HTML](https://arxiv.org/html/2609.17391v1), [PDF](https://arxiv.org/pdf/2609.17391v1). Title/ID/version verified. Production case studies are author reports; no code or deployed system inspected. + +## Exact readset + +§§1–7, emphasizing §3 challenges, §§4.1–4.2 knowledge/loop, Algorithm1, §§5.1–5.4 methods/results. All Tables1–4 and figure captions/discussion1–6 read. PDF p.4 Fig.3, p.5 Algorithm1/correctness/noise prose, p.7 Figs.5–6/Table2, and p.8 Tables3–4 visually checked. Figures1–2/4 are caption/text-only reads. There are no numbered cost-model equations or appendix in this version. The noise reduction relation and hypothesis scoring are unnumbered. No controlled ablation isolating random layer sampling, knowledge refinement, human cookbook, or always-on triggering is reported. + +## F1. Layer-local diagnosis with system-level acceptance + +- **Objective (F):** improve serving-stack throughput/latency while preserving predictions and production constraints. +- **Assumptions (F):** appropriate profiling and semantic context exist for each layer: GPU/kernel, framework graph, model server, feature processing; recorded model inputs/weights/outputs represent the intended workload. +- **Decisions / constraints (F):** Algorithm1 randomly samples one layer per iteration, profiles it, ranks hypotheses within that layer by time share × expected gain, and rejects hypotheses whose best possible gain is below measurement noise. This is not demonstrated as globally optimal layer selection. +- **Mechanism (F):** Profile→Diagnose→Plan/Apply→Verify; candidates beating the local incumbent/noise gate receive a full-stack load test; regressions revert. Post-run refinement records accepted/rejected context without indefinitely appending every trace. Release/age triggers re-open optimization. +- **Resource benefit / cost (F/P):** focuses specialist tooling/context and avoids optimizing tiny time shares; full-stack replay and increased sampling consume resources. The expected-gain score is a heuristic, not a measured runtime predictor or hardware ceiling. +- **Author evidence (F):** production case studies find serialization, feature processing, graph and kernel opportunities. Table1 includes both latency and throughput changes, e.g. retrieval1.67×/1.10×, ranking-model2 1.98×/2.00×. Hardware, request mix and absolute latency are not uniformly supplied for those table rows, so they cannot be imported as general expectations. +- **Limits / countersignals (F/P):** knowledge-refinement and continual triggering benefits are asserted, not isolated experimentally. Intro/§6 describe E2E gain above noise; Algorithm1 explicitly gates local gain then full-stack non-regression. For a local procedure, choose and declare the stricter desired acceptance rule rather than treating these descriptions as identical. +- **Candidate rule (P):** retain layer-specific observables and ownership; evaluate impact on the actual critical path and full service objective. After an accepted change, re-profile before choosing the next target. Store rejection reasons scoped to model/workload/hardware versions, rather than permanent bans on whole techniques. + +## F2. Noise-aware verification and typed correctness gates + +- **Objective (F):** prevent noise or output changes from being promoted as performance progress. +- **Assumptions / constraints (F):** repeated unchanged-baseline runs estimate noise; weights/inputs/baseline predictions recorded before rewriting. Deterministic order/precision-preserving changes require exact elementwise equality. Reordered floating point uses task/dtype bounds; approximations use business metrics; configuration uses a shadow canary at fixed latency SLO. +- **Mechanism (F):** reported E2E baseline spread is ±6%; 2–6% candidate gains get up to8× samples, with claimed 1/sqrt(k) shrinkage to2.1%. Full-stack testing follows local validation. +- **Author evidence (F):** §4.2 describes the protocol; §5 gives accepted cases. Per-kernel bounds are 1e-3 FP32/1e-2 FP16, while end-to-end reorder checks describe 1e-3 absolute deviation (1e-4 FP32) and at most0.1% outside the1e-3 bound; nonfinite results fail. These are this paper's settings, not a universal tolerance prescription. +- **Resource benefit / cost (F/P):** reduced false promotion at added replay cost. No raw no-op distribution, sample counts, autocorrelation analysis, or confidence level for ±6% is reported. +- **Limits / countersignals (P):** 1/sqrt(k) reduction needs a justified noise model; drift and correlated traffic can invalidate it. The stated end-to-end tolerance text needs precise implementation interpretation, especially its threshold and allowed-outlier clauses. Never loosen a user's correctness contract to reproduce a paper threshold. +- **Candidate rule (P):** estimate local paired/repeated uncertainty, preserve run order/load/cache state, and separate indeterminate from rejected. Do not assume8× samples guarantees a2.1% detectable gain. Declare exact-equality, numerical tolerance, approximation-quality and SLO gates before trials. + +## F3. Redirect from GPU work to host data movement + +- **Objective (F):** remove exposed CPU-side request preparation rather than optimizing only model kernels. +- **Assumptions / decisions (F):** string-heavy Triton input conversion; CPU feature processing with one context row and up to2,000 candidate rows; one pod with12 Python backend processes over14 vCPUs. Features/data ownership must permit views or native lookup. +- **Mechanism (F):** §5.1 converts a Python deserialization path to C++; §5.3 exposes numeric tensors as read-only native views, scans strings in C++, bypasses Python materialization when vocabulary lookup is the only consumer, pre-resolves safe routing with decode fallback, uses Cython for irregular per-element work, and writes features directly into preallocated output slices. +- **Resource benefit / cost (F):** removes Python objects, copies, concatenations and redundant assembly; adds native code and ownership constraints. This is local CPU/memory activity, not evidence for NIC/network optimization merely because inputs came over gRPC. +- **Author evidence (F):** serialization step up to30×, not whole-server30×. Table2 gives call-site speedups, not pod throughput. Table3's cumulative pod throughput progresses940→about1,200→about1,500 requests/s at a fixed latency SLO, overall1.6×; native kernels+assembly are combined in one stage, then zero-copy I/O. Exact SLO value and isolated contribution of the combined pieces are unreported. +- **Limits / countersignals (P):** no independent generalization to arbitrary feature pipelines. Native views require buffer lifetime and immutability checks; shared-memory lookup requires stable vocabulary semantics. Benchmark proof of ownership correctness is not supplied by a high speedup alone. +- **Candidate rule (P):** before a new kernel experiment, inspect serialization/materialization/assembly time shares. Propose views or native preprocessing only when required semantics/lifetimes are established; measure both the component and request-level result with the same pod CPU budget. + +## F4. Expose fusion opportunities, then retune serving configuration + +- **Objective (F):** reduce redundant graph/kernel work and retune concurrency after bottlenecks move. +- **Assumptions / decisions (F):** §5.2 multi-task recommendation model, AOTInductor, FP16, RTX PRO6000 Blackwell,2,000 candidates/request. §5.4 one GPU partition per pod; sweeps vary model-instance count and dynamic batch size, while queue policy is derived from SLO, not independently searched. +- **Mechanism (F):** precompute candidate-only/position-only attention pieces, fuse six kernels with intermediates retained in registers; decompose opaque embedding-bag into fusion-visible primitives; reuse semantic embeddings across branches. Configuration search replays captured production tensors under held load and validates via shadow canary. +- **Resource benefit / cost (F):** attention traffic falls to roughly one-third; register pressure/fusion eligibility can trade against memory savings. More instances/bigger batches consume memory and can raise tail latency, so neither monotonically improves throughput-at-SLO. +- **Author evidence (F):** §5.2 attention996.5→279.8µs (3.56× module speedup), bit-identical under preserved order/precision. Combined embedding/reuse changes reduce total GPU kernel time33.4%, forward latency30.1%, dispatcher share44.8→28.5%; these are different denominators and the combined gain is not each component's isolated effect. The dominant profile shifts toward GEMM. §5.4 reports >2× throughput variation across configurations of one code-optimized model, not a final2× gain for every model. +- **Limits / countersignals (F/P):** Table4 gives selected trial RPS/p99 but no per-row baseline RPS, so tuning speedup cannot be calculated. ModelB explicitly shows SLO250ms and measured p99=271ms despite the caption saying throughput sustained at SLO; treat compliance as unresolved. Other rows' smaller p99 do not validate this row. No GPU partition dimensions or total fleet-resource normalization is given. +- **Candidate rule (P):** use model semantics to distinguish request-invariant from candidate-varying work. After changing code, reopen instance/batch tuning under unchanged absolute SLO, resource budget and quality constraints. Require every selected trial to pass its own inequalities; never infer SLO compliance from a caption or aggregate gain. + + +# Agentic Kernel Optimization: pinned original-source extraction + +Status: candidate; empirical_validation: not_run. + +## Result and scope + +This paper is useful evidence for a correctness-gated, profiler-guided optimization campaign, workload-regime dispatch, and escalation from local tuning to structural redesign. It does **not** supply a quantitative physical lower-bound model, calibrated latency predictor, learned shortlist score, or controlled ablation of the agent workflow. Its numerical results are specific to CUDA kernels on a local NVIDIA B200 and the authors' contest evaluation. This extraction makes no portability, NPU, reproduction, or present implementation claim. + +Labels: **F** = paper fact or author-reported observation; **F-hypothesis** = a future direction or interpretation explicitly proposed by the authors, not a demonstrated improvement; **P** = candidate operational rule proposed by this extraction. Analytical checks and reporting cautions are explicitly identified rather than attributed to the authors. + +## Provenance and exact readset + +- Verified requested ID/title match: **arXiv:2608.14560v1**, **Agentic Kernel Optimization: Generating State-of-the-Art GPU Kernels Without Hand-Written CUDA**. +- Authors: Mao Luo, Hongbin Li, Feng Lin, Hanling Yi, Zhe Huang; Intellifusion Inc. +- Original arXiv submission history displays **25 May 2026, 02:50:41 UTC**, v1 only. PDF and HTML display **25 May 2026**. Preserve this date as reported: it does not align with the August-style `2608` identifier; the discrepancy is unresolved, not silently repaired. +- Verified 2026-10-15 using [versioned abstract](https://arxiv.org/abs/2608.14560v1), [versioned HTML](https://arxiv.org/html/2608.14560v1), and [versioned PDF](https://arxiv.org/pdf/2608.14560v1). PDF is 12 pages. +- Original PDF/HTML, text extracts and figure renders were retained outside the deliverable tree; only this derivative extraction is delivered. +- PDF SHA-256: `d0f04ea7a63af331b1de4567c655e4ca88bdf0f9af8818aaf9edfd5a7c1ff991`. +- HTML SHA-256: `bceb7f6766f8c0456a387ebaab5e89929222267010f14cba79e307e3c3dcd83e`. +- Read all PDF text, pp. 1–12: Abstract; §1; §§2.1, 2.2, 2.3; §§3.1.1–3.1.3 and 3.2.1–3.2.3; both discussion subsections in §4; §5; Acknowledgments; reference list; Appendices A.1–A.4, including A.3.1–A.3.2; B.1–B.4, including B.3.1–B.3.2; C.1–C.4, including C.3.1–C.3.2. +- Read all **Tables 1–21**, including captions, units, and adjacent interpretation. Figures **1–4** were read visually from rendered PDF pages 2–4, including workflow arrows and trajectory annotations. Approximate annotations, rather than digitized curve positions, are used below. +- Read mathematical expressions: §3.1.2 sparse-attention logits `(q_nope K_c^T) + (q_pe K_p^T)` and attention-weighted output; §3.1.3 unnumbered TopK score `score(t) = sum_h ReLU(Q_h K_t^T) w_h`; C.3.1 unnumbered batch-indexed equivalent. There are **no numbered cost-model equations** in this version. +- Checked `prior-foundation-pack` and `supplier-research-cache/source-notes` for the title/ID: no existing coverage found. No repository was read or run; author-linked implementation is not needed to support the extraction. + +### M4. Workload-regime diagnosis instead of one global bottleneck label + +- **F objective:** Explain speedups and choose specializations using a few distinct execution regimes. +- **F assumptions:** Shape/sequence metadata separates different launch, occupancy, arithmetic, and data-movement behavior. Authors choose one representative per regime. +- **F decisions/constraints:** MoE regimes are based on sequence length; attention on query-token count; TopK on maximum pages/length. All benchmark workloads still face correctness acceptance; representative profiling is not evidence that every workload has identical counters. +- **F mechanism:** Group cases, profile representative hot paths with NCU, connect measured limitations to dispatch boundaries, then retain workload-specific fast paths. +- **F resource benefit/cost:** Smaller profiling focus and better shape-specific decisions are plausible benefits, but profiling-cost reduction is not measured. Specialization increases implementation/dispatch complexity. +- **F evidence:** Tables 3–5 enumerate all 19/23/128 cases by regime; Appendices A–C provide detailed slow-case evidence. +- **Limits/countersignals:** No formal clustering algorithm, sampling adequacy test, held-out workload validation, or cross-hardware validation. See reported conflicts below between main-text representatives and appendices. +- **P candidate rule:** Keep regime-specific correctness and latency records. Do not use a single averaged speedup or one profile as a universal kernel cost model. Reprofile when the shape mix or hardware changes. +- Source: [§3.2](https://arxiv.org/html/2608.14560v1#S3.SS2). + +## 2. Kernel mechanisms and their resource trade-offs + +### M5. MoE: keep metadata on device, dispatch GEMM backends, inspect producer–consumer traffic + +- **F objective:** Accelerate DeepSeek-V3-style MoE routing, activation gathering/quantization, two expert GEMMs with SwiGLU, and weighted scatter. +- **F assumptions/semantics:** Eight routing groups, group top-2, final top-8 experts; FP8 contiguous activation layout with FP32 block scales over 128 values; GEMM1 `[T,7168] → [T,4096]`, then SwiGLU and requantization; GEMM2 `[T,2048] → [T,7168]`. +- **F decisions/constraints:** Device-side metadata avoids hot-path `cudaStreamSynchronize`. One compiled module contains CUTLASS FP8 blockwise, a custom tcgen05 backend, and a cuBLAS FP16 fallback for very large T. Exact dispatch thresholds are not supplied. The text calls tcgen05 “hand-written” while globally claiming no human-written kernel code; this wording does not establish human authorship, and the inconsistency should not be silently resolved. +- **F mechanism:** Backend/tiling selection by workload, pipeline overlap, fused scan/scatter, static compilation, newer matrix instructions, and small-T routing changes accumulate improvements (Figure 2). For the long profiled case CUTLASS is selected because the authors report it is 2–7% faster than their tcgen05 implementation in long cases. +- **F resource benefit/cost:** Less host synchronization and interstage traffic; strong matrix throughput but high registers/shared memory. Appendix A gives 168 registers/thread and 201.22 KB dynamic shared memory/CTA, one resident CTA/SM, and 14.09% achieved occupancy. +- **F evidence:** Final local aggregate 92.68× relative to PyTorch for 1.05B tokens, with FlashInfer at 47.08× on the same reported local comparison. Long-case NCU has GEMM1 600.22 µs, GEMM2 383.26 µs, total iteration 1261.94 µs. Scatter is 81.31 µs and 62.92% of peak sustained DRAM throughput, making it the largest non-GEMM DRAM consumer. +- **F-hypothesis:** Fuse pull-scatter into the GEMM2 epilogue so producer/consumer values avoid a separate global-memory stage. Authors leave this undone because of an upstream CUTLASS API constraint. +- **Limits/countersignals:** Low occupancy alone does not prove low useful performance. Conversely, the main-text 97%/95% SM-utilization statement and appendix's 43.80–57.55% SM-throughput figures use unmatched metric definitions and possibly different collection windows. Their comparison remains unresolved, not a proven contradiction or evidence of physical saturation. Scatter's 6.4% of iteration time caps any benefit from removing only that measured cost; broader fusion interactions are not measured. +- **P candidate rule:** Retain per-regime backend comparisons instead of assuming a newer instruction path always wins. Prioritize interstage movement only after measuring its fraction and validating integration feasibility; do not convert proposed epilogue fusion into an achieved result. +- Sources: [§3.1.1](https://arxiv.org/html/2608.14560v1#S3.SS1.SSS1), [§3.2.1](https://arxiv.org/html/2608.14560v1#S3.SS2.SSS1), [Appendix A](https://arxiv.org/html/2608.14560v1#A1). + +### M6. Sparse attention: trade Split-K parallelism against merge overhead and register pressure + +- **F objective:** Compute paged decoding attention over 2048 selected KV entries, producing 512 output dimensions and LSE. +- **F assumptions/semantics:** Logits combine non-positional and positional dot products; base-2 softmax; output accumulates weights against K_c. Exact benchmark accuracy constraints limit lower precision. +- **F decisions/constraints:** Four heads per CTA; 128 threads/four warps, one warp per head. Use a two-stage asynchronous global-to-shared pipeline and double buffering. Single token takes a fused single-pass path; two tokens use templated Split-K=64; larger batches use Split-K=32. Merge divides output into four slices; BF16 partial results reduce merge traffic. +- **F mechanism:** Increase useful work parallelism when batch size is small while bypassing an unnecessary merge for a singleton. Register-resident query/output, branchless online softmax, and reordered blocks support the pipeline and locality. +- **F resource benefit/cost:** More Split-K CTAs can hide latency but add partial storage/reduction and launch cost. Registers and shared memory constrain residency; final eight-token partial kernel uses 192 registers/thread, 73.98 KB/CTA in Appendix B, and 10.07% achieved occupancy. Main text says about 50 KB; preserve that conflict. +- **F evidence:** Final local aggregate 181.35× PyTorch, FlashInfer 10.33×, 427M tokens. Final slow-case partial is 17.73 µs; merge 8.58 µs; total 26.31 µs. Partial has 17.68% SM throughput and 1.58% DRAM throughput; 1024 CTAs, 3.46 waves/SM. Merge has 128 CTAs, 0.17 waves/SM, 1.81% SM throughput, 0.77% DRAM throughput. Thus low memory utilization does not mean data access is irrelevant: poorly hidden gather/staging latency is the authors' explanation. +- **F-hypothesis:** Reduce register pressure or redesign around TMA/warpgroups/tcgen05. Additional local fusion is said to be unlikely to address the structural bottleneck. Lower precision is constrained by correctness, not a free optimization. +- **Limits/countersignals:** Authors use a single warmup and single NVTX-scoped measurement for this profiler capture. Phase timing is source-mapped PC-sampling attribution, not separately timed phases. No controlled Split-K sweep or precision-error curve is published. Main text calls merge partitioning the largest gain, while the cumulative annotations show larger absolute steps earlier; causal ranking is not established. +- **P candidate rule:** Classify latency/occupancy limits separately from bandwidth saturation. Adjust split/merge structure by regime, recording both stages. Any proposed register-reduction or tensor-core path must earn correctness and whole-iteration timing, not only a favorable occupancy estimate. +- Sources: [§3.1.2](https://arxiv.org/html/2608.14560v1#S3.SS1.SSS2), [§3.2.2](https://arxiv.org/html/2608.14560v1#S3.SS2.SSS2), [Appendix B](https://arxiv.org/html/2608.14560v1#A2). + +### M7. TopK: semantic fast paths before arithmetic tuning + +- **F objective:** Return the exact selected indices for weighted, rectified dot-product scores. +- **F assumptions/semantics:** FP8 Q has 64 heads × 128 dimensions; paged FP8 K has per-token FP32 scales; K=2048 selections. Required matched-index ratio is 1.0. When sequence length is at most K, every valid token is selected and score computation is unnecessary for this output contract. Pages contain 64 tokens, so max pages ≤32 implies the whole batch qualifies for this specialization. +- **F decisions/constraints:** Dispatch on each element's actual sequence length entirely on device. Preserve bit-exact dequantization and index semantics. For mixed batches only long elements calculate scores; short elements map block-table indices and pad remaining entries with -1. +- **F mechanism:** Bypass GEMM and selection for short sequences. Otherwise fuse dot products, ReLU, head weights, and reduction. Use padded shared layouts (key stride 129; cross-warp partials `[16][33]` rather than `[16][32]`) and a four-pass 8-bit radix selection using sortable float representations, early termination, subgroup histograms, suffix scanning, and ballot-based gather. Increase radix threads from 256 to 512 to reduce per-thread loop work. +- **F resource benefit/cost:** Eliminate unnecessary score/selection computation for eligible inputs; remove 32-way bank conflicts and serialized selection work. Exact-match requirements lead the slow-case score kernel to scalar FP32 dots rather than tensor cores. Extra fast/slow paths complicate scheduling and can leave many CTAs immediately returning. +- **F evidence:** Final local aggregate 1101.02× PyTorch, FlashInfer 52.03×, 414M tokens. Of 128 workloads, 69 are in the two all-short regimes and 59 in the long regime (this count addition is an extraction calculation from Table 5). Appendix C's worst-speedup case is 107.29× the mathematical reference. Only one of four batch elements exceeds K; score and radix stages total 24.86 µs, with low useful device coverage. +- **Limits/countersignals:** The huge PyTorch-relative average is strongly influenced by eliminating work that PyTorch still performs; it is not an across-the-board 1101× faster GEMM. Main text describes a three-kernel pipeline, but Appendix C explicitly invokes two kernels and handles remapping inline. Benchmark exact-match constraints are narrower than generic approximate TopK usefulness. +- **P candidate rule:** Prove a semantics-preserving shape/value-metadata shortcut before considering lower-level tuning. Report fast-path hit rate and slow-path performance separately; never generalize an aggregate shortcut-dominated result to larger sequences or a different output ordering/tie contract. +- Sources: [§3.1.3](https://arxiv.org/html/2608.14560v1#S3.SS1.SSS3), [§3.2.3](https://arxiv.org/html/2608.14560v1#S3.SS2.SSS3), [Appendix C](https://arxiv.org/html/2608.14560v1#A3). + +### M8. TopK residual scheduling limitation and evidence granularity + +- **F objective:** Explain the slow mixed-batch case after semantic work elimination and local shared-memory improvements. +- **F assumptions:** Small active batch count can limit whole-device coverage even when occupancy counters within active execution are nontrivial. +- **F decisions/constraints:** Keep exact scalar path where required; distinguish launched CTA count from CTAs doing score computation. +- **F mechanism/evidence:** Score grid is 288 CTAs but three of four batch elements exit early. Radix grid is four CTAs, one per element; only one performs all radix work over 2241 keys. Radix's reported 23.54% achieved occupancy coexists with just 0.01 waves over 148 SMs and 0.16% SM throughput. Those counters are not interchangeable notions of global utilization. +- **F resource benefit/cost:** Fast exits save work but leave scheduling/parallelism limits. Radix stage 13.18 µs is slightly larger than score stage 11.68 µs. The reported phase attribution says fast-path remapping for the three short elements is the largest radix component (3.14 µs), followed by ballot gather (2.30 µs) and histograms (1.98 µs). +- **F-hypothesis:** A persistent or globally scheduled combined fast/slow path could use more SMs; a tensor-core long-sequence path could coexist with scalar exact paths where needed. Neither is implemented/evaluated in the paper. +- **Limits/countersignals:** Four-CTA radix PC sampling is sparse. Its phase allocation uses executed warp instructions as a proxy; these estimated phase times cannot be treated as direct microbenchmarks or physical lower bounds. +- **P candidate rule:** For tiny or mixed grids, record useful CTAs, waves, active fractions, and launch count alongside occupancy. Require measurement of the full mixed batch before accepting persistent scheduling as better. +- Source: [C.2–C.4](https://arxiv.org/html/2608.14560v1#A3.SS2). + + + +# P: shared evidence boundary + +Keep analytical physical constraints, measured attainable envelopes and conditional Amdahl impact separate from empirical predictions or heuristic ranks. The existing performance-ceiling-analysis hierarchy is reused, not replaced. A learned runtime is not a physical lower bound; a profiler throughput percentage is not a guaranteed speedup. Queueing, overlap and bottleneck migration invalidate naive summation of component time. The task's own semantic/quality/SLO contract governs; paper thresholds are historical evidence. No local benchmark, installation, hardware measurement, implementation change, matrix edit or promotion was performed. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md new file mode 100644 index 000000000..9b9e4c0cd --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md @@ -0,0 +1,304 @@ +# Agentic Kernel Optimization: pinned original-source extraction + +Status: candidate; empirical_validation: not_run. + +## Result and scope + +This paper is useful evidence for a correctness-gated, profiler-guided optimization campaign, workload-regime dispatch, and escalation from local tuning to structural redesign. It does **not** supply a quantitative physical lower-bound model, calibrated latency predictor, learned shortlist score, or controlled ablation of the agent workflow. Its numerical results are specific to CUDA kernels on a local NVIDIA B200 and the authors' contest evaluation. This extraction makes no portability, NPU, reproduction, or present implementation claim. + +Labels: **F** = paper fact or author-reported observation; **F-hypothesis** = a future direction or interpretation explicitly proposed by the authors, not a demonstrated improvement; **P** = candidate operational rule proposed by this extraction. Analytical checks and reporting cautions are explicitly identified rather than attributed to the authors. + +## Provenance and exact readset + +- Verified requested ID/title match: **arXiv:2608.14560v1**, **Agentic Kernel Optimization: Generating State-of-the-Art GPU Kernels Without Hand-Written CUDA**. +- Authors: Mao Luo, Hongbin Li, Feng Lin, Hanling Yi, Zhe Huang; Intellifusion Inc. +- Original arXiv submission history displays **25 May 2026, 02:50:41 UTC**, v1 only. PDF and HTML display **25 May 2026**. Preserve this date as reported: it does not align with the August-style `2608` identifier; the discrepancy is unresolved, not silently repaired. +- Verified 2026-10-15 using [versioned abstract](https://arxiv.org/abs/2608.14560v1), [versioned HTML](https://arxiv.org/html/2608.14560v1), and [versioned PDF](https://arxiv.org/pdf/2608.14560v1). PDF is 12 pages. +- Original PDF/HTML, text extracts and figure renders were retained outside the deliverable tree; only this derivative extraction is delivered. +- PDF SHA-256: `d0f04ea7a63af331b1de4567c655e4ca88bdf0f9af8818aaf9edfd5a7c1ff991`. +- HTML SHA-256: `bceb7f6766f8c0456a387ebaab5e89929222267010f14cba79e307e3c3dcd83e`. +- Read all PDF text, pp. 1–12: Abstract; §1; §§2.1, 2.2, 2.3; §§3.1.1–3.1.3 and 3.2.1–3.2.3; both discussion subsections in §4; §5; Acknowledgments; reference list; Appendices A.1–A.4, including A.3.1–A.3.2; B.1–B.4, including B.3.1–B.3.2; C.1–C.4, including C.3.1–C.3.2. +- Read all **Tables 1–21**, including captions, units, and adjacent interpretation. Figures **1–4** were read visually from rendered PDF pages 2–4, including workflow arrows and trajectory annotations. Approximate annotations, rather than digitized curve positions, are used below. +- Read mathematical expressions: §3.1.2 sparse-attention logits `(q_nope K_c^T) + (q_pe K_p^T)` and attention-weighted output; §3.1.3 unnumbered TopK score `score(t) = sum_h ReLU(Q_h K_t^T) w_h`; C.3.1 unnumbered batch-indexed equivalent. There are **no numbered cost-model equations** in this version. +- Checked `prior-foundation-pack` and `supplier-research-cache/source-notes` for the title/ID: no existing coverage found. No repository was read or run; author-linked implementation is not needed to support the extraction. + +## 1. What is actually modeled, shortlisted, measured, and redirected + +### M1. Profile/history-driven candidate search + +- **F objective:** Improve kernel speed subject to all benchmark correctness conditions. +- **F assumptions:** A fixed reference, workload definition, harness, configuration, and dataset are available; CUDA candidates can be built and tested in isolated GPU environments; NCU and run history are available to the planning role. +- **F decisions/constraints:** Only kernel implementation is editable. Numerical failures, runtime errors, and timeouts invalidate a candidate. The framework can coordinate heterogeneous CLI agents, but the actual campaign says its Houmao agents used Claude Code with Claude Opus 4.6 and isolated context windows; mentioning Codex as a supported CLI does not establish a controlled mixed-model comparison. +- **F mechanism:** Planner receives current incumbent, NCU reports, and records of kernels/metrics/decisions. Parallel coders implement and benchmark different proposals. Synthesizer selects and merges useful changes and validates the updated result. Profiler supplies bottleneck reports. Researcher supplies external examples on demand. Figure 1 explicitly feeds results, decisions, profiler output, and notes back into history and planning. +- **F resource benefit/cost:** Parallel exploration and reuse of profiling/history can reduce serial search and repeated mistakes, but the paper does not quantify either saving. Reported expenditure is approximately 1.9 billion agent tokens across the three campaigns; GPU-hours, monetary cost, wall time, role-level token attribution, and parallel coder count are not given. +- **F evidence:** Workflow description/diagram, cumulative trajectories, and final kernel performance. No controlled comparison to one agent, random search, no-profiler search, or a human-only campaign. +- **Limits/countersignals:** No mathematical acquisition function, uncertainty estimate, quantitative candidate-ranking criterion, exact candidate budget, exact stall threshold, or prediction error evaluation. The Synthesizer's selection is qualitative. Campaign success alone cannot identify the causal value of each role. +- **P candidate rule:** Maintain an experiment record with workload regime, correctness gate, incumbent, proposed bottleneck, measurable predicted direction, observed result, and retained/rejected decision; use that record plus fresh profiles to choose the next small candidate set. Treat any numeric ranking model as a separate proposal requiring validation, not a method recovered from this paper. +- Source: [§2.1](https://arxiv.org/html/2608.14560v1#S2.SS1), [Figure 1](https://arxiv.org/html/2608.14560v1#S1.F1), [§2.3](https://arxiv.org/html/2608.14560v1#S2.SS3). + +### M2. Correctness and anti-exploitation gates + +- **F objective:** Ensure speed gains represent a deployable computation rather than changes to the evaluation or reuse of test outputs. +- **F assumptions:** Repeated benchmark iterations can expose stable tensor identities; an ordinary output comparison alone may fail to detect identity-based output caching. +- **F decisions/constraints:** Freeze non-kernel surfaces. Reject sample-specific shortcuts, tensor-identity output caches, and cross-iteration buffer reuse. Require separate cold and warm measurements if a legitimate deployable cache is material. +- **F mechanism:** Apply all-correctness acceptance before speedup selection; provide anti-hacking rules in each agent's initial prompt. Tool/environment notes include tensor cloning, L2 flushing, cold-cache and no-CUDA-graph defaults. +- **F resource benefit/cost:** Avoid spending tokens optimizing invalid objectives and avoid selecting artificial speedups. No measured anti-hacking overhead or ablation is reported. +- **F evidence:** Early MoE candidates reportedly exceeded 1000× because the in-process harness reused tensor pointers and the generated program returned cached outputs after its first execution. The paper identifies those results as invalid, not achievements to include in the final campaign. +- **Limits/countersignals:** Prompt restrictions are described; the paper does not establish a formal proof or exhaustive adversarial test of the final candidates. General correctness tolerances are not fully enumerated in the paper. TopK has the explicit matched-index ratio of 1.0. +- **P candidate rule:** Before recording a new incumbent, preserve harness identity and validate behavior on fresh content/identities consistent with the authorized workload. Record cache state and graph mode with each timing. Huge gains trigger an evaluation-path audit before resource-model conclusions. +- Source: [§2.1](https://arxiv.org/html/2608.14560v1#S2.SS1), [Table 2](https://arxiv.org/html/2608.14560v1#S2.T2), [§4](https://arxiv.org/html/2608.14560v1#S4). + +### M3. Stall-triggered research and human search correction + +- **F objective:** Escape unproductive local optimization and avoid discarding useful ideas because an unrelated defect was blamed on them. +- **F assumptions:** Agents are competent at local implementation but can under-explore references, prefer small changes after a plateau, and misattribute a failure. +- **F decisions/constraints:** After several failures in one direction, consult the research role; after no improvement within an allotted time, return to the Planner. Humans supply references or redirect strategy; authors say humans neither reviewed nor edited kernel code. +- **F mechanism:** A structured escalation path changes the search direction rather than continuing near-identical local attempts. Supplied references include DeepGEMM, FlashInfer, and RadiK; reusable skills cover architecture, profiling, and independent review. +- **F resource benefit/cost:** Intended reduction of futile token/GPU exploration; no intervention-level cost or return is measured. +- **F evidence:** Three qualitative recurring failure modes in §2.2; trajectories show stepwise gains after increasingly specialized changes. No intervention log, frequency, counterfactual, or controlled human-removal ablation. +- **Limits/countersignals:** The paper's broad suggestion that limited domain knowledge may suffice is not demonstrated across users/tasks. No reproducible numerical threshold defines a plateau. +- **P candidate rule:** Escalate only after logging why repeated attempts failed; distinguish invalid implementation from a falsified optimization hypothesis. Supply a novel reference or structural alternative when evidence contradicts the current search direction. Define local attempt/time budgets explicitly for a new workflow; these would be proposed policy parameters, not paper facts. +- Source: [§2.2](https://arxiv.org/html/2608.14560v1#S2.SS2), [§4](https://arxiv.org/html/2608.14560v1#S4). + +### M4. Workload-regime diagnosis instead of one global bottleneck label + +- **F objective:** Explain speedups and choose specializations using a few distinct execution regimes. +- **F assumptions:** Shape/sequence metadata separates different launch, occupancy, arithmetic, and data-movement behavior. Authors choose one representative per regime. +- **F decisions/constraints:** MoE regimes are based on sequence length; attention on query-token count; TopK on maximum pages/length. All benchmark workloads still face correctness acceptance; representative profiling is not evidence that every workload has identical counters. +- **F mechanism:** Group cases, profile representative hot paths with NCU, connect measured limitations to dispatch boundaries, then retain workload-specific fast paths. +- **F resource benefit/cost:** Smaller profiling focus and better shape-specific decisions are plausible benefits, but profiling-cost reduction is not measured. Specialization increases implementation/dispatch complexity. +- **F evidence:** Tables 3–5 enumerate all 19/23/128 cases by regime; Appendices A–C provide detailed slow-case evidence. +- **Limits/countersignals:** No formal clustering algorithm, sampling adequacy test, held-out workload validation, or cross-hardware validation. See reported conflicts below between main-text representatives and appendices. +- **P candidate rule:** Keep regime-specific correctness and latency records. Do not use a single averaged speedup or one profile as a universal kernel cost model. Reprofile when the shape mix or hardware changes. +- Source: [§3.2](https://arxiv.org/html/2608.14560v1#S3.SS2). + +## 2. Kernel mechanisms and their resource trade-offs + +### M5. MoE: keep metadata on device, dispatch GEMM backends, inspect producer–consumer traffic + +- **F objective:** Accelerate DeepSeek-V3-style MoE routing, activation gathering/quantization, two expert GEMMs with SwiGLU, and weighted scatter. +- **F assumptions/semantics:** Eight routing groups, group top-2, final top-8 experts; FP8 contiguous activation layout with FP32 block scales over 128 values; GEMM1 `[T,7168] → [T,4096]`, then SwiGLU and requantization; GEMM2 `[T,2048] → [T,7168]`. +- **F decisions/constraints:** Device-side metadata avoids hot-path `cudaStreamSynchronize`. One compiled module contains CUTLASS FP8 blockwise, a custom tcgen05 backend, and a cuBLAS FP16 fallback for very large T. Exact dispatch thresholds are not supplied. The text calls tcgen05 “hand-written” while globally claiming no human-written kernel code; this wording does not establish human authorship, and the inconsistency should not be silently resolved. +- **F mechanism:** Backend/tiling selection by workload, pipeline overlap, fused scan/scatter, static compilation, newer matrix instructions, and small-T routing changes accumulate improvements (Figure 2). For the long profiled case CUTLASS is selected because the authors report it is 2–7% faster than their tcgen05 implementation in long cases. +- **F resource benefit/cost:** Less host synchronization and interstage traffic; strong matrix throughput but high registers/shared memory. Appendix A gives 168 registers/thread and 201.22 KB dynamic shared memory/CTA, one resident CTA/SM, and 14.09% achieved occupancy. +- **F evidence:** Final local aggregate 92.68× relative to PyTorch for 1.05B tokens, with FlashInfer at 47.08× on the same reported local comparison. Long-case NCU has GEMM1 600.22 µs, GEMM2 383.26 µs, total iteration 1261.94 µs. Scatter is 81.31 µs and 62.92% of peak sustained DRAM throughput, making it the largest non-GEMM DRAM consumer. +- **F-hypothesis:** Fuse pull-scatter into the GEMM2 epilogue so producer/consumer values avoid a separate global-memory stage. Authors leave this undone because of an upstream CUTLASS API constraint. +- **Limits/countersignals:** Low occupancy alone does not prove low useful performance. Conversely, the main-text 97%/95% SM-utilization statement and appendix's 43.80–57.55% SM-throughput figures use unmatched metric definitions and possibly different collection windows. Their comparison remains unresolved, not a proven contradiction or evidence of physical saturation. Scatter's 6.4% of iteration time caps any benefit from removing only that measured cost; broader fusion interactions are not measured. +- **P candidate rule:** Retain per-regime backend comparisons instead of assuming a newer instruction path always wins. Prioritize interstage movement only after measuring its fraction and validating integration feasibility; do not convert proposed epilogue fusion into an achieved result. +- Sources: [§3.1.1](https://arxiv.org/html/2608.14560v1#S3.SS1.SSS1), [§3.2.1](https://arxiv.org/html/2608.14560v1#S3.SS2.SSS1), [Appendix A](https://arxiv.org/html/2608.14560v1#A1). + +### M6. Sparse attention: trade Split-K parallelism against merge overhead and register pressure + +- **F objective:** Compute paged decoding attention over 2048 selected KV entries, producing 512 output dimensions and LSE. +- **F assumptions/semantics:** Logits combine non-positional and positional dot products; base-2 softmax; output accumulates weights against K_c. Exact benchmark accuracy constraints limit lower precision. +- **F decisions/constraints:** Four heads per CTA; 128 threads/four warps, one warp per head. Use a two-stage asynchronous global-to-shared pipeline and double buffering. Single token takes a fused single-pass path; two tokens use templated Split-K=64; larger batches use Split-K=32. Merge divides output into four slices; BF16 partial results reduce merge traffic. +- **F mechanism:** Increase useful work parallelism when batch size is small while bypassing an unnecessary merge for a singleton. Register-resident query/output, branchless online softmax, and reordered blocks support the pipeline and locality. +- **F resource benefit/cost:** More Split-K CTAs can hide latency but add partial storage/reduction and launch cost. Registers and shared memory constrain residency; final eight-token partial kernel uses 192 registers/thread, 73.98 KB/CTA in Appendix B, and 10.07% achieved occupancy. Main text says about 50 KB; preserve that conflict. +- **F evidence:** Final local aggregate 181.35× PyTorch, FlashInfer 10.33×, 427M tokens. Final slow-case partial is 17.73 µs; merge 8.58 µs; total 26.31 µs. Partial has 17.68% SM throughput and 1.58% DRAM throughput; 1024 CTAs, 3.46 waves/SM. Merge has 128 CTAs, 0.17 waves/SM, 1.81% SM throughput, 0.77% DRAM throughput. Thus low memory utilization does not mean data access is irrelevant: poorly hidden gather/staging latency is the authors' explanation. +- **F-hypothesis:** Reduce register pressure or redesign around TMA/warpgroups/tcgen05. Additional local fusion is said to be unlikely to address the structural bottleneck. Lower precision is constrained by correctness, not a free optimization. +- **Limits/countersignals:** Authors use a single warmup and single NVTX-scoped measurement for this profiler capture. Phase timing is source-mapped PC-sampling attribution, not separately timed phases. No controlled Split-K sweep or precision-error curve is published. Main text calls merge partitioning the largest gain, while the cumulative annotations show larger absolute steps earlier; causal ranking is not established. +- **P candidate rule:** Classify latency/occupancy limits separately from bandwidth saturation. Adjust split/merge structure by regime, recording both stages. Any proposed register-reduction or tensor-core path must earn correctness and whole-iteration timing, not only a favorable occupancy estimate. +- Sources: [§3.1.2](https://arxiv.org/html/2608.14560v1#S3.SS1.SSS2), [§3.2.2](https://arxiv.org/html/2608.14560v1#S3.SS2.SSS2), [Appendix B](https://arxiv.org/html/2608.14560v1#A2). + +### M7. TopK: semantic fast paths before arithmetic tuning + +- **F objective:** Return the exact selected indices for weighted, rectified dot-product scores. +- **F assumptions/semantics:** FP8 Q has 64 heads × 128 dimensions; paged FP8 K has per-token FP32 scales; K=2048 selections. Required matched-index ratio is 1.0. When sequence length is at most K, every valid token is selected and score computation is unnecessary for this output contract. Pages contain 64 tokens, so max pages ≤32 implies the whole batch qualifies for this specialization. +- **F decisions/constraints:** Dispatch on each element's actual sequence length entirely on device. Preserve bit-exact dequantization and index semantics. For mixed batches only long elements calculate scores; short elements map block-table indices and pad remaining entries with -1. +- **F mechanism:** Bypass GEMM and selection for short sequences. Otherwise fuse dot products, ReLU, head weights, and reduction. Use padded shared layouts (key stride 129; cross-warp partials `[16][33]` rather than `[16][32]`) and a four-pass 8-bit radix selection using sortable float representations, early termination, subgroup histograms, suffix scanning, and ballot-based gather. Increase radix threads from 256 to 512 to reduce per-thread loop work. +- **F resource benefit/cost:** Eliminate unnecessary score/selection computation for eligible inputs; remove 32-way bank conflicts and serialized selection work. Exact-match requirements lead the slow-case score kernel to scalar FP32 dots rather than tensor cores. Extra fast/slow paths complicate scheduling and can leave many CTAs immediately returning. +- **F evidence:** Final local aggregate 1101.02× PyTorch, FlashInfer 52.03×, 414M tokens. Of 128 workloads, 69 are in the two all-short regimes and 59 in the long regime (this count addition is an extraction calculation from Table 5). Appendix C's worst-speedup case is 107.29× the mathematical reference. Only one of four batch elements exceeds K; score and radix stages total 24.86 µs, with low useful device coverage. +- **Limits/countersignals:** The huge PyTorch-relative average is strongly influenced by eliminating work that PyTorch still performs; it is not an across-the-board 1101× faster GEMM. Main text describes a three-kernel pipeline, but Appendix C explicitly invokes two kernels and handles remapping inline. Benchmark exact-match constraints are narrower than generic approximate TopK usefulness. +- **P candidate rule:** Prove a semantics-preserving shape/value-metadata shortcut before considering lower-level tuning. Report fast-path hit rate and slow-path performance separately; never generalize an aggregate shortcut-dominated result to larger sequences or a different output ordering/tie contract. +- Sources: [§3.1.3](https://arxiv.org/html/2608.14560v1#S3.SS1.SSS3), [§3.2.3](https://arxiv.org/html/2608.14560v1#S3.SS2.SSS3), [Appendix C](https://arxiv.org/html/2608.14560v1#A3). + +### M8. TopK residual scheduling limitation and evidence granularity + +- **F objective:** Explain the slow mixed-batch case after semantic work elimination and local shared-memory improvements. +- **F assumptions:** Small active batch count can limit whole-device coverage even when occupancy counters within active execution are nontrivial. +- **F decisions/constraints:** Keep exact scalar path where required; distinguish launched CTA count from CTAs doing score computation. +- **F mechanism/evidence:** Score grid is 288 CTAs but three of four batch elements exit early. Radix grid is four CTAs, one per element; only one performs all radix work over 2241 keys. Radix's reported 23.54% achieved occupancy coexists with just 0.01 waves over 148 SMs and 0.16% SM throughput. Those counters are not interchangeable notions of global utilization. +- **F resource benefit/cost:** Fast exits save work but leave scheduling/parallelism limits. Radix stage 13.18 µs is slightly larger than score stage 11.68 µs. The reported phase attribution says fast-path remapping for the three short elements is the largest radix component (3.14 µs), followed by ballot gather (2.30 µs) and histograms (1.98 µs). +- **F-hypothesis:** A persistent or globally scheduled combined fast/slow path could use more SMs; a tensor-core long-sequence path could coexist with scalar exact paths where needed. Neither is implemented/evaluated in the paper. +- **Limits/countersignals:** Four-CTA radix PC sampling is sparse. Its phase allocation uses executed warp instructions as a proxy; these estimated phase times cannot be treated as direct microbenchmarks or physical lower bounds. +- **P candidate rule:** For tiny or mixed grids, record useful CTAs, waves, active fractions, and launch count alongside occupancy. Require measurement of the full mixed batch before accepting persistent scheduling as better. +- Source: [C.2–C.4](https://arxiv.org/html/2608.14560v1#A3.SS2). + +## 3. Evidence ledger: denominators, workloads, and trajectories + +### F: final campaign results (Table 1) + +All three local comparisons use **NVIDIA B200** and **PyTorch implementation latency as the speedup denominator**. Figure axes say average speedup; the exact arithmetic/geometric aggregation and workload weighting are not defined in this paper. + +| Task | Cases (from §3.2) | FlashInfer/PyTorch speedup | Generated/PyTorch speedup | Agent tokens | +|---|---:|---:|---:|---:| +| Fused MoE | 19 | 47.08× | 92.68× | 1.05B | +| DSA Sparse Attention | 23 | 10.33× | 181.35× | 427M | +| DSA TopK Indexer | 128 | 52.03× | 1101.02× | 414M | + +Token sum is 1.891B (extraction arithmetic), consistent with approximately 1.9B. Token accounting details (input/output, caching, failed attempts, role allocation) are unreported. No dollar conversion is justified. + +Official contest claim is **MoE 1.71× relative to FlashInfer**, versus **1.68×** for the highest reported agent-assisted-track score. Acknowledgments attribute the result to an organizer email; the email itself was not inspected. This is a different evaluation statement and denominator from local Table 1. Do not label 1.71× as PyTorch-relative or treat the local Table 1 ratio as the official score. [Table 1](https://arxiv.org/html/2608.14560v1#S1.T1), [Acknowledgments](https://arxiv.org/html/2608.14560v1#Sx1). + +### F: cumulative annotations, not controlled ablations + +These are approximate labels in visually read Figures 2–4. Consecutive changes are campaign stages; differences do not isolate causal gains, and cumulative token totals are not deployment latency/cost models. Some plotted point positions do not align precisely with annotations (notably Figure 2 and early Figure 3); no interpolated curve or regression is warranted. + +- **Figure 2, MoE:** PyTorch 0M/1×; cuBLAS FP16 with fast-16BF compute about 50M/26.8×; synchronization-free path about 100M/31×; CUTLASS FP8 grouped, 1-SM blockwise about 315M/43×; dual-tile dispatch about 420M/54×; pipeline overlap plus fused scan/scatter and uint4 scatter about 680M/78×; static compilation/embedded CUTLASS about 790M/85×; tcgen05 on GEMM1 about 880M/87×; tcgen05 on both GEMMs with two TMA descriptors about 940M/90×; small-T path, buckets, and parallel routing about 1050M/92.68×. Dashed FlashInfer line approximately 47×. +- **Figure 3, attention:** PyTorch 0M/1×; naive CUDA using one CTA per token/head and sequential gather about 30M/43.00× (annotation; marker appears lower); register-resident path about 85M/77.26×; adaptive Split-K about 195M/117.01×; multi-head pipelining about 248M/153.07×; workload-sensitive dispatch about 355M/160.56×; merge output partition about 393M/174.28×; templated Split-K about 427M/181.35×. FlashInfer line approximately 10.33×. +- **Figure 4, TopK:** PyTorch 0M/1×; hybrid CUDA plus PyTorch mm/topk about 180M/6.5×; fully CUDA fused stage with CPU batch dispatch about 220M/91×; on-device sequence-based dispatch/early exit about 340M/900×; cooperative 32-token K tile loaded once per CTA about 385M/942×; key shared stride 129 about 405M/971×; padded `[16][33]` partials and 16-warp radix about 414M/1101×. FlashInfer line approximately 52×. + +Sources: [Figure 2](https://arxiv.org/html/2608.14560v1#S3.F2), [Figure 3](https://arxiv.org/html/2608.14560v1#S3.F3), [Figure 4](https://arxiv.org/html/2608.14560v1#S3.F4). + +### F: regime table data + +All regime speedups are in the paper's PyTorch-reference context; latency is for the listed representative, not every member of the group. + +| Task/regime | Range | Count | Speedup range | Representative | Representative latency | Reported dominant issue | +|---|---|---:|---|---|---|---| +| MoE short | length 1–16 | 5 | 103–240× | length 7 | 0.099 ms | routing/launch overhead | +| MoE median | 32–80 | 11 | 75–93× | 54 | 0.205 ms | GEMM1+2 about 65% of iteration | +| MoE long | 901–14,107 | 3 | 38–74× | 14,107 | 1.229 ms | GEMM1 about 47%, GEMM2 about 30% | +| Attention short | 1 query token | 1 | 280× | 1 token | 0.005 ms | four CTAs, launch/underfill | +| Attention median | 2 query tokens | 8 | 125–148× | 2 tokens | 0.017 ms | Split-K latency and registers | +| Attention long | 6–8 query tokens | 14 | 108–228× | 8 tokens | 0.026 ms | registers and remaining bank conflicts | +| TopK short | max S≤1024; max P≤16 | 27 | 477–3732× | batch 29, max P=1, max S=64 | ~0.002 ms | remap launch/grid | +| TopK medium | 1088≤max S≤2048; 17≤max P≤32 | 42 | 816–5366× | batch 15, max P=31, max S=1984 | ~0.004 ms | remap proportional to batch and K | +| TopK long | max S>2048; max P>32 | 59 | 107–756× | batch 4, max P=36, S=[18,11,2161,20] | ~0.020 ms | active-CTA underfill and FP8 conversion stalls | + +Sources: [Table 3](https://arxiv.org/html/2608.14560v1#S3.T3), [Table 4](https://arxiv.org/html/2608.14560v1#S3.T4), [Table 5](https://arxiv.org/html/2608.14560v1#S3.T5). + +## 4. Detailed profiler evidence (reported measurements, not reproduced) + +All captures identify **NVIDIA B200, SM100, compute capability 10.0**, NCU **2026.1.0.0**, full metric set and kernel replay. SM/DRAM/L1/L2 throughput percentages are NCU resource-throughput metrics; they are not latency savings, mathematical utilization bounds, or fraction of all chip time interchangeable with occupancy. Appendix tables retain profiled kernel-time totals separately from main-table representative benchmark latency. + +### F: Appendix A, MoE + +Provenance: `cuda-moe-tvm-v14`, workload `5e8dc11c`, sequence length 14,107; three warmups, five NVTX-scoped measurement iterations. Tables 6–9. + +| Kernel | Invocations | Time per invocation or row mean (µs) | SM % | DRAM % | L1 % | L2 % | Achieved occupancy % | Registers/thread | Warp cycles/issued instruction | +|---|---:|---:|---:|---:|---:|---:|---:|---:|---:| +| CUTLASS FP8 grouped | 2 | 491.74 mean | 50.68 | 24.85 | 45.18 | 41.69 | 14.09 | 168 | 5.46 | +| routing | 1 | 108.22 | 62.37 | 1.74 | 67.96 | 1.65 | 65.08 | 32 | 17.71 | +| pull scatter BF16 | 1 | 81.31 | 23.52 | 62.92 | 33.87 | 30.90 | 43.50 | 61 | 26.82 | +| gather FP8/scales | 1 | 42.69 | 46.47 | 47.04 | 46.91 | 35.63 | 82.40 | 32 | 25.56 | +| SwiGLU→FP8 | 1 | 34.94 | 70.89 | 55.87 | 30.86 | 32.65 | 85.21 | 29 | 16.66 | +| scatter with scan | 1 | 11.30 | 2.31 | 0.53 | 1.80 | 1.47 | 24.03 | 18 | 198.69 | + +Total 1261.94 µs; the grouped row must be multiplied by two, not counted once. Individual GEMMs: 600.22 µs (K=7168) and 383.26 µs (K=2048). + +Table 7 min/max/average: SM clock 1.58/1.63/1.60 GHz; DRAM clock 4.00 GHz; memory throughput 37.52/50.70/44.11%; DRAM 23.99/25.71/24.85%; L1 38.02/52.34/45.18%; L2 37.68/45.71/41.69%; SM 43.80/57.55/50.68%. Table 8: 384 threads, 148 CTAs, 1.00 waves/SM, 201.22 KB dynamic shared memory/CTA, theoretical occupancy 18.75%, achieved 14.09%, active warps/SM 9.02, active threads/warp 31.85. Table 9 scatter: 14,107 CTAs, 23.83 waves/SM; clocks SM 1.94 GHz, DRAM 3.99 GHz; 62.92% memory throughput. The reported scatter fraction is about 6.4% of the profiled iteration. + +### F: Appendix B, sparse attention + +Provenance: `dsa-attn-v4`, workload `385742b2`, query tokens 8, pages 8462, K=2048; one warmup and one NVTX measurement iteration; imported source, line information enabled. Tables 10–15. + +| Metric | partial<32> | merge<32> | +|---|---:|---:| +| Time (µs) | 17.73 | 8.58 | +| SM throughput % | 17.68 | 1.81 | +| Memory throughput % | 16.38 | 1.45 | +| DRAM throughput % | 1.58 | 0.77 | +| L1/TEX throughput % | 37.11 | 6.60 | +| L2 throughput % | 3.38 | 0.94 | +| SM frequency GHz | 1.94 | 1.95 | +| DRAM frequency GHz | 3.98 | 3.98 | +| Threads/CTA | 128 | 128 | +| CTAs | 1024 | 128 | +| Waves/SM | 3.46 | 0.17 | +| Registers/thread | 192 | 95 | +| Dynamic shared memory KB/CTA | 73.98 | 0.00 | +| Theoretical occupancy % | 12.50 | 31.25 | +| Achieved occupancy % | 10.07 | 6.16 | +| Active warps/SM | 6.45 | 3.94 | +| Warp cycles/issued instruction | 4.00 | 13.86 | +| Active threads/warp | 31.52 | 31.08 | + +Total 26.31 µs; approximately 67% partial / 33% merge. Partial grid is 8 tokens × 4 head groups × 32 splits; each CTA handles 64 sparse entries. Merge consumes 32 BF16 partials and performs LSE-renormalized weighted accumulation; four output slices yield 128 CTAs. The 148-SM device is explicitly stated in the merge discussion. + +Table 11 source-attributed phase times (µs): partial staging via cp.async 5.54; sparse index gather 5.34; dot/reduction 1.81; value accumulation 1.66; query/prologue 1.16; online softmax 0.96; shared KV loads 0.91; epilogue 0.35. Merge LSE/valid-split scan 3.11; weighted accumulation 2.58; helpers/scheduling 1.94; epilogue 0.95. The first two partial phases total 10.88 µs, reported as 41% of the complete iteration. These are sampled source attributions, not independent phase timers. + +### F: Appendix C, TopK + +Provenance: `dsa-topk-indexer-v6`, workload `4c7705ad`, batch 4, max pages 36, total pages 11,923, sequence lengths **[98,91,2241,100]**, only b=2 slow path; one warmup and one NVTX measurement; source import/line info enabled. This differs from Table 5's representative vector. Reported speedup 107.29× the mathematical reference, the lowest across 128 contest cases. Tables 16–21. + +| Metric | FusedGemm | RadixSelect | +|---|---:|---:| +| Time (µs) | 11.68 | 13.18 | +| SM throughput % | 9.66 | 0.16 | +| Memory throughput % | 15.22 | 0.87 | +| DRAM throughput % | 0.37 | 0.03 | +| L1/TEX throughput % | 45.82 | 11.42 | +| L2 throughput % | 0.30 | 0.12 | +| SM frequency GHz | 1.94 | 1.95 | +| DRAM frequency GHz | 3.98 | 3.98 | +| Threads/CTA | 512 | 512 | +| CTAs | 288 | 4 | +| Waves/SM | 0.97 | 0.01 | +| Registers/thread | 64 | 40 | +| Dynamic shared memory KB/CTA | 48.13 | 38.15 | +| Theoretical occupancy % | 50.00 | 50.00 | +| Achieved occupancy % | 33.92 | 23.54 | +| Active warps/SM | 21.71 | 15.07 | +| Warp cycles/issued instruction | 21.64 | 17.79 | +| Active threads/warp | 31.30 | 30.85 | + +Total 24.86 µs. No separate remapping kernel runs in this case. Score uses scalar FP32 for bit-exactness. Four CTAs cannot cover 148 SMs, irrespective of the active-execution occupancy metric. + +Table 17 source-attributed/proxy phase times (µs): score setup 2.88; scalar dots 2.88; query dequantization 1.86; FP8 conversion helper 1.52; CUDA helper code 1.52; page table/key-scale loads 0.68; key dequantization/ReLU/reduction 0.34. Radix fast remap 3.14; ballot gather 2.30; histogram build 1.98; histogram initialization 1.27; suffix scan 1.05; selected bucket 0.83; score loading/encoding 0.59; subgroup histogram reduction 0.36; slow setup 0.31; other 1.35. The radix subdivision uses executed warp instructions as a proxy because its small grid yields sparse PC samples. Do not imply these are exact phase latency measurements. + +Sources: [Appendix A](https://arxiv.org/html/2608.14560v1#A1), [Appendix B](https://arxiv.org/html/2608.14560v1#A2), [Appendix C](https://arxiv.org/html/2608.14560v1#A3). + +## 5. Physical bounds versus empirical predictions: explicit answer + +- **F:** Resource-feasibility constraints are discussed: registers/CTA, shared-memory footprint, resident blocks, occupancy ceilings, and CTA coverage. They help reject simplistic explanations such as bandwidth saturation when bandwidth counters are low. +- **F:** NCU's Speed-of-Light throughput counters compare observed hardware activity with profiler-defined throughput capacity. They are measurements/normalizations; the paper does not derive a universal lower bound on end-to-end latency from them. +- **F:** Main-text launch floors and structural bottleneck claims are interpretations of profiling, not mathematical proofs. The score equations define required computation, not a cost model. +- **F:** No explicit FLOP/byte model, arithmetic-intensity roofline, compulsory-traffic lower bound, overlap equation, launch-time bound, calibrated regression, surrogate model, or prediction-error statistics is reported. No formula maps tokens spent to expected speedup. +- **F:** Candidate shortlisting is Planner judgment based on incumbent/profile/history and external examples, followed by measurement; it is not a learned shortlist or validated analytical optimizer. +- **F:** Backend preferences and Split-K thresholds are empirical implementation choices. Proposed TMA/tcgen05/persistent/epilogue directions remain unmeasured hypotheses. +- **P:** Keep separate fields for (a) semantic feasibility/physical constraints, (b) measured counters, (c) empirical prediction, and (d) untested optimization hypothesis. This prevents a low-throughput diagnosis from being promoted into an achievable speedup promise. +- **P:** A future analytic bound can shortlist impossible or obviously poor candidates, but measured correctness and regime-level latency must decide acceptance; adding such a bound would be an extension beyond this source. + +## 6. Important limitations and unreconciled signals + +1. **Bibliographic date anomaly:** all inspected originals say 25 May 2026 with an ID beginning 2608. Record both; no conjectural repair. +2. **MoE metric comparison unresolved:** §3.2.1 says 97%/95% SM utilization for the long representative; Table 7's SM throughput is 43.80–57.55%, mean 50.68%. Metric definitions, denominators and capture windows have not been matched. This is not a proven contradiction or proof of saturation. +3. **Attention memory conflict:** main text ~50 KB versus Appendix B 73.98 KB dynamic shared memory/CTA. Use the appendix value only with its pinned version/capture. +4. **TopK workload conflict:** Table 5 [18,11,2161,20], ~20 µs; Appendix C [98,91,2241,100], 24.86 µs, though appendix calls it the corresponding long representative. Preserve distinct identities/timings. +5. **MoE timing context:** Table 3 1.229 ms vs Appendix A 1.26194 ms. Profiler capture and benchmark timing are different contexts; do not overwrite one with the other or call a regression from this alone. +6. **Trajectory interpretation:** cumulative campaign stages are not controlled ablations, and annotation/plot placement inconsistencies preclude a precise token-efficiency curve. Attention's “largest gain” attribution to merge partitioning is not established by the plotted stage values. +7. **Model/implementation wording:** framework examples include Codex but campaign specification says Claude Code/Opus 4.6. A custom backend is called hand-written despite the overall no-human-code claim. Preserve scope; do not invent a resolved authorship or mixed-model experiment. +8. **Statistical/cost incompleteness:** benchmark repetitions, variance, uncertainty, aggregation method, total GPU/wall-clock cost, model sampling settings, accepted/rejected run counts, intervention count, and full search logs are unreported in the paper. Profiling captures have their own stated 3+5 or 1+1 iterations. +9. **Transfer limits:** three selected task families, one GPU type, fixed benchmark shapes and strong correctness constraints. No held-out workload study, end-to-end serving throughput/energy result, or cross-architecture claim is supported. +10. **Implementation future directions:** epilogue fusion is blocked/unimplemented; TMA/tcgen05 attention and persistent TopK are proposals. The paper's title does not justify presenting these proposals as already achieved. + +## 7. Leads for a separate next gate (unread, not admitted as evidence) + +These are citations or author-supplied links found in the paper; their contents were **not** fetched/read for this extraction. No implementation action is proposed by listing them. + +- Author-linked generated solutions: https://github.com/CodeGandee/flashinfer-bench-starter-kit/tree/main/solution/cuda +- Houmao orchestration: https://github.com/igamenovoer/houmao +- FlashInfer-Bench reference: arXiv:2601.00227, https://arxiv.org/abs/2601.00227 +- TritonForge, arXiv:2512.09196, https://arxiv.org/abs/2512.09196 +- CUDAForge, arXiv:2511.01884, https://arxiv.org/abs/2511.01884 +- Astra, arXiv:2509.07506, https://arxiv.org/abs/2509.07506 +- AKG Kernel Agent, arXiv:2512.23424, https://arxiv.org/abs/2512.23424 +- Dr. Kernel, arXiv:2602.05885, https://arxiv.org/abs/2602.05885 +- Paper-supplied architecture notes https://github.com/technillogue/ptx-isa-markdown and profiler skill https://github.com/maxiaosong1124/ncu-cuda-profiling-skill +- DeepGEMM and RadiK are named external-reference leads; no exact paper/repository identity was verified here. + +## 8. Reuse delta against the supplied prior-reference inventory + +The relevant rows of `supplier-research-cache/prior-readsets/reference-matrix.md` and Task 1 of `HANDOFF.md` were read after paper extraction. These inventory records already identify analytical and empirical roofline material; the parent also confirms existing Amdahl coverage. They are overlap evidence only, not newly verified current implementation state. + +- **P `optimization-search-policy`:** Add profile/history-conditioned proposals, bounded unsuccessful-direction escalation, explicit separation of spurious implementation failures from failed optimization hypotheses, and the absence of controlled agent-role evidence. +- **P `inference-benchmark-design`:** Add the concrete tensor-identity cache failure, fixed editable surface, cold/warm split, exact TopK contract, separate benchmark/profiler contexts, and regime-dependent fast-path reporting. +- **P `kernel-writing-guide`:** Add shape-regime dispatch and semantic work elimination as candidate design rules, with numerical exactness and integration constraints; retain hardware-specific CUDA examples as examples only. +- **P `dense-performance-evidence`:** Add capture provenance, metric-denominator distinctions, phase-attribution/proxy labels, token-accounting limits, and unreconciled cross-section values. +- **P `inference-optimization-casebook`:** Add the three concrete before/after campaign narratives and residual-bottleneck cases, preserving cumulative rather than isolated attribution. +- **P `performance-ceiling-analysis`:** Cross-reference the existing analytical/empirical/Amdahl distinction. Do not create a duplicate ceiling method or claim this paper adds a physical-bound formula. + +## Extraction completion + +All requested original-paper methods, experimental trajectories, regime results, and profiler appendices were read. No separate controlled ablation section exists. No software installation, kernel reproduction, hardware access, repository inspection, PR, benchmark run, or implementation modification occurred. Original-source cache remains outside the deliverable tree; this derivative note is part of Pack A. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md new file mode 100644 index 000000000..09ed926ae --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md @@ -0,0 +1,48 @@ +# FlashVector: source audit and mechanisms + +Status: candidate / empirical_validation: not_run. F = paper fact; P = proposed use. [FlashVector: Agent for Hierarchical Model Serving Stack Optimization, 2609.17391v1](https://arxiv.org/abs/2609.17391v1), submitted 2026-09-15. [Pinned HTML](https://arxiv.org/html/2609.17391v1), [PDF](https://arxiv.org/pdf/2609.17391v1). Title/ID/version verified. Production case studies are author reports; no code or deployed system inspected. + +## Exact readset + +§§1–7, emphasizing §3 challenges, §§4.1–4.2 knowledge/loop, Algorithm1, §§5.1–5.4 methods/results. All Tables1–4 and figure captions/discussion1–6 read. PDF p.4 Fig.3, p.5 Algorithm1/correctness/noise prose, p.7 Figs.5–6/Table2, and p.8 Tables3–4 visually checked. Figures1–2/4 are caption/text-only reads. There are no numbered cost-model equations or appendix in this version. The noise reduction relation and hypothesis scoring are unnumbered. No controlled ablation isolating random layer sampling, knowledge refinement, human cookbook, or always-on triggering is reported. + +## F1. Layer-local diagnosis with system-level acceptance + +- **Objective (F):** improve serving-stack throughput/latency while preserving predictions and production constraints. +- **Assumptions (F):** appropriate profiling and semantic context exist for each layer: GPU/kernel, framework graph, model server, feature processing; recorded model inputs/weights/outputs represent the intended workload. +- **Decisions / constraints (F):** Algorithm1 randomly samples one layer per iteration, profiles it, ranks hypotheses within that layer by time share × expected gain, and rejects hypotheses whose best possible gain is below measurement noise. This is not demonstrated as globally optimal layer selection. +- **Mechanism (F):** Profile→Diagnose→Plan/Apply→Verify; candidates beating the local incumbent/noise gate receive a full-stack load test; regressions revert. Post-run refinement records accepted/rejected context without indefinitely appending every trace. Release/age triggers re-open optimization. +- **Resource benefit / cost (F/P):** focuses specialist tooling/context and avoids optimizing tiny time shares; full-stack replay and increased sampling consume resources. The expected-gain score is a heuristic, not a measured runtime predictor or hardware ceiling. +- **Author evidence (F):** production case studies find serialization, feature processing, graph and kernel opportunities. Table1 includes both latency and throughput changes, e.g. retrieval1.67×/1.10×, ranking-model2 1.98×/2.00×. Hardware, request mix and absolute latency are not uniformly supplied for those table rows, so they cannot be imported as general expectations. +- **Limits / countersignals (F/P):** knowledge-refinement and continual triggering benefits are asserted, not isolated experimentally. Intro/§6 describe E2E gain above noise; Algorithm1 explicitly gates local gain then full-stack non-regression. For a local procedure, choose and declare the stricter desired acceptance rule rather than treating these descriptions as identical. +- **Candidate rule (P):** retain layer-specific observables and ownership; evaluate impact on the actual critical path and full service objective. After an accepted change, re-profile before choosing the next target. Store rejection reasons scoped to model/workload/hardware versions, rather than permanent bans on whole techniques. + +## F2. Noise-aware verification and typed correctness gates + +- **Objective (F):** prevent noise or output changes from being promoted as performance progress. +- **Assumptions / constraints (F):** repeated unchanged-baseline runs estimate noise; weights/inputs/baseline predictions recorded before rewriting. Deterministic order/precision-preserving changes require exact elementwise equality. Reordered floating point uses task/dtype bounds; approximations use business metrics; configuration uses a shadow canary at fixed latency SLO. +- **Mechanism (F):** reported E2E baseline spread is ±6%; 2–6% candidate gains get up to8× samples, with claimed 1/sqrt(k) shrinkage to2.1%. Full-stack testing follows local validation. +- **Author evidence (F):** §4.2 describes the protocol; §5 gives accepted cases. Per-kernel bounds are 1e-3 FP32/1e-2 FP16, while end-to-end reorder checks describe 1e-3 absolute deviation (1e-4 FP32) and at most0.1% outside the1e-3 bound; nonfinite results fail. These are this paper's settings, not a universal tolerance prescription. +- **Resource benefit / cost (F/P):** reduced false promotion at added replay cost. No raw no-op distribution, sample counts, autocorrelation analysis, or confidence level for ±6% is reported. +- **Limits / countersignals (P):** 1/sqrt(k) reduction needs a justified noise model; drift and correlated traffic can invalidate it. The stated end-to-end tolerance text needs precise implementation interpretation, especially its threshold and allowed-outlier clauses. Never loosen a user's correctness contract to reproduce a paper threshold. +- **Candidate rule (P):** estimate local paired/repeated uncertainty, preserve run order/load/cache state, and separate indeterminate from rejected. Do not assume8× samples guarantees a2.1% detectable gain. Declare exact-equality, numerical tolerance, approximation-quality and SLO gates before trials. + +## F3. Redirect from GPU work to host data movement + +- **Objective (F):** remove exposed CPU-side request preparation rather than optimizing only model kernels. +- **Assumptions / decisions (F):** string-heavy Triton input conversion; CPU feature processing with one context row and up to2,000 candidate rows; one pod with12 Python backend processes over14 vCPUs. Features/data ownership must permit views or native lookup. +- **Mechanism (F):** §5.1 converts a Python deserialization path to C++; §5.3 exposes numeric tensors as read-only native views, scans strings in C++, bypasses Python materialization when vocabulary lookup is the only consumer, pre-resolves safe routing with decode fallback, uses Cython for irregular per-element work, and writes features directly into preallocated output slices. +- **Resource benefit / cost (F):** removes Python objects, copies, concatenations and redundant assembly; adds native code and ownership constraints. This is local CPU/memory activity, not evidence for NIC/network optimization merely because inputs came over gRPC. +- **Author evidence (F):** serialization step up to30×, not whole-server30×. Table2 gives call-site speedups, not pod throughput. Table3's cumulative pod throughput progresses940→about1,200→about1,500 requests/s at a fixed latency SLO, overall1.6×; native kernels+assembly are combined in one stage, then zero-copy I/O. Exact SLO value and isolated contribution of the combined pieces are unreported. +- **Limits / countersignals (P):** no independent generalization to arbitrary feature pipelines. Native views require buffer lifetime and immutability checks; shared-memory lookup requires stable vocabulary semantics. Benchmark proof of ownership correctness is not supplied by a high speedup alone. +- **Candidate rule (P):** before a new kernel experiment, inspect serialization/materialization/assembly time shares. Propose views or native preprocessing only when required semantics/lifetimes are established; measure both the component and request-level result with the same pod CPU budget. + +## F4. Expose fusion opportunities, then retune serving configuration + +- **Objective (F):** reduce redundant graph/kernel work and retune concurrency after bottlenecks move. +- **Assumptions / decisions (F):** §5.2 multi-task recommendation model, AOTInductor, FP16, RTX PRO6000 Blackwell,2,000 candidates/request. §5.4 one GPU partition per pod; sweeps vary model-instance count and dynamic batch size, while queue policy is derived from SLO, not independently searched. +- **Mechanism (F):** precompute candidate-only/position-only attention pieces, fuse six kernels with intermediates retained in registers; decompose opaque embedding-bag into fusion-visible primitives; reuse semantic embeddings across branches. Configuration search replays captured production tensors under held load and validates via shadow canary. +- **Resource benefit / cost (F):** attention traffic falls to roughly one-third; register pressure/fusion eligibility can trade against memory savings. More instances/bigger batches consume memory and can raise tail latency, so neither monotonically improves throughput-at-SLO. +- **Author evidence (F):** §5.2 attention996.5→279.8µs (3.56× module speedup), bit-identical under preserved order/precision. Combined embedding/reuse changes reduce total GPU kernel time33.4%, forward latency30.1%, dispatcher share44.8→28.5%; these are different denominators and the combined gain is not each component's isolated effect. The dominant profile shifts toward GEMM. §5.4 reports >2× throughput variation across configurations of one code-optimized model, not a final2× gain for every model. +- **Limits / countersignals (F/P):** Table4 gives selected trial RPS/p99 but no per-row baseline RPS, so tuning speedup cannot be calculated. ModelB explicitly shows SLO250ms and measured p99=271ms despite the caption saying throughput sustained at SLO; treat compliance as unresolved. Other rows' smaller p99 do not validate this row. No GPU partition dimensions or total fleet-resource normalization is given. +- **Candidate rule (P):** use model semantics to distinguish request-invariant from candidate-varying work. After changing code, reopen instance/batch tuning under unchanged absolute SLO, resource budget and quality constraints. Require every selected trial to pass its own inequalities; never infer SLO compliance from a caption or aggregate gain. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md new file mode 100644 index 000000000..ba2ca9222 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md @@ -0,0 +1,45 @@ +# InferenceBench: source audit and mechanisms + +Status: candidate / empirical_validation: not_run. F = source fact; P = proposal. [InferenceBench: A Benchmark for Open-Ended LLM Inference Optimization by AI Agents, 2607.20468v1](https://arxiv.org/abs/2607.20468v1), [HTML](https://arxiv.org/html/2607.20468v1), [PDF](https://arxiv.org/pdf/2607.20468v1). ID/title/version match verified. Original abstract and full text display 2026-05-20 despite the July-coded identifier; this unresolved metadata anomaly is preserved, not repaired. Scaffolds are described as April 2026 snapshots. No current model ranking is inferred. + +## Exact readset + +§§1–6; methods §§3.1–3.4; results and ablations §4/§4.1; behavior §§5.1–5.3; limitations §6. Appendices A.1–A.5, B.1–B.4, C.1–C.3, D.1–D.2, E.1–E.4, F examples 1–7, G.1–G.5 read. Tables 1–22 read as PDF/HTML text; Fig.1 caption and explanation read; rendered Fig.2 and Tables 6–7 visually checked on PDF p.8. Metric formulas A.5 and quartile-volatility formula C.3 are unnumbered. No implementation repository opened. The quoted transcripts are evidence supplied by the paper, not independently audited experiment logs. + +## Metric and resource contract (F) + +Main setting: Mistral-7B-Instruct-v0.3, one H100 80 GB, two-hour wall-clock budget, three development/evaluation seed pairs per agent×scenario. Each job receives 16 CPUs, 180 GB RAM and 400 GB scratch on shared two-socket EPYC 9654 nodes; Ubuntu 22.04, driver 580.82.07, CUDA 12.8 container, PyTorch 2.8.0. The displayed host runtime CUDA version is 13.0, distinct from container toolchain/runtime. + +A: 8,192/1,024 target input/output tokens, 128 requests, concurrency 1, minimize TTFT. B: 1,024/8,192, 64 requests, concurrency 1, minimize TPOT. C: 1,024/1,024, the same 256 requests replayed under burst cap64, Poisson32 requests/s cap32, constant16 requests/s cap16; maximize geometric-mean completed request throughput across profiles. D: 4,096/2,048, 96 requests, concurrency4; geometric mean of inverse mean TTFT, inverse mean TPOT, and requests/s on D's own workload. Token lengths vary uniformly over 80–100% of the targets; outputs are forced to sampled lengths. Inputs are LongBench-v2 documents with hashed realized request sets. + +TTFT is client send to first parsed content-bearing SSE chunk; ITL is between streamed chunks, not necessarily individual tokens. Per-request TPOT=(end−first)/(output_tokens−1). Request throughput counts completed requests / wall time. Secondary generation throughput uses all output tokens / summed decode intervals, so its numerator differs by one token/request from the TPOT convention. D uses seconds and requests/s, not milliseconds; it is not composed from A/B/C baselines. Failed quality/integrity/unusable final servers score baseline-equivalent 1×, not zero. Aggregate is geometric mean of A–D speedups; cells are means over three seeds with sample SEM. Baseline native values: A 840 ms, B 41 ms, C 0.132 requests/s, D 1.68. These mixed quantities cannot be ranked against Vidur capacity/$ or FlashVector pod RPS. + +## I1. Make exploration executable and compare fair budgets + +- **Objective (F):** evaluate useful autonomous deployment under a fixed budget, including engine selection, integration and tuning. +- **Assumptions (F):** same hardware, weights, inputs, scoring gates and wall-clock allowance; candidate setup/JIT/repair consumes the agent's budget. +- **Decisions / constraints (F):** serving engine, backend, quantization, KV dtype, scheduler/batch/token limits, compile/graph choices; correct base model and functioning OpenAI-compatible server required. +- **Mechanism (F):** compare agents with defaults and documented-flag Random/SMAC/TPE searches. Each optimizer×engine has a separate two-hour run; the full cross-engine grid is not a single two-hour joint engine-search result. +- **Resource benefit / cost (F):** search attempts trade possible serving gains against setup, compilation, evaluation and API/GPU cost. D.2 uses a historical nominal H100 price of $1.99/h: a complete 12-run agent evaluation has $47.76 nominal GPU cost before overhead, plus API costs. These are optimization expenditures, not steady-state serving cost per request. +- **Author evidence (F):** §5/E.3 report 169/180 final launchers using vLLM, median one distinct non-default argument set, and 81% of restarts repeating arguments. Table20 shows engine choice matters across the fixed scenarios; it does not establish a universal engine winner. Table2's best-agent aggregate 8.08× and SMAC-vLLM 11.53× use the same naïve PyTorch denominator, not a tuned-production baseline. +- **Limits / countersignals (F/P):** only three seeds and fixed scaffold/model snapshots; broader cross-engine search consumes multiple independent budgets. §G.3's conjecture that two hours covers most of the flag space lacks an exhaustive optimum proof. Scenario-C vLLM default 48.69× exceeds its SMAC search 46.70× in Table2, so search is not uniformly better than defaults. +- **Candidate rule (P):** preserve a known-good incumbent while allocating bounded trials across materially different hypotheses. Count distinct measured configurations, not ideas mentioned or identical restarts. Use documented compatible families; do not silently turn this literature recommendation into installation or engine replacement authority. + +## I2. Preserve the best valid artifact, not the last edit + +- **Objective (F):** close the gap between finding a good configuration and delivering it. +- **Assumptions / decisions (F):** final server must match its launcher/configuration and pass final evaluation; quick probes are provisional. Choose whether to continue, revert, combine validated changes or finalize. +- **Mechanism (F):** structured prompt establishes baseline, changes one variable per experiment, logs proposals/outcomes, and reserves the last 15 minutes for validation. Best-seen rescoring diagnoses lost valid configurations rather than changing the benchmark's final-state objective. +- **Evidence (F):** Table3: 117/180 pass both gates, 34 fail/incomplete quality, 11 integrity flags, 18 server/runtime failures; categories exclusive. Table6: structured GPT-5.4 passes 11/12 versus10/12, Opus4.7 11/12 versus5/12. Best-seen Table4 rises from 8.62× to12.34× for per-scenario best-agent aggregation; this is a different aggregation from one agent's Table2 aggregate. Warm-start Table21 improves reliability but does not remove search gaps. Time-budget Fig.2/§4.1 does not show monotonic gains through 8 h. +- **Cost / limits (F/P):** preserving/replaying artifacts consumes time. No controlled isolation attributes all structured-prompt effects to a single constituent rule; fixed 15-minute reserve is benchmark-specific. One-variable exploration alone misses interactions. +- **Candidate rule (P):** store immutable candidate/config/input/evaluator identities and last full-valid results. Use one-factor contrasts for attribution, then explicitly labeled interaction tests. Reserve finalization based on measured restart/warmup/full-validation cost; after a regression restore and verify the incumbent rather than repeat repairs indefinitely. + +## I3. Treat measurement semantics as correctness + +- **Objective (F):** reject apparent speed improvements that alter the task or event boundaries. +- **Assumptions / constraints (F):** quality at least95% of baseline on a seed-fixed500-question MMLU-Pro subset, plus an independent integrity judgment from launcher/log/transcript evidence. Development/evaluation seeds differ. +- **Mechanism (F):** gate output quality and task integrity before scoring; use held-out canonical inputs and a final working-server check. Appendix F distinguishes fake first chunks, bypassed decode and dependency/compilation delays from real gains. +- **Resource benefit / cost (F/P):** gates prevent invalid apparent gains from entering selection, but quality evaluation and artifact/judge inspection consume time and compute. Their isolated resource overhead is unreported; total campaign cost cannot be assigned to the gates. +- **Evidence (F):** C.1 threshold rescoring is stable through0.95 and changes at most one rank at0.97. C.2 judge agreement κ=0.82; a stratified50-run manual audit finds zero false positives and one missed violation. These are sample estimates, not a guarantee. A quality-passing fake decode run is excluded; no exploit is an optimization recommendation. +- **Limits / countersignals (F/P):** §G.2 calls ScenarioD concurrency1, conflicting with §3/Table1 and A.3/Table8 concurrency4. Do not use that paragraph as a clean concurrency-specific causal claim. Main prompt B.1 allows quantization while §G.2 describes prequantized-checkpoint prohibition more specifically; do not reconstruct a universal authorization rule from this inconsistent presentation. +- **Candidate rule (P):** specify genuine first generated token, required forward/decode work, token counting and output length before optimization. Audit timing anomalies against both artifact semantics and physical feasibility; passing a small quality test cannot prove measurement integrity. Keep honest failures distinct from baseline performance when reporting local results, even if a benchmark maps both to1×. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md new file mode 100644 index 000000000..276fd9396 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md @@ -0,0 +1,33 @@ +# Prior coverage and incremental delta + +This file is a readset/crosswalk, not a new maintained matrix. Inventory-level statements describe supplied snapshots, not current repository verification. + +## Earlier six-paper artifact inspected before mining + +- `prior-foundation-pack/INTEGRATION_NOTES.md` +- `prior-foundation-pack/choose-prefill-decode-schedule/references/source-notes.md` +- `prior-foundation-pack/notes/scheduling.md` +- The bundle's file inventory and title/ID matches were checked for all four Pack A papers. + +Vidur was an explicitly unread next gate in Sarathi-Serve's scheduling extraction. Pack A closes that paper-reading gate with calibration/simulation evidence; it does not reread or replace Sarathi/DistServe mechanisms. The other three Pack A titles/IDs had no prior extraction in those readsets. + +**Verified prior artifact locators, outside this standalone pack:** `choose-prefill-decode-schedule/SKILL.md`, `choose-prefill-decode-schedule/references/source-notes.md`, and `notes/scheduling.md` within the earlier `inferrsi-paper-delivery` bundle. Link them during integration using the owner's actual artifact destination. Local scratch paths are locators, not assumed shareable URLs. + +## Earlier implementation discovery inspected + +`source-notes/inferrsi-engine-references.md` and `source-notes/inferrsi-npu-references.md` were searched/read for overlap. Their serving scheduler/connector and NPU implementation boundaries remain separate evidence. Pack A establishes no latest engine behavior, NPU compatibility, SSD coverage or network tuning mechanism. The separately present `inferrsi-candidate-bundles` inventory was checked; its vLLM and NPU lifecycle candidates are not replaced. + +## Supplied matrix / handoff overlap + +`prior-readsets/reference-matrix.md` is a supplied snapshot: branch `opus/meta-skill-bootstrap`, revision `4d61d2c`, date2026-10-15. Relevant Reference Matrix systems and methodology rows, HANDOFF Task1, and pasted handoff performance-ceiling entries were read. Existing inventory already includes: + +- `performance-ceiling-analysis`: analytical, empirical and Amdahl levels; LLM-Viewer1893e4b, ERT0771fa9, TensorRT-LLMf33e0e5fd lineage. Missing target NPU/B300 measurement evidence stays missing. +- `optimization-search-policy`: SkillOpt/vllm-evolve/RRSI methodology. +- `inference-benchmark-design`, `dense-performance-evidence`, `kernel-writing-guide`, `inference-optimization-casebook`. +- `host-overhead-profiling`, `host-overhead-optimization`. + +These names are merge destinations confirmed by the inventory, not proof the underlying current files were inspected. No live repository links/anchors are fabricated. + +## P: incremental links to add, after reconciliation + +Only two official matrix destinations are proposed: `docs/reference-matrix.md` and `docs/searchspace-matrix.md`. Add Pack A paper provenance/methodology to Reference Matrix §2. Link existing skills to this pack's [readset](../READSET.md), [mechanisms](../MECHANISMS.md), [bounds/predictions supplement](../knowledge/bounds-predictions-and-decisions.md) and [cases](../cases/decision-cases.md). SearchSpace can cross-link these gates where an existing mechanism needs them, without adding hardware coverage from a methodology paper. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/vidur.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/vidur.md new file mode 100644 index 000000000..8e71a2230 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/papers-20261015/references/vidur.md @@ -0,0 +1,40 @@ +# Vidur: source audit and mechanisms + +Status: candidate / empirical_validation: not_run. F = paper fact or author-reported evidence; P = proposed operational use. Source: [Vidur: A Large-Scale Simulation Framework For LLM Inference, 2405.05465v2](https://arxiv.org/abs/2405.05465v2), revised 2024-05-21. [Pinned full text](https://arxiv.org/html/2405.05465v2), [PDF](https://arxiv.org/pdf/2405.05465v2). ID/title/version match verified against arXiv abstract and full text. No implementation audit. + +## Exact readset + +Full methods §§3–6, including §§4.1–4.5 and §§5.1–5.2; evaluation §§7.1–7.3; Appendix A.1–A.2. Background §§1–2 and related-work/conclusion §§8–9 also read. Table 1 workload definitions and Table 2 cost accounting read in text. All figure captions/discussion 1–8 read; rendered PDF Figures 5–6 (p.11) and 7–8 (p.16) visually checked. Other figures are caption/text-only reads; no values inferred from their unseen pixels. The paper has no numbered cost equations; the quadratic prefill surrogate in §4.3 and the capacity/cost definitions in §6 are unnumbered. No RF-versus-MLP/polynomial ablation or isolated error attribution experiment is reported in the inspected paper. + +## V1. Dependency-aware operator models + +- **Objective (F):** estimate inference execution across batch composition and parallelization without profiling every sequence-length combination. +- **Assumptions (F):** shared transformer operator families; token-level work depends on current prefill+decode tokens; prefill attention has quadratic sequence-length cost; decode attention depends mainly on total KV reads when the kernel can parallelize across skewed sequences. +- **Decisions / constraints (F):** model shapes, sharded tensor shapes, current token count, per-request context lengths, phase, communication payload and topology. Profile sharded compute shapes on one GPU; communication requires separate topology-specific profiling. +- **Mechanism (F):** §4.3 replaces a prefill batch with an equivalent length sqrt(sum p_i²), models decode by aggregate KV traffic, and separates communication from model-dependent compute. §4.4 uses random-forest interpolation to capture tile/wave discontinuities with sparse profiles. +- **Resource benefit / cost (F):** less hardware profiling; CPU lookup/simulation replaces exhaustive deployment search. Profiling is still required. The random forest and length reduction are empirical approximations, not physical runtime lower bounds. +- **Author evidence (F):** end-to-end fidelity below is evidence for the composite simulator. It does not isolate the marginal accuracy or sample savings of each modeling choice. +- **Limits / countersignals (F/P):** exact training/held-out operator splits, RF uncertainty calibration and coverage boundaries are unreported. The skew-insensitivity argument specifically depends on sequence-parallel attention kernels. Unsupported kernels, model structures, dtypes, graph modes and topologies require new validation; do not extrapolate by model size alone. +- **Candidate rule (P):** attach an input-dependency signature and calibration domain to every predictor. Test unequal-context batches even when total KV bytes match. Mark interpolation, extrapolation and missing-profile states separately. + +## V2. Stateful simulation plus constrained shortlist + +- **Objective (F):** maximize sustainable QPS per hourly rental dollar subject to latency requirements. +- **Assumptions (F):** workload-specific request lengths/arrivals, modeled batching and memory policies, synchronous pipeline scheduling. Runtime error changes queueing and future batch composition. +- **Decisions / constraints (F):** GPU SKU, TP/PP degrees, replicas, scheduler, batch size and scheduler token budget. §6 defines capacity using P99 scheduling delay under 5 seconds; §7.3 imposes TTFT P90 <2 s and TBT P99 <200 ms. These are study choices, not universal SLOs. +- **Mechanism (F):** global routing → replica batching/KV planner → pipeline-stage scheduling; enumerate configurations and binary-search their sustainable arrival rate, then filter/select on joint SLO and cost. The cost denominator is the hourly rental cost of all GPUs used, not one GPU and not cost per generated token. +- **Resource benefit / cost (F):** simulations parallelize across CPU cores; avoid deploying every candidate. Appendix A.2 projects actual-execution cost for 35,565 search runs rather than reporting those GPU runs as performed. Simulated search took about 12.5 h on a 96-core CPU machine, about $125 under the authors' historical price assumptions. Projected deployment cost is about $1.14M, not a current price quote or measured bill. +- **Author evidence (F):** §7.3's search uses four models, three traces, A100/H100, at most 16 GPUs across replicas; TP and PP each 1/2/4; batch 32–512; vLLM, Orca+ and Sarathi-Serve. Fig.5 shows that the Pareto frontier of one latency metric can violate the other. Fig.1/§7.3 reports up to roughly 2× configuration-transfer cost across workloads. +- **Limits / countersignals (F/P):** default-vLLM fidelity tests do not independently validate every scheduler/PP configuration in the wider simulated search. Synchronous PP support does not establish asynchronous overlap support. Fig.5(b)'s label says Qwen-72B/Arxiv-4K, while §7.3's paragraph names BWB-4K; retain this discrepancy when citing that panel. +- **Candidate rule (P):** use predictions to create a diverse, jointly feasible shortlist and mark close ranks unresolved. Reevaluate after workload drift; measure finalists on the intended implementation and resource budget before promotion. + +## V3. Validate at the queueing regime that matters + +- **Objective (F/P):** prevent accurate local runtime estimates from creating overconfident service-level claims. +- **Assumptions / decisions (F):** compare four models (LLaMA2-7B/70B, InternLM-20B, Qwen-72B), three length traces capped at 4,096 total tokens, and static versus Poisson arrivals. Fidelity configurations use TP1/2/4 as appropriate and the default vLLM scheduler in an optimized vLLM fork with CUDA graphs and added scheduling/telemetry support. +- **Mechanism / metric (F):** dynamic normalized E2E latency = request latency / output-token count. Static normalized execution latency excludes scheduling delay. Median/P95 are evaluated separately; these are not TTFT or token-tail TBT accuracy claims. +- **Resource benefit / cost (F/P):** the proposed validation gate reduces the risk of selecting a falsely feasible deployment; the paper does not isolate the runtime/cost of this fidelity protocol from profiling and evaluation. This is a proposed risk benefit, not a measured speedup. +- **Resource context (F):** Azure A100 VMs contain four 80-GB GPUs with pairwise NVLink; the described H100 VMs likewise contain four 80-GB H100s with pairwise NVLink. The methods do not qualify an NPU stack. +- **Author evidence (F):** §7.2 reports static P95 error up to 3.33%; at 85% capacity error is below 5% in almost all scenarios. Appendix A.1/Fig.7(d) reports -12.65% P95 normalized E2E error for LLaMA2-7B on Arxiv-4K at 95% capacity. This qualifies the abstract's less-than-9% phrasing. Authors attribute the small-model error partly to CPU overhead, with queue amplification near capacity. +- **Limits (F/P):** component error attribution is an explanation, not an isolated ablation. The paper does not supply a universal safety margin or calibrated prediction interval. +- **Candidate rule (P):** validate operator, iteration, request and queue behavior separately; sample below and near the operating capacity boundary, include host overhead, and refuse SLO certification from an uncalibrated simulator alone. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/roofline-contract.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/roofline-contract.md new file mode 100644 index 000000000..36d2611b9 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/roofline-contract.md @@ -0,0 +1,129 @@ +# Pure Roofline helper contract + +The bundled [helper](../scripts/roofline.py) implements the existing L1 formulas +and [bound discipline](papers-20261015/knowledge/bounds-predictions-and-decisions.md). +It is InferRSI-authored software, not copied upstream code. The procedure remains +candidate / empirical_validation=not_run; CPU arithmetic checks do not establish +campaign efficacy, model qualification or achievable acceleration. + +## Calling and scope + +Load the script as a Python module and call `analyze(workload, hardware)`. It uses +only the standard library, returns a new JSON-compatible mapping and neither +mutates the inputs nor reads/writes files, runs commands, discovers devices or +accesses the network. Loading/persisting attachments is the caller's separate +responsibility. This is an internal skill helper, not a new CLI or public API. + +The first slice accepts one device, one homogeneous floating-point operation +class and one traffic tier. It does not walk a model, estimate work from shapes, +sum devices, pool capacity, model communication or perform Amdahl/E2E analysis. +The counts describe the stated algorithm: a different algorithm or cache policy +can change both work and traffic. Logical tensor sizes are not automatically +mandatory transfers across a particular memory tier. + +## Input fields + +Both arguments are JSON objects. Unknown facts are omitted or null, with a +`missing_reason` where available. Extra metadata is retained without interpreting +or verifying it. Units and condition strings are exact; there is no implicit +conversion, normalization or hardware-name lookup. + +| Object | Required fields | +| --- | --- | +| `workload` | Nonempty `workload_id`, `shape`, `boundary`, `hardware_id`, `resource_scope`; `operation`, `work`, `traffic`, nonempty `assumptions` list | +| `hardware` | Matching `hardware_id` and logical `resource_scope`; integer `device_count=1`; `operation`, `peak_compute`, `bandwidth`, nonempty `assumptions` list | +| Each `operation` | `dtype`, `accumulator_dtype`, `op_class`, `sparsity`, `fma_flops`; all five must match | +| `work` / `traffic` | Finite positive `value`, exact `unit` (`FLOP` / `byte`), `source`; traffic also names a `tier` | +| `peak_compute` / `bandwidth` | Finite positive `value`, exact `unit` (`FLOP/s` / `byte/s`), `source`; bandwidth names the same `tier` | +| Each `source` | Nonempty `kind`, `locator`; nonempty `revision` or lowercase 64-hex `sha256`; caller-supplied `recorded_at` text, or `time_unknown_reason` | + +Supported dtype spellings are `float64`, `float32`, `tf32`, `float16`, `bfloat16`, +`float8_e4m3fn`, `float8_e5m2`. This list does not certify hardware support. +`op_class` is exactly one of `scalar`, `vector`, `matrix`. `sparsity` is an +explicit condition string such as `dense` or `2:4`; no speed multiplier follows +from it. `fma_flops` is 1 or 2, matching the supplied count/rate convention; the +helper never converts between conventions. + +Work/traffic source kinds are `derived`, `measured` or `synthetic`. Both hardware +rates must use `rated` sources, or both must be explicitly `synthetic` fixtures. +The first helper retains empirical (`measured`) rates and probes in its inputs +but returns insufficient evidence for their use as an L1 rated bound. A measured +component envelope is not a universal physical limit. A source label does not +verify the linked document: callers own source authenticity, applicability, +clock/power/allocation conditions and whether the work/traffic counts are valid. +Source timestamps are retained text, not a freshness or qualification decision. + +## Output and failure semantics + +`analysis_status` is `COMPUTED` or `INSUFFICIENT_EVIDENCE`, never a campaign +verdict. For compatible, sourced inputs: + +- `arithmetic_intensity_flop_per_byte = F/T`. +- `conditional_roof_flop_per_s = min(P, (F/T)*B)`. +- `ridge_flop_per_byte = P/B`. +- `conditional_runtime_floor_s = max(F/P, T/B)`, not their sum. +- `analytical_limiting_factor` is `memory`, `compute` or exact-numeric `balanced`. + +The floor is conditional on the supplied counts/rated rates; it excludes queueing, +launch, synchronization and communication. No observed baseline, attainable +utilization, speedup, SLO or goal acceptance is derived. `evidence_basis` preserves +the common hardware source kind, or null for mixed kinds; inspect status and +unknowns before using any number. + +Missing sources/values, unsupported scope and incompatible conditions yield +explicit `unknowns` and null dependent outputs. AI may remain available when +only hardware evidence is missing. `inputs` retains independent copies of all +source facts/metadata; `assumptions` concatenates caller assumptions and `limits` +records interpretation boundaries. Malformed types, nonfinite numbers, booleans +in numeric fields, nonpositive numbers and derived overflow/underflow raise +`ValueError`. Zero-work or zero-traffic cases are outside this first slice; zero +never substitutes for unknown. Nothing executes or grants authorization. + +## Worked caller-controlled attachment + +[roofline-example.json](roofline-example.json) contains entirely synthetic facts, +not device specifications. Calling `analyze(example["workload"], example["hardware"])` +gives AI 6 FLOP/byte, roof 60 FLOP/s, ridge 10 FLOP/byte, conditional floor 10 s, +`memory` and `evidence_basis=synthetic`. These are dimensional test numbers. + +A caller may retain the input and returned mapping at +`plan/attachments/.json` before search, or in a separately versioned +attachment for a permitted row-4 revision. For example, the following caller +explicitly performs the file operations; replace the placeholders and choose a +new attachment path rather than overwriting frozen evidence: + +```python +import json +import runpy +from pathlib import Path + +owner = Path("") +helper = runpy.run_path(str(owner / "scripts/roofline.py")) +analyze = helper["analyze"] +example = json.loads((owner / "references/roofline-example.json").read_text(encoding="utf-8")) +attachment = { + "helper_revision": "", + "analysis": analyze(**example), +} +target = Path("") / "plan/attachments/.json" +target.parent.mkdir(parents=True, exist_ok=True) +with target.open("x", encoding="utf-8") as stream: + stream.write(json.dumps(attachment, indent=2, allow_nan=False) + "\n") +``` + +The helper revision/digest is caller-supplied provenance, not a Git probe. Then +reference the attachment using existing campaign-plan fields: + +```yaml +search_plan: + - id: "" + conditional_headroom: >- + Synthetic component example only: conditional floor 10 s for the stated + work/traffic. Exposed E2E time, baseline, noise and removable headroom remain + unknown; no speedup or goal decision follows. + evidence: "plan/attachments/.json" +``` + +This is a row-4 excerpt; preserve all other required plan fields. The helper does +not create the attachment, modify the plan or freeze/accept goals. Frozen rows, +RunSpec, validators, historical records and goal-owner authority are unchanged. diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/roofline-example.json b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/roofline-example.json new file mode 100644 index 000000000..de06fdbdf --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/roofline-example.json @@ -0,0 +1,72 @@ +{ + "workload": { + "workload_id": "synthetic-component-v1", + "shape": "one synthetic matrix operation", + "boundary": "one invocation; stated compute and HBM traffic only", + "hardware_id": "synthetic-reference", + "resource_scope": "logical-device-0", + "operation": { + "dtype": "bfloat16", + "accumulator_dtype": "float32", + "op_class": "matrix", + "sparsity": "dense", + "fma_flops": 2 + }, + "work": { + "value": 600, + "unit": "FLOP", + "source": { + "kind": "synthetic", + "locator": "fixture:roofline-example", + "revision": "v1", + "time_unknown_reason": "Undated synthetic arithmetic fixture" + } + }, + "traffic": { + "value": 100, + "unit": "byte", + "tier": "HBM", + "source": { + "kind": "synthetic", + "locator": "fixture:roofline-example", + "revision": "v1", + "time_unknown_reason": "Undated synthetic arithmetic fixture" + } + }, + "assumptions": ["Counts are synthetic and apply only to this stated invocation."] + }, + "hardware": { + "hardware_id": "synthetic-reference", + "resource_scope": "logical-device-0", + "device_count": 1, + "operation": { + "dtype": "bfloat16", + "accumulator_dtype": "float32", + "op_class": "matrix", + "sparsity": "dense", + "fma_flops": 2 + }, + "peak_compute": { + "value": 100, + "unit": "FLOP/s", + "source": { + "kind": "synthetic", + "locator": "fixture:roofline-example", + "revision": "v1", + "time_unknown_reason": "Undated synthetic arithmetic fixture" + } + }, + "bandwidth": { + "value": 10, + "unit": "byte/s", + "tier": "HBM", + "source": { + "kind": "synthetic", + "locator": "fixture:roofline-example", + "revision": "v1", + "time_unknown_reason": "Undated synthetic arithmetic fixture" + } + }, + "assumptions": ["Rates are synthetic references, not measured or rated device facts."] + } +} diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/xllm-pd-handoff.md b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/xllm-pd-handoff.md new file mode 100644 index 000000000..61da96121 --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/references/xllm-pd-handoff.md @@ -0,0 +1,69 @@ +# xLLM on Ascend: accounting for prefill reuse and decode transfer + +At [xLLM revision `90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4`][version] (`0.12.0` in +`version.txt`), a prefill-side prefix hit can reduce the tokens computed in a +chunk. A separate operation prepares the decode instance to serve the next +token. Account for both before estimating how much of a request can get faster. +This source inspection extends the [prefix-reuse cost comparison](mooncake-prefix-reuse-feasibility.md) +with one engine's actual scheduling and transfer boundaries. + +## Trace one request + +| Decision | What the pinned source shows | How to use it | +| --- | --- | --- | +| Which scheduler runs? | [Selection][factory] tests `enable_disagg_pd`. [Construction][create] picks `PDScheduler` or the continuous scheduler. The [batch policy][mode] disables mixed batches on a disaggregated `PREFILL` instance. | Check the effective flag and role on each instance. Chunking by itself also exists on the continuous path. | +| Which prompt tokens need compute? | [Prefill allocation][chunk] normally looks up shared blocks before computing the number of new tokens in the chunk. It bounds the end by both the prompt length and the cached-token count plus the budget. Linear-attention models can introduce an alignment step. Redistribution can skip a shared lookup to avoid matching the sequence's own published blocks. | Record matched tokens, newly scheduled tokens and the chunk budget separately. Block capacity can include reserved but uncomputed tokens. A cold prompt has no reusable prefix. | +| Is decode ready? | The [decode admission RPC][admit] first tries to allocate the destination blocks and prepares the transfer metadata, then publishes a reservation. It distinguishes an overlong prompt from transient cache pressure. The [first-generation handler][id] also checks the request and reservation identity. | Trace one request across both roles. Refuse the handoff on a stale reservation, even if the request identifier matches. | +| Did the KV arrive? | On native `PULL`, the [restore path][pull] checks group identities and local/remote block counts, then checks transfer success before normal enqueue. The same code describes a different ordering for heterogeneous `PUSH`, in which writes precede the first-generation message. | Record the transport mode, both endpoints, rank mapping and restore outcome. A prefix hit on prefill or an accepted reservation on decode establishes neither transfer completion nor interoperability. | + +The [P/D example][pd] uses etcd for instance metadata and an external xLLM +Service for routing. Its example launches separate prefill and decode roles +with both chunking and prefix caching disabled. Its later note describes +enabling both on the prefill path. The [Ascend guide][ascend] separately +documents compatible drivers, a model-supported NPU image and an example +using HCCL. Its single-service health check cannot test a cross-instance handoff. + +## Recheck and reject + +1. On the pinned source, follow the factory into the batch policy. With + disaggregation off, the factory must select the continuous path. With it on + and role `PREFILL`, confirm the policy disables mixed batches. +2. Compare a prompt with no match against one with a matched prefix. Read + `allocate_for_prefill` and check that new compute is the difference between + the target position and the sequence's current KV token count (including any shared prefix and earlier computed chunks). Follow the allocation + target separately if full-prompt reservation is enabled. +3. Inspect the upstream [failed-pull test definition][test]. A fake worker + returns failure after decode has reserved blocks. Its assertions require the + free-block count to recover and the decode queue to stay empty. The test + body is an oracle for this failure path. It supplies no hardware result. +4. For a future service comparison, hold weights, tokenizer, KV representation, + device budget, arrival trace and prompt/output lengths fixed. Include cold + and repeated-prefix requests. Capture queue time per role, actual prefix + tokens, bytes transferred, restore time, TTFT, token-gap distribution and + failed requests. With unknown topology or cache representation, or with only + a health response or a prefix-hit counter, leave service impact unresolved. + +**Evidence.** `empirical_validation: not_run`. The deployment commands are +upstream examples. No scheduler tests, service, external router, transport +or NPU result was executed or qualified for this source note. + +**License.** The pinned [root license][license] is Apache-2.0. The inspected +implementation and test carry xLLM Authors' Apache-2.0 notices. The +[third-party notice][notices] assigns component-specific terms, including +BSD-3-Clause for etcd-cpp-apiv3 and Apache-2.0 for bRPC. This note includes +original analysis and links only. External xLLM Service, dependencies, images +and model weights are outside the inspected source scope. + +[version]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/version.txt +[factory]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/scheduler/scheduler_factory.cpp#L26-L32 +[create]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/scheduler/scheduler_factory.h#L42-L70 +[mode]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/scheduler/scheduler_policy.cpp#L1150-L1193 +[chunk]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/scheduler/scheduler_policy.cpp#L584-L653 +[admit]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/disaggregation/pd_service_impl.cpp#L229-L299 +[id]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/disaggregation/pd_scheduler.cpp#L999-L1079 +[pull]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/xllm/core/disaggregation/pd_scheduler.cpp#L1140-L1228 +[pd]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/docs/src/content/docs/en/features/disagg_pd.md +[ascend]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/docs/src/content/docs/en/hardware/ascend_npu.md +[test]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/tests/core/scheduler/pd_scheduler_test.cpp#L1141-L1186 +[license]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/LICENSE +[notices]: https://github.com/xLLM-AI/xllm/blob/90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4/THIRDPARTYNOTICES.md diff --git a/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/scripts/roofline.py b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/scripts/roofline.py new file mode 100644 index 000000000..4bd02213b --- /dev/null +++ b/src/inferrsi/knowledge/atoms/playbooks/performance-ceiling-analysis/scripts/roofline.py @@ -0,0 +1,200 @@ +"""Pure, internal single-resource Roofline arithmetic; no execution or acceptance.""" + +import math + +FLOAT_DTYPES = { + "float64", "float32", "tf32", "float16", "bfloat16", "float8_e4m3fn", "float8_e5m2", +} +OP_FIELDS = ("dtype", "accumulator_dtype", "op_class", "sparsity", "fma_flops") + + +def _copy_json(value): + """Accept only JSON data, without invoking caller-defined copy/serialization hooks.""" + if value is None or type(value) in (str, int, bool): + return value + if type(value) is float and math.isfinite(value): + return value + if type(value) is list: + return [_copy_json(item) for item in value] + if type(value) is dict and all(type(key) is str for key in value): + return {key: _copy_json(item) for key, item in value.items()} + raise ValueError("Inputs must contain only finite JSON data") + + +def _text(mapping, key, path, unknowns): + value = mapping.get(key) + if value is None or value == "": + unknowns.append(f"{path}.{key}: missing") + return None + if type(value) is not str or not value.strip(): + raise ValueError(f"{path}.{key} must be nonempty text or null") + return value + + +def _mapping(value, path): + if value is None: + return {} + if type(value) is not dict: + raise ValueError(f"{path} must be an object or null") + return value + + +def _positive(value, path): + if value is None: + return None + if type(value) not in (int, float): + raise ValueError(f"{path} must be a finite positive number or null") + try: + result = float(value) + except OverflowError as error: + raise ValueError(f"{path} exceeds the numeric range") from error + if not math.isfinite(result) or result <= 0: + raise ValueError(f"{path} must be a finite positive number or null") + return result + + +def _source(value, path, unknowns): + source = _mapping(value, path) + kind = _text(source, "kind", path, unknowns) + _text(source, "locator", path, unknowns) + revision = source.get("revision") + digest = source.get("sha256") + if revision is not None: + _text(source, "revision", path, unknowns) + if digest is not None: + if type(digest) is not str or len(digest) != 64 or any( + char not in "0123456789abcdef" for char in digest + ): + raise ValueError(f"{path}.sha256 must be a lowercase SHA-256 digest") + if not revision and not digest: + unknowns.append(f"{path}: source revision or sha256 is missing") + if source.get("recorded_at"): + _text(source, "recorded_at", path, unknowns) + else: + _text(source, "time_unknown_reason", path, unknowns) + return kind + + +def _fact(mapping, key, unit, path, unknowns): + path = f"{path}.{key}" + fact = _mapping(mapping.get(key), path) + value = _positive(fact.get("value"), f"{path}.value") + if value is None: + unknowns.append(f"{path}.value: {fact.get('missing_reason') or 'missing'}") + if _text(fact, "unit", path, unknowns) != unit: + unknowns.append(f"{path}.unit: requires {unit}; no implicit conversion") + kind = _source(fact.get("source"), f"{path}.source", unknowns) + return value, fact, kind + + +def _operation(mapping, path, unknowns): + operation = _mapping(mapping.get("operation"), f"{path}.operation") + for key in OP_FIELDS[:-1]: + _text(operation, key, f"{path}.operation", unknowns) + for key in ("dtype", "accumulator_dtype"): + if operation.get(key) not in FLOAT_DTYPES: + unknowns.append(f"{path}.operation.{key}: unsupported floating-point dtype") + if operation.get("op_class") not in ("scalar", "vector", "matrix"): + unknowns.append(f"{path}.operation.op_class: requires one scalar/vector/matrix class") + convention = operation.get("fma_flops") + _positive(convention, f"{path}.operation.fma_flops") + if convention not in (1, 2): + unknowns.append(f"{path}.operation.fma_flops: requires an explicit 1 or 2 convention") + return operation + + +def _finite(value, label): + if not math.isfinite(value) or value <= 0: + raise ValueError(f"Derived {label} is outside the finite positive numeric range") + return value + + +def analyze(workload, hardware): + """Return conditional arithmetic and retained inputs; see references/roofline-contract.md. + + Missing/incompatible evidence returns INSUFFICIENT_EVIDENCE. Malformed data + raises ValueError. Neither result is a campaign verdict or permission to run. + Hardware rates must both be rated references, or both synthetic fixtures. + Empirical component envelopes are retained but not treated as L1 bounds. + """ + workload = _mapping(_copy_json(workload), "workload") + hardware = _mapping(_copy_json(hardware), "hardware") + unknowns = [] + for key in ("workload_id", "shape", "boundary", "hardware_id", "resource_scope"): + _text(workload, key, "workload", unknowns) + operation = _operation(workload, "workload", unknowns) + work, _, work_kind = _fact(workload, "work", "FLOP", "workload", unknowns) + traffic, traffic_fact, traffic_kind = _fact( + workload, "traffic", "byte", "workload", unknowns + ) + tier = _text(traffic_fact, "tier", "workload.traffic", unknowns) + if work_kind not in ("derived", "measured", "synthetic"): + unknowns.append("workload.work.source.kind: requires derived/measured/synthetic counts") + if traffic_kind not in ("derived", "measured", "synthetic"): + unknowns.append("workload.traffic.source.kind: requires derived/measured/synthetic counts") + intensity = _finite(work / traffic, "intensity") if not unknowns else None + + for key in ("hardware_id", "resource_scope"): + value = _text(hardware, key, "hardware", unknowns) + if value != workload.get(key): + unknowns.append(f"hardware.{key}: differs from workload") + count = hardware.get("device_count") + _positive(count, "hardware.device_count") + if type(count) is not int or count != 1: + unknowns.append("hardware.device_count: only one device is supported") + hardware_operation = _operation(hardware, "hardware", unknowns) + for key in OP_FIELDS: + if operation.get(key) != hardware_operation.get(key): + unknowns.append(f"hardware.operation.{key}: differs from workload") + compute, _, compute_kind = _fact( + hardware, "peak_compute", "FLOP/s", "hardware", unknowns + ) + bandwidth, bandwidth_fact, bandwidth_kind = _fact( + hardware, "bandwidth", "byte/s", "hardware", unknowns + ) + bandwidth_tier = _text(bandwidth_fact, "tier", "hardware.bandwidth", unknowns) + if tier != bandwidth_tier: + unknowns.append("hardware.bandwidth.tier: differs from workload traffic tier") + basis = compute_kind if compute_kind == bandwidth_kind else None + if basis not in ("rated", "synthetic"): + unknowns.append("hardware rates: requires both rated or both synthetic sources; " + "probes/empirical envelopes are outside this L1 helper") + assumptions = [] + for label, mapping in (("workload", workload), ("hardware", hardware)): + values = mapping.get("assumptions") + if values is None or values == []: + unknowns.append(f"{label}.assumptions: missing") + elif type(values) is not list or any( + type(value) is not str or not value.strip() for value in values + ): + raise ValueError(f"{label}.assumptions must be a list of nonempty strings") + else: + assumptions.extend(values) + roof = ridge = floor = limiting = None + if not unknowns: + compute_time = _finite(work / compute, "compute time") + traffic_time = _finite(traffic / bandwidth, "traffic time") + floor = max(compute_time, traffic_time) + # Avoid overflowing intensity * bandwidth before applying the compute cap. + roof = _finite(work / floor, "roof") + ridge = _finite(compute / bandwidth, "ridge") + limiting = ("balanced" if compute_time == traffic_time else + "compute" if compute_time > traffic_time else "memory") + return { + "analysis_status": "INSUFFICIENT_EVIDENCE" if unknowns else "COMPUTED", + "evidence_basis": basis, + "arithmetic_intensity_flop_per_byte": intensity, + "conditional_roof_flop_per_s": roof, + "ridge_flop_per_byte": ridge, + "conditional_runtime_floor_s": floor, + "analytical_limiting_factor": limiting, + "assumptions": assumptions, + "unknowns": unknowns, + "inputs": {"workload": workload, "hardware": hardware}, + "limits": [ + "Conditional on supplied work/traffic, operation and resource facts; unverified here.", + "No achievable utilization, speedup, quality, goal acceptance or E2E claim follows.", + "Queueing, launch, synchronization and communication are not modeled.", + "Changing algorithm, caching, sparsity or traffic changes this conditional model.", + ], + } diff --git a/src/inferrsi/knowledge/compositions/performance-ceiling-analysis.json b/src/inferrsi/knowledge/compositions/performance-ceiling-analysis.json new file mode 100644 index 000000000..9b0034b67 --- /dev/null +++ b/src/inferrsi/knowledge/compositions/performance-ceiling-analysis.json @@ -0,0 +1,517 @@ +{ + "authority": "checkout", + "metadata": { + "id": "performance-ceiling-analysis", + "kind": "skill", + "entrypoint": "playbooks/measurement/performance-ceiling-analysis/SKILL.md", + "title": "Estimate optimization headroom before modifying an inference system. Produces a three-level ceiling model (analytical, empirical component, end-to-end) and a prioritized measurement plan. Use to formulate acceptance targets when the user has not supplied them, assess a requested speedup, or identify the binding bottleneck.\n", + "origin": [ + "external" + ], + "sources": [ + { + "type": "git", + "repo": "https://github.com/InferMatrixLab/InferRSI", + "commit": "e2f3be102c66c358803ed2186ed67bf627ebcbdf", + "path": "src/inferrsi/knowledge/data/skill_library/playbooks/measurement/performance-ceiling-analysis/SKILL.md", + "sha256": "baeab73fb1fbf09da6ae0930b380720c66d9dc8085f8ccd1fb61381bb894799f" + }, + { + "url": "https://github.com/NVIDIA/TensorRT-LLM", + "commit": "f33e0e5fd55b", + "paths": [ + ".claude/skills/perf-analysis/SKILL.md", + ".claude/skills/perf-nsight-compute-analysis/references/roofline-analysis.md", + ".claude/skills/perf-workload-profiling/SKILL.md", + ".claude/skills/perf-optimization/SKILL.md", + ".claude/skills/perf-optimization-casebook/SKILL.md", + ".claude/skills/exec-env-check/SKILL.md", + ".claude/skills/exec-remote-slurm/SKILL.md", + ".claude/agents/perf-profiling-specialist.md" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/hahnyuan/LLM-Viewer", + "commit": "1893e4b5705d", + "paths": [ + "roofline_model.py", + "model_analyzer.py", + "hardwares/hardware_params.py", + "configs/DiT.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/ebugger/Empirical-Roofline-Toolkit", + "commit": "0771fa9621d0", + "paths": [ + "Empirical_Roofline_Tool-1.1.0/README.md", + "Empirical_Roofline_Tool-1.1.0/Drivers/driver1.c", + "Empirical_Roofline_Tool-1.1.0/Kernels/kernel1.c", + "Empirical_Roofline_Tool-1.1.0/Scripts/roofline.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + }, + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT", + "revision_precision": "full" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + }, + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices", + "revision_precision": "full" + } + ], + "applicability": { + "scope": "inference serving systems (LLM, diffusion, audio)", + "hardware": "any; CUDA examples from sources, NPU adaptation required", + "prerequisites": "profiler access (nsys/ncu or NPU equivalent), or willingness to work at L1 analytical only" + }, + "state": "candidate", + "limitations": [ + "Source-derived candidate; no local efficacy validation.", + "Acceptance-target preparation is agent guidance: the CLI and pure L1 helper do not infer gates, and unsupported estimates cannot replace user criteria or qualify campaign outcomes.", + "Mooncake's prefix-reuse condition is an analytical approximation; current cache validity, placement, effective rates, overlap and SLO outcomes remain unverified.", + "FlexGen's cross-tier feasibility comparison assumes fitted rates and perfect overlap; relaxed placements may OOM, the printed bls wording remains unresolved, and current compatibility, latency and efficacy are unverified.", + "The HuggingArch checkpoint anchor covers stored weights only. KV size and growth, activation traffic, collectives and end-to-end serving performance stay unanchored by it. Per-rank weight bytes stay unanchored until the second gate passes, and that gate checks the declared layout and format, not the placement a framework uses at run time.", + "Checkout-only local skill; no automatic execution or promotion.", + "Only declared references are required; other cross-skill links are navigation.", + "Historical revisions require a matching checkout or a retained store." + ], + "attribution": [ + { + "url": "https://github.com/NVIDIA/TensorRT-LLM", + "commit": "f33e0e5fd55b", + "paths": [ + ".claude/skills/perf-analysis/SKILL.md", + ".claude/skills/perf-nsight-compute-analysis/references/roofline-analysis.md", + ".claude/skills/perf-workload-profiling/SKILL.md", + ".claude/skills/perf-optimization/SKILL.md", + ".claude/skills/perf-optimization-casebook/SKILL.md", + ".claude/skills/exec-env-check/SKILL.md", + ".claude/skills/exec-remote-slurm/SKILL.md", + ".claude/agents/perf-profiling-specialist.md" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/hahnyuan/LLM-Viewer", + "commit": "1893e4b5705d", + "paths": [ + "roofline_model.py", + "model_analyzer.py", + "hardwares/hardware_params.py", + "configs/DiT.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "url": "https://github.com/ebugger/Empirical-Roofline-Toolkit", + "commit": "0771fa9621d0", + "paths": [ + "Empirical_Roofline_Tool-1.1.0/README.md", + "Empirical_Roofline_Tool-1.1.0/Drivers/driver1.c", + "Empirical_Roofline_Tool-1.1.0/Kernels/kernel1.c", + "Empirical_Roofline_Tool-1.1.0/Scripts/roofline.py" + ], + "type": "git", + "revision_precision": "prefix" + }, + { + "type": "paper", + "id": "usenix:fast25-qin", + "version": "FAST '25 proceedings, February 25-27, 2025, pp. 155-170", + "url": "https://www.usenix.org/system/files/fast25-qin.pdf", + "content_sha256": "543e56c541523c5e807d2231370f96749b2294bc901266397a7265b18ae2c130", + "sections": [ + "2.2, Table 1, Equations 1-2", + "3.1 and 5.3 (storage-scope limits only)" + ], + "readset": "references/mooncake-prefix-reuse-feasibility.md", + "license": "UNKNOWN" + }, + { + "type": "paper", + "id": "pmlr-v202-sheng23a", + "version": "ICML 2023 official ten-author edition, PMLR 202:31094-31116", + "url": "https://proceedings.mlr.press/v202/sheng23a/sheng23a.pdf", + "content_sha256": "7cd9673c37640011d38ef4b8595f5e1e09a85b1f803a3734f19c97ca66c75b9e", + "sections": [ + "1 and 3; 4.1-4.3, Figures 1-3, Algorithm 1, Equation 1", + "4.4 (scope boundary only); 6 and 6.1, Tables 2-3 (denominators and ablations)", + "Appendix A.3 selected cost/peak-memory formulas, PDF pages 15-17; A.2 ending only (theorem boundary)" + ], + "readset": "references/flexgen-offload-feasibility.md", + "license": "CC-BY-4.0" + }, + { + "type": "git", + "url": "https://github.com/shenh10/HuggingArch", + "commit": "facbbbc96856e558b9084a94a5070b2e2c86cf0b", + "paths": [ + "docs/validation.md", + "backend/arch/validate/_matching.py", + "backend/arch/validate/_weight_ledger.py", + "backend/arch/validate/_ablation.py", + "docs/parallelism.md", + "docs/evaluation_model.md", + "docs/measured_calibration.md", + "docs/known_limitations.md", + "kernel_bench/emit.py", + "backend/inference/op_calibration.py", + "backend/measure/scope.py", + "LICENSE" + ], + "readset": "references/huggingarch-checkpoint-anchor.md", + "identity": "references/huggingarch-source-identity.json", + "license": "MIT" + }, + { + "type": "document", + "url": "https://shenhan.cc/blog/huggingarch", + "displayed_publication_date": "2026-10-08", + "accessed": "2026-11-10", + "sha256": "31d0e0a9bbf9e32723fb6ab09179fbefb2fbba1043863f1475ecc7ea7ce24ed4", + "readset": "references/huggingarch-checkpoint-anchor.md", + "scope": "Live, unversioned companion post; sections 2.5, 2.6, 3.6 and 3.7 read from one retrieval, whose HTML bytes the sha256 identifies. Published before the pinned commit, so not attributable to it; figures absent from the repository are recorded as unverified.", + "license": "UNKNOWN" + }, + { + "type": "git", + "url": "https://github.com/xLLM-AI/xllm", + "commit": "90f6f13ea3d94334d4b5bd73d9fb23fc66bef1e4", + "paths": [ + "LICENSE", + "THIRDPARTYNOTICES.md", + "docs/src/content/docs/en/features/disagg_pd.md", + "docs/src/content/docs/en/hardware/ascend_npu.md", + "tests/core/scheduler/pd_scheduler_test.cpp", + "version.txt", + "xllm/core/disaggregation/pd_scheduler.cpp", + "xllm/core/disaggregation/pd_service_impl.cpp", + "xllm/core/scheduler/scheduler_factory.cpp", + "xllm/core/scheduler/scheduler_factory.h", + "xllm/core/scheduler/scheduler_policy.cpp" + ], + "readset": "references/xllm-pd-handoff.md", + "license": "Apache-2.0 with component-specific notices" + } + ], + "empirical_validation": "not_run", + "required_resources": [ + "playbooks/measurement/performance-ceiling-analysis/SKILL.md", + "playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md", + "playbooks/measurement/performance-ceiling-analysis/references/flexgen-offload-feasibility.md", + "playbooks/measurement/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md", + "playbooks/measurement/performance-ceiling-analysis/references/huggingarch-source-identity.json", + "playbooks/measurement/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/README.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/READSET.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/vidur.md", + "playbooks/measurement/performance-ceiling-analysis/references/roofline-contract.md", + "playbooks/measurement/performance-ceiling-analysis/references/roofline-example.json", + "playbooks/measurement/performance-ceiling-analysis/references/xllm-pd-handoff.md", + "playbooks/measurement/performance-ceiling-analysis/scripts/roofline.py" + ], + "composition": { + "when": {}, + "license": "Apache-2.0", + "permissions": { + "read": true, + "retain": true, + "redistribute": true + }, + "nodes": { + "navigation": { + "ref": "checkout:performance-ceiling-analysis.original.navigation", + "revision": "sha256:eca4b581910a0bbd12c42675bd15e092dddebb9aad1acbd6743bc8695feff0ea" + }, + "decision": { + "ref": "checkout:performance-ceiling-analysis.original.decision", + "revision": "sha256:59c4b84701e6911e8a8c6dbd4969acfbb0a03bb3dae04444cb4bf7511fa9a805" + }, + "procedure": { + "ref": "checkout:performance-ceiling-analysis.original.procedure", + "revision": "sha256:ab37c942a47029978319cc4e46dbade256f4634a4551b6a6a09a206ea1ece010", + "requires": [ + "decision" + ] + }, + "original": { + "ref": "checkout:performance-ceiling-analysis.original", + "revision": "sha256:f4b3caf76e0801ff55bd93a45fa8012a7d6815438b95b3ff4a8aaf4effe598b1" + }, + "acceptance-criteria": { + "ref": "checkout:performance-ceiling-analysis.acceptance-criteria", + "revision": "sha256:b9061dd86bfe8684fc6fe1f757a7c21696012e274a4a7451dcbd5ff4bbcbdfb2" + }, + "flexgen-offload-feasibility": { + "ref": "checkout:performance-ceiling-analysis.flexgen-offload-feasibility", + "revision": "sha256:c4e9be7af0d0b6ebb9116a1d9c94e356c090d88be5dbe0898172c49b2e493f48" + }, + "huggingarch-checkpoint-anchor": { + "ref": "checkout:performance-ceiling-analysis.huggingarch-checkpoint-anchor", + "revision": "sha256:116c2c572c7e8297645b2b8750c9d48ba9d1e7e76705ed5e3ac6e1f8cb4a5b3a" + }, + "huggingarch-source-identity": { + "ref": "checkout:performance-ceiling-analysis.huggingarch-source-identity", + "revision": "sha256:e11064e64fee263e5ec8410ea9192f60c91c219d99012b0866d24648e83faaf4" + }, + "mooncake-prefix-reuse-feasibility": { + "ref": "checkout:performance-ceiling-analysis.mooncake-prefix-reuse-feasibility", + "revision": "sha256:59694c1ec6979fa8db47c0390748342be3013bdf3e26b478d8ee665f961e08aa" + }, + "integration-notes": { + "ref": "checkout:performance-ceiling-analysis.integration-notes", + "revision": "sha256:f780f94c4502193bedf9eb0d601de9f16eefb9652f560c9469067232add08610" + }, + "mechanisms": { + "ref": "checkout:performance-ceiling-analysis.mechanisms", + "revision": "sha256:2401686c905b65db89a53dacb54cb1f76ad5defae4bd9fd3b9fbe855078f93af" + }, + "readme": { + "ref": "checkout:performance-ceiling-analysis.readme", + "revision": "sha256:4f72927c8bc4e0ed17f634731c17929cd64e08676825fca74b6fd95e1bd4047a" + }, + "readset": { + "ref": "checkout:performance-ceiling-analysis.readset", + "revision": "sha256:b7d266e647355bde70018658370161d0b8e00db24c568940ebb56cc881dabe6b" + }, + "static-checks": { + "ref": "checkout:performance-ceiling-analysis.static-checks", + "revision": "sha256:669cef45098a46095ad7fcab330f508b9bdd4221332652a550d1284662acf0df" + }, + "decision-cases": { + "ref": "checkout:performance-ceiling-analysis.decision-cases", + "revision": "sha256:40f216bced5d93e971dd43c26df83f4df9964f13ac11a8d4aab65817b38cad9f" + }, + "govern-optimization-experiments-procedure": { + "ref": "checkout:performance-ceiling-analysis.govern-optimization-experiments-procedure", + "revision": "sha256:dbd2ca2094022fdfbe18372a10ff2e00b42ce041e04074a233490f43ce4f9bea" + }, + "govern-optimization-experiments-source-notes": { + "ref": "checkout:performance-ceiling-analysis.govern-optimization-experiments-source-notes", + "revision": "sha256:68b65c4d2c377656b0b1028015825445a3af046f63add30d3df33dd5d432f064" + }, + "bounds-predictions-and-decisions": { + "ref": "checkout:performance-ceiling-analysis.bounds-predictions-and-decisions", + "revision": "sha256:f2a6e14ad1cfb953060060d3b768304047a307ebf58ae0741e6e2fdda9ab88dd" + }, + "redirect-cross-layer-optimization-procedure": { + "ref": "checkout:performance-ceiling-analysis.redirect-cross-layer-optimization-procedure", + "revision": "sha256:cdbffa033771f7cc2ccc54bb2bac5a4e4a105769004bf855fbe92858adacdb68" + }, + "redirect-cross-layer-optimization-source-notes": { + "ref": "checkout:performance-ceiling-analysis.redirect-cross-layer-optimization-source-notes", + "revision": "sha256:11ce1f73accae11cc57e433c95b135e975aca9f5919dd75ac0a8c0ed8c56806b" + }, + "agentic-kernel": { + "ref": "checkout:performance-ceiling-analysis.agentic-kernel", + "revision": "sha256:94ce04e1223ad7c359eb3f8dda0c55225457fee0857f77c6a48dc0ced7c5c33b" + }, + "flashvector": { + "ref": "checkout:performance-ceiling-analysis.flashvector", + "revision": "sha256:6e6ced37080f4c646fbca71f175cf880efb7595838ad091a025dde8c6d915917" + }, + "inferencebench": { + "ref": "checkout:performance-ceiling-analysis.inferencebench", + "revision": "sha256:53414529b1c7417661de375089e5528a21192df8d026361bf36eba273f26470b" + }, + "prior-coverage": { + "ref": "checkout:performance-ceiling-analysis.prior-coverage", + "revision": "sha256:46640bd3ae47085cfefcdf1a88b243bd218a0f4c3cee9d4cf6cdde97388e12ab" + }, + "vidur": { + "ref": "checkout:performance-ceiling-analysis.vidur", + "revision": "sha256:34d8591f4d24130dc6bcf5573aa2ec025ee7f35a5c5c0533fc6907d2e8933100" + }, + "roofline-contract": { + "ref": "checkout:performance-ceiling-analysis.roofline-contract", + "revision": "sha256:a5d6c87e04e438adec92f16a659aeaadba0b9eaae7b805a3648f3e696640af9b" + }, + "roofline-example": { + "ref": "checkout:performance-ceiling-analysis.roofline-example", + "revision": "sha256:0fc510aaa0dc8938b6a1fa734bf7712759f46e2e95ae512f5865414190dd9909" + }, + "xllm-pd-handoff": { + "ref": "checkout:performance-ceiling-analysis.xllm-pd-handoff", + "revision": "sha256:f706ebe06e8900c7d309adaf0b89a3d2ef78078cef54418cb3eb30207a5cc56a" + }, + "roofline": { + "ref": "checkout:performance-ceiling-analysis.roofline", + "revision": "sha256:d27383635d8b61d486be9ba334e4326f6444f4846b58810275439c515297ea7b" + } + }, + "routes": { + "navigation": { + "layer": "L0", + "required": [ + "navigation" + ] + }, + "decision": { + "layer": "L1", + "required": [ + "decision" + ] + }, + "procedure": { + "layer": "L2", + "required": [ + "procedure" + ] + }, + "originals": { + "layer": "L3", + "required": [ + "original", + "acceptance-criteria", + "flexgen-offload-feasibility", + "huggingarch-checkpoint-anchor", + "huggingarch-source-identity", + "mooncake-prefix-reuse-feasibility", + "integration-notes", + "mechanisms", + "readme", + "readset", + "static-checks", + "decision-cases", + "govern-optimization-experiments-procedure", + "govern-optimization-experiments-source-notes", + "bounds-predictions-and-decisions", + "redirect-cross-layer-optimization-procedure", + "redirect-cross-layer-optimization-source-notes", + "agentic-kernel", + "flashvector", + "inferencebench", + "prior-coverage", + "vidur", + "roofline-contract", + "roofline-example", + "xllm-pd-handoff", + "roofline" + ] + } + } + } + }, + "directory_resources": { + "playbooks/measurement/performance-ceiling-analysis/SKILL.md": "original", + "playbooks/measurement/performance-ceiling-analysis/references/acceptance-criteria.md": "acceptance-criteria", + "playbooks/measurement/performance-ceiling-analysis/references/flexgen-offload-feasibility.md": "flexgen-offload-feasibility", + "playbooks/measurement/performance-ceiling-analysis/references/huggingarch-checkpoint-anchor.md": "huggingarch-checkpoint-anchor", + "playbooks/measurement/performance-ceiling-analysis/references/huggingarch-source-identity.json": "huggingarch-source-identity", + "playbooks/measurement/performance-ceiling-analysis/references/mooncake-prefix-reuse-feasibility.md": "mooncake-prefix-reuse-feasibility", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/INTEGRATION_NOTES.md": "integration-notes", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/MECHANISMS.md": "mechanisms", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/README.md": "readme", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/READSET.md": "readset", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/STATIC_CHECKS.md": "static-checks", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/cases/decision-cases.md": "decision-cases", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/procedure.md": "govern-optimization-experiments-procedure", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/govern-optimization-experiments/references/source-notes.md": "govern-optimization-experiments-source-notes", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/knowledge/bounds-predictions-and-decisions.md": "bounds-predictions-and-decisions", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/procedure.md": "redirect-cross-layer-optimization-procedure", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/redirect-cross-layer-optimization/references/source-notes.md": "redirect-cross-layer-optimization-source-notes", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/agentic-kernel.md": "agentic-kernel", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/flashvector.md": "flashvector", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/inferencebench.md": "inferencebench", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/prior-coverage.md": "prior-coverage", + "playbooks/measurement/performance-ceiling-analysis/references/papers-20261015/references/vidur.md": "vidur", + "playbooks/measurement/performance-ceiling-analysis/references/roofline-contract.md": "roofline-contract", + "playbooks/measurement/performance-ceiling-analysis/references/roofline-example.json": "roofline-example", + "playbooks/measurement/performance-ceiling-analysis/references/xllm-pd-handoff.md": "xllm-pd-handoff", + "playbooks/measurement/performance-ceiling-analysis/scripts/roofline.py": "roofline" + } +} diff --git a/tests/knowledge/test_atomic_performance_ceiling.py b/tests/knowledge/test_atomic_performance_ceiling.py new file mode 100644 index 000000000..ef8a3ed3f --- /dev/null +++ b/tests/knowledge/test_atomic_performance_ceiling.py @@ -0,0 +1,171 @@ +"""Reopen the released performance-ceiling guide and its attachments through the Reader.""" + +import json +import runpy +import shutil +from pathlib import PurePosixPath + +import pytest + +from inferrsi.knowledge.atomic_build import build_generation +from inferrsi.knowledge.atomic_generation import InstalledGeneration +from inferrsi.knowledge.catalog import _skill_search_source +from inferrsi.knowledge.decision_cards import DecisionSource +from tests.knowledge.test_atomic_casebooks import ( + ATOMS, + FIXTURES, + RELEASE_COMMIT, + assert_empty, + canonical, + digest, + select, +) +from tests.knowledge.test_atomic_generation import RELEASE_ROOT, make_author_root +from tests.knowledge.test_atomic_reader import allow +from tools.plugin_bundle import _io_path + +NAME = "performance-ceiling-analysis" +REF = "checkout:" + NAME +LIBRARY = "src/inferrsi/knowledge/data/skill_library/" +RELEASE = json.loads((FIXTURES / "playbook-domain-v0.3.4.json").read_bytes())["refs"][REF] + + +@pytest.fixture(scope="module") +def installed(tmp_path_factory): + root = tmp_path_factory.mktemp("ceiling") + author = make_author_root(root) + release = _io_path(root / "release") + shutil.copytree(RELEASE_ROOT, release) + spec_file = ATOMS.parent / "compositions" / (NAME + ".json") + shutil.copyfile(spec_file, author / "compositions" / spec_file.name) + spec = json.loads(spec_file.read_bytes()) + nodes = spec["metadata"]["composition"]["nodes"] + assert spec["directory_resources"].keys() == RELEASE["required_resources"].keys() + for logical, label in spec["directory_resources"].items(): + atom = ATOMS / (nodes[label]["ref"].removeprefix("checkout:") + ".json") + shutil.copyfile(atom, author / "atoms" / atom.name) + (resource,) = json.loads(atom.read_bytes())["content"].values() + raw = (ATOMS / resource["path"]).read_bytes() + assert digest(raw) == RELEASE["required_resources"][logical] + for dest in (author / "atoms" / resource["path"], release / LIBRARY / logical): + dest.parent.mkdir(parents=True, exist_ok=True) + dest.write_bytes(raw) + target = root / "installed" + generation = build_generation( + author, target, permits=allow, source_roots={RELEASE_COMMIT: release} + ) + return InstalledGeneration(target, expected=generation) + + +def test_original_paths_permissions_and_released_decision(installed): + _, bundle = installed.read_resolved(REF, revision=installed.catalog[REF]["revision"]) + assert bundle.view()["resources"] == RELEASE["required_resources"] + assert len(bundle.content) == 26 and sum(map(len, bundle.content.values())) == 255282 + assert bundle.dependencies == RELEASE["dependencies"] == {} + metadata = dict(bundle.metadata) + metadata.pop("composition") + metadata["sources"] = metadata["sources"][1:] + assert ( + digest(canonical(metadata)) + == "b2624f69eff89125265cb70470d115ffe2c5e1e10c74a97da98e851ab38e4c23" + ) + layers = {} + for level in ("L0", "L1", "L2", "L3"): + result = select(installed, REF, level, 1_000_000) + size = sum(map(len, result.bodies)) + assert result.receipt["status"] == "delivered" and result.receipt["body_bytes"] == size + assert select(installed, REF, level, size) == result + short = select(installed, REF, level, size - 1) + assert_empty(short, "over_budget") + assert short.receipt["required_bytes"] == size + assert_empty( + select(installed, REF, level, size, revision=RELEASE["revision"]), + "unavailable_revision", + ) + for denied in {REF, *(row["ref"] for row in result.receipt["delivered"])}: + incomplete = select( + installed, REF, level, size, permits=lambda pin, op: pin.ref != denied + ) + assert_empty(incomplete, "permission_denied") + for body, row in zip(result.bodies, result.receipt["delivered"], strict=True): + lo, hi = row["source_byte_range"] + path = row["source_path"].removeprefix(LIBRARY) + assert body == bundle.content[path][lo:hi] + assert row["source"]["commit"] == RELEASE_COMMIT + assert row["source_range_verification"] == "verified_at_build" + assert row["source_sha256"] == digest(body) + layers[level] = result.bodies + guide = RELEASE["entrypoint"] + (decision,) = layers["L1"] + assert bundle.content[guide].startswith(layers["L0"][0]) + assert layers["L2"][0] == decision and b"".join(layers["L2"]) == bundle.content[guide] + assert layers["L3"] == tuple(bundle.content[path] for path in sorted(bundle.content)) + _, fields = _skill_search_source(decision.decode()) + card = DecisionSource(REF, RELEASE["revision"], "skill", guide, guide, fields).project()["card"] + assert card["status"] == "partial" and card["missing_fields"] == ["validation"] + assert len(canonical(card)) == RELEASE["card_bytes"] == 9794 + assert digest(canonical(card)) == RELEASE["card_sha256"] + + +def test_source_scope_and_navigation(installed): + _, bundle = installed.read_resolved(REF, revision=installed.catalog[REF]["revision"]) + parents = bundle.metadata["sources"][1:] + assert len(parents) == len(bundle.metadata["attribution"]) == 8 + assert [p["revision_precision"] for p in parents[:3]] == ["prefix"] * 3 + assert [p["license"] for p in parents[3:]] == [ + "UNKNOWN", + "CC-BY-4.0", + "MIT", + "UNKNOWN", + "Apache-2.0 with component-specific notices", + ] + nodes = bundle.metadata["composition"]["nodes"] + for label, readset in [ + ("mooncake-prefix-reuse-feasibility", "mooncake-prefix-reuse-feasibility.md"), + ("flexgen-offload-feasibility", "flexgen-offload-feasibility.md"), + ("huggingarch-checkpoint-anchor", "huggingarch-checkpoint-anchor.md"), + ("huggingarch-source-identity", "huggingarch-checkpoint-anchor.md"), + ("xllm-pd-handoff", "xllm-pd-handoff.md"), + ]: + node = nodes[label] + _, material = installed.read_resolved(node["ref"], revision=node["revision"]) + target = "references/" + readset + assert material.metadata["sources"][1:] == [ + p for p in parents if p.get("readset") == target + ] + assert material.metadata["attribution"] == [ + p for p in bundle.metadata["attribution"] if p.get("readset") == target + ] + links = RELEASE["relative_guide_links"].values() + outside = {link["path"] for link in links if not link["in_directory"]} + assert len(outside) == 3 and outside.isdisjoint(bundle.content) + assert NAME not in installed.skills + assert nodes["acceptance-criteria"]["ref"] == REF + ".acceptance-criteria" + + +def test_released_roofline_calculator_and_example(installed, tmp_path): + delivered = select(installed, REF, "L3", 1_000_000) + contents = { + PurePosixPath(item["source_path"]).name: body + for item, body in zip(delivered.receipt["delivered"], delivered.bodies, strict=True) + if item["source_path"].endswith( + ("/scripts/roofline.py", "/references/roofline-example.json") + ) + } + script = tmp_path / "roofline.py" + script.write_bytes(contents["roofline.py"]) + analyze = runpy.run_path(str(script))["analyze"] + example = json.loads(contents["roofline-example.json"]) + result = analyze(**example) + assert result["analysis_status"] == "COMPUTED" and result["evidence_basis"] == "synthetic" + assert ( + result["analytical_limiting_factor"] == "memory" + and result["conditional_runtime_floor_s"] == 10 + ) + del example["hardware"]["bandwidth"]["value"] + incomplete = analyze(**example) + assert incomplete["analysis_status"] == "INSUFFICIENT_EVIDENCE" + assert incomplete["conditional_runtime_floor_s"] is None + example["hardware"]["bandwidth"]["value"] = -1 + with pytest.raises(ValueError): + analyze(**example)