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.
- acprof/__init__.py +3 -0
- acprof/__main__.py +5 -0
- acprof/_bundle/.dockerignore +20 -0
- acprof/_bundle/LICENSE +202 -0
- acprof/_bundle/NOTICE +43 -0
- acprof/_bundle/acprof/__init__.py +3 -0
- acprof/_bundle/acprof/__main__.py +5 -0
- acprof/_bundle/acprof/analysis/__init__.py +1 -0
- acprof/_bundle/acprof/analysis/audit.py +276 -0
- acprof/_bundle/acprof/analysis/comparison.py +364 -0
- acprof/_bundle/acprof/analysis/compatibility.py +223 -0
- acprof/_bundle/acprof/analysis/conditions.py +185 -0
- acprof/_bundle/acprof/analysis/independent_comparison.py +191 -0
- acprof/_bundle/acprof/analysis/latency_model.py +1106 -0
- acprof/_bundle/acprof/analysis/latency_report.py +577 -0
- acprof/_bundle/acprof/analysis/model.py +276 -0
- acprof/_bundle/acprof/analysis/precision.py +51 -0
- acprof/_bundle/acprof/analysis/uncertainty.py +144 -0
- acprof/_bundle/acprof/application/__init__.py +1 -0
- acprof/_bundle/acprof/application/download.py +14 -0
- acprof/_bundle/acprof/application/errors.py +5 -0
- acprof/_bundle/acprof/application/notifications.py +302 -0
- acprof/_bundle/acprof/application/preparation.py +333 -0
- acprof/_bundle/acprof/application/resources.py +66 -0
- acprof/_bundle/acprof/application/run.py +462 -0
- acprof/_bundle/acprof/application/terminal_log.py +136 -0
- acprof/_bundle/acprof/artifact_layout.py +261 -0
- acprof/_bundle/acprof/artifacts.py +161 -0
- acprof/_bundle/acprof/capabilities.py +404 -0
- acprof/_bundle/acprof/cli/__init__.py +1 -0
- acprof/_bundle/acprof/cli/audit.py +74 -0
- acprof/_bundle/acprof/cli/auto.py +41 -0
- acprof/_bundle/acprof/cli/backfill_compute.py +498 -0
- acprof/_bundle/acprof/cli/compare.py +34 -0
- acprof/_bundle/acprof/cli/coverage.py +70 -0
- acprof/_bundle/acprof/cli/doctor.py +47 -0
- acprof/_bundle/acprof/cli/inspect.py +101 -0
- acprof/_bundle/acprof/cli/load.py +190 -0
- acprof/_bundle/acprof/cli/main.py +64 -0
- acprof/_bundle/acprof/cli/model_store.py +22 -0
- acprof/_bundle/acprof/cli/plot.py +211 -0
- acprof/_bundle/acprof/cli/posthoc.py +113 -0
- acprof/_bundle/acprof/cli/probe.py +186 -0
- acprof/_bundle/acprof/cli/report.py +35 -0
- acprof/_bundle/acprof/cli/results.py +37 -0
- acprof/_bundle/acprof/cli/run.py +54 -0
- acprof/_bundle/acprof/cli/stats.py +94 -0
- acprof/_bundle/acprof/cli/tui.py +65 -0
- acprof/_bundle/acprof/config.py +177 -0
- acprof/_bundle/acprof/container/__init__.py +1 -0
- acprof/_bundle/acprof/container/compat/__init__.py +1 -0
- acprof/_bundle/acprof/container/compat/transformers_dynamic.py +54 -0
- acprof/_bundle/acprof/container/compat/transformers_model_types.json +1091 -0
- acprof/_bundle/acprof/container/compute_profile_runner.py +392 -0
- acprof/_bundle/acprof/container/download_model.py +165 -0
- acprof/_bundle/acprof/container/execution.py +73 -0
- acprof/_bundle/acprof/container/handlers/__init__.py +298 -0
- acprof/_bundle/acprof/container/handlers/audio.py +743 -0
- acprof/_bundle/acprof/container/handlers/custom_pipeline.py +74 -0
- acprof/_bundle/acprof/container/handlers/cv.py +321 -0
- acprof/_bundle/acprof/container/handlers/diffusion.py +728 -0
- acprof/_bundle/acprof/container/handlers/moss.py +64 -0
- acprof/_bundle/acprof/container/handlers/multimodal.py +609 -0
- acprof/_bundle/acprof/container/handlers/nlp.py +747 -0
- acprof/_bundle/acprof/container/handlers/onnx_tasks.py +231 -0
- acprof/_bundle/acprof/container/handlers/onnxruntime.py +90 -0
- acprof/_bundle/acprof/container/handlers/structured.py +185 -0
- acprof/_bundle/acprof/container/handlers/timeseries.py +178 -0
- acprof/_bundle/acprof/container/load_policy.py +81 -0
- acprof/_bundle/acprof/container/loading_quality.py +48 -0
- acprof/_bundle/acprof/container/local_pipeline.py +31 -0
- acprof/_bundle/acprof/container/model_files.py +280 -0
- acprof/_bundle/acprof/container/model_probe.py +80 -0
- acprof/_bundle/acprof/container/onnx_session.py +150 -0
- acprof/_bundle/acprof/container/runtime_manifest.py +150 -0
- acprof/_bundle/acprof/container/runtime_validate.py +156 -0
- acprof/_bundle/acprof/container/server.py +209 -0
- acprof/_bundle/acprof/container/torch_execution.py +55 -0
- acprof/_bundle/acprof/container/validation.py +172 -0
- acprof/_bundle/acprof/cpu_affinity.py +35 -0
- acprof/_bundle/acprof/dependency_locks.py +129 -0
- acprof/_bundle/acprof/experiment.py +356 -0
- acprof/_bundle/acprof/extensions/__init__.py +294 -0
- acprof/_bundle/acprof/extensions/builtin/manifest.json +3591 -0
- acprof/_bundle/acprof/extensions/onnxruntime/manifest.json +191 -0
- acprof/_bundle/acprof/extensions/schema.py +238 -0
- acprof/_bundle/acprof/extensions/transformers/4.57.6.json +1639 -0
- acprof/_bundle/acprof/extensions/transformers/5.10.4.json +1812 -0
- acprof/_bundle/acprof/failures.py +115 -0
- acprof/_bundle/acprof/hardware_conditions.py +18 -0
- acprof/_bundle/acprof/hf_download.py +143 -0
- acprof/_bundle/acprof/hf_endpoints.py +62 -0
- acprof/_bundle/acprof/hf_transport.py +238 -0
- acprof/_bundle/acprof/host/__init__.py +1 -0
- acprof/_bundle/acprof/host/automation.py +161 -0
- acprof/_bundle/acprof/host/client.py +520 -0
- acprof/_bundle/acprof/host/collection_history.py +77 -0
- acprof/_bundle/acprof/host/collection_workflow.py +285 -0
- acprof/_bundle/acprof/host/command.py +119 -0
- acprof/_bundle/acprof/host/container_lifecycle.py +225 -0
- acprof/_bundle/acprof/host/container_state.py +128 -0
- acprof/_bundle/acprof/host/coverage_state.py +259 -0
- acprof/_bundle/acprof/host/detect.py +669 -0
- acprof/_bundle/acprof/host/docker_runtime.py +359 -0
- acprof/_bundle/acprof/host/doctor.py +158 -0
- acprof/_bundle/acprof/host/env_utils.py +233 -0
- acprof/_bundle/acprof/host/execution_conditions.py +87 -0
- acprof/_bundle/acprof/host/gpu_device.py +66 -0
- acprof/_bundle/acprof/host/hardware_conditions.py +130 -0
- acprof/_bundle/acprof/host/images/__init__.py +1 -0
- acprof/_bundle/acprof/host/images/dependencies.py +169 -0
- acprof/_bundle/acprof/host/images/environment.py +313 -0
- acprof/_bundle/acprof/host/images/graph.py +143 -0
- acprof/_bundle/acprof/host/images/identity.py +6 -0
- acprof/_bundle/acprof/host/images/inventory.py +445 -0
- acprof/_bundle/acprof/host/images/runtime.py +457 -0
- acprof/_bundle/acprof/host/images/scan.py +154 -0
- acprof/_bundle/acprof/host/input_plan.py +1056 -0
- acprof/_bundle/acprof/host/interface_probe.py +141 -0
- acprof/_bundle/acprof/host/largest_scale_probe.py +566 -0
- acprof/_bundle/acprof/host/matrix_plan.py +98 -0
- acprof/_bundle/acprof/host/measurement/__init__.py +1 -0
- acprof/_bundle/acprof/host/measurement/boundary.py +162 -0
- acprof/_bundle/acprof/host/measurement/capture.py +139 -0
- acprof/_bundle/acprof/host/measurement/checkpoint.py +275 -0
- acprof/_bundle/acprof/host/measurement/config.py +212 -0
- acprof/_bundle/acprof/host/measurement/diagnostics.py +247 -0
- acprof/_bundle/acprof/host/measurement/energy_validation.py +172 -0
- acprof/_bundle/acprof/host/measurement/errors.py +25 -0
- acprof/_bundle/acprof/host/measurement/execution.py +396 -0
- acprof/_bundle/acprof/host/measurement/load.py +237 -0
- acprof/_bundle/acprof/host/measurement/metrics.py +975 -0
- acprof/_bundle/acprof/host/measurement/monitors.py +143 -0
- acprof/_bundle/acprof/host/measurement/publication.py +171 -0
- acprof/_bundle/acprof/host/measurement/requests.py +97 -0
- acprof/_bundle/acprof/host/measurement/types.py +82 -0
- acprof/_bundle/acprof/host/model_coverage.py +337 -0
- acprof/_bundle/acprof/host/model_errors.py +116 -0
- acprof/_bundle/acprof/host/model_inspection.py +107 -0
- acprof/_bundle/acprof/host/model_schema.py +35 -0
- acprof/_bundle/acprof/host/model_store.py +733 -0
- acprof/_bundle/acprof/host/network_preflight.py +229 -0
- acprof/_bundle/acprof/host/orchestrator.py +1133 -0
- acprof/_bundle/acprof/host/permissions.py +117 -0
- acprof/_bundle/acprof/host/platform_metadata.py +63 -0
- acprof/_bundle/acprof/host/posthoc/__init__.py +12 -0
- acprof/_bundle/acprof/host/posthoc/backfill.py +415 -0
- acprof/_bundle/acprof/host/posthoc/context.py +400 -0
- acprof/_bundle/acprof/host/posthoc/plans.py +597 -0
- acprof/_bundle/acprof/host/posthoc/service.py +303 -0
- acprof/_bundle/acprof/host/posthoc/storage.py +491 -0
- acprof/_bundle/acprof/host/preflight.py +370 -0
- acprof/_bundle/acprof/host/profiling/__init__.py +1 -0
- acprof/_bundle/acprof/host/profiling/compute.py +436 -0
- acprof/_bundle/acprof/host/profiling/compute_plan.py +261 -0
- acprof/_bundle/acprof/host/profiling/execution.py +547 -0
- acprof/_bundle/acprof/host/profiling/execution_plan.py +576 -0
- acprof/_bundle/acprof/host/profiling/progress.py +83 -0
- acprof/_bundle/acprof/host/profiling/support.py +252 -0
- acprof/_bundle/acprof/host/profiling/tools/__init__.py +1 -0
- acprof/_bundle/acprof/host/profiling/tools/advisor.py +164 -0
- acprof/_bundle/acprof/host/profiling/tools/compute_parsers.py +409 -0
- acprof/_bundle/acprof/host/profiling/tools/execution_environment.py +135 -0
- acprof/_bundle/acprof/host/profiling/tools/execution_parsers.py +364 -0
- acprof/_bundle/acprof/host/profiling/tools/massif.py +418 -0
- acprof/_bundle/acprof/host/profiling/tools/ncu.py +696 -0
- acprof/_bundle/acprof/host/profiling/tools/nsys.py +326 -0
- acprof/_bundle/acprof/host/profiling/tools/tool_discovery.py +229 -0
- acprof/_bundle/acprof/host/profiling/tools/torch.py +158 -0
- acprof/_bundle/acprof/host/result_cleanup.py +65 -0
- acprof/_bundle/acprof/host/run_state.py +639 -0
- acprof/_bundle/acprof/host/runtime_settings.py +10 -0
- acprof/_bundle/acprof/host/runtime_validation.py +302 -0
- acprof/_bundle/acprof/host/source_bundle.py +96 -0
- acprof/_bundle/acprof/host/startup_probe.py +95 -0
- acprof/_bundle/acprof/host/static_metadata.py +936 -0
- acprof/_bundle/acprof/host/task_support.py +121 -0
- acprof/_bundle/acprof/installation.py +26 -0
- acprof/_bundle/acprof/latency_slo.py +62 -0
- acprof/_bundle/acprof/messages.py +26 -0
- acprof/_bundle/acprof/metric_registry.py +315 -0
- acprof/_bundle/acprof/model_candidates.py +297 -0
- acprof/_bundle/acprof/model_contract.py +234 -0
- acprof/_bundle/acprof/model_dependencies.py +93 -0
- acprof/_bundle/acprof/model_dependency_domain.py +45 -0
- acprof/_bundle/acprof/model_dependency_eval.py +438 -0
- acprof/_bundle/acprof/model_dependency_flow.py +200 -0
- acprof/_bundle/acprof/model_evidence.py +115 -0
- acprof/_bundle/acprof/model_metadata_analysis.py +156 -0
- acprof/_bundle/acprof/model_repository.py +149 -0
- acprof/_bundle/acprof/model_resolution.py +129 -0
- acprof/_bundle/acprof/model_review.py +155 -0
- acprof/_bundle/acprof/model_source_analysis.py +299 -0
- acprof/_bundle/acprof/model_spec.py +204 -0
- acprof/_bundle/acprof/model_support.py +105 -0
- acprof/_bundle/acprof/model_transforms.py +81 -0
- acprof/_bundle/acprof/monitors/__init__.py +1 -0
- acprof/_bundle/acprof/monitors/common.py +63 -0
- acprof/_bundle/acprof/monitors/energy_cpu.py +651 -0
- acprof/_bundle/acprof/monitors/energy_nvml.py +381 -0
- acprof/_bundle/acprof/monitors/gpu_metrics.py +123 -0
- acprof/_bundle/acprof/monitors/interfaces.py +74 -0
- acprof/_bundle/acprof/monitors/perf_mips.py +617 -0
- acprof/_bundle/acprof/monitors/rapl_topology.py +100 -0
- acprof/_bundle/acprof/monitors/resource_metrics.py +472 -0
- acprof/_bundle/acprof/monitors/resource_readers.py +435 -0
- acprof/_bundle/acprof/monitors/resource_usage.py +450 -0
- acprof/_bundle/acprof/monitors/sampling.py +79 -0
- acprof/_bundle/acprof/network_policy.py +182 -0
- acprof/_bundle/acprof/notifications.py +279 -0
- acprof/_bundle/acprof/packet/__init__.py +1 -0
- acprof/_bundle/acprof/packet/merge_packet_latency.py +369 -0
- acprof/_bundle/acprof/packet/sniff_parse_pcap.py +240 -0
- acprof/_bundle/acprof/pixel_metrics.py +103 -0
- acprof/_bundle/acprof/platform.py +180 -0
- acprof/_bundle/acprof/plotting/__init__.py +1 -0
- acprof/_bundle/acprof/plotting/config.py +487 -0
- acprof/_bundle/acprof/plotting/data.py +236 -0
- acprof/_bundle/acprof/plotting/diagnostics.py +747 -0
- acprof/_bundle/acprof/plotting/latency.py +638 -0
- acprof/_bundle/acprof/plotting/metrics.py +648 -0
- acprof/_bundle/acprof/plotting/plotly-LICENSE.txt +21 -0
- acprof/_bundle/acprof/plotting/report.py +66 -0
- acprof/_bundle/acprof/plotting/styles.py +111 -0
- acprof/_bundle/acprof/precision.py +42 -0
- acprof/_bundle/acprof/preparation_events.py +78 -0
- acprof/_bundle/acprof/progress_events.py +105 -0
- acprof/_bundle/acprof/quality.py +153 -0
- acprof/_bundle/acprof/resource_budget.py +29 -0
- acprof/_bundle/acprof/result_csv.py +263 -0
- acprof/_bundle/acprof/result_layers.py +365 -0
- acprof/_bundle/acprof/run_args.py +223 -0
- acprof/_bundle/acprof/run_options.py +225 -0
- acprof/_bundle/acprof/runtime_dependencies.py +195 -0
- acprof/_bundle/acprof/runtime_profiles.py +258 -0
- acprof/_bundle/acprof/runtime_settings.py +72 -0
- acprof/_bundle/acprof/source_identity.py +68 -0
- acprof/_bundle/acprof/telemetry.py +225 -0
- acprof/_bundle/acprof/testing/__init__.py +1 -0
- acprof/_bundle/acprof/testing/evidence.py +117 -0
- acprof/_bundle/acprof/testing/plugin.py +126 -0
- acprof/_bundle/acprof/testing/provenance.py +53 -0
- acprof/_bundle/acprof/testing/sharding.py +14 -0
- acprof/_bundle/acprof/tui/__init__.py +1 -0
- acprof/_bundle/acprof/tui/app.py +934 -0
- acprof/_bundle/acprof/tui/app_contracts.py +43 -0
- acprof/_bundle/acprof/tui/catalog_controller.py +120 -0
- acprof/_bundle/acprof/tui/commands.py +209 -0
- acprof/_bundle/acprof/tui/configuration_controller.py +436 -0
- acprof/_bundle/acprof/tui/diagnostics.py +340 -0
- acprof/_bundle/acprof/tui/downloads.py +56 -0
- acprof/_bundle/acprof/tui/environment.py +248 -0
- acprof/_bundle/acprof/tui/experiment_catalog.py +279 -0
- acprof/_bundle/acprof/tui/experiment_controller.py +132 -0
- acprof/_bundle/acprof/tui/experiment_picker.py +273 -0
- acprof/_bundle/acprof/tui/field_validation.py +62 -0
- acprof/_bundle/acprof/tui/i18n.py +57 -0
- acprof/_bundle/acprof/tui/image_controller.py +525 -0
- acprof/_bundle/acprof/tui/images.py +737 -0
- acprof/_bundle/acprof/tui/input.py +191 -0
- acprof/_bundle/acprof/tui/localization_controller.py +110 -0
- acprof/_bundle/acprof/tui/log.py +310 -0
- acprof/_bundle/acprof/tui/model_candidates.py +278 -0
- acprof/_bundle/acprof/tui/model_controller.py +111 -0
- acprof/_bundle/acprof/tui/model_input.py +12 -0
- acprof/_bundle/acprof/tui/model_store.py +166 -0
- acprof/_bundle/acprof/tui/preflight_controller.py +271 -0
- acprof/_bundle/acprof/tui/preparation.py +269 -0
- acprof/_bundle/acprof/tui/presentation.py +46 -0
- acprof/_bundle/acprof/tui/process.py +111 -0
- acprof/_bundle/acprof/tui/process_controller.py +218 -0
- acprof/_bundle/acprof/tui/profile_controller.py +109 -0
- acprof/_bundle/acprof/tui/progress.py +195 -0
- acprof/_bundle/acprof/tui/recovery.py +114 -0
- acprof/_bundle/acprof/tui/recovery_controller.py +169 -0
- acprof/_bundle/acprof/tui/rendering.py +75 -0
- acprof/_bundle/acprof/tui/reports.py +303 -0
- acprof/_bundle/acprof/tui/result_controller.py +279 -0
- acprof/_bundle/acprof/tui/review_inputs.py +54 -0
- acprof/_bundle/acprof/tui/run_form.py +125 -0
- acprof/_bundle/acprof/tui/run_planning.py +97 -0
- acprof/_bundle/acprof/tui/run_results.py +175 -0
- acprof/_bundle/acprof/tui/scrollbar.py +65 -0
- acprof/_bundle/acprof/tui/settings.py +203 -0
- acprof/_bundle/acprof/tui/slash_controller.py +95 -0
- acprof/_bundle/acprof/tui/stages.py +97 -0
- acprof/_bundle/acprof/tui/storage.py +150 -0
- acprof/_bundle/acprof/tui/table.py +213 -0
- acprof/_bundle/acprof/tui/themes.py +112 -0
- acprof/_bundle/acprof/tui/translation_catalog.py +1861 -0
- acprof/_bundle/acprof/tui/tui.tcss +373 -0
- acprof/_bundle/acprof/tui/views.py +706 -0
- acprof/_bundle/acprof/window_records.py +165 -0
- acprof/_bundle/acprof/workloads/__init__.py +222 -0
- acprof/_bundle/acprof/workloads/audio.py +621 -0
- acprof/_bundle/acprof/workloads/contract.py +116 -0
- acprof/_bundle/acprof/workloads/cv.py +240 -0
- acprof/_bundle/acprof/workloads/diffusion.py +410 -0
- acprof/_bundle/acprof/workloads/multimodal.py +329 -0
- acprof/_bundle/acprof/workloads/nlp.py +151 -0
- acprof/_bundle/acprof/workloads/structured.py +151 -0
- acprof/_bundle/acprof/workloads/timeseries.py +69 -0
- acprof/_bundle/assets/audio/librispeech-clean-test-en-30s/audio.wav +0 -0
- acprof/_bundle/assets/audio/librispeech-clean-test-en-30s/source.json +81 -0
- acprof/_bundle/dockerfiles/environment_tools.py +314 -0
- acprof/_bundle/dockerfiles/locks/audio-cpu.artifacts.json +503 -0
- acprof/_bundle/dockerfiles/locks/audio-cpu.txt +143 -0
- acprof/_bundle/dockerfiles/locks/audio-cu124.artifacts.json +600 -0
- acprof/_bundle/dockerfiles/locks/audio-cu124.txt +171 -0
- acprof/_bundle/dockerfiles/locks/audio-cu128.artifacts.json +544 -0
- acprof/_bundle/dockerfiles/locks/audio-cu128.txt +155 -0
- acprof/_bundle/dockerfiles/locks/custom-multimodal-cpu.artifacts.json +510 -0
- acprof/_bundle/dockerfiles/locks/custom-multimodal-cpu.txt +145 -0
- acprof/_bundle/dockerfiles/locks/custom-multimodal-cu124.artifacts.json +607 -0
- acprof/_bundle/dockerfiles/locks/custom-multimodal-cu124.txt +173 -0
- acprof/_bundle/dockerfiles/locks/custom-multimodal-cu128.artifacts.json +642 -0
- acprof/_bundle/dockerfiles/locks/custom-multimodal-cu128.txt +183 -0
- acprof/_bundle/dockerfiles/locks/cv-cpu.artifacts.json +279 -0
- acprof/_bundle/dockerfiles/locks/cv-cpu.txt +79 -0
- acprof/_bundle/dockerfiles/locks/cv-cu124.artifacts.json +376 -0
- acprof/_bundle/dockerfiles/locks/cv-cu124.txt +107 -0
- acprof/_bundle/dockerfiles/locks/cv-cu128.artifacts.json +411 -0
- acprof/_bundle/dockerfiles/locks/cv-cu128.txt +117 -0
- acprof/_bundle/dockerfiles/locks/diffusion-cpu.artifacts.json +335 -0
- acprof/_bundle/dockerfiles/locks/diffusion-cpu.txt +95 -0
- acprof/_bundle/dockerfiles/locks/diffusion-cu124.artifacts.json +432 -0
- acprof/_bundle/dockerfiles/locks/diffusion-cu124.txt +123 -0
- acprof/_bundle/dockerfiles/locks/diffusion-cu128.artifacts.json +467 -0
- acprof/_bundle/dockerfiles/locks/diffusion-cu128.txt +133 -0
- acprof/_bundle/dockerfiles/locks/moss-transformers5104.artifacts.json +621 -0
- acprof/_bundle/dockerfiles/locks/moss-transformers5104.txt +177 -0
- acprof/_bundle/dockerfiles/locks/multimodal-transformers4576.artifacts.json +635 -0
- acprof/_bundle/dockerfiles/locks/multimodal-transformers4576.txt +181 -0
- acprof/_bundle/dockerfiles/locks/nlp-cpu.artifacts.json +363 -0
- acprof/_bundle/dockerfiles/locks/nlp-cpu.txt +103 -0
- acprof/_bundle/dockerfiles/locks/nlp-cu124.artifacts.json +460 -0
- acprof/_bundle/dockerfiles/locks/nlp-cu124.txt +131 -0
- acprof/_bundle/dockerfiles/locks/nlp-cu128.artifacts.json +495 -0
- acprof/_bundle/dockerfiles/locks/nlp-cu128.txt +141 -0
- acprof/_bundle/dockerfiles/locks/onnxruntime-cpu.artifacts.json +261 -0
- acprof/_bundle/dockerfiles/locks/onnxruntime-cpu.txt +73 -0
- acprof/_bundle/dockerfiles/locks/platform-cpu.artifacts.json +99 -0
- acprof/_bundle/dockerfiles/locks/platform-cpu.txt +27 -0
- acprof/_bundle/dockerfiles/locks/platform-cu124.artifacts.json +196 -0
- acprof/_bundle/dockerfiles/locks/platform-cu124.txt +55 -0
- acprof/_bundle/dockerfiles/locks/platform-cu128.artifacts.json +231 -0
- acprof/_bundle/dockerfiles/locks/platform-cu128.txt +65 -0
- acprof/_bundle/dockerfiles/locks/platform-python-cpu.artifacts.json +37 -0
- acprof/_bundle/dockerfiles/locks/platform-python-cpu.txt +9 -0
- acprof/_bundle/dockerfiles/locks/structured-cpu.artifacts.json +279 -0
- acprof/_bundle/dockerfiles/locks/structured-cpu.txt +79 -0
- acprof/_bundle/dockerfiles/locks/structured-cu124.artifacts.json +376 -0
- acprof/_bundle/dockerfiles/locks/structured-cu124.txt +107 -0
- acprof/_bundle/dockerfiles/locks/structured-cu128.artifacts.json +411 -0
- acprof/_bundle/dockerfiles/locks/structured-cu128.txt +117 -0
- acprof/_bundle/dockerfiles/locks/system-trixie-amd64.json +620 -0
- acprof/_bundle/dockerfiles/locks/timeseries-cpu.artifacts.json +314 -0
- acprof/_bundle/dockerfiles/locks/timeseries-cpu.txt +89 -0
- acprof/_bundle/dockerfiles/locks/timeseries-cu124.artifacts.json +411 -0
- acprof/_bundle/dockerfiles/locks/timeseries-cu124.txt +117 -0
- acprof/_bundle/dockerfiles/locks/timeseries-cu128.artifacts.json +446 -0
- acprof/_bundle/dockerfiles/locks/timeseries-cu128.txt +127 -0
- acprof/_bundle/dockerfiles/locks/transformers5104-cpu.artifacts.json +594 -0
- acprof/_bundle/dockerfiles/locks/transformers5104-cpu.txt +169 -0
- acprof/_bundle/dockerfiles/locks/transformers5104-cu124.artifacts.json +691 -0
- acprof/_bundle/dockerfiles/locks/transformers5104-cu124.txt +197 -0
- acprof/_bundle/dockerfiles/locks/transformers5104-cu128.artifacts.json +726 -0
- acprof/_bundle/dockerfiles/locks/transformers5104-cu128.txt +207 -0
- acprof/_bundle/dockerfiles/platform.Dockerfile +22 -0
- acprof/_bundle/dockerfiles/requirements/audio.in +5 -0
- acprof/_bundle/dockerfiles/requirements/custom-multimodal.in +2 -0
- acprof/_bundle/dockerfiles/requirements/cv.in +4 -0
- acprof/_bundle/dockerfiles/requirements/diffusion.in +6 -0
- acprof/_bundle/dockerfiles/requirements/moss-transformers5104.in +9 -0
- acprof/_bundle/dockerfiles/requirements/multimodal-transformers4576.in +3 -0
- acprof/_bundle/dockerfiles/requirements/nlp.in +7 -0
- acprof/_bundle/dockerfiles/requirements/onnxruntime.in +9 -0
- acprof/_bundle/dockerfiles/requirements/service.in +8 -0
- acprof/_bundle/dockerfiles/requirements/structured.in +4 -0
- acprof/_bundle/dockerfiles/requirements/timeseries.in +2 -0
- acprof/_bundle/dockerfiles/requirements/timm.in +1 -0
- acprof/_bundle/dockerfiles/requirements/transformers5104.in +4 -0
- acprof/_bundle/dockerfiles/runtime-final.Dockerfile +34 -0
- acprof/_bundle/dockerfiles/runtime-model.Dockerfile +19 -0
- acprof/_bundle/dockerfiles/runtime.Dockerfile +23 -0
- acprof/_bundle/examples/coverage/regression.json +17 -0
- acprof/_bundle/examples/hardware-validation.json +19 -0
- acprof/_bundle/examples/multimodal/ultravox.model.json +29 -0
- acprof/_bundle/examples/nlp/smoke.py +111 -0
- acprof/_bundle/examples/onnxruntime/fixtures.py +164 -0
- acprof/_bundle/examples/onnxruntime/iris.json +16 -0
- acprof/_bundle/examples/onnxruntime/iris.model.json +7 -0
- acprof/_bundle/examples/onnxruntime/real_models.py +155 -0
- acprof/_bundle/examples/onnxruntime/smoke.py +68 -0
- acprof/_bundle/examples/structured/chronos_smoke.py +56 -0
- acprof/_bundle/examples/structured/export_models.py +71 -0
- acprof/_bundle/examples/structured/smoke.py +71 -0
- acprof/_bundle/licenses/CC-BY-4.0.txt +156 -0
- acprof/analysis/__init__.py +1 -0
- acprof/analysis/audit.py +276 -0
- acprof/analysis/comparison.py +364 -0
- acprof/analysis/compatibility.py +223 -0
- acprof/analysis/conditions.py +185 -0
- acprof/analysis/independent_comparison.py +191 -0
- acprof/analysis/latency_model.py +1106 -0
- acprof/analysis/latency_report.py +577 -0
- acprof/analysis/model.py +276 -0
- acprof/analysis/precision.py +51 -0
- acprof/analysis/uncertainty.py +144 -0
- acprof/application/__init__.py +1 -0
- acprof/application/download.py +14 -0
- acprof/application/errors.py +5 -0
- acprof/application/notifications.py +302 -0
- acprof/application/preparation.py +333 -0
- acprof/application/resources.py +66 -0
- acprof/application/run.py +462 -0
- acprof/application/terminal_log.py +136 -0
- acprof/artifact_layout.py +261 -0
- acprof/artifacts.py +161 -0
- acprof/capabilities.py +404 -0
- acprof/cli/__init__.py +1 -0
- acprof/cli/audit.py +74 -0
- acprof/cli/auto.py +41 -0
- acprof/cli/backfill_compute.py +498 -0
- acprof/cli/compare.py +34 -0
- acprof/cli/coverage.py +70 -0
- acprof/cli/doctor.py +47 -0
- acprof/cli/inspect.py +101 -0
- acprof/cli/load.py +190 -0
- acprof/cli/main.py +64 -0
- acprof/cli/model_store.py +22 -0
- acprof/cli/plot.py +211 -0
- acprof/cli/posthoc.py +113 -0
- acprof/cli/probe.py +186 -0
- acprof/cli/report.py +35 -0
- acprof/cli/results.py +37 -0
- acprof/cli/run.py +54 -0
- acprof/cli/stats.py +94 -0
- acprof/cli/tui.py +65 -0
- acprof/config.py +177 -0
- acprof/container/__init__.py +1 -0
- acprof/container/compat/__init__.py +1 -0
- acprof/container/compat/transformers_dynamic.py +54 -0
- acprof/container/compat/transformers_model_types.json +1091 -0
- acprof/container/compute_profile_runner.py +392 -0
- acprof/container/download_model.py +165 -0
- acprof/container/execution.py +73 -0
- acprof/container/handlers/__init__.py +298 -0
- acprof/container/handlers/audio.py +743 -0
- acprof/container/handlers/custom_pipeline.py +74 -0
- acprof/container/handlers/cv.py +321 -0
- acprof/container/handlers/diffusion.py +728 -0
- acprof/container/handlers/moss.py +64 -0
- acprof/container/handlers/multimodal.py +609 -0
- acprof/container/handlers/nlp.py +747 -0
- acprof/container/handlers/onnx_tasks.py +231 -0
- acprof/container/handlers/onnxruntime.py +90 -0
- acprof/container/handlers/structured.py +185 -0
- acprof/container/handlers/timeseries.py +178 -0
- acprof/container/load_policy.py +81 -0
- acprof/container/loading_quality.py +48 -0
- acprof/container/local_pipeline.py +31 -0
- acprof/container/model_files.py +280 -0
- acprof/container/model_probe.py +80 -0
- acprof/container/onnx_session.py +150 -0
- acprof/container/runtime_manifest.py +150 -0
- acprof/container/runtime_validate.py +156 -0
- acprof/container/server.py +209 -0
- acprof/container/torch_execution.py +55 -0
- acprof/container/validation.py +172 -0
- acprof/cpu_affinity.py +35 -0
- acprof/dependency_locks.py +129 -0
- acprof/experiment.py +356 -0
- acprof/extensions/__init__.py +294 -0
- acprof/extensions/builtin/manifest.json +3591 -0
- acprof/extensions/onnxruntime/manifest.json +191 -0
- acprof/extensions/schema.py +238 -0
- acprof/extensions/transformers/4.57.6.json +1639 -0
- acprof/extensions/transformers/5.10.4.json +1812 -0
- acprof/failures.py +115 -0
- acprof/hardware_conditions.py +18 -0
- acprof/hf_download.py +143 -0
- acprof/hf_endpoints.py +62 -0
- acprof/hf_transport.py +238 -0
- acprof/host/__init__.py +1 -0
- acprof/host/automation.py +161 -0
- acprof/host/client.py +520 -0
- acprof/host/collection_history.py +77 -0
- acprof/host/collection_workflow.py +285 -0
- acprof/host/command.py +119 -0
- acprof/host/container_lifecycle.py +225 -0
- acprof/host/container_state.py +128 -0
- acprof/host/coverage_state.py +259 -0
- acprof/host/detect.py +669 -0
- acprof/host/docker_runtime.py +359 -0
- acprof/host/doctor.py +158 -0
- acprof/host/env_utils.py +233 -0
- acprof/host/execution_conditions.py +87 -0
- acprof/host/gpu_device.py +66 -0
- acprof/host/hardware_conditions.py +130 -0
- acprof/host/images/__init__.py +1 -0
- acprof/host/images/dependencies.py +169 -0
- acprof/host/images/environment.py +313 -0
- acprof/host/images/graph.py +143 -0
- acprof/host/images/identity.py +6 -0
- acprof/host/images/inventory.py +445 -0
- acprof/host/images/runtime.py +457 -0
- acprof/host/images/scan.py +154 -0
- acprof/host/input_plan.py +1056 -0
- acprof/host/interface_probe.py +141 -0
- acprof/host/largest_scale_probe.py +566 -0
- acprof/host/matrix_plan.py +98 -0
- acprof/host/measurement/__init__.py +1 -0
- acprof/host/measurement/boundary.py +162 -0
- acprof/host/measurement/capture.py +139 -0
- acprof/host/measurement/checkpoint.py +275 -0
- acprof/host/measurement/config.py +212 -0
- acprof/host/measurement/diagnostics.py +247 -0
- acprof/host/measurement/energy_validation.py +172 -0
- acprof/host/measurement/errors.py +25 -0
- acprof/host/measurement/execution.py +396 -0
- acprof/host/measurement/load.py +237 -0
- acprof/host/measurement/metrics.py +975 -0
- acprof/host/measurement/monitors.py +143 -0
- acprof/host/measurement/publication.py +171 -0
- acprof/host/measurement/requests.py +97 -0
- acprof/host/measurement/types.py +82 -0
- acprof/host/model_coverage.py +337 -0
- acprof/host/model_errors.py +116 -0
- acprof/host/model_inspection.py +107 -0
- acprof/host/model_schema.py +35 -0
- acprof/host/model_store.py +733 -0
- acprof/host/network_preflight.py +229 -0
- acprof/host/orchestrator.py +1133 -0
- acprof/host/permissions.py +117 -0
- acprof/host/platform_metadata.py +63 -0
- acprof/host/posthoc/__init__.py +12 -0
- acprof/host/posthoc/backfill.py +415 -0
- acprof/host/posthoc/context.py +400 -0
- acprof/host/posthoc/plans.py +597 -0
- acprof/host/posthoc/service.py +303 -0
- acprof/host/posthoc/storage.py +491 -0
- acprof/host/preflight.py +370 -0
- acprof/host/profiling/__init__.py +1 -0
- acprof/host/profiling/compute.py +436 -0
- acprof/host/profiling/compute_plan.py +261 -0
- acprof/host/profiling/execution.py +547 -0
- acprof/host/profiling/execution_plan.py +576 -0
- acprof/host/profiling/progress.py +83 -0
- acprof/host/profiling/support.py +252 -0
- acprof/host/profiling/tools/__init__.py +1 -0
- acprof/host/profiling/tools/advisor.py +164 -0
- acprof/host/profiling/tools/compute_parsers.py +409 -0
- acprof/host/profiling/tools/execution_environment.py +135 -0
- acprof/host/profiling/tools/execution_parsers.py +364 -0
- acprof/host/profiling/tools/massif.py +418 -0
- acprof/host/profiling/tools/ncu.py +696 -0
- acprof/host/profiling/tools/nsys.py +326 -0
- acprof/host/profiling/tools/tool_discovery.py +229 -0
- acprof/host/profiling/tools/torch.py +158 -0
- acprof/host/result_cleanup.py +65 -0
- acprof/host/run_state.py +639 -0
- acprof/host/runtime_settings.py +10 -0
- acprof/host/runtime_validation.py +302 -0
- acprof/host/source_bundle.py +96 -0
- acprof/host/startup_probe.py +95 -0
- acprof/host/static_metadata.py +936 -0
- acprof/host/task_support.py +121 -0
- acprof/installation.py +26 -0
- acprof/latency_slo.py +62 -0
- acprof/messages.py +26 -0
- acprof/metric_registry.py +315 -0
- acprof/model_candidates.py +297 -0
- acprof/model_contract.py +234 -0
- acprof/model_dependencies.py +93 -0
- acprof/model_dependency_domain.py +45 -0
- acprof/model_dependency_eval.py +438 -0
- acprof/model_dependency_flow.py +200 -0
- acprof/model_evidence.py +115 -0
- acprof/model_metadata_analysis.py +156 -0
- acprof/model_repository.py +149 -0
- acprof/model_resolution.py +129 -0
- acprof/model_review.py +155 -0
- acprof/model_source_analysis.py +299 -0
- acprof/model_spec.py +204 -0
- acprof/model_support.py +105 -0
- acprof/model_transforms.py +81 -0
- acprof/monitors/__init__.py +1 -0
- acprof/monitors/common.py +63 -0
- acprof/monitors/energy_cpu.py +651 -0
- acprof/monitors/energy_nvml.py +381 -0
- acprof/monitors/gpu_metrics.py +123 -0
- acprof/monitors/interfaces.py +74 -0
- acprof/monitors/perf_mips.py +617 -0
- acprof/monitors/rapl_topology.py +100 -0
- acprof/monitors/resource_metrics.py +472 -0
- acprof/monitors/resource_readers.py +435 -0
- acprof/monitors/resource_usage.py +450 -0
- acprof/monitors/sampling.py +79 -0
- acprof/network_policy.py +182 -0
- acprof/notifications.py +279 -0
- acprof/packet/__init__.py +1 -0
- acprof/packet/merge_packet_latency.py +369 -0
- acprof/packet/sniff_parse_pcap.py +240 -0
- acprof/pixel_metrics.py +103 -0
- acprof/platform.py +180 -0
- acprof/plotting/__init__.py +1 -0
- acprof/plotting/config.py +487 -0
- acprof/plotting/data.py +236 -0
- acprof/plotting/diagnostics.py +747 -0
- acprof/plotting/latency.py +638 -0
- acprof/plotting/metrics.py +648 -0
- acprof/plotting/plotly-LICENSE.txt +21 -0
- acprof/plotting/report.css +61 -0
- acprof/plotting/report.html +68 -0
- acprof/plotting/report.js +295 -0
- acprof/plotting/report.py +66 -0
- acprof/plotting/styles.py +111 -0
- acprof/plotting/view_model.js +145 -0
- acprof/precision.py +42 -0
- acprof/preparation_events.py +78 -0
- acprof/progress_events.py +105 -0
- acprof/quality.py +153 -0
- acprof/resource_budget.py +29 -0
- acprof/result_csv.py +263 -0
- acprof/result_layers.py +365 -0
- acprof/run_args.py +223 -0
- acprof/run_options.py +225 -0
- acprof/runtime_dependencies.py +195 -0
- acprof/runtime_profiles.py +258 -0
- acprof/runtime_settings.py +72 -0
- acprof/source_identity.py +68 -0
- acprof/telemetry.py +225 -0
- acprof/testing/__init__.py +1 -0
- acprof/testing/evidence.py +117 -0
- acprof/testing/plugin.py +126 -0
- acprof/testing/provenance.py +53 -0
- acprof/testing/sharding.py +14 -0
- acprof/tui/__init__.py +1 -0
- acprof/tui/app.py +934 -0
- acprof/tui/app_contracts.py +43 -0
- acprof/tui/catalog_controller.py +120 -0
- acprof/tui/commands.py +209 -0
- acprof/tui/configuration_controller.py +436 -0
- acprof/tui/diagnostics.py +340 -0
- acprof/tui/downloads.py +56 -0
- acprof/tui/environment.py +248 -0
- acprof/tui/experiment_catalog.py +279 -0
- acprof/tui/experiment_controller.py +132 -0
- acprof/tui/experiment_picker.py +273 -0
- acprof/tui/field_validation.py +62 -0
- acprof/tui/i18n.py +57 -0
- acprof/tui/image_controller.py +525 -0
- acprof/tui/images.py +737 -0
- acprof/tui/input.py +191 -0
- acprof/tui/localization_controller.py +110 -0
- acprof/tui/log.py +310 -0
- acprof/tui/model_candidates.py +278 -0
- acprof/tui/model_controller.py +111 -0
- acprof/tui/model_input.py +12 -0
- acprof/tui/model_store.py +166 -0
- acprof/tui/preflight_controller.py +271 -0
- acprof/tui/preparation.py +269 -0
- acprof/tui/presentation.py +46 -0
- acprof/tui/process.py +111 -0
- acprof/tui/process_controller.py +218 -0
- acprof/tui/profile_controller.py +109 -0
- acprof/tui/progress.py +195 -0
- acprof/tui/recovery.py +114 -0
- acprof/tui/recovery_controller.py +169 -0
- acprof/tui/rendering.py +75 -0
- acprof/tui/reports.py +303 -0
- acprof/tui/result_controller.py +279 -0
- acprof/tui/review_inputs.py +54 -0
- acprof/tui/run_form.py +125 -0
- acprof/tui/run_planning.py +97 -0
- acprof/tui/run_results.py +175 -0
- acprof/tui/scrollbar.py +65 -0
- acprof/tui/settings.py +203 -0
- acprof/tui/slash_controller.py +95 -0
- acprof/tui/stages.py +97 -0
- acprof/tui/storage.py +150 -0
- acprof/tui/table.py +213 -0
- acprof/tui/themes.py +112 -0
- acprof/tui/translation_catalog.py +1861 -0
- acprof/tui/tui.tcss +373 -0
- acprof/tui/views.py +706 -0
- acprof/window_records.py +165 -0
- acprof/workloads/__init__.py +222 -0
- acprof/workloads/audio.py +621 -0
- acprof/workloads/contract.py +116 -0
- acprof/workloads/cv.py +240 -0
- acprof/workloads/diffusion.py +410 -0
- acprof/workloads/multimodal.py +329 -0
- acprof/workloads/nlp.py +151 -0
- acprof/workloads/structured.py +151 -0
- acprof/workloads/timeseries.py +69 -0
- acprof-0.3.0.dist-info/METADATA +117 -0
- acprof-0.3.0.dist-info/RECORD +704 -0
- acprof-0.3.0.dist-info/WHEEL +4 -0
- acprof-0.3.0.dist-info/entry_points.txt +2 -0
- acprof-0.3.0.dist-info/licenses/LICENSE +202 -0
- acprof-0.3.0.dist-info/licenses/NOTICE +43 -0
- acprof-0.3.0.dist-info/licenses/licenses/CC-BY-4.0.txt +156 -0
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"""Linux powercap topology and optional DRAM policy; no sampling or scheduling."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import os
|
|
5
|
+
import re
|
|
6
|
+
from pathlib import Path
|
|
7
|
+
from typing import Any
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
def discover_rapl_topology(powercap_root="/sys/class/powercap") -> dict:
|
|
11
|
+
root = Path(powercap_root)
|
|
12
|
+
records: dict[str, dict[str, Any]] = {}
|
|
13
|
+
visited = set()
|
|
14
|
+
errors = []
|
|
15
|
+
|
|
16
|
+
def walk(path):
|
|
17
|
+
real = os.path.realpath(path)
|
|
18
|
+
if real in records:
|
|
19
|
+
aliases = records[real]["aliases"]
|
|
20
|
+
if str(path) not in aliases:
|
|
21
|
+
aliases.append(str(path))
|
|
22
|
+
if real in visited:
|
|
23
|
+
return
|
|
24
|
+
visited.add(real)
|
|
25
|
+
is_domain = re.fullmatch(r"[\w-]*rapl(?:-mmio)?(?::\d+)+", path.name) is not None
|
|
26
|
+
if is_domain:
|
|
27
|
+
entry = {"id": path.name, "path": real, "aliases": [str(path)],
|
|
28
|
+
"parent_id": path.name.rsplit(":", 1)[0] if path.name.count(":") > 1 else None,
|
|
29
|
+
"name": None, "kind": "other", "energy_path": str(Path(real) / "energy_uj"),
|
|
30
|
+
"max_energy_range_uj": None, "enabled": None,
|
|
31
|
+
"status": "unavailable", "detail": "", "selected": False}
|
|
32
|
+
records[real] = entry
|
|
33
|
+
try:
|
|
34
|
+
entry["name"] = (path / "name").read_text().strip()
|
|
35
|
+
entry["kind"] = ("package" if entry["name"].startswith("package-") else
|
|
36
|
+
"dram" if entry["name"].lower() == "dram" else "other")
|
|
37
|
+
if (path / "enabled").exists():
|
|
38
|
+
entry["enabled"] = bool(int((path / "enabled").read_text()))
|
|
39
|
+
if (path / "max_energy_range_uj").exists():
|
|
40
|
+
entry["max_energy_range_uj"] = int((path / "max_energy_range_uj").read_text())
|
|
41
|
+
value = int((path / "energy_uj").read_text())
|
|
42
|
+
if value < 0 or (entry["max_energy_range_uj"] is not None and entry["max_energy_range_uj"] <= 0):
|
|
43
|
+
raise ValueError("invalid RAPL energy/range")
|
|
44
|
+
# enabled controls power capping, not the energy counter.
|
|
45
|
+
entry["status"] = "available"
|
|
46
|
+
except PermissionError as exc:
|
|
47
|
+
entry.update(status="permission_denied", detail=str(exc))
|
|
48
|
+
except (OSError, ValueError) as exc:
|
|
49
|
+
entry["detail"] = str(exc)
|
|
50
|
+
try:
|
|
51
|
+
children = sorted(path.iterdir(), key=lambda item: item.name)
|
|
52
|
+
except OSError as exc:
|
|
53
|
+
errors.append({"path": str(path), "error": str(exc)})
|
|
54
|
+
return
|
|
55
|
+
for child in children:
|
|
56
|
+
# Do not traverse unrelated sysfs device/subsystem links or cycles.
|
|
57
|
+
if "rapl" in child.name and child.is_dir():
|
|
58
|
+
walk(child)
|
|
59
|
+
|
|
60
|
+
if root.is_dir():
|
|
61
|
+
walk(root)
|
|
62
|
+
domains = sorted(records.values(), key=lambda entry: entry["id"])
|
|
63
|
+
selected_packages: dict[str, dict[str, Any]] = {}
|
|
64
|
+
for entry in domains:
|
|
65
|
+
if entry["kind"] == "package" and entry["status"] == "available":
|
|
66
|
+
# Alternate interfaces to the same package (e.g. MSR/MMIO) are not additive.
|
|
67
|
+
previous = selected_packages.get(entry["name"])
|
|
68
|
+
if previous is None or ("mmio" in previous["id"] and "mmio" not in entry["id"]):
|
|
69
|
+
if previous is not None:
|
|
70
|
+
previous["selected"] = False
|
|
71
|
+
selected_packages[entry["name"]] = entry
|
|
72
|
+
entry["selected"] = True
|
|
73
|
+
selected_ids = {entry["id"] for entry in selected_packages.values()}
|
|
74
|
+
for entry in domains:
|
|
75
|
+
if entry["kind"] == "dram" and entry["parent_id"] in selected_ids and entry["status"] == "available":
|
|
76
|
+
entry["selected"] = True
|
|
77
|
+
entry["aliases"].sort()
|
|
78
|
+
if not entry["selected"] and not entry["detail"]:
|
|
79
|
+
entry["detail"] = "metadata-only subdomain or alternate package interface"
|
|
80
|
+
missing = sorted(package for package in selected_ids if not any(
|
|
81
|
+
entry["kind"] == "dram" and entry["parent_id"] == package and entry["selected"] for entry in domains))
|
|
82
|
+
missing.extend(entry["id"] for entry in domains if entry["kind"] == "package"
|
|
83
|
+
and entry["name"] not in selected_packages)
|
|
84
|
+
dram_status = "available" if selected_ids and not missing else "unavailable"
|
|
85
|
+
if missing and any(e["kind"] == "dram" and e["parent_id"] in missing
|
|
86
|
+
and e["status"] == "permission_denied" for e in domains):
|
|
87
|
+
dram_status = "permission_denied"
|
|
88
|
+
return {"schema_version": 1, "source": str(root), "domains": domains, "errors": errors,
|
|
89
|
+
"dram_status": dram_status, "dram_missing_packages": missing,
|
|
90
|
+
"counter_assumption": "at most one wrap per domain between adjacent samples"}
|
|
91
|
+
|
|
92
|
+
|
|
93
|
+
def dram_policy(mode: str, selection: str) -> bool:
|
|
94
|
+
if selection not in {"auto", "off", "required"}:
|
|
95
|
+
raise ValueError("DRAM energy must be auto/off/required")
|
|
96
|
+
if mode not in {"basic", "full"}:
|
|
97
|
+
raise ValueError("profiling mode must be basic/full")
|
|
98
|
+
if mode == "basic" and selection == "required":
|
|
99
|
+
raise ValueError("--dram-energy required needs --profiling-mode full")
|
|
100
|
+
return mode == "full" and selection != "off"
|
|
@@ -0,0 +1,472 @@
|
|
|
1
|
+
"""Pure resource sample reduction and window counter metric derivation."""
|
|
2
|
+
from __future__ import annotations
|
|
3
|
+
|
|
4
|
+
import math
|
|
5
|
+
from collections import Counter
|
|
6
|
+
from dataclasses import dataclass
|
|
7
|
+
|
|
8
|
+
BYTES_PER_GIB = 1024 ** 3
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
@dataclass
|
|
12
|
+
class ResourceUsageSample:
|
|
13
|
+
timestamp: float
|
|
14
|
+
container_cpu_s: float | None
|
|
15
|
+
container_mem_usage_bytes: int | None
|
|
16
|
+
gpu_util_pct: float | None
|
|
17
|
+
gpu_mem_used_bytes: int | None
|
|
18
|
+
gpu_mem_total_bytes: int | None
|
|
19
|
+
cpu_freq_avg_hz: float | None = None
|
|
20
|
+
cpu_freq_peak_hz: float | None = None
|
|
21
|
+
gpu_sm_clock_mhz: float | None = None
|
|
22
|
+
gpu_memory_clock_mhz: float | None = None
|
|
23
|
+
gpu_pstate: str | None = None
|
|
24
|
+
gpu_temp_c: float | None = None
|
|
25
|
+
container_swap_usage_bytes: int | None = None
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
@dataclass
|
|
29
|
+
class ResourceUsageResult:
|
|
30
|
+
resource_usage_iters: int
|
|
31
|
+
container_cpu_util_avg_pct: float
|
|
32
|
+
container_cpu_util_peak_pct: float
|
|
33
|
+
cpu_freq_avg_hz: float
|
|
34
|
+
cpu_freq_peak_hz: float
|
|
35
|
+
container_mem_usage_avg_bytes: float
|
|
36
|
+
container_mem_usage_peak_bytes: float
|
|
37
|
+
container_mem_util_avg_pct: float
|
|
38
|
+
container_mem_util_peak_pct: float
|
|
39
|
+
gpu_util_avg_pct: float
|
|
40
|
+
gpu_util_peak_pct: float
|
|
41
|
+
gpu_sm_clock_mhz: float
|
|
42
|
+
gpu_memory_clock_mhz: float
|
|
43
|
+
gpu_pstate: str
|
|
44
|
+
gpu_temp_c: float
|
|
45
|
+
gpu_mem_used_avg_bytes: float
|
|
46
|
+
gpu_mem_used_peak_bytes: float
|
|
47
|
+
gpu_mem_util_avg_pct: float
|
|
48
|
+
gpu_mem_util_peak_pct: float
|
|
49
|
+
gpu_mem_total_bytes: float
|
|
50
|
+
container_swap_limit_bytes: float = float("nan")
|
|
51
|
+
container_swap_usage_avg_bytes: float = float("nan")
|
|
52
|
+
container_swap_usage_peak_bytes: float = float("nan")
|
|
53
|
+
container_io_read_bytes: float = float("nan")
|
|
54
|
+
container_io_write_bytes: float = float("nan")
|
|
55
|
+
container_cpu_nr_periods_delta: float = float("nan")
|
|
56
|
+
container_cpu_nr_throttled_delta: float = float("nan")
|
|
57
|
+
container_cpu_throttled_period_ratio_pct: float = float("nan")
|
|
58
|
+
container_cpu_throttled_time_s: float = float("nan")
|
|
59
|
+
container_cpu_pressure_some_stall_pct: float = float("nan")
|
|
60
|
+
container_cpu_pressure_full_stall_pct: float = float("nan")
|
|
61
|
+
container_mem_high_events_delta: float = float("nan")
|
|
62
|
+
container_mem_max_events_delta: float = float("nan")
|
|
63
|
+
container_mem_oom_events_delta: float = float("nan")
|
|
64
|
+
container_mem_oom_kill_events_delta: float = float("nan")
|
|
65
|
+
container_mem_pressure_some_stall_pct: float = float("nan")
|
|
66
|
+
container_mem_pressure_full_stall_pct: float = float("nan")
|
|
67
|
+
container_mem_peak_cgroup_bytes: float = float("nan")
|
|
68
|
+
container_mem_anon_bytes_end: float = float("nan")
|
|
69
|
+
container_mem_file_bytes_end: float = float("nan")
|
|
70
|
+
container_mem_slab_bytes_end: float = float("nan")
|
|
71
|
+
container_mem_pgfault_delta: float = float("nan")
|
|
72
|
+
container_mem_pgmajfault_delta: float = float("nan")
|
|
73
|
+
container_mem_workingset_refault_delta: float = float("nan")
|
|
74
|
+
container_io_read_ops: float = float("nan")
|
|
75
|
+
container_io_write_ops: float = float("nan")
|
|
76
|
+
container_io_pressure_some_stall_pct: float = float("nan")
|
|
77
|
+
container_io_pressure_full_stall_pct: float = float("nan")
|
|
78
|
+
container_pids_current_end: float = float("nan")
|
|
79
|
+
container_pids_peak_cgroup: float = float("nan")
|
|
80
|
+
container_pids_max_events_delta: float = float("nan")
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@dataclass
|
|
84
|
+
class WindowCounterSnapshots:
|
|
85
|
+
cpu_throttle: dict[str, float] | None = None
|
|
86
|
+
memory_events: dict[str, float] | None = None
|
|
87
|
+
cpu_pressure: dict[str, float] | None = None
|
|
88
|
+
memory_pressure: dict[str, float] | None = None
|
|
89
|
+
io_pressure: dict[str, float] | None = None
|
|
90
|
+
memory_peak: dict[str, float] | None = None
|
|
91
|
+
memory_stat: dict[str, float] | None = None
|
|
92
|
+
io_operations: dict[str, float] | None = None
|
|
93
|
+
pids: dict[str, float] | None = None
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
def _nan_result(resource_usage_iters: int = 0) -> ResourceUsageResult:
|
|
97
|
+
nan = float("nan")
|
|
98
|
+
return ResourceUsageResult(
|
|
99
|
+
resource_usage_iters=resource_usage_iters,
|
|
100
|
+
container_cpu_util_avg_pct=nan,
|
|
101
|
+
container_cpu_util_peak_pct=nan,
|
|
102
|
+
cpu_freq_avg_hz=nan,
|
|
103
|
+
cpu_freq_peak_hz=nan,
|
|
104
|
+
container_mem_usage_avg_bytes=nan,
|
|
105
|
+
container_mem_usage_peak_bytes=nan,
|
|
106
|
+
container_mem_util_avg_pct=nan,
|
|
107
|
+
container_mem_util_peak_pct=nan,
|
|
108
|
+
gpu_util_avg_pct=nan,
|
|
109
|
+
gpu_util_peak_pct=nan,
|
|
110
|
+
gpu_sm_clock_mhz=nan,
|
|
111
|
+
gpu_memory_clock_mhz=nan,
|
|
112
|
+
gpu_pstate="nan",
|
|
113
|
+
gpu_temp_c=nan,
|
|
114
|
+
gpu_mem_used_avg_bytes=nan,
|
|
115
|
+
gpu_mem_used_peak_bytes=nan,
|
|
116
|
+
gpu_mem_util_avg_pct=nan,
|
|
117
|
+
gpu_mem_util_peak_pct=nan,
|
|
118
|
+
gpu_mem_total_bytes=nan,
|
|
119
|
+
container_swap_limit_bytes=nan,
|
|
120
|
+
container_swap_usage_avg_bytes=nan,
|
|
121
|
+
container_swap_usage_peak_bytes=nan,
|
|
122
|
+
container_io_read_bytes=nan,
|
|
123
|
+
container_io_write_bytes=nan,
|
|
124
|
+
)
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def _mean(values: list[float]) -> float:
|
|
128
|
+
return sum(values) / len(values) if values else float("nan")
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
def _normalize_pstate(value: object) -> str | None:
|
|
132
|
+
if isinstance(value, str):
|
|
133
|
+
normalized = value.strip().upper()
|
|
134
|
+
if normalized.startswith("P") and normalized[1:].isdigit():
|
|
135
|
+
numeric = int(normalized[1:])
|
|
136
|
+
return normalized if 0 <= numeric <= 15 else None
|
|
137
|
+
return None
|
|
138
|
+
from typing import SupportsIndex, SupportsInt, cast
|
|
139
|
+
try:
|
|
140
|
+
numeric = int(cast(SupportsInt | SupportsIndex, value))
|
|
141
|
+
except (TypeError, ValueError):
|
|
142
|
+
return None
|
|
143
|
+
return f"P{numeric}" if 0 <= numeric <= 15 else None
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
def _dominant_pstate(values: list[str]) -> str:
|
|
147
|
+
normalized = [state for value in values if (state := _normalize_pstate(value))]
|
|
148
|
+
if not normalized:
|
|
149
|
+
return "nan"
|
|
150
|
+
counts = Counter(normalized)
|
|
151
|
+
highest_count = max(counts.values())
|
|
152
|
+
candidates = [state for state, count in counts.items() if count == highest_count]
|
|
153
|
+
return min(candidates, key=lambda state: int(state[1:]))
|
|
154
|
+
|
|
155
|
+
|
|
156
|
+
def counter_delta(
|
|
157
|
+
start: dict[str, float] | None,
|
|
158
|
+
end: dict[str, float] | None,
|
|
159
|
+
key: str,
|
|
160
|
+
) -> float:
|
|
161
|
+
if start is None or end is None:
|
|
162
|
+
return float("nan")
|
|
163
|
+
start_value = float(start.get(key, float("nan")))
|
|
164
|
+
end_value = float(end.get(key, float("nan")))
|
|
165
|
+
if (
|
|
166
|
+
not math.isfinite(start_value)
|
|
167
|
+
or not math.isfinite(end_value)
|
|
168
|
+
or start_value < 0.0
|
|
169
|
+
or end_value < start_value
|
|
170
|
+
):
|
|
171
|
+
return float("nan")
|
|
172
|
+
return end_value - start_value
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def _snapshot_value(snapshot: dict[str, float] | None, key: str) -> float:
|
|
176
|
+
if snapshot is None:
|
|
177
|
+
return float("nan")
|
|
178
|
+
try:
|
|
179
|
+
value = float(snapshot.get(key, float("nan")))
|
|
180
|
+
except (TypeError, ValueError):
|
|
181
|
+
return float("nan")
|
|
182
|
+
return value if math.isfinite(value) else float("nan")
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def _pressure_stall_pct(
|
|
186
|
+
start: dict[str, float] | None,
|
|
187
|
+
end: dict[str, float] | None,
|
|
188
|
+
scope: str,
|
|
189
|
+
elapsed_s: float,
|
|
190
|
+
) -> float:
|
|
191
|
+
delta_usec = counter_delta(start, end, scope)
|
|
192
|
+
if delta_usec != delta_usec or elapsed_s <= 0.0:
|
|
193
|
+
return float("nan")
|
|
194
|
+
return (delta_usec / (elapsed_s * 1_000_000.0)) * 100.0
|
|
195
|
+
|
|
196
|
+
|
|
197
|
+
def apply_window_counter_metrics(
|
|
198
|
+
result: ResourceUsageResult,
|
|
199
|
+
start: WindowCounterSnapshots,
|
|
200
|
+
end: WindowCounterSnapshots,
|
|
201
|
+
elapsed_s: float,
|
|
202
|
+
) -> None:
|
|
203
|
+
nr_periods = counter_delta(
|
|
204
|
+
start.cpu_throttle,
|
|
205
|
+
end.cpu_throttle,
|
|
206
|
+
"nr_periods",
|
|
207
|
+
)
|
|
208
|
+
nr_throttled = counter_delta(
|
|
209
|
+
start.cpu_throttle,
|
|
210
|
+
end.cpu_throttle,
|
|
211
|
+
"nr_throttled",
|
|
212
|
+
)
|
|
213
|
+
throttled_usec = counter_delta(
|
|
214
|
+
start.cpu_throttle,
|
|
215
|
+
end.cpu_throttle,
|
|
216
|
+
"throttled_usec",
|
|
217
|
+
)
|
|
218
|
+
result.container_cpu_nr_periods_delta = nr_periods
|
|
219
|
+
result.container_cpu_nr_throttled_delta = nr_throttled
|
|
220
|
+
if nr_periods == nr_periods and nr_periods > 0.0 and nr_throttled == nr_throttled:
|
|
221
|
+
result.container_cpu_throttled_period_ratio_pct = (
|
|
222
|
+
nr_throttled / nr_periods
|
|
223
|
+
) * 100.0
|
|
224
|
+
if throttled_usec == throttled_usec:
|
|
225
|
+
result.container_cpu_throttled_time_s = throttled_usec / 1_000_000.0
|
|
226
|
+
|
|
227
|
+
result.container_cpu_pressure_some_stall_pct = _pressure_stall_pct(
|
|
228
|
+
start.cpu_pressure,
|
|
229
|
+
end.cpu_pressure,
|
|
230
|
+
"some",
|
|
231
|
+
elapsed_s,
|
|
232
|
+
)
|
|
233
|
+
result.container_cpu_pressure_full_stall_pct = _pressure_stall_pct(
|
|
234
|
+
start.cpu_pressure,
|
|
235
|
+
end.cpu_pressure,
|
|
236
|
+
"full",
|
|
237
|
+
elapsed_s,
|
|
238
|
+
)
|
|
239
|
+
|
|
240
|
+
memory_event_fields = {
|
|
241
|
+
"high": "container_mem_high_events_delta",
|
|
242
|
+
"max": "container_mem_max_events_delta",
|
|
243
|
+
"oom": "container_mem_oom_events_delta",
|
|
244
|
+
"oom_kill": "container_mem_oom_kill_events_delta",
|
|
245
|
+
}
|
|
246
|
+
for event, field in memory_event_fields.items():
|
|
247
|
+
setattr(
|
|
248
|
+
result,
|
|
249
|
+
field,
|
|
250
|
+
counter_delta(start.memory_events, end.memory_events, event),
|
|
251
|
+
)
|
|
252
|
+
|
|
253
|
+
result.container_mem_pressure_some_stall_pct = _pressure_stall_pct(
|
|
254
|
+
start.memory_pressure,
|
|
255
|
+
end.memory_pressure,
|
|
256
|
+
"some",
|
|
257
|
+
elapsed_s,
|
|
258
|
+
)
|
|
259
|
+
result.container_mem_pressure_full_stall_pct = _pressure_stall_pct(
|
|
260
|
+
start.memory_pressure,
|
|
261
|
+
end.memory_pressure,
|
|
262
|
+
"full",
|
|
263
|
+
elapsed_s,
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
result.container_mem_peak_cgroup_bytes = _snapshot_value(
|
|
267
|
+
end.memory_peak,
|
|
268
|
+
"peak",
|
|
269
|
+
)
|
|
270
|
+
result.container_mem_anon_bytes_end = _snapshot_value(
|
|
271
|
+
end.memory_stat,
|
|
272
|
+
"anon",
|
|
273
|
+
)
|
|
274
|
+
result.container_mem_file_bytes_end = _snapshot_value(
|
|
275
|
+
end.memory_stat,
|
|
276
|
+
"file",
|
|
277
|
+
)
|
|
278
|
+
result.container_mem_slab_bytes_end = _snapshot_value(
|
|
279
|
+
end.memory_stat,
|
|
280
|
+
"slab",
|
|
281
|
+
)
|
|
282
|
+
result.container_mem_pgfault_delta = counter_delta(
|
|
283
|
+
start.memory_stat,
|
|
284
|
+
end.memory_stat,
|
|
285
|
+
"pgfault",
|
|
286
|
+
)
|
|
287
|
+
result.container_mem_pgmajfault_delta = counter_delta(
|
|
288
|
+
start.memory_stat,
|
|
289
|
+
end.memory_stat,
|
|
290
|
+
"pgmajfault",
|
|
291
|
+
)
|
|
292
|
+
result.container_mem_workingset_refault_delta = counter_delta(
|
|
293
|
+
start.memory_stat,
|
|
294
|
+
end.memory_stat,
|
|
295
|
+
"workingset_refault",
|
|
296
|
+
)
|
|
297
|
+
|
|
298
|
+
result.container_io_read_ops = counter_delta(
|
|
299
|
+
start.io_operations,
|
|
300
|
+
end.io_operations,
|
|
301
|
+
"read_ops",
|
|
302
|
+
)
|
|
303
|
+
result.container_io_write_ops = counter_delta(
|
|
304
|
+
start.io_operations,
|
|
305
|
+
end.io_operations,
|
|
306
|
+
"write_ops",
|
|
307
|
+
)
|
|
308
|
+
result.container_io_pressure_some_stall_pct = _pressure_stall_pct(
|
|
309
|
+
start.io_pressure,
|
|
310
|
+
end.io_pressure,
|
|
311
|
+
"some",
|
|
312
|
+
elapsed_s,
|
|
313
|
+
)
|
|
314
|
+
result.container_io_pressure_full_stall_pct = _pressure_stall_pct(
|
|
315
|
+
start.io_pressure,
|
|
316
|
+
end.io_pressure,
|
|
317
|
+
"full",
|
|
318
|
+
elapsed_s,
|
|
319
|
+
)
|
|
320
|
+
result.container_pids_current_end = _snapshot_value(end.pids, "current")
|
|
321
|
+
result.container_pids_peak_cgroup = _snapshot_value(end.pids, "peak")
|
|
322
|
+
result.container_pids_max_events_delta = counter_delta(
|
|
323
|
+
start.pids,
|
|
324
|
+
end.pids,
|
|
325
|
+
"max_events",
|
|
326
|
+
)
|
|
327
|
+
|
|
328
|
+
|
|
329
|
+
def reduce_resource_samples(
|
|
330
|
+
samples: list[ResourceUsageSample],
|
|
331
|
+
cpu_cores: float,
|
|
332
|
+
mem_limit_bytes: float,
|
|
333
|
+
min_cpu_interval_s: float = 0.0,
|
|
334
|
+
) -> ResourceUsageResult:
|
|
335
|
+
if not samples:
|
|
336
|
+
return _nan_result(0)
|
|
337
|
+
|
|
338
|
+
samples = sorted(samples, key=lambda sample: sample.timestamp)
|
|
339
|
+
result = _nan_result(len(samples))
|
|
340
|
+
|
|
341
|
+
cpu_interval_utils: list[float] = []
|
|
342
|
+
cpu_elapsed_s = 0.0
|
|
343
|
+
cpu_delta_s = 0.0
|
|
344
|
+
if cpu_cores > 0:
|
|
345
|
+
cpu_samples = [
|
|
346
|
+
(sample.timestamp, sample.container_cpu_s)
|
|
347
|
+
for sample in samples
|
|
348
|
+
if sample.container_cpu_s is not None
|
|
349
|
+
]
|
|
350
|
+
for idx in range(1, len(cpu_samples)):
|
|
351
|
+
prev_t, prev_cpu = cpu_samples[idx - 1]
|
|
352
|
+
curr_t, curr_cpu = cpu_samples[idx]
|
|
353
|
+
dt = curr_t - prev_t
|
|
354
|
+
delta = float(curr_cpu) - float(prev_cpu)
|
|
355
|
+
if dt <= 0 or delta < 0:
|
|
356
|
+
continue
|
|
357
|
+
cpu_elapsed_s += dt
|
|
358
|
+
cpu_delta_s += delta
|
|
359
|
+
if dt >= min_cpu_interval_s:
|
|
360
|
+
util = (delta / (dt * cpu_cores)) * 100.0
|
|
361
|
+
cpu_interval_utils.append(util)
|
|
362
|
+
|
|
363
|
+
if cpu_elapsed_s > 0:
|
|
364
|
+
result.container_cpu_util_avg_pct = (cpu_delta_s / (cpu_elapsed_s * cpu_cores)) * 100.0
|
|
365
|
+
if cpu_interval_utils:
|
|
366
|
+
result.container_cpu_util_peak_pct = max(cpu_interval_utils)
|
|
367
|
+
|
|
368
|
+
cpu_freq_avgs = [
|
|
369
|
+
float(sample.cpu_freq_avg_hz)
|
|
370
|
+
for sample in samples
|
|
371
|
+
if sample.cpu_freq_avg_hz is not None
|
|
372
|
+
]
|
|
373
|
+
cpu_freq_peaks = [
|
|
374
|
+
float(sample.cpu_freq_peak_hz)
|
|
375
|
+
for sample in samples
|
|
376
|
+
if sample.cpu_freq_peak_hz is not None
|
|
377
|
+
]
|
|
378
|
+
if cpu_freq_avgs:
|
|
379
|
+
result.cpu_freq_avg_hz = _mean(cpu_freq_avgs)
|
|
380
|
+
if cpu_freq_peaks:
|
|
381
|
+
result.cpu_freq_peak_hz = max(cpu_freq_peaks)
|
|
382
|
+
|
|
383
|
+
mem_values = [
|
|
384
|
+
float(sample.container_mem_usage_bytes)
|
|
385
|
+
for sample in samples
|
|
386
|
+
if sample.container_mem_usage_bytes is not None
|
|
387
|
+
]
|
|
388
|
+
if mem_values:
|
|
389
|
+
result.container_mem_usage_avg_bytes = _mean(mem_values)
|
|
390
|
+
result.container_mem_usage_peak_bytes = max(mem_values)
|
|
391
|
+
if mem_limit_bytes > 0:
|
|
392
|
+
result.container_mem_util_avg_pct = (
|
|
393
|
+
result.container_mem_usage_avg_bytes / mem_limit_bytes
|
|
394
|
+
) * 100.0
|
|
395
|
+
result.container_mem_util_peak_pct = (
|
|
396
|
+
result.container_mem_usage_peak_bytes / mem_limit_bytes
|
|
397
|
+
) * 100.0
|
|
398
|
+
|
|
399
|
+
swap_values = [
|
|
400
|
+
float(sample.container_swap_usage_bytes)
|
|
401
|
+
for sample in samples
|
|
402
|
+
if sample.container_swap_usage_bytes is not None
|
|
403
|
+
]
|
|
404
|
+
if swap_values:
|
|
405
|
+
result.container_swap_usage_avg_bytes = _mean(swap_values)
|
|
406
|
+
result.container_swap_usage_peak_bytes = max(swap_values)
|
|
407
|
+
|
|
408
|
+
gpu_utils = [
|
|
409
|
+
float(sample.gpu_util_pct)
|
|
410
|
+
for sample in samples
|
|
411
|
+
if sample.gpu_util_pct is not None
|
|
412
|
+
]
|
|
413
|
+
if gpu_utils:
|
|
414
|
+
result.gpu_util_avg_pct = _mean(gpu_utils)
|
|
415
|
+
result.gpu_util_peak_pct = max(gpu_utils)
|
|
416
|
+
|
|
417
|
+
gpu_sm_clocks = [
|
|
418
|
+
float(sample.gpu_sm_clock_mhz)
|
|
419
|
+
for sample in samples
|
|
420
|
+
if sample.gpu_sm_clock_mhz is not None
|
|
421
|
+
]
|
|
422
|
+
gpu_memory_clocks = [
|
|
423
|
+
float(sample.gpu_memory_clock_mhz)
|
|
424
|
+
for sample in samples
|
|
425
|
+
if sample.gpu_memory_clock_mhz is not None
|
|
426
|
+
]
|
|
427
|
+
gpu_pstates = [
|
|
428
|
+
sample.gpu_pstate
|
|
429
|
+
for sample in samples
|
|
430
|
+
if sample.gpu_pstate is not None
|
|
431
|
+
]
|
|
432
|
+
gpu_temperatures = [
|
|
433
|
+
float(sample.gpu_temp_c)
|
|
434
|
+
for sample in samples
|
|
435
|
+
if sample.gpu_temp_c is not None
|
|
436
|
+
]
|
|
437
|
+
if gpu_sm_clocks:
|
|
438
|
+
result.gpu_sm_clock_mhz = _mean(gpu_sm_clocks)
|
|
439
|
+
if gpu_memory_clocks:
|
|
440
|
+
result.gpu_memory_clock_mhz = _mean(gpu_memory_clocks)
|
|
441
|
+
result.gpu_pstate = _dominant_pstate(gpu_pstates)
|
|
442
|
+
if gpu_temperatures:
|
|
443
|
+
result.gpu_temp_c = _mean(gpu_temperatures)
|
|
444
|
+
|
|
445
|
+
gpu_mem_used = [
|
|
446
|
+
float(sample.gpu_mem_used_bytes)
|
|
447
|
+
for sample in samples
|
|
448
|
+
if sample.gpu_mem_used_bytes is not None
|
|
449
|
+
]
|
|
450
|
+
gpu_mem_totals = [
|
|
451
|
+
float(sample.gpu_mem_total_bytes)
|
|
452
|
+
for sample in samples
|
|
453
|
+
if sample.gpu_mem_total_bytes is not None and sample.gpu_mem_total_bytes > 0
|
|
454
|
+
]
|
|
455
|
+
if gpu_mem_used:
|
|
456
|
+
result.gpu_mem_used_avg_bytes = _mean(gpu_mem_used)
|
|
457
|
+
result.gpu_mem_used_peak_bytes = max(gpu_mem_used)
|
|
458
|
+
if gpu_mem_totals:
|
|
459
|
+
result.gpu_mem_total_bytes = max(gpu_mem_totals)
|
|
460
|
+
|
|
461
|
+
gpu_mem_utils = [
|
|
462
|
+
(float(sample.gpu_mem_used_bytes) / float(sample.gpu_mem_total_bytes)) * 100.0
|
|
463
|
+
for sample in samples
|
|
464
|
+
if sample.gpu_mem_used_bytes is not None
|
|
465
|
+
and sample.gpu_mem_total_bytes is not None
|
|
466
|
+
and sample.gpu_mem_total_bytes > 0
|
|
467
|
+
]
|
|
468
|
+
if gpu_mem_utils:
|
|
469
|
+
result.gpu_mem_util_avg_pct = _mean(gpu_mem_utils)
|
|
470
|
+
result.gpu_mem_util_peak_pct = max(gpu_mem_utils)
|
|
471
|
+
|
|
472
|
+
return result
|