acprof 0.3.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (704) hide show
  1. acprof/__init__.py +3 -0
  2. acprof/__main__.py +5 -0
  3. acprof/_bundle/.dockerignore +20 -0
  4. acprof/_bundle/LICENSE +202 -0
  5. acprof/_bundle/NOTICE +43 -0
  6. acprof/_bundle/acprof/__init__.py +3 -0
  7. acprof/_bundle/acprof/__main__.py +5 -0
  8. acprof/_bundle/acprof/analysis/__init__.py +1 -0
  9. acprof/_bundle/acprof/analysis/audit.py +276 -0
  10. acprof/_bundle/acprof/analysis/comparison.py +364 -0
  11. acprof/_bundle/acprof/analysis/compatibility.py +223 -0
  12. acprof/_bundle/acprof/analysis/conditions.py +185 -0
  13. acprof/_bundle/acprof/analysis/independent_comparison.py +191 -0
  14. acprof/_bundle/acprof/analysis/latency_model.py +1106 -0
  15. acprof/_bundle/acprof/analysis/latency_report.py +577 -0
  16. acprof/_bundle/acprof/analysis/model.py +276 -0
  17. acprof/_bundle/acprof/analysis/precision.py +51 -0
  18. acprof/_bundle/acprof/analysis/uncertainty.py +144 -0
  19. acprof/_bundle/acprof/application/__init__.py +1 -0
  20. acprof/_bundle/acprof/application/download.py +14 -0
  21. acprof/_bundle/acprof/application/errors.py +5 -0
  22. acprof/_bundle/acprof/application/notifications.py +302 -0
  23. acprof/_bundle/acprof/application/preparation.py +333 -0
  24. acprof/_bundle/acprof/application/resources.py +66 -0
  25. acprof/_bundle/acprof/application/run.py +462 -0
  26. acprof/_bundle/acprof/application/terminal_log.py +136 -0
  27. acprof/_bundle/acprof/artifact_layout.py +261 -0
  28. acprof/_bundle/acprof/artifacts.py +161 -0
  29. acprof/_bundle/acprof/capabilities.py +404 -0
  30. acprof/_bundle/acprof/cli/__init__.py +1 -0
  31. acprof/_bundle/acprof/cli/audit.py +74 -0
  32. acprof/_bundle/acprof/cli/auto.py +41 -0
  33. acprof/_bundle/acprof/cli/backfill_compute.py +498 -0
  34. acprof/_bundle/acprof/cli/compare.py +34 -0
  35. acprof/_bundle/acprof/cli/coverage.py +70 -0
  36. acprof/_bundle/acprof/cli/doctor.py +47 -0
  37. acprof/_bundle/acprof/cli/inspect.py +101 -0
  38. acprof/_bundle/acprof/cli/load.py +190 -0
  39. acprof/_bundle/acprof/cli/main.py +64 -0
  40. acprof/_bundle/acprof/cli/model_store.py +22 -0
  41. acprof/_bundle/acprof/cli/plot.py +211 -0
  42. acprof/_bundle/acprof/cli/posthoc.py +113 -0
  43. acprof/_bundle/acprof/cli/probe.py +186 -0
  44. acprof/_bundle/acprof/cli/report.py +35 -0
  45. acprof/_bundle/acprof/cli/results.py +37 -0
  46. acprof/_bundle/acprof/cli/run.py +54 -0
  47. acprof/_bundle/acprof/cli/stats.py +94 -0
  48. acprof/_bundle/acprof/cli/tui.py +65 -0
  49. acprof/_bundle/acprof/config.py +177 -0
  50. acprof/_bundle/acprof/container/__init__.py +1 -0
  51. acprof/_bundle/acprof/container/compat/__init__.py +1 -0
  52. acprof/_bundle/acprof/container/compat/transformers_dynamic.py +54 -0
  53. acprof/_bundle/acprof/container/compat/transformers_model_types.json +1091 -0
  54. acprof/_bundle/acprof/container/compute_profile_runner.py +392 -0
  55. acprof/_bundle/acprof/container/download_model.py +165 -0
  56. acprof/_bundle/acprof/container/execution.py +73 -0
  57. acprof/_bundle/acprof/container/handlers/__init__.py +298 -0
  58. acprof/_bundle/acprof/container/handlers/audio.py +743 -0
  59. acprof/_bundle/acprof/container/handlers/custom_pipeline.py +74 -0
  60. acprof/_bundle/acprof/container/handlers/cv.py +321 -0
  61. acprof/_bundle/acprof/container/handlers/diffusion.py +728 -0
  62. acprof/_bundle/acprof/container/handlers/moss.py +64 -0
  63. acprof/_bundle/acprof/container/handlers/multimodal.py +609 -0
  64. acprof/_bundle/acprof/container/handlers/nlp.py +747 -0
  65. acprof/_bundle/acprof/container/handlers/onnx_tasks.py +231 -0
  66. acprof/_bundle/acprof/container/handlers/onnxruntime.py +90 -0
  67. acprof/_bundle/acprof/container/handlers/structured.py +185 -0
  68. acprof/_bundle/acprof/container/handlers/timeseries.py +178 -0
  69. acprof/_bundle/acprof/container/load_policy.py +81 -0
  70. acprof/_bundle/acprof/container/loading_quality.py +48 -0
  71. acprof/_bundle/acprof/container/local_pipeline.py +31 -0
  72. acprof/_bundle/acprof/container/model_files.py +280 -0
  73. acprof/_bundle/acprof/container/model_probe.py +80 -0
  74. acprof/_bundle/acprof/container/onnx_session.py +150 -0
  75. acprof/_bundle/acprof/container/runtime_manifest.py +150 -0
  76. acprof/_bundle/acprof/container/runtime_validate.py +156 -0
  77. acprof/_bundle/acprof/container/server.py +209 -0
  78. acprof/_bundle/acprof/container/torch_execution.py +55 -0
  79. acprof/_bundle/acprof/container/validation.py +172 -0
  80. acprof/_bundle/acprof/cpu_affinity.py +35 -0
  81. acprof/_bundle/acprof/dependency_locks.py +129 -0
  82. acprof/_bundle/acprof/experiment.py +356 -0
  83. acprof/_bundle/acprof/extensions/__init__.py +294 -0
  84. acprof/_bundle/acprof/extensions/builtin/manifest.json +3591 -0
  85. acprof/_bundle/acprof/extensions/onnxruntime/manifest.json +191 -0
  86. acprof/_bundle/acprof/extensions/schema.py +238 -0
  87. acprof/_bundle/acprof/extensions/transformers/4.57.6.json +1639 -0
  88. acprof/_bundle/acprof/extensions/transformers/5.10.4.json +1812 -0
  89. acprof/_bundle/acprof/failures.py +115 -0
  90. acprof/_bundle/acprof/hardware_conditions.py +18 -0
  91. acprof/_bundle/acprof/hf_download.py +143 -0
  92. acprof/_bundle/acprof/hf_endpoints.py +62 -0
  93. acprof/_bundle/acprof/hf_transport.py +238 -0
  94. acprof/_bundle/acprof/host/__init__.py +1 -0
  95. acprof/_bundle/acprof/host/automation.py +161 -0
  96. acprof/_bundle/acprof/host/client.py +520 -0
  97. acprof/_bundle/acprof/host/collection_history.py +77 -0
  98. acprof/_bundle/acprof/host/collection_workflow.py +285 -0
  99. acprof/_bundle/acprof/host/command.py +119 -0
  100. acprof/_bundle/acprof/host/container_lifecycle.py +225 -0
  101. acprof/_bundle/acprof/host/container_state.py +128 -0
  102. acprof/_bundle/acprof/host/coverage_state.py +259 -0
  103. acprof/_bundle/acprof/host/detect.py +669 -0
  104. acprof/_bundle/acprof/host/docker_runtime.py +359 -0
  105. acprof/_bundle/acprof/host/doctor.py +158 -0
  106. acprof/_bundle/acprof/host/env_utils.py +233 -0
  107. acprof/_bundle/acprof/host/execution_conditions.py +87 -0
  108. acprof/_bundle/acprof/host/gpu_device.py +66 -0
  109. acprof/_bundle/acprof/host/hardware_conditions.py +130 -0
  110. acprof/_bundle/acprof/host/images/__init__.py +1 -0
  111. acprof/_bundle/acprof/host/images/dependencies.py +169 -0
  112. acprof/_bundle/acprof/host/images/environment.py +313 -0
  113. acprof/_bundle/acprof/host/images/graph.py +143 -0
  114. acprof/_bundle/acprof/host/images/identity.py +6 -0
  115. acprof/_bundle/acprof/host/images/inventory.py +445 -0
  116. acprof/_bundle/acprof/host/images/runtime.py +457 -0
  117. acprof/_bundle/acprof/host/images/scan.py +154 -0
  118. acprof/_bundle/acprof/host/input_plan.py +1056 -0
  119. acprof/_bundle/acprof/host/interface_probe.py +141 -0
  120. acprof/_bundle/acprof/host/largest_scale_probe.py +566 -0
  121. acprof/_bundle/acprof/host/matrix_plan.py +98 -0
  122. acprof/_bundle/acprof/host/measurement/__init__.py +1 -0
  123. acprof/_bundle/acprof/host/measurement/boundary.py +162 -0
  124. acprof/_bundle/acprof/host/measurement/capture.py +139 -0
  125. acprof/_bundle/acprof/host/measurement/checkpoint.py +275 -0
  126. acprof/_bundle/acprof/host/measurement/config.py +212 -0
  127. acprof/_bundle/acprof/host/measurement/diagnostics.py +247 -0
  128. acprof/_bundle/acprof/host/measurement/energy_validation.py +172 -0
  129. acprof/_bundle/acprof/host/measurement/errors.py +25 -0
  130. acprof/_bundle/acprof/host/measurement/execution.py +396 -0
  131. acprof/_bundle/acprof/host/measurement/load.py +237 -0
  132. acprof/_bundle/acprof/host/measurement/metrics.py +975 -0
  133. acprof/_bundle/acprof/host/measurement/monitors.py +143 -0
  134. acprof/_bundle/acprof/host/measurement/publication.py +171 -0
  135. acprof/_bundle/acprof/host/measurement/requests.py +97 -0
  136. acprof/_bundle/acprof/host/measurement/types.py +82 -0
  137. acprof/_bundle/acprof/host/model_coverage.py +337 -0
  138. acprof/_bundle/acprof/host/model_errors.py +116 -0
  139. acprof/_bundle/acprof/host/model_inspection.py +107 -0
  140. acprof/_bundle/acprof/host/model_schema.py +35 -0
  141. acprof/_bundle/acprof/host/model_store.py +733 -0
  142. acprof/_bundle/acprof/host/network_preflight.py +229 -0
  143. acprof/_bundle/acprof/host/orchestrator.py +1133 -0
  144. acprof/_bundle/acprof/host/permissions.py +117 -0
  145. acprof/_bundle/acprof/host/platform_metadata.py +63 -0
  146. acprof/_bundle/acprof/host/posthoc/__init__.py +12 -0
  147. acprof/_bundle/acprof/host/posthoc/backfill.py +415 -0
  148. acprof/_bundle/acprof/host/posthoc/context.py +400 -0
  149. acprof/_bundle/acprof/host/posthoc/plans.py +597 -0
  150. acprof/_bundle/acprof/host/posthoc/service.py +303 -0
  151. acprof/_bundle/acprof/host/posthoc/storage.py +491 -0
  152. acprof/_bundle/acprof/host/preflight.py +370 -0
  153. acprof/_bundle/acprof/host/profiling/__init__.py +1 -0
  154. acprof/_bundle/acprof/host/profiling/compute.py +436 -0
  155. acprof/_bundle/acprof/host/profiling/compute_plan.py +261 -0
  156. acprof/_bundle/acprof/host/profiling/execution.py +547 -0
  157. acprof/_bundle/acprof/host/profiling/execution_plan.py +576 -0
  158. acprof/_bundle/acprof/host/profiling/progress.py +83 -0
  159. acprof/_bundle/acprof/host/profiling/support.py +252 -0
  160. acprof/_bundle/acprof/host/profiling/tools/__init__.py +1 -0
  161. acprof/_bundle/acprof/host/profiling/tools/advisor.py +164 -0
  162. acprof/_bundle/acprof/host/profiling/tools/compute_parsers.py +409 -0
  163. acprof/_bundle/acprof/host/profiling/tools/execution_environment.py +135 -0
  164. acprof/_bundle/acprof/host/profiling/tools/execution_parsers.py +364 -0
  165. acprof/_bundle/acprof/host/profiling/tools/massif.py +418 -0
  166. acprof/_bundle/acprof/host/profiling/tools/ncu.py +696 -0
  167. acprof/_bundle/acprof/host/profiling/tools/nsys.py +326 -0
  168. acprof/_bundle/acprof/host/profiling/tools/tool_discovery.py +229 -0
  169. acprof/_bundle/acprof/host/profiling/tools/torch.py +158 -0
  170. acprof/_bundle/acprof/host/result_cleanup.py +65 -0
  171. acprof/_bundle/acprof/host/run_state.py +639 -0
  172. acprof/_bundle/acprof/host/runtime_settings.py +10 -0
  173. acprof/_bundle/acprof/host/runtime_validation.py +302 -0
  174. acprof/_bundle/acprof/host/source_bundle.py +96 -0
  175. acprof/_bundle/acprof/host/startup_probe.py +95 -0
  176. acprof/_bundle/acprof/host/static_metadata.py +936 -0
  177. acprof/_bundle/acprof/host/task_support.py +121 -0
  178. acprof/_bundle/acprof/installation.py +26 -0
  179. acprof/_bundle/acprof/latency_slo.py +62 -0
  180. acprof/_bundle/acprof/messages.py +26 -0
  181. acprof/_bundle/acprof/metric_registry.py +315 -0
  182. acprof/_bundle/acprof/model_candidates.py +297 -0
  183. acprof/_bundle/acprof/model_contract.py +234 -0
  184. acprof/_bundle/acprof/model_dependencies.py +93 -0
  185. acprof/_bundle/acprof/model_dependency_domain.py +45 -0
  186. acprof/_bundle/acprof/model_dependency_eval.py +438 -0
  187. acprof/_bundle/acprof/model_dependency_flow.py +200 -0
  188. acprof/_bundle/acprof/model_evidence.py +115 -0
  189. acprof/_bundle/acprof/model_metadata_analysis.py +156 -0
  190. acprof/_bundle/acprof/model_repository.py +149 -0
  191. acprof/_bundle/acprof/model_resolution.py +129 -0
  192. acprof/_bundle/acprof/model_review.py +155 -0
  193. acprof/_bundle/acprof/model_source_analysis.py +299 -0
  194. acprof/_bundle/acprof/model_spec.py +204 -0
  195. acprof/_bundle/acprof/model_support.py +105 -0
  196. acprof/_bundle/acprof/model_transforms.py +81 -0
  197. acprof/_bundle/acprof/monitors/__init__.py +1 -0
  198. acprof/_bundle/acprof/monitors/common.py +63 -0
  199. acprof/_bundle/acprof/monitors/energy_cpu.py +651 -0
  200. acprof/_bundle/acprof/monitors/energy_nvml.py +381 -0
  201. acprof/_bundle/acprof/monitors/gpu_metrics.py +123 -0
  202. acprof/_bundle/acprof/monitors/interfaces.py +74 -0
  203. acprof/_bundle/acprof/monitors/perf_mips.py +617 -0
  204. acprof/_bundle/acprof/monitors/rapl_topology.py +100 -0
  205. acprof/_bundle/acprof/monitors/resource_metrics.py +472 -0
  206. acprof/_bundle/acprof/monitors/resource_readers.py +435 -0
  207. acprof/_bundle/acprof/monitors/resource_usage.py +450 -0
  208. acprof/_bundle/acprof/monitors/sampling.py +79 -0
  209. acprof/_bundle/acprof/network_policy.py +182 -0
  210. acprof/_bundle/acprof/notifications.py +279 -0
  211. acprof/_bundle/acprof/packet/__init__.py +1 -0
  212. acprof/_bundle/acprof/packet/merge_packet_latency.py +369 -0
  213. acprof/_bundle/acprof/packet/sniff_parse_pcap.py +240 -0
  214. acprof/_bundle/acprof/pixel_metrics.py +103 -0
  215. acprof/_bundle/acprof/platform.py +180 -0
  216. acprof/_bundle/acprof/plotting/__init__.py +1 -0
  217. acprof/_bundle/acprof/plotting/config.py +487 -0
  218. acprof/_bundle/acprof/plotting/data.py +236 -0
  219. acprof/_bundle/acprof/plotting/diagnostics.py +747 -0
  220. acprof/_bundle/acprof/plotting/latency.py +638 -0
  221. acprof/_bundle/acprof/plotting/metrics.py +648 -0
  222. acprof/_bundle/acprof/plotting/plotly-LICENSE.txt +21 -0
  223. acprof/_bundle/acprof/plotting/report.py +66 -0
  224. acprof/_bundle/acprof/plotting/styles.py +111 -0
  225. acprof/_bundle/acprof/precision.py +42 -0
  226. acprof/_bundle/acprof/preparation_events.py +78 -0
  227. acprof/_bundle/acprof/progress_events.py +105 -0
  228. acprof/_bundle/acprof/quality.py +153 -0
  229. acprof/_bundle/acprof/resource_budget.py +29 -0
  230. acprof/_bundle/acprof/result_csv.py +263 -0
  231. acprof/_bundle/acprof/result_layers.py +365 -0
  232. acprof/_bundle/acprof/run_args.py +223 -0
  233. acprof/_bundle/acprof/run_options.py +225 -0
  234. acprof/_bundle/acprof/runtime_dependencies.py +195 -0
  235. acprof/_bundle/acprof/runtime_profiles.py +258 -0
  236. acprof/_bundle/acprof/runtime_settings.py +72 -0
  237. acprof/_bundle/acprof/source_identity.py +68 -0
  238. acprof/_bundle/acprof/telemetry.py +225 -0
  239. acprof/_bundle/acprof/testing/__init__.py +1 -0
  240. acprof/_bundle/acprof/testing/evidence.py +117 -0
  241. acprof/_bundle/acprof/testing/plugin.py +126 -0
  242. acprof/_bundle/acprof/testing/provenance.py +53 -0
  243. acprof/_bundle/acprof/testing/sharding.py +14 -0
  244. acprof/_bundle/acprof/tui/__init__.py +1 -0
  245. acprof/_bundle/acprof/tui/app.py +934 -0
  246. acprof/_bundle/acprof/tui/app_contracts.py +43 -0
  247. acprof/_bundle/acprof/tui/catalog_controller.py +120 -0
  248. acprof/_bundle/acprof/tui/commands.py +209 -0
  249. acprof/_bundle/acprof/tui/configuration_controller.py +436 -0
  250. acprof/_bundle/acprof/tui/diagnostics.py +340 -0
  251. acprof/_bundle/acprof/tui/downloads.py +56 -0
  252. acprof/_bundle/acprof/tui/environment.py +248 -0
  253. acprof/_bundle/acprof/tui/experiment_catalog.py +279 -0
  254. acprof/_bundle/acprof/tui/experiment_controller.py +132 -0
  255. acprof/_bundle/acprof/tui/experiment_picker.py +273 -0
  256. acprof/_bundle/acprof/tui/field_validation.py +62 -0
  257. acprof/_bundle/acprof/tui/i18n.py +57 -0
  258. acprof/_bundle/acprof/tui/image_controller.py +525 -0
  259. acprof/_bundle/acprof/tui/images.py +737 -0
  260. acprof/_bundle/acprof/tui/input.py +191 -0
  261. acprof/_bundle/acprof/tui/localization_controller.py +110 -0
  262. acprof/_bundle/acprof/tui/log.py +310 -0
  263. acprof/_bundle/acprof/tui/model_candidates.py +278 -0
  264. acprof/_bundle/acprof/tui/model_controller.py +111 -0
  265. acprof/_bundle/acprof/tui/model_input.py +12 -0
  266. acprof/_bundle/acprof/tui/model_store.py +166 -0
  267. acprof/_bundle/acprof/tui/preflight_controller.py +271 -0
  268. acprof/_bundle/acprof/tui/preparation.py +269 -0
  269. acprof/_bundle/acprof/tui/presentation.py +46 -0
  270. acprof/_bundle/acprof/tui/process.py +111 -0
  271. acprof/_bundle/acprof/tui/process_controller.py +218 -0
  272. acprof/_bundle/acprof/tui/profile_controller.py +109 -0
  273. acprof/_bundle/acprof/tui/progress.py +195 -0
  274. acprof/_bundle/acprof/tui/recovery.py +114 -0
  275. acprof/_bundle/acprof/tui/recovery_controller.py +169 -0
  276. acprof/_bundle/acprof/tui/rendering.py +75 -0
  277. acprof/_bundle/acprof/tui/reports.py +303 -0
  278. acprof/_bundle/acprof/tui/result_controller.py +279 -0
  279. acprof/_bundle/acprof/tui/review_inputs.py +54 -0
  280. acprof/_bundle/acprof/tui/run_form.py +125 -0
  281. acprof/_bundle/acprof/tui/run_planning.py +97 -0
  282. acprof/_bundle/acprof/tui/run_results.py +175 -0
  283. acprof/_bundle/acprof/tui/scrollbar.py +65 -0
  284. acprof/_bundle/acprof/tui/settings.py +203 -0
  285. acprof/_bundle/acprof/tui/slash_controller.py +95 -0
  286. acprof/_bundle/acprof/tui/stages.py +97 -0
  287. acprof/_bundle/acprof/tui/storage.py +150 -0
  288. acprof/_bundle/acprof/tui/table.py +213 -0
  289. acprof/_bundle/acprof/tui/themes.py +112 -0
  290. acprof/_bundle/acprof/tui/translation_catalog.py +1861 -0
  291. acprof/_bundle/acprof/tui/tui.tcss +373 -0
  292. acprof/_bundle/acprof/tui/views.py +706 -0
  293. acprof/_bundle/acprof/window_records.py +165 -0
  294. acprof/_bundle/acprof/workloads/__init__.py +222 -0
  295. acprof/_bundle/acprof/workloads/audio.py +621 -0
  296. acprof/_bundle/acprof/workloads/contract.py +116 -0
  297. acprof/_bundle/acprof/workloads/cv.py +240 -0
  298. acprof/_bundle/acprof/workloads/diffusion.py +410 -0
  299. acprof/_bundle/acprof/workloads/multimodal.py +329 -0
  300. acprof/_bundle/acprof/workloads/nlp.py +151 -0
  301. acprof/_bundle/acprof/workloads/structured.py +151 -0
  302. acprof/_bundle/acprof/workloads/timeseries.py +69 -0
  303. acprof/_bundle/assets/audio/librispeech-clean-test-en-30s/audio.wav +0 -0
  304. acprof/_bundle/assets/audio/librispeech-clean-test-en-30s/source.json +81 -0
  305. acprof/_bundle/dockerfiles/environment_tools.py +314 -0
  306. acprof/_bundle/dockerfiles/locks/audio-cpu.artifacts.json +503 -0
  307. acprof/_bundle/dockerfiles/locks/audio-cpu.txt +143 -0
  308. acprof/_bundle/dockerfiles/locks/audio-cu124.artifacts.json +600 -0
  309. acprof/_bundle/dockerfiles/locks/audio-cu124.txt +171 -0
  310. acprof/_bundle/dockerfiles/locks/audio-cu128.artifacts.json +544 -0
  311. acprof/_bundle/dockerfiles/locks/audio-cu128.txt +155 -0
  312. acprof/_bundle/dockerfiles/locks/custom-multimodal-cpu.artifacts.json +510 -0
  313. acprof/_bundle/dockerfiles/locks/custom-multimodal-cpu.txt +145 -0
  314. acprof/_bundle/dockerfiles/locks/custom-multimodal-cu124.artifacts.json +607 -0
  315. acprof/_bundle/dockerfiles/locks/custom-multimodal-cu124.txt +173 -0
  316. acprof/_bundle/dockerfiles/locks/custom-multimodal-cu128.artifacts.json +642 -0
  317. acprof/_bundle/dockerfiles/locks/custom-multimodal-cu128.txt +183 -0
  318. acprof/_bundle/dockerfiles/locks/cv-cpu.artifacts.json +279 -0
  319. acprof/_bundle/dockerfiles/locks/cv-cpu.txt +79 -0
  320. acprof/_bundle/dockerfiles/locks/cv-cu124.artifacts.json +376 -0
  321. acprof/_bundle/dockerfiles/locks/cv-cu124.txt +107 -0
  322. acprof/_bundle/dockerfiles/locks/cv-cu128.artifacts.json +411 -0
  323. acprof/_bundle/dockerfiles/locks/cv-cu128.txt +117 -0
  324. acprof/_bundle/dockerfiles/locks/diffusion-cpu.artifacts.json +335 -0
  325. acprof/_bundle/dockerfiles/locks/diffusion-cpu.txt +95 -0
  326. acprof/_bundle/dockerfiles/locks/diffusion-cu124.artifacts.json +432 -0
  327. acprof/_bundle/dockerfiles/locks/diffusion-cu124.txt +123 -0
  328. acprof/_bundle/dockerfiles/locks/diffusion-cu128.artifacts.json +467 -0
  329. acprof/_bundle/dockerfiles/locks/diffusion-cu128.txt +133 -0
  330. acprof/_bundle/dockerfiles/locks/moss-transformers5104.artifacts.json +621 -0
  331. acprof/_bundle/dockerfiles/locks/moss-transformers5104.txt +177 -0
  332. acprof/_bundle/dockerfiles/locks/multimodal-transformers4576.artifacts.json +635 -0
  333. acprof/_bundle/dockerfiles/locks/multimodal-transformers4576.txt +181 -0
  334. acprof/_bundle/dockerfiles/locks/nlp-cpu.artifacts.json +363 -0
  335. acprof/_bundle/dockerfiles/locks/nlp-cpu.txt +103 -0
  336. acprof/_bundle/dockerfiles/locks/nlp-cu124.artifacts.json +460 -0
  337. acprof/_bundle/dockerfiles/locks/nlp-cu124.txt +131 -0
  338. acprof/_bundle/dockerfiles/locks/nlp-cu128.artifacts.json +495 -0
  339. acprof/_bundle/dockerfiles/locks/nlp-cu128.txt +141 -0
  340. acprof/_bundle/dockerfiles/locks/onnxruntime-cpu.artifacts.json +261 -0
  341. acprof/_bundle/dockerfiles/locks/onnxruntime-cpu.txt +73 -0
  342. acprof/_bundle/dockerfiles/locks/platform-cpu.artifacts.json +99 -0
  343. acprof/_bundle/dockerfiles/locks/platform-cpu.txt +27 -0
  344. acprof/_bundle/dockerfiles/locks/platform-cu124.artifacts.json +196 -0
  345. acprof/_bundle/dockerfiles/locks/platform-cu124.txt +55 -0
  346. acprof/_bundle/dockerfiles/locks/platform-cu128.artifacts.json +231 -0
  347. acprof/_bundle/dockerfiles/locks/platform-cu128.txt +65 -0
  348. acprof/_bundle/dockerfiles/locks/platform-python-cpu.artifacts.json +37 -0
  349. acprof/_bundle/dockerfiles/locks/platform-python-cpu.txt +9 -0
  350. acprof/_bundle/dockerfiles/locks/structured-cpu.artifacts.json +279 -0
  351. acprof/_bundle/dockerfiles/locks/structured-cpu.txt +79 -0
  352. acprof/_bundle/dockerfiles/locks/structured-cu124.artifacts.json +376 -0
  353. acprof/_bundle/dockerfiles/locks/structured-cu124.txt +107 -0
  354. acprof/_bundle/dockerfiles/locks/structured-cu128.artifacts.json +411 -0
  355. acprof/_bundle/dockerfiles/locks/structured-cu128.txt +117 -0
  356. acprof/_bundle/dockerfiles/locks/system-trixie-amd64.json +620 -0
  357. acprof/_bundle/dockerfiles/locks/timeseries-cpu.artifacts.json +314 -0
  358. acprof/_bundle/dockerfiles/locks/timeseries-cpu.txt +89 -0
  359. acprof/_bundle/dockerfiles/locks/timeseries-cu124.artifacts.json +411 -0
  360. acprof/_bundle/dockerfiles/locks/timeseries-cu124.txt +117 -0
  361. acprof/_bundle/dockerfiles/locks/timeseries-cu128.artifacts.json +446 -0
  362. acprof/_bundle/dockerfiles/locks/timeseries-cu128.txt +127 -0
  363. acprof/_bundle/dockerfiles/locks/transformers5104-cpu.artifacts.json +594 -0
  364. acprof/_bundle/dockerfiles/locks/transformers5104-cpu.txt +169 -0
  365. acprof/_bundle/dockerfiles/locks/transformers5104-cu124.artifacts.json +691 -0
  366. acprof/_bundle/dockerfiles/locks/transformers5104-cu124.txt +197 -0
  367. acprof/_bundle/dockerfiles/locks/transformers5104-cu128.artifacts.json +726 -0
  368. acprof/_bundle/dockerfiles/locks/transformers5104-cu128.txt +207 -0
  369. acprof/_bundle/dockerfiles/platform.Dockerfile +22 -0
  370. acprof/_bundle/dockerfiles/requirements/audio.in +5 -0
  371. acprof/_bundle/dockerfiles/requirements/custom-multimodal.in +2 -0
  372. acprof/_bundle/dockerfiles/requirements/cv.in +4 -0
  373. acprof/_bundle/dockerfiles/requirements/diffusion.in +6 -0
  374. acprof/_bundle/dockerfiles/requirements/moss-transformers5104.in +9 -0
  375. acprof/_bundle/dockerfiles/requirements/multimodal-transformers4576.in +3 -0
  376. acprof/_bundle/dockerfiles/requirements/nlp.in +7 -0
  377. acprof/_bundle/dockerfiles/requirements/onnxruntime.in +9 -0
  378. acprof/_bundle/dockerfiles/requirements/service.in +8 -0
  379. acprof/_bundle/dockerfiles/requirements/structured.in +4 -0
  380. acprof/_bundle/dockerfiles/requirements/timeseries.in +2 -0
  381. acprof/_bundle/dockerfiles/requirements/timm.in +1 -0
  382. acprof/_bundle/dockerfiles/requirements/transformers5104.in +4 -0
  383. acprof/_bundle/dockerfiles/runtime-final.Dockerfile +34 -0
  384. acprof/_bundle/dockerfiles/runtime-model.Dockerfile +19 -0
  385. acprof/_bundle/dockerfiles/runtime.Dockerfile +23 -0
  386. acprof/_bundle/examples/coverage/regression.json +17 -0
  387. acprof/_bundle/examples/hardware-validation.json +19 -0
  388. acprof/_bundle/examples/multimodal/ultravox.model.json +29 -0
  389. acprof/_bundle/examples/nlp/smoke.py +111 -0
  390. acprof/_bundle/examples/onnxruntime/fixtures.py +164 -0
  391. acprof/_bundle/examples/onnxruntime/iris.json +16 -0
  392. acprof/_bundle/examples/onnxruntime/iris.model.json +7 -0
  393. acprof/_bundle/examples/onnxruntime/real_models.py +155 -0
  394. acprof/_bundle/examples/onnxruntime/smoke.py +68 -0
  395. acprof/_bundle/examples/structured/chronos_smoke.py +56 -0
  396. acprof/_bundle/examples/structured/export_models.py +71 -0
  397. acprof/_bundle/examples/structured/smoke.py +71 -0
  398. acprof/_bundle/licenses/CC-BY-4.0.txt +156 -0
  399. acprof/analysis/__init__.py +1 -0
  400. acprof/analysis/audit.py +276 -0
  401. acprof/analysis/comparison.py +364 -0
  402. acprof/analysis/compatibility.py +223 -0
  403. acprof/analysis/conditions.py +185 -0
  404. acprof/analysis/independent_comparison.py +191 -0
  405. acprof/analysis/latency_model.py +1106 -0
  406. acprof/analysis/latency_report.py +577 -0
  407. acprof/analysis/model.py +276 -0
  408. acprof/analysis/precision.py +51 -0
  409. acprof/analysis/uncertainty.py +144 -0
  410. acprof/application/__init__.py +1 -0
  411. acprof/application/download.py +14 -0
  412. acprof/application/errors.py +5 -0
  413. acprof/application/notifications.py +302 -0
  414. acprof/application/preparation.py +333 -0
  415. acprof/application/resources.py +66 -0
  416. acprof/application/run.py +462 -0
  417. acprof/application/terminal_log.py +136 -0
  418. acprof/artifact_layout.py +261 -0
  419. acprof/artifacts.py +161 -0
  420. acprof/capabilities.py +404 -0
  421. acprof/cli/__init__.py +1 -0
  422. acprof/cli/audit.py +74 -0
  423. acprof/cli/auto.py +41 -0
  424. acprof/cli/backfill_compute.py +498 -0
  425. acprof/cli/compare.py +34 -0
  426. acprof/cli/coverage.py +70 -0
  427. acprof/cli/doctor.py +47 -0
  428. acprof/cli/inspect.py +101 -0
  429. acprof/cli/load.py +190 -0
  430. acprof/cli/main.py +64 -0
  431. acprof/cli/model_store.py +22 -0
  432. acprof/cli/plot.py +211 -0
  433. acprof/cli/posthoc.py +113 -0
  434. acprof/cli/probe.py +186 -0
  435. acprof/cli/report.py +35 -0
  436. acprof/cli/results.py +37 -0
  437. acprof/cli/run.py +54 -0
  438. acprof/cli/stats.py +94 -0
  439. acprof/cli/tui.py +65 -0
  440. acprof/config.py +177 -0
  441. acprof/container/__init__.py +1 -0
  442. acprof/container/compat/__init__.py +1 -0
  443. acprof/container/compat/transformers_dynamic.py +54 -0
  444. acprof/container/compat/transformers_model_types.json +1091 -0
  445. acprof/container/compute_profile_runner.py +392 -0
  446. acprof/container/download_model.py +165 -0
  447. acprof/container/execution.py +73 -0
  448. acprof/container/handlers/__init__.py +298 -0
  449. acprof/container/handlers/audio.py +743 -0
  450. acprof/container/handlers/custom_pipeline.py +74 -0
  451. acprof/container/handlers/cv.py +321 -0
  452. acprof/container/handlers/diffusion.py +728 -0
  453. acprof/container/handlers/moss.py +64 -0
  454. acprof/container/handlers/multimodal.py +609 -0
  455. acprof/container/handlers/nlp.py +747 -0
  456. acprof/container/handlers/onnx_tasks.py +231 -0
  457. acprof/container/handlers/onnxruntime.py +90 -0
  458. acprof/container/handlers/structured.py +185 -0
  459. acprof/container/handlers/timeseries.py +178 -0
  460. acprof/container/load_policy.py +81 -0
  461. acprof/container/loading_quality.py +48 -0
  462. acprof/container/local_pipeline.py +31 -0
  463. acprof/container/model_files.py +280 -0
  464. acprof/container/model_probe.py +80 -0
  465. acprof/container/onnx_session.py +150 -0
  466. acprof/container/runtime_manifest.py +150 -0
  467. acprof/container/runtime_validate.py +156 -0
  468. acprof/container/server.py +209 -0
  469. acprof/container/torch_execution.py +55 -0
  470. acprof/container/validation.py +172 -0
  471. acprof/cpu_affinity.py +35 -0
  472. acprof/dependency_locks.py +129 -0
  473. acprof/experiment.py +356 -0
  474. acprof/extensions/__init__.py +294 -0
  475. acprof/extensions/builtin/manifest.json +3591 -0
  476. acprof/extensions/onnxruntime/manifest.json +191 -0
  477. acprof/extensions/schema.py +238 -0
  478. acprof/extensions/transformers/4.57.6.json +1639 -0
  479. acprof/extensions/transformers/5.10.4.json +1812 -0
  480. acprof/failures.py +115 -0
  481. acprof/hardware_conditions.py +18 -0
  482. acprof/hf_download.py +143 -0
  483. acprof/hf_endpoints.py +62 -0
  484. acprof/hf_transport.py +238 -0
  485. acprof/host/__init__.py +1 -0
  486. acprof/host/automation.py +161 -0
  487. acprof/host/client.py +520 -0
  488. acprof/host/collection_history.py +77 -0
  489. acprof/host/collection_workflow.py +285 -0
  490. acprof/host/command.py +119 -0
  491. acprof/host/container_lifecycle.py +225 -0
  492. acprof/host/container_state.py +128 -0
  493. acprof/host/coverage_state.py +259 -0
  494. acprof/host/detect.py +669 -0
  495. acprof/host/docker_runtime.py +359 -0
  496. acprof/host/doctor.py +158 -0
  497. acprof/host/env_utils.py +233 -0
  498. acprof/host/execution_conditions.py +87 -0
  499. acprof/host/gpu_device.py +66 -0
  500. acprof/host/hardware_conditions.py +130 -0
  501. acprof/host/images/__init__.py +1 -0
  502. acprof/host/images/dependencies.py +169 -0
  503. acprof/host/images/environment.py +313 -0
  504. acprof/host/images/graph.py +143 -0
  505. acprof/host/images/identity.py +6 -0
  506. acprof/host/images/inventory.py +445 -0
  507. acprof/host/images/runtime.py +457 -0
  508. acprof/host/images/scan.py +154 -0
  509. acprof/host/input_plan.py +1056 -0
  510. acprof/host/interface_probe.py +141 -0
  511. acprof/host/largest_scale_probe.py +566 -0
  512. acprof/host/matrix_plan.py +98 -0
  513. acprof/host/measurement/__init__.py +1 -0
  514. acprof/host/measurement/boundary.py +162 -0
  515. acprof/host/measurement/capture.py +139 -0
  516. acprof/host/measurement/checkpoint.py +275 -0
  517. acprof/host/measurement/config.py +212 -0
  518. acprof/host/measurement/diagnostics.py +247 -0
  519. acprof/host/measurement/energy_validation.py +172 -0
  520. acprof/host/measurement/errors.py +25 -0
  521. acprof/host/measurement/execution.py +396 -0
  522. acprof/host/measurement/load.py +237 -0
  523. acprof/host/measurement/metrics.py +975 -0
  524. acprof/host/measurement/monitors.py +143 -0
  525. acprof/host/measurement/publication.py +171 -0
  526. acprof/host/measurement/requests.py +97 -0
  527. acprof/host/measurement/types.py +82 -0
  528. acprof/host/model_coverage.py +337 -0
  529. acprof/host/model_errors.py +116 -0
  530. acprof/host/model_inspection.py +107 -0
  531. acprof/host/model_schema.py +35 -0
  532. acprof/host/model_store.py +733 -0
  533. acprof/host/network_preflight.py +229 -0
  534. acprof/host/orchestrator.py +1133 -0
  535. acprof/host/permissions.py +117 -0
  536. acprof/host/platform_metadata.py +63 -0
  537. acprof/host/posthoc/__init__.py +12 -0
  538. acprof/host/posthoc/backfill.py +415 -0
  539. acprof/host/posthoc/context.py +400 -0
  540. acprof/host/posthoc/plans.py +597 -0
  541. acprof/host/posthoc/service.py +303 -0
  542. acprof/host/posthoc/storage.py +491 -0
  543. acprof/host/preflight.py +370 -0
  544. acprof/host/profiling/__init__.py +1 -0
  545. acprof/host/profiling/compute.py +436 -0
  546. acprof/host/profiling/compute_plan.py +261 -0
  547. acprof/host/profiling/execution.py +547 -0
  548. acprof/host/profiling/execution_plan.py +576 -0
  549. acprof/host/profiling/progress.py +83 -0
  550. acprof/host/profiling/support.py +252 -0
  551. acprof/host/profiling/tools/__init__.py +1 -0
  552. acprof/host/profiling/tools/advisor.py +164 -0
  553. acprof/host/profiling/tools/compute_parsers.py +409 -0
  554. acprof/host/profiling/tools/execution_environment.py +135 -0
  555. acprof/host/profiling/tools/execution_parsers.py +364 -0
  556. acprof/host/profiling/tools/massif.py +418 -0
  557. acprof/host/profiling/tools/ncu.py +696 -0
  558. acprof/host/profiling/tools/nsys.py +326 -0
  559. acprof/host/profiling/tools/tool_discovery.py +229 -0
  560. acprof/host/profiling/tools/torch.py +158 -0
  561. acprof/host/result_cleanup.py +65 -0
  562. acprof/host/run_state.py +639 -0
  563. acprof/host/runtime_settings.py +10 -0
  564. acprof/host/runtime_validation.py +302 -0
  565. acprof/host/source_bundle.py +96 -0
  566. acprof/host/startup_probe.py +95 -0
  567. acprof/host/static_metadata.py +936 -0
  568. acprof/host/task_support.py +121 -0
  569. acprof/installation.py +26 -0
  570. acprof/latency_slo.py +62 -0
  571. acprof/messages.py +26 -0
  572. acprof/metric_registry.py +315 -0
  573. acprof/model_candidates.py +297 -0
  574. acprof/model_contract.py +234 -0
  575. acprof/model_dependencies.py +93 -0
  576. acprof/model_dependency_domain.py +45 -0
  577. acprof/model_dependency_eval.py +438 -0
  578. acprof/model_dependency_flow.py +200 -0
  579. acprof/model_evidence.py +115 -0
  580. acprof/model_metadata_analysis.py +156 -0
  581. acprof/model_repository.py +149 -0
  582. acprof/model_resolution.py +129 -0
  583. acprof/model_review.py +155 -0
  584. acprof/model_source_analysis.py +299 -0
  585. acprof/model_spec.py +204 -0
  586. acprof/model_support.py +105 -0
  587. acprof/model_transforms.py +81 -0
  588. acprof/monitors/__init__.py +1 -0
  589. acprof/monitors/common.py +63 -0
  590. acprof/monitors/energy_cpu.py +651 -0
  591. acprof/monitors/energy_nvml.py +381 -0
  592. acprof/monitors/gpu_metrics.py +123 -0
  593. acprof/monitors/interfaces.py +74 -0
  594. acprof/monitors/perf_mips.py +617 -0
  595. acprof/monitors/rapl_topology.py +100 -0
  596. acprof/monitors/resource_metrics.py +472 -0
  597. acprof/monitors/resource_readers.py +435 -0
  598. acprof/monitors/resource_usage.py +450 -0
  599. acprof/monitors/sampling.py +79 -0
  600. acprof/network_policy.py +182 -0
  601. acprof/notifications.py +279 -0
  602. acprof/packet/__init__.py +1 -0
  603. acprof/packet/merge_packet_latency.py +369 -0
  604. acprof/packet/sniff_parse_pcap.py +240 -0
  605. acprof/pixel_metrics.py +103 -0
  606. acprof/platform.py +180 -0
  607. acprof/plotting/__init__.py +1 -0
  608. acprof/plotting/config.py +487 -0
  609. acprof/plotting/data.py +236 -0
  610. acprof/plotting/diagnostics.py +747 -0
  611. acprof/plotting/latency.py +638 -0
  612. acprof/plotting/metrics.py +648 -0
  613. acprof/plotting/plotly-LICENSE.txt +21 -0
  614. acprof/plotting/report.css +61 -0
  615. acprof/plotting/report.html +68 -0
  616. acprof/plotting/report.js +295 -0
  617. acprof/plotting/report.py +66 -0
  618. acprof/plotting/styles.py +111 -0
  619. acprof/plotting/view_model.js +145 -0
  620. acprof/precision.py +42 -0
  621. acprof/preparation_events.py +78 -0
  622. acprof/progress_events.py +105 -0
  623. acprof/quality.py +153 -0
  624. acprof/resource_budget.py +29 -0
  625. acprof/result_csv.py +263 -0
  626. acprof/result_layers.py +365 -0
  627. acprof/run_args.py +223 -0
  628. acprof/run_options.py +225 -0
  629. acprof/runtime_dependencies.py +195 -0
  630. acprof/runtime_profiles.py +258 -0
  631. acprof/runtime_settings.py +72 -0
  632. acprof/source_identity.py +68 -0
  633. acprof/telemetry.py +225 -0
  634. acprof/testing/__init__.py +1 -0
  635. acprof/testing/evidence.py +117 -0
  636. acprof/testing/plugin.py +126 -0
  637. acprof/testing/provenance.py +53 -0
  638. acprof/testing/sharding.py +14 -0
  639. acprof/tui/__init__.py +1 -0
  640. acprof/tui/app.py +934 -0
  641. acprof/tui/app_contracts.py +43 -0
  642. acprof/tui/catalog_controller.py +120 -0
  643. acprof/tui/commands.py +209 -0
  644. acprof/tui/configuration_controller.py +436 -0
  645. acprof/tui/diagnostics.py +340 -0
  646. acprof/tui/downloads.py +56 -0
  647. acprof/tui/environment.py +248 -0
  648. acprof/tui/experiment_catalog.py +279 -0
  649. acprof/tui/experiment_controller.py +132 -0
  650. acprof/tui/experiment_picker.py +273 -0
  651. acprof/tui/field_validation.py +62 -0
  652. acprof/tui/i18n.py +57 -0
  653. acprof/tui/image_controller.py +525 -0
  654. acprof/tui/images.py +737 -0
  655. acprof/tui/input.py +191 -0
  656. acprof/tui/localization_controller.py +110 -0
  657. acprof/tui/log.py +310 -0
  658. acprof/tui/model_candidates.py +278 -0
  659. acprof/tui/model_controller.py +111 -0
  660. acprof/tui/model_input.py +12 -0
  661. acprof/tui/model_store.py +166 -0
  662. acprof/tui/preflight_controller.py +271 -0
  663. acprof/tui/preparation.py +269 -0
  664. acprof/tui/presentation.py +46 -0
  665. acprof/tui/process.py +111 -0
  666. acprof/tui/process_controller.py +218 -0
  667. acprof/tui/profile_controller.py +109 -0
  668. acprof/tui/progress.py +195 -0
  669. acprof/tui/recovery.py +114 -0
  670. acprof/tui/recovery_controller.py +169 -0
  671. acprof/tui/rendering.py +75 -0
  672. acprof/tui/reports.py +303 -0
  673. acprof/tui/result_controller.py +279 -0
  674. acprof/tui/review_inputs.py +54 -0
  675. acprof/tui/run_form.py +125 -0
  676. acprof/tui/run_planning.py +97 -0
  677. acprof/tui/run_results.py +175 -0
  678. acprof/tui/scrollbar.py +65 -0
  679. acprof/tui/settings.py +203 -0
  680. acprof/tui/slash_controller.py +95 -0
  681. acprof/tui/stages.py +97 -0
  682. acprof/tui/storage.py +150 -0
  683. acprof/tui/table.py +213 -0
  684. acprof/tui/themes.py +112 -0
  685. acprof/tui/translation_catalog.py +1861 -0
  686. acprof/tui/tui.tcss +373 -0
  687. acprof/tui/views.py +706 -0
  688. acprof/window_records.py +165 -0
  689. acprof/workloads/__init__.py +222 -0
  690. acprof/workloads/audio.py +621 -0
  691. acprof/workloads/contract.py +116 -0
  692. acprof/workloads/cv.py +240 -0
  693. acprof/workloads/diffusion.py +410 -0
  694. acprof/workloads/multimodal.py +329 -0
  695. acprof/workloads/nlp.py +151 -0
  696. acprof/workloads/structured.py +151 -0
  697. acprof/workloads/timeseries.py +69 -0
  698. acprof-0.3.0.dist-info/METADATA +117 -0
  699. acprof-0.3.0.dist-info/RECORD +704 -0
  700. acprof-0.3.0.dist-info/WHEEL +4 -0
  701. acprof-0.3.0.dist-info/entry_points.txt +2 -0
  702. acprof-0.3.0.dist-info/licenses/LICENSE +202 -0
  703. acprof-0.3.0.dist-info/licenses/NOTICE +43 -0
  704. acprof-0.3.0.dist-info/licenses/licenses/CC-BY-4.0.txt +156 -0
acprof/__init__.py ADDED
@@ -0,0 +1,3 @@
1
+ """AC-Prof package."""
2
+
3
+ __version__ = "0.3.0"
acprof/__main__.py ADDED
@@ -0,0 +1,5 @@
1
+ """Run the installed AC-Prof commands with python -m acprof."""
2
+ from acprof.cli.main import main
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
@@ -0,0 +1,20 @@
1
+ # 构建只读取受版本控制的代码、Dockerfile 和依赖输入。
2
+ .git
3
+ .venv
4
+ .release-venv
5
+ dist
6
+ build
7
+ tests/
8
+ docs/
9
+ .pytest_cache/
10
+ .mypy_cache/
11
+ .ruff_cache/
12
+ .coverage*
13
+ .env*
14
+ .agents
15
+ .codex
16
+ internal-testing
17
+ results*
18
+ result-past
19
+ **/__pycache__
20
+ **/*.pyc
acprof/_bundle/LICENSE ADDED
@@ -0,0 +1,202 @@
1
+
2
+ Apache License
3
+ Version 2.0, January 2004
4
+ http://www.apache.org/licenses/
5
+
6
+ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
7
+
8
+ 1. Definitions.
9
+
10
+ "License" shall mean the terms and conditions for use, reproduction,
11
+ and distribution as defined by Sections 1 through 9 of this document.
12
+
13
+ "Licensor" shall mean the copyright owner or entity authorized by
14
+ the copyright owner that is granting the License.
15
+
16
+ "Legal Entity" shall mean the union of the acting entity and all
17
+ other entities that control, are controlled by, or are under common
18
+ control with that entity. For the purposes of this definition,
19
+ "control" means (i) the power, direct or indirect, to cause the
20
+ direction or management of such entity, whether by contract or
21
+ otherwise, or (ii) ownership of fifty percent (50%) or more of the
22
+ outstanding shares, or (iii) beneficial ownership of such entity.
23
+
24
+ "You" (or "Your") shall mean an individual or Legal Entity
25
+ exercising permissions granted by this License.
26
+
27
+ "Source" form shall mean the preferred form for making modifications,
28
+ including but not limited to software source code, documentation
29
+ source, and configuration files.
30
+
31
+ "Object" form shall mean any form resulting from mechanical
32
+ transformation or translation of a Source form, including but
33
+ not limited to compiled object code, generated documentation,
34
+ and conversions to other media types.
35
+
36
+ "Work" shall mean the work of authorship, whether in Source or
37
+ Object form, made available under the License, as indicated by a
38
+ copyright notice that is included in or attached to the work
39
+ (an example is provided in the Appendix below).
40
+
41
+ "Derivative Works" shall mean any work, whether in Source or Object
42
+ form, that is based on (or derived from) the Work and for which the
43
+ editorial revisions, annotations, elaborations, or other modifications
44
+ represent, as a whole, an original work of authorship. For the purposes
45
+ of this License, Derivative Works shall not include works that remain
46
+ separable from, or merely link (or bind by name) to the interfaces of,
47
+ the Work and Derivative Works thereof.
48
+
49
+ "Contribution" shall mean any work of authorship, including
50
+ the original version of the Work and any modifications or additions
51
+ to that Work or Derivative Works thereof, that is intentionally
52
+ submitted to Licensor for inclusion in the Work by the copyright owner
53
+ or by an individual or Legal Entity authorized to submit on behalf of
54
+ the copyright owner. For the purposes of this definition, "submitted"
55
+ means any form of electronic, verbal, or written communication sent
56
+ to the Licensor or its representatives, including but not limited to
57
+ communication on electronic mailing lists, source code control systems,
58
+ and issue tracking systems that are managed by, or on behalf of, the
59
+ Licensor for the purpose of discussing and improving the Work, but
60
+ excluding communication that is conspicuously marked or otherwise
61
+ designated in writing by the copyright owner as "Not a Contribution."
62
+
63
+ "Contributor" shall mean Licensor and any individual or Legal Entity
64
+ on behalf of whom a Contribution has been received by Licensor and
65
+ subsequently incorporated within the Work.
66
+
67
+ 2. Grant of Copyright License. Subject to the terms and conditions of
68
+ this License, each Contributor hereby grants to You a perpetual,
69
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
70
+ copyright license to reproduce, prepare Derivative Works of,
71
+ publicly display, publicly perform, sublicense, and distribute the
72
+ Work and such Derivative Works in Source or Object form.
73
+
74
+ 3. Grant of Patent License. Subject to the terms and conditions of
75
+ this License, each Contributor hereby grants to You a perpetual,
76
+ worldwide, non-exclusive, no-charge, royalty-free, irrevocable
77
+ (except as stated in this section) patent license to make, have made,
78
+ use, offer to sell, sell, import, and otherwise transfer the Work,
79
+ where such license applies only to those patent claims licensable
80
+ by such Contributor that are necessarily infringed by their
81
+ Contribution(s) alone or by combination of their Contribution(s)
82
+ with the Work to which such Contribution(s) was submitted. If You
83
+ institute patent litigation against any entity (including a
84
+ cross-claim or counterclaim in a lawsuit) alleging that the Work
85
+ or a Contribution incorporated within the Work constitutes direct
86
+ or contributory patent infringement, then any patent licenses
87
+ granted to You under this License for that Work shall terminate
88
+ as of the date such litigation is filed.
89
+
90
+ 4. Redistribution. You may reproduce and distribute copies of the
91
+ Work or Derivative Works thereof in any medium, with or without
92
+ modifications, and in Source or Object form, provided that You
93
+ meet the following conditions:
94
+
95
+ (a) You must give any other recipients of the Work or
96
+ Derivative Works a copy of this License; and
97
+
98
+ (b) You must cause any modified files to carry prominent notices
99
+ stating that You changed the files; and
100
+
101
+ (c) You must retain, in the Source form of any Derivative Works
102
+ that You distribute, all copyright, patent, trademark, and
103
+ attribution notices from the Source form of the Work,
104
+ excluding those notices that do not pertain to any part of
105
+ the Derivative Works; and
106
+
107
+ (d) If the Work includes a "NOTICE" text file as part of its
108
+ distribution, then any Derivative Works that You distribute must
109
+ include a readable copy of the attribution notices contained
110
+ within such NOTICE file, excluding those notices that do not
111
+ pertain to any part of the Derivative Works, in at least one
112
+ of the following places: within a NOTICE text file distributed
113
+ as part of the Derivative Works; within the Source form or
114
+ documentation, if provided along with the Derivative Works; or,
115
+ within a display generated by the Derivative Works, if and
116
+ wherever such third-party notices normally appear. The contents
117
+ of the NOTICE file are for informational purposes only and
118
+ do not modify the License. You may add Your own attribution
119
+ notices within Derivative Works that You distribute, alongside
120
+ or as an addendum to the NOTICE text from the Work, provided
121
+ that such additional attribution notices cannot be construed
122
+ as modifying the License.
123
+
124
+ You may add Your own copyright statement to Your modifications and
125
+ may provide additional or different license terms and conditions
126
+ for use, reproduction, or distribution of Your modifications, or
127
+ for any such Derivative Works as a whole, provided Your use,
128
+ reproduction, and distribution of the Work otherwise complies with
129
+ the conditions stated in this License.
130
+
131
+ 5. Submission of Contributions. Unless You explicitly state otherwise,
132
+ any Contribution intentionally submitted for inclusion in the Work
133
+ by You to the Licensor shall be under the terms and conditions of
134
+ this License, without any additional terms or conditions.
135
+ Notwithstanding the above, nothing herein shall supersede or modify
136
+ the terms of any separate license agreement you may have executed
137
+ with Licensor regarding such Contributions.
138
+
139
+ 6. Trademarks. This License does not grant permission to use the trade
140
+ names, trademarks, service marks, or product names of the Licensor,
141
+ except as required for reasonable and customary use in describing the
142
+ origin of the Work and reproducing the content of the NOTICE file.
143
+
144
+ 7. Disclaimer of Warranty. Unless required by applicable law or
145
+ agreed to in writing, Licensor provides the Work (and each
146
+ Contributor provides its Contributions) on an "AS IS" BASIS,
147
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
148
+ implied, including, without limitation, any warranties or conditions
149
+ of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
150
+ PARTICULAR PURPOSE. You are solely responsible for determining the
151
+ appropriateness of using or redistributing the Work and assume any
152
+ risks associated with Your exercise of permissions under this License.
153
+
154
+ 8. Limitation of Liability. In no event and under no legal theory,
155
+ whether in tort (including negligence), contract, or otherwise,
156
+ unless required by applicable law (such as deliberate and grossly
157
+ negligent acts) or agreed to in writing, shall any Contributor be
158
+ liable to You for damages, including any direct, indirect, special,
159
+ incidental, or consequential damages of any character arising as a
160
+ result of this License or out of the use or inability to use the
161
+ Work (including but not limited to damages for loss of goodwill,
162
+ work stoppage, computer failure or malfunction, or any and all
163
+ other commercial damages or losses), even if such Contributor
164
+ has been advised of the possibility of such damages.
165
+
166
+ 9. Accepting Warranty or Additional Liability. While redistributing
167
+ the Work or Derivative Works thereof, You may choose to offer,
168
+ and charge a fee for, acceptance of support, warranty, indemnity,
169
+ or other liability obligations and/or rights consistent with this
170
+ License. However, in accepting such obligations, You may act only
171
+ on Your own behalf and on Your sole responsibility, not on behalf
172
+ of any other Contributor, and only if You agree to indemnify,
173
+ defend, and hold each Contributor harmless for any liability
174
+ incurred by, or claims asserted against, such Contributor by reason
175
+ of your accepting any such warranty or additional liability.
176
+
177
+ END OF TERMS AND CONDITIONS
178
+
179
+ APPENDIX: How to apply the Apache License to your work.
180
+
181
+ To apply the Apache License to your work, attach the following
182
+ boilerplate notice, with the fields enclosed by brackets "[]"
183
+ replaced with your own identifying information. (Don't include
184
+ the brackets!) The text should be enclosed in the appropriate
185
+ comment syntax for the file format. We also recommend that a
186
+ file or class name and description of purpose be included on the
187
+ same "printed page" as the copyright notice for easier
188
+ identification within third-party archives.
189
+
190
+ Copyright [yyyy] [name of copyright owner]
191
+
192
+ Licensed under the Apache License, Version 2.0 (the "License");
193
+ you may not use this file except in compliance with the License.
194
+ You may obtain a copy of the License at
195
+
196
+ http://www.apache.org/licenses/LICENSE-2.0
197
+
198
+ Unless required by applicable law or agreed to in writing, software
199
+ distributed under the License is distributed on an "AS IS" BASIS,
200
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
201
+ See the License for the specific language governing permissions and
202
+ limitations under the License.
acprof/_bundle/NOTICE ADDED
@@ -0,0 +1,43 @@
1
+ AC-Prof
2
+ https://github.com/kainam15/AC-Prof
3
+
4
+ Project origin and attribution
5
+ ------------------------------
6
+ AC-Prof is part of the DOR project of the DISTINT group at Jinan University:
7
+ https://github.com/wingter562/DISTINT_open_data
8
+
9
+ The original project definition credits Dr. Wentai Wu (Jinan University),
10
+ with primary contribution by Dr. Shenghai Li (South China University of
11
+ Technology), and lists these contributors:
12
+ Wentai Wu, JNU
13
+ Shenghai Li, SCUT
14
+ Qinan Wu, JNU
15
+ Kaizhe Song, JNU
16
+ Yukai Wang, JNU
17
+
18
+ The attribution above follows the original AC-Prof project definition.
19
+ This repository continues that project with the current Python package,
20
+ runtime profiles, measurement protocol, CLI and Textual interface. Source
21
+ history records the subsequent changes and contributors.
22
+ Project code is licensed under Apache-2.0; see LICENSE.
23
+
24
+ Bundled third-party material
25
+ ---------------------------
26
+ assets/audio/librispeech-clean-test-en-30s/audio.wav is derived from
27
+ LibriSpeech, prepared by Vassil Panayotov with assistance from Daniel Povey.
28
+ Source: https://www.openslr.org/12
29
+ Mirror: https://huggingface.co/datasets/openslr/librispeech_asr
30
+ Dataset revision: 71cacbfb7e2354c4226d01e70d77d5fca3d04ba1
31
+ License: Creative Commons Attribution 4.0 International (CC-BY-4.0).
32
+ See licenses/CC-BY-4.0.txt and https://creativecommons.org/licenses/by/4.0/.
33
+
34
+ AC-Prof concatenated clean/test recordings 6930-75918-0001,
35
+ 6930-75918-0002 and 6930-75918-0003, then retained the first 30 seconds as
36
+ 16 kHz mono PCM16 WAV. It did not normalize, resample, apply gain or trim
37
+ silence. The source identities, hashes and transformation details are in
38
+ assets/audio/librispeech-clean-test-en-30s/source.json.
39
+ The audio retains CC-BY-4.0 and is not relicensed under Apache-2.0.
40
+
41
+ Downloaded model code, weights, external datasets and separately installed
42
+ dependencies retain their respective licenses. Their inclusion or use does
43
+ not imply endorsement by their authors or by the original project team.
@@ -0,0 +1,3 @@
1
+ """AC-Prof package."""
2
+
3
+ __version__ = "0.3.0"
@@ -0,0 +1,5 @@
1
+ """Run the installed AC-Prof commands with python -m acprof."""
2
+ from acprof.cli.main import main
3
+
4
+ if __name__ == "__main__":
5
+ raise SystemExit(main())
@@ -0,0 +1 @@
1
+ """AC-Prof analysis."""
@@ -0,0 +1,276 @@
1
+ """只读结果审计;保持历史字段和不可用原因,不回填测量值。"""
2
+ from __future__ import annotations
3
+
4
+ import csv
5
+ import hashlib
6
+ import json
7
+ import math
8
+ from collections import Counter
9
+ from pathlib import Path
10
+
11
+ from acprof.artifact_layout import ArtifactLayout
12
+ from acprof.artifacts import read_json_object
13
+ from acprof.capabilities import collection_outcomes
14
+ from acprof.failures import Failure
15
+ from acprof.metric_registry import METRICS, NUMERIC_FIELDS
16
+ from acprof.platform import native_only_metric, recorded_identity
17
+ from acprof.quality import read_quality, summarize_quality
18
+ from acprof.result_csv import (
19
+ ResultCsvSnapshot,
20
+ expected_measurements,
21
+ measurement_key,
22
+ read_result_csv_snapshot,
23
+ result_csv_snapshot_unchanged,
24
+ )
25
+
26
+ MISSING = {"", "nan", "none", "null", "n/a"}
27
+
28
+
29
+ def number(value):
30
+ try:
31
+ result = float(value)
32
+ return result if math.isfinite(result) else None
33
+ except (ValueError, TypeError, OverflowError):
34
+ return None
35
+
36
+
37
+ def missing_reason(field: str, row: dict, metadata: dict) -> str:
38
+ if field not in row:
39
+ return "not_recorded"
40
+ metric = METRICS[field]
41
+ if recorded_identity(metadata)["environment_class"] == "wsl2" and native_only_metric(metric):
42
+ return "unavailable_on_wsl2"
43
+ if metric.applicability in {"gpu", "gpu_idle_debug"} and row.get("gpu_mode") == "off":
44
+ return "not_applicable"
45
+ if metric.applicability == "cpu" and row.get("gpu_mode") == "on":
46
+ return "not_applicable"
47
+ if str(row.get("status", "")).strip().lower() == "error":
48
+ return "measurement_failed"
49
+ if metric.tool:
50
+ suffix = "torch_profiler_eager" if metric.tool == "torch" else metric.tool
51
+ error = str(row.get(f"compute_profile_error_{suffix}", "")).strip()
52
+ if error.lower() not in MISSING:
53
+ return "profiler_reported_error"
54
+ key = "compute_profile_tools" if metric.tool in {"torch", "ncu"} else "execution_profile_tools"
55
+ enabled = metadata.get(key)
56
+ if isinstance(enabled, str):
57
+ try:
58
+ enabled = json.loads(enabled)
59
+ except ValueError:
60
+ enabled = enabled.split(",")
61
+ if isinstance(enabled, list) and not any(metric.tool in str(tool) for tool in enabled):
62
+ return "tool_not_enabled"
63
+ return "unavailable_unspecified"
64
+
65
+
66
+ def _formula_checks(row: dict) -> dict[str, float]:
67
+ """仅检查可由同一行确定的关系,不重建 RAPL 分段归因或补猜缺失来源。"""
68
+ values = {name: number(value) for name, value in row.items()}
69
+ expected = {}
70
+ cpu = values.get("vcpu_energy_eff_j")
71
+ gpu = values.get("gpu_energy_eff_j") if row.get("gpu_mode") == "on" else 0.0
72
+ if cpu is not None and cpu >= 0 and gpu is not None and gpu >= 0:
73
+ expected["container_attributed_energy_eff_j"] = cpu + gpu
74
+ request = values.get("packet_request_wire_bytes_per_request")
75
+ response = values.get("packet_response_wire_bytes_per_request")
76
+ if request is not None and response is not None:
77
+ expected["packet_total_wire_bytes_per_request"] = request + response
78
+ total = values.get("packet_total_wire_bytes_per_request")
79
+ payload = values.get("packet_tcp_payload_bytes_per_request")
80
+ if total is not None and payload is not None:
81
+ expected["packet_protocol_overhead_bytes_per_request"] = total - payload
82
+ if total > 0:
83
+ expected["packet_protocol_overhead_ratio"] = (total - payload) / total
84
+ return expected
85
+
86
+
87
+ def _check_workload_counts(row: dict) -> None:
88
+ raw = row.get("workload_contract", "")
89
+ if str(raw).strip().lower() in MISSING:
90
+ return
91
+ summary = json.loads(raw)
92
+ if not isinstance(summary, dict) or summary.get("schema_version") != 1:
93
+ raise ValueError("不支持的 workload_contract 摘要格式")
94
+ total = summary.get("request_count")
95
+ variants = summary.get("variants")
96
+ if type(total) is not int or total < 0 or not isinstance(variants, list):
97
+ raise ValueError("workload_contract 缺少合法 request_count/variants")
98
+ counts = [item.get("count") if isinstance(item, dict) else None for item in variants]
99
+ valid_counts = [count for count in counts if type(count) is int and count > 0]
100
+ if len(valid_counts) != len(counts) or sum(valid_counts) != total:
101
+ raise ValueError("workload_contract 的 variants 计数与 request_count 不一致")
102
+ completed = number(row.get("repeat_in_window"))
103
+ if completed is not None and completed != total:
104
+ raise ValueError("workload_contract.request_count 与 repeat_in_window 不一致")
105
+
106
+
107
+ def audit_result(source: str | Path, *, result_snapshot: ResultCsvSnapshot | None = None,
108
+ verify_result_snapshot: bool = True) -> dict:
109
+ path = Path(source)
110
+ if path.is_dir():
111
+ path /= "result_layers.json"
112
+ report = {**summarize_quality(None), "schema_version": 1, "result_csv": str(path.resolve()),
113
+ "valid": True, "issues": [], "missing_metrics": {},
114
+ "counts": {"rows": 0, "formal_ok": 0, "warmup": 0, "warn": 0, "error": 0},
115
+ "completion": "unknown", "measurement_status": "unknown", "run_status": "unknown", "coverage": None}
116
+
117
+ def issue(code, message, *, severity="error", **detail):
118
+ report["issues"].append({"code": code, "message": str(message), "severity": severity, **detail})
119
+ if severity == "error":
120
+ report["valid"] = False
121
+
122
+ def read_json(name):
123
+ try:
124
+ artifact = layout.path(name)
125
+ if not artifact.exists():
126
+ return {}
127
+ return read_json_object(artifact, label=name)
128
+ except (ValueError, OSError) as error:
129
+ issue("invalid_metadata", f"{name}: {error}")
130
+ return {}
131
+
132
+ def recorded_failure(name, location, value):
133
+ try:
134
+ if not isinstance(value, dict):
135
+ raise ValueError("typed failure must be an object")
136
+ failure = Failure(**value)
137
+ string_fields = (failure.stage, failure.detail, failure.device, failure.runtime_profile,
138
+ failure.exception_type)
139
+ if (not failure.stage or not failure.detail or any(not isinstance(item, str) for item in string_fields)
140
+ or not isinstance(failure.evidence, dict)):
141
+ raise ValueError("typed failure fields have invalid types")
142
+ return failure.to_dict()
143
+ except (TypeError, ValueError) as error:
144
+ issue("invalid_metadata", f"{name} {location}: {error}")
145
+ return None
146
+
147
+ try:
148
+ layout = ArtifactLayout.from_csv(path)
149
+ except (ValueError, OSError) as error:
150
+ issue("invalid_layout", error)
151
+ return report
152
+ report["layout_version"] = layout.layout_version
153
+ metadata = read_json("static_meta.json")
154
+ validation = read_json("runtime_validation.json")
155
+ resolution = read_json("model_resolution.json")
156
+ report["failures"] = []
157
+ devices = validation.get("devices", {})
158
+ if not isinstance(devices, dict):
159
+ issue("invalid_metadata", "runtime_validation.json devices: expected an object")
160
+ else:
161
+ for device, item in devices.items():
162
+ if not isinstance(item, dict):
163
+ issue("invalid_metadata", f"runtime_validation.json devices.{device}: expected an object")
164
+ elif item.get("failure") is not None:
165
+ failure = recorded_failure("runtime_validation.json", f"devices.{device}.failure", item["failure"])
166
+ if failure is not None:
167
+ report["failures"].append(failure)
168
+ recorded = read_json("runtime_failures.json").get("failures", [])
169
+ if not isinstance(recorded, list):
170
+ issue("invalid_metadata", "runtime_failures.json failures: expected a list")
171
+ else:
172
+ for index, value in enumerate(recorded):
173
+ failure = recorded_failure("runtime_failures.json", f"failures[{index}]", value)
174
+ if failure is not None:
175
+ report["failures"].append(failure)
176
+ if resolution.get("failure") is not None:
177
+ failure = recorded_failure("model_resolution.json", "failure", resolution["failure"])
178
+ if failure is not None:
179
+ report["failures"].append(failure)
180
+ report.update(read_quality(path))
181
+ for failure in report["failures"]:
182
+ issue(failure["reason_code"], failure["detail"], failure=failure)
183
+ for check in report["quality_checks"]:
184
+ issue(check["code"], check["detail"], severity=check["severity"], quality_check=check)
185
+ report.update(recorded_identity(metadata))
186
+ state = read_json("run_state.json")
187
+ if state:
188
+ report["run_status"] = state.get("status")
189
+ report["run_id"] = state.get("run_id")
190
+ report["completion"] = "complete" if state.get("status") == "complete" else "incomplete"
191
+ try:
192
+ snapshot = result_snapshot or read_result_csv_snapshot(path)
193
+ if snapshot.path != path.resolve():
194
+ raise ValueError("result CSV snapshot belongs to a different path")
195
+ fields, rows = snapshot.fields, snapshot.rows
196
+ report["result_sha256"] = snapshot.sha256
197
+ if verify_result_snapshot and not result_csv_snapshot_unchanged(snapshot):
198
+ issue("changing_snapshot", "读取期间 CSV 发生变化,请采集结束后重新审计")
199
+ except (ValueError, OSError, csv.Error) as error:
200
+ issue("invalid_csv", error)
201
+ return report
202
+ report["counts"]["rows"] = len(rows)
203
+ if "environment_class" not in fields:
204
+ issue("missing_environment_class", "结果缺少 environment_class 环境身份列")
205
+ environments = {row.get("environment_class", "unknown") for row in rows}
206
+ report["row_environment_classes"] = sorted(environments)
207
+ if len(environments) > 1 or any(value not in {"unknown", report["environment_class"]}
208
+ for value in environments):
209
+ issue("environment_mismatch", "CSV 与元数据环境身份不一致,或包含混合环境结果")
210
+ if report["environment_class"] == "unknown":
211
+ issue("unknown_environment", "环境身份 unknown;不能作为 Native Linux baseline", severity="warning")
212
+ report["execution"] = collection_outcomes(rows)
213
+ report["unknown_columns"] = [name for name in fields if name not in METRICS]
214
+ report["missing_columns"] = [name for name in METRICS if name not in fields]
215
+ expected_hash = metadata.get("input_scale_plan_sha256")
216
+ if expected_hash and str(expected_hash).lower() not in MISSING:
217
+ try:
218
+ plan = layout.path("input_scale_plan.json")
219
+ if not plan.is_file() or hashlib.sha256(plan.read_bytes()).hexdigest() != expected_hash:
220
+ issue("input_plan_hash", "输入计划与 static_meta.json 中的 SHA256 不一致")
221
+ except (OSError, ValueError) as error:
222
+ issue("input_plan_hash", error)
223
+ if state.get("runtime"):
224
+ try:
225
+ options = state["options"]
226
+ expected = expected_measurements(
227
+ [int(value) for value in options["cpus"].split(",")],
228
+ [int(value) for value in options["mems"].split(",")], options["gpus"].split(","),
229
+ state["runtime"]["planned"]["scales"], options["warmup"], options["repeat"],
230
+ )
231
+ actual = {measurement_key(row) for row in rows}
232
+ report["coverage"] = {"expected": len(expected), "actual": len(actual),
233
+ "missing": len(expected - actual), "unexpected": len(actual - expected)}
234
+ if expected != actual:
235
+ issue("plan_coverage", "结果行与原实验计划不完全一致")
236
+ except (ValueError, KeyError, TypeError, AttributeError) as error:
237
+ issue("invalid_run_state", error)
238
+ missing: dict[str, Counter[str]] = {}
239
+ for index, row in enumerate(rows, 2):
240
+ status = row.get("status", "").strip().lower()
241
+ warmup = number(row["warmup"]) == 1
242
+ report["counts"]["warmup"] += warmup
243
+ if status not in {"ok", "warn", "error"}:
244
+ issue("invalid_status", "status 应为 ok、warn 或 error", row=index)
245
+ if status in {"warn", "error"}:
246
+ report["counts"][status] += 1
247
+ formal = status == "ok" and not warmup
248
+ report["counts"]["formal_ok"] += formal
249
+ try:
250
+ _check_workload_counts(row)
251
+ except (ValueError, TypeError) as error:
252
+ issue("workload_contract", error, row=index)
253
+ for field in NUMERIC_FIELDS:
254
+ if (report["environment_class"] == "wsl2" and native_only_metric(METRICS[field])
255
+ and number(row.get(field)) is not None):
256
+ issue("unsupported_wsl_metric", f"WSL2 不允许记录 Native 专属指标 {field}", row=index, field=field)
257
+ raw = str(row.get(field, "nan")).strip().lower()
258
+ if raw not in MISSING and number(raw) is None:
259
+ issue("invalid_number", f"{field} 不是有限数值或 nan", row=index, field=field)
260
+ elif formal and raw in MISSING:
261
+ missing.setdefault(field, Counter())[missing_reason(field, row, metadata)] += 1
262
+ if formal:
263
+ for field, expected_value in _formula_checks(row).items():
264
+ actual_value = number(row.get(field))
265
+ # CSV 保存到 6 位小数,容忍加减的累计舍入,不把缺失分母解释为错误。
266
+ if actual_value is not None and not math.isclose(actual_value, expected_value, rel_tol=2e-5, abs_tol=2e-6):
267
+ issue("formula_mismatch", f"{field}: 实际 {actual_value:g},应为 {expected_value:g}", row=index, field=field)
268
+ report["missing_metrics"] = {name: dict(reasons) for name, reasons in missing.items()}
269
+ coverage = report["coverage"]
270
+ if coverage is not None:
271
+ formal = report["counts"]["rows"] - report["counts"]["warmup"]
272
+ report["measurement_status"] = (
273
+ "complete" if report["completion"] == "complete" and not coverage["missing"]
274
+ and not coverage["unexpected"] and formal > 0 and formal == report["counts"]["formal_ok"]
275
+ else "incomplete")
276
+ return report