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,706 @@
|
|
|
1
|
+
"""TUI 页面布局、公共控件与确认弹窗。"""
|
|
2
|
+
|
|
3
|
+
from __future__ import annotations
|
|
4
|
+
|
|
5
|
+
from typing import TYPE_CHECKING
|
|
6
|
+
|
|
7
|
+
from textual import on
|
|
8
|
+
from textual.app import ComposeResult
|
|
9
|
+
from textual.containers import Grid, Horizontal, Vertical, VerticalScroll
|
|
10
|
+
from textual.screen import ModalScreen
|
|
11
|
+
from textual.widgets import (
|
|
12
|
+
Button,
|
|
13
|
+
Checkbox,
|
|
14
|
+
Collapsible,
|
|
15
|
+
ContentSwitcher,
|
|
16
|
+
Label,
|
|
17
|
+
Rule,
|
|
18
|
+
Static,
|
|
19
|
+
TabPane,
|
|
20
|
+
)
|
|
21
|
+
from textual.widgets.button import ButtonVariant
|
|
22
|
+
|
|
23
|
+
from acprof.tui.app_contracts import translated_app
|
|
24
|
+
from acprof.tui.field_validation import ConfigField
|
|
25
|
+
from acprof.tui.i18n import LANGUAGE_OPTIONS, message_id
|
|
26
|
+
from acprof.tui.input import BarCursorInput as Input
|
|
27
|
+
from acprof.tui.log import SelectableLog
|
|
28
|
+
from acprof.tui.model_input import ModelInput
|
|
29
|
+
from acprof.tui.presentation import NOT_APPLICABLE, format_input_number
|
|
30
|
+
from acprof.tui.rendering import CjkCompositor
|
|
31
|
+
from acprof.tui.run_form import PRESET_OPTIONS
|
|
32
|
+
from acprof.tui.table import ResizableDataTable
|
|
33
|
+
from acprof.tui.themes import THEME_OPTIONS
|
|
34
|
+
|
|
35
|
+
if TYPE_CHECKING:
|
|
36
|
+
from acprof.tui.app import AcprofTui
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
# Keep the original triangles with one extra cell before the title text.
|
|
40
|
+
COLLAPSED_SYMBOL = "▶ "
|
|
41
|
+
EXPANDED_SYMBOL = "▼ "
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
class StatusCheckbox(Checkbox):
|
|
45
|
+
"""Checkbox whose selected mark is unambiguous in dark terminals."""
|
|
46
|
+
|
|
47
|
+
BUTTON_INNER = "✓"
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
class EnvironmentPreflightScreen(ModalScreen[bool]):
|
|
51
|
+
"""Show cached issues without running probes while the dialog is open."""
|
|
52
|
+
|
|
53
|
+
AUTO_FOCUS = "#preflight-close"
|
|
54
|
+
BINDINGS = [("escape", "close", "关闭详情")]
|
|
55
|
+
CSS = """
|
|
56
|
+
EnvironmentPreflightScreen { align: center middle; }
|
|
57
|
+
#preflight-dialog {
|
|
58
|
+
width: 92%; max-width: 100; height: auto; max-height: 85%;
|
|
59
|
+
border: round $accent; background: $surface; padding: 1 2;
|
|
60
|
+
}
|
|
61
|
+
#preflight-title { height: auto; text-style: bold; margin-bottom: 1; }
|
|
62
|
+
#preflight-scroll { height: auto; max-height: 45vh; margin-bottom: 1; }
|
|
63
|
+
#preflight-details { height: auto; }
|
|
64
|
+
#preflight-buttons { height: auto; align-horizontal: right; }
|
|
65
|
+
#preflight-buttons Button { margin-left: 1; }
|
|
66
|
+
"""
|
|
67
|
+
|
|
68
|
+
def __init__(self, details: str, *, retry_disabled: bool):
|
|
69
|
+
super().__init__()
|
|
70
|
+
self._compositor = CjkCompositor()
|
|
71
|
+
self.details = details
|
|
72
|
+
self.retry_disabled = retry_disabled
|
|
73
|
+
|
|
74
|
+
def compose(self) -> ComposeResult:
|
|
75
|
+
tr = translated_app(self.app).tr
|
|
76
|
+
with Vertical(id="preflight-dialog"):
|
|
77
|
+
yield Static(tr("环境状态"), id="preflight-title")
|
|
78
|
+
with VerticalScroll(id="preflight-scroll"):
|
|
79
|
+
yield Static(tr(self.details), id="preflight-details", markup=False)
|
|
80
|
+
with Horizontal(id="preflight-buttons"):
|
|
81
|
+
yield Button(tr("关闭详情"), id="preflight-close")
|
|
82
|
+
yield Button(tr("重新检查"), id="preflight-retry", variant="primary",
|
|
83
|
+
disabled=self.retry_disabled)
|
|
84
|
+
|
|
85
|
+
@on(Button.Pressed, "#preflight-close")
|
|
86
|
+
def action_close(self) -> None:
|
|
87
|
+
self.dismiss(False)
|
|
88
|
+
|
|
89
|
+
@on(Button.Pressed, "#preflight-retry")
|
|
90
|
+
def retry(self) -> None:
|
|
91
|
+
self.dismiss(True)
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
class ConfirmActionScreen(ModalScreen[bool]):
|
|
95
|
+
"""Small confirmation screen for long-running or mutating actions."""
|
|
96
|
+
|
|
97
|
+
# 打开时不预选按钮;鼠标悬停与主动使用 Tab 聚焦仍保留高亮。
|
|
98
|
+
AUTO_FOCUS = ""
|
|
99
|
+
|
|
100
|
+
BINDINGS = [("escape", "cancel", "取消")]
|
|
101
|
+
|
|
102
|
+
CSS = """
|
|
103
|
+
ConfirmActionScreen {
|
|
104
|
+
align: center middle;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
#confirm-dialog {
|
|
108
|
+
width: 92%;
|
|
109
|
+
max-width: 100;
|
|
110
|
+
height: auto;
|
|
111
|
+
max-height: 80%;
|
|
112
|
+
border: round $accent;
|
|
113
|
+
background: $surface;
|
|
114
|
+
padding: 1 2;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
#confirm-title {
|
|
118
|
+
text-style: bold;
|
|
119
|
+
margin-bottom: 1;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
#confirm-message {
|
|
123
|
+
height: auto;
|
|
124
|
+
max-height: 40vh;
|
|
125
|
+
overflow-y: auto;
|
|
126
|
+
margin-bottom: 1;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
#confirm-buttons {
|
|
130
|
+
height: auto;
|
|
131
|
+
align-horizontal: right;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
#confirm-buttons Button {
|
|
135
|
+
margin-left: 1;
|
|
136
|
+
}
|
|
137
|
+
"""
|
|
138
|
+
|
|
139
|
+
def __init__(
|
|
140
|
+
self, title: str, message: str, confirm_label: str = "确认", *,
|
|
141
|
+
variant: ButtonVariant = "primary",
|
|
142
|
+
):
|
|
143
|
+
super().__init__()
|
|
144
|
+
self._compositor = CjkCompositor()
|
|
145
|
+
self.dialog_title = title
|
|
146
|
+
self.message = message
|
|
147
|
+
self.confirm_label = confirm_label
|
|
148
|
+
self.confirm_variant = variant
|
|
149
|
+
|
|
150
|
+
def compose(self) -> ComposeResult:
|
|
151
|
+
tr = translated_app(self.app).tr
|
|
152
|
+
with Vertical(id="confirm-dialog"):
|
|
153
|
+
yield Static(tr(self.dialog_title), id="confirm-title", markup=False)
|
|
154
|
+
yield Static(tr(self.message), id="confirm-message", markup=False)
|
|
155
|
+
with Horizontal(id="confirm-buttons"):
|
|
156
|
+
yield Button(tr("取消"), id="confirm-no")
|
|
157
|
+
yield Button(
|
|
158
|
+
tr(self.confirm_label),
|
|
159
|
+
id="confirm-yes",
|
|
160
|
+
variant=self.confirm_variant,
|
|
161
|
+
)
|
|
162
|
+
|
|
163
|
+
@on(Button.Pressed, "#confirm-yes")
|
|
164
|
+
def confirm(self) -> None:
|
|
165
|
+
self.dismiss(True)
|
|
166
|
+
|
|
167
|
+
def on_mount(self) -> None:
|
|
168
|
+
for button in self.query(Button):
|
|
169
|
+
button.active_effect_duration = 0
|
|
170
|
+
|
|
171
|
+
@on(Button.Pressed, "#confirm-no")
|
|
172
|
+
def cancel(self) -> None:
|
|
173
|
+
self.dismiss(False)
|
|
174
|
+
|
|
175
|
+
def action_cancel(self) -> None:
|
|
176
|
+
self.dismiss(False)
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
class LogPanel(Vertical):
|
|
180
|
+
"""Keep the log controls available when the log fills the terminal."""
|
|
181
|
+
|
|
182
|
+
ALLOW_MAXIMIZE = True
|
|
183
|
+
|
|
184
|
+
|
|
185
|
+
def compose_number_field(app: AcprofTui, label: str, widget_id: str, value: int | float | str,
|
|
186
|
+
unit: str, *, placeholder: str = "") -> ComposeResult:
|
|
187
|
+
yield app.localization.localized_widget(Label(label))
|
|
188
|
+
yield ConfigField(Horizontal(
|
|
189
|
+
app.localization.localized_widget(Input(
|
|
190
|
+
value=format_input_number(value), id=widget_id, classes="config-control",
|
|
191
|
+
placeholder=placeholder,
|
|
192
|
+
)), app.localization.localized_widget(Label(unit, classes="field-unit")), classes="number-field"), field_id=widget_id)
|
|
193
|
+
|
|
194
|
+
|
|
195
|
+
def compose_run_tab(app: AcprofTui) -> ComposeResult:
|
|
196
|
+
with TabPane("实验配置", id="run-tab"):
|
|
197
|
+
with Vertical(classes="page-header"):
|
|
198
|
+
yield app.localization.localized_widget(Static("", id="config-summary", classes="page-summary", markup=False))
|
|
199
|
+
yield Static("", id="preflight-run-reason", markup=False)
|
|
200
|
+
with ContentSwitcher(initial="run-form", id="experiment-pages"):
|
|
201
|
+
with VerticalScroll(id="run-form", classes="pane-scroll"):
|
|
202
|
+
with Grid(classes="form-grid"):
|
|
203
|
+
yield app.localization.localized_widget(Label("模型 ID"))
|
|
204
|
+
with Horizontal(classes="model-picker-row"):
|
|
205
|
+
yield ConfigField(app.localization.localized_widget(ModelInput(
|
|
206
|
+
value=app.configuration.initial_config.model,
|
|
207
|
+
placeholder="google-bert/bert-base-uncased",
|
|
208
|
+
id="model", classes="config-control",
|
|
209
|
+
tooltip="自由输入模型 ID;F4 搜索本地候选与验证记录。",
|
|
210
|
+
)), field_id="model")
|
|
211
|
+
yield app.localization.localized_widget(Button("模型候选", id="model-candidates"))
|
|
212
|
+
yield app.localization.localized_widget(Label("模型来源"))
|
|
213
|
+
yield ConfigField(app.localization.localized_select((("Hugging Face", "huggingface"),
|
|
214
|
+
("ModelScope", "modelscope")), value=app.configuration.initial_config.model_source, allow_blank=False,
|
|
215
|
+
id="model-source", classes="config-control"), field_id="model-source")
|
|
216
|
+
yield app.localization.localized_widget(Label("输出目录"))
|
|
217
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
218
|
+
value=app.configuration.initial_config.output_dir,
|
|
219
|
+
id="output-dir",
|
|
220
|
+
classes="config-control",
|
|
221
|
+
)), field_id="output-dir")
|
|
222
|
+
|
|
223
|
+
yield app.localization.localized_widget(Label("运行预设"))
|
|
224
|
+
yield app.localization.localized_select(
|
|
225
|
+
PRESET_OPTIONS,
|
|
226
|
+
value=app.configuration.initial_preset,
|
|
227
|
+
allow_blank=False,
|
|
228
|
+
id="run-preset",
|
|
229
|
+
)
|
|
230
|
+
|
|
231
|
+
yield app.localization.localized_widget(Label("CPU 列表"))
|
|
232
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
233
|
+
value=app.configuration.initial_config.cpus,
|
|
234
|
+
placeholder="1,2,4,8",
|
|
235
|
+
id="cpus",
|
|
236
|
+
classes="config-control",
|
|
237
|
+
)), field_id="cpus")
|
|
238
|
+
yield app.localization.localized_widget(Label("内存 GB"))
|
|
239
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
240
|
+
value=app.configuration.initial_config.mems,
|
|
241
|
+
placeholder="2,4,8,16",
|
|
242
|
+
id="mems",
|
|
243
|
+
classes="config-control",
|
|
244
|
+
)), field_id="mems")
|
|
245
|
+
|
|
246
|
+
yield app.localization.localized_widget(Label("GPU 模式"))
|
|
247
|
+
yield ConfigField(app.localization.localized_select(
|
|
248
|
+
app.configuration.gpu_options(),
|
|
249
|
+
value=app.configuration.initial_config.gpus,
|
|
250
|
+
allow_blank=False,
|
|
251
|
+
id="gpus",
|
|
252
|
+
classes="config-control",
|
|
253
|
+
), field_id="gpus")
|
|
254
|
+
yield app.localization.localized_widget(Label("输入规模", id="input-scales-label"))
|
|
255
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
256
|
+
value=app.configuration.initial_config.input_scales,
|
|
257
|
+
placeholder="留空自动规划;如 64,128,256",
|
|
258
|
+
id="input-scales",
|
|
259
|
+
classes="config-control",
|
|
260
|
+
)), field_id="input-scales")
|
|
261
|
+
|
|
262
|
+
with app.localization.localized_widget(Collapsible(
|
|
263
|
+
title="完整命令(自动更新)",
|
|
264
|
+
collapsed=True,
|
|
265
|
+
collapsed_symbol=COLLAPSED_SYMBOL,
|
|
266
|
+
expanded_symbol=EXPANDED_SYMBOL,
|
|
267
|
+
id="command-details",
|
|
268
|
+
)):
|
|
269
|
+
yield app.localization.localized_widget(Static("", id="command-preview", markup=False))
|
|
270
|
+
yield app.localization.localized_widget(Static(
|
|
271
|
+
"测量窗口内暂停常规界面刷新,不读取正在写入的 CSV。",
|
|
272
|
+
id="science-note",
|
|
273
|
+
markup=False,
|
|
274
|
+
))
|
|
275
|
+
|
|
276
|
+
with VerticalScroll(id="advanced-form", classes="pane-scroll"):
|
|
277
|
+
with Grid(classes="form-grid"):
|
|
278
|
+
for label, field, unit in (
|
|
279
|
+
("Warmup", "warmup", "次"), ("Repeat", "repeat", "次"),
|
|
280
|
+
("采样频率", "sample_hz", "Hz"), ("Idle 基线", "idle_seconds", "s"),
|
|
281
|
+
("冷却时间", "idle_cooldown_seconds", "s"), ("连接/读取超时", "request_timeout_seconds", "s"),
|
|
282
|
+
("Batch size", "batch_size", ""), ("窗口请求数", "repeat_in_window", "次"),
|
|
283
|
+
("自动窗口", "repeat_window_seconds", "s"),
|
|
284
|
+
):
|
|
285
|
+
yield from compose_number_field(
|
|
286
|
+
app, label, field.replace("_", "-"), getattr(app.configuration.initial_config, field), unit,
|
|
287
|
+
placeholder="0 表示自动校准" if field == "repeat_in_window" else "",
|
|
288
|
+
)
|
|
289
|
+
with Grid(classes="form-grid"):
|
|
290
|
+
yield app.localization.localized_widget(Label("输入规划"))
|
|
291
|
+
yield ConfigField(app.localization.localized_select(
|
|
292
|
+
(("自动范围", "auto"), ("最小单一尺度", "minimal")),
|
|
293
|
+
value=app.configuration.initial_config.input_scale_policy, allow_blank=False,
|
|
294
|
+
id="input-scale-policy", classes="config-control",
|
|
295
|
+
), field_id="input-scale-policy")
|
|
296
|
+
yield app.localization.localized_widget(Label("画像模式"))
|
|
297
|
+
yield ConfigField(app.localization.localized_select(
|
|
298
|
+
(("完整(RAPL / perf / 抓包)", "full"), ("基础(延迟 / CPU / 内存)", "basic")),
|
|
299
|
+
value=app.configuration.initial_config.profiling_mode,
|
|
300
|
+
allow_blank=False, id="profiling-mode", classes="config-control",
|
|
301
|
+
), field_id="profiling-mode")
|
|
302
|
+
yield app.localization.localized_widget(Label("固定 CPU 集合"))
|
|
303
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
304
|
+
value=app.configuration.initial_config.cpuset_cpus, id="cpuset-cpus",
|
|
305
|
+
placeholder="可选;如 0-3,8;用于正式采集", classes="config-control",
|
|
306
|
+
)), field_id="cpuset-cpus")
|
|
307
|
+
yield app.localization.localized_widget(Label("抓包网卡"))
|
|
308
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
309
|
+
value=app.configuration.initial_config.sniff_iface,
|
|
310
|
+
id="sniff-iface",
|
|
311
|
+
classes="config-control",
|
|
312
|
+
)), field_id="sniff-iface")
|
|
313
|
+
yield app.localization.localized_widget(Label("通知"))
|
|
314
|
+
yield ConfigField(app.localization.localized_select(
|
|
315
|
+
(
|
|
316
|
+
("自动", "auto"),
|
|
317
|
+
("关闭", "none"),
|
|
318
|
+
("企业微信", "wecom"),
|
|
319
|
+
),
|
|
320
|
+
value=app.configuration.initial_config.notify,
|
|
321
|
+
allow_blank=False,
|
|
322
|
+
id="notify",
|
|
323
|
+
classes="config-control",
|
|
324
|
+
), field_id="notify")
|
|
325
|
+
|
|
326
|
+
yield app.localization.localized_widget(Static("深度性能分析", classes="section-title"))
|
|
327
|
+
yield app.localization.localized_widget(Static(
|
|
328
|
+
"按需选择;分析器分别运行,可能增加准备时间。首次采集建议关闭。",
|
|
329
|
+
classes="page-hint", markup=False,
|
|
330
|
+
))
|
|
331
|
+
with Grid(classes="profiler-grid"):
|
|
332
|
+
for widget_id, label, enabled in (
|
|
333
|
+
("torch-profiler", "PyTorch Profiler — 算子与框架计算分析",
|
|
334
|
+
app.configuration.initial_config.compute_profile_tool in {"torch", "both"}),
|
|
335
|
+
("ncu-profiler", "NVIDIA NCU — GPU 内核性能分析",
|
|
336
|
+
app.configuration.initial_config.compute_profile_tool in {"ncu", "both"}),
|
|
337
|
+
("massif-profiler", "Valgrind Massif — CPU 内存分析",
|
|
338
|
+
app.configuration.initial_config.execution_profile_tool in {"massif", "both"}),
|
|
339
|
+
("nsys-profiler", "NVIDIA Nsys — CPU/GPU 执行时序分析",
|
|
340
|
+
app.configuration.initial_config.execution_profile_tool in {"nsys", "both"}),
|
|
341
|
+
):
|
|
342
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
343
|
+
label, value=enabled, id=widget_id,
|
|
344
|
+
classes="config-control option-checkbox profiler-checkbox",
|
|
345
|
+
))
|
|
346
|
+
|
|
347
|
+
yield app.localization.localized_widget(Static("识别覆盖(通常留空)", classes="section-title"))
|
|
348
|
+
with Grid(classes="form-grid"):
|
|
349
|
+
yield app.localization.localized_widget(Label("模型 revision"))
|
|
350
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
351
|
+
value=app.configuration.initial_config.revision, id="revision", classes="config-control",
|
|
352
|
+
placeholder="留空解析默认 revision;候选选择会固定 commit SHA",
|
|
353
|
+
)), field_id="revision")
|
|
354
|
+
yield app.localization.localized_widget(Label("Task"))
|
|
355
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
356
|
+
value=app.configuration.initial_config.task,
|
|
357
|
+
placeholder="如 text-generation",
|
|
358
|
+
id="task",
|
|
359
|
+
classes="config-control",
|
|
360
|
+
)), field_id="task")
|
|
361
|
+
yield app.localization.localized_widget(Label("Task family"))
|
|
362
|
+
yield ConfigField(app.localization.localized_select(
|
|
363
|
+
(
|
|
364
|
+
("自动识别", ""),
|
|
365
|
+
("NLP", "nlp"),
|
|
366
|
+
("CV", "cv"),
|
|
367
|
+
("Audio", "audio"),
|
|
368
|
+
("Time series", "timeseries"),
|
|
369
|
+
("Diffusion", "diffusion"),
|
|
370
|
+
("Multimodal", "multimodal"),
|
|
371
|
+
("结构化数据/策略", "structured"),
|
|
372
|
+
),
|
|
373
|
+
value=app.configuration.initial_config.task_family,
|
|
374
|
+
allow_blank=False,
|
|
375
|
+
id="task-family",
|
|
376
|
+
classes="config-control",
|
|
377
|
+
), field_id="task-family")
|
|
378
|
+
yield app.localization.localized_widget(Label("Backend"))
|
|
379
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
380
|
+
value=app.configuration.initial_config.backend,
|
|
381
|
+
placeholder="留空自动识别",
|
|
382
|
+
id="backend",
|
|
383
|
+
classes="config-control",
|
|
384
|
+
)), field_id="backend")
|
|
385
|
+
yield app.localization.localized_widget(Label("模型接口声明"))
|
|
386
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
387
|
+
value=app.configuration.initial_config.model_spec,
|
|
388
|
+
placeholder="模型接口 JSON,可留空",
|
|
389
|
+
id="model-spec",
|
|
390
|
+
classes="config-control",
|
|
391
|
+
)), field_id="model-spec")
|
|
392
|
+
yield app.localization.localized_widget(Label("Workload manifest"))
|
|
393
|
+
yield ConfigField(app.localization.localized_widget(Input(
|
|
394
|
+
value=app.configuration.initial_config.workload_spec,
|
|
395
|
+
placeholder="输入素材 manifest,可留空",
|
|
396
|
+
id="workload-spec",
|
|
397
|
+
classes="config-control",
|
|
398
|
+
)), field_id="workload-spec")
|
|
399
|
+
|
|
400
|
+
with Collapsible(title=app.tr(message_id('ui.0223')), collapsed=True):
|
|
401
|
+
with Grid(classes="form-grid"):
|
|
402
|
+
for key, label, placeholder in (
|
|
403
|
+
("max-download", "下载预算", "5GB;留空不设上限"),
|
|
404
|
+
("model-store", "Model Store 路径", "留空使用用户缓存目录"),
|
|
405
|
+
):
|
|
406
|
+
yield app.localization.localized_widget(Label(label))
|
|
407
|
+
yield ConfigField(app.localization.localized_widget(Input(value=getattr(app.configuration.initial_config, key.replace("-", "_")),
|
|
408
|
+
placeholder=placeholder, id=key, classes="config-control")), field_id=key)
|
|
409
|
+
yield app.localization.localized_widget(Label("预计下载大小"))
|
|
410
|
+
yield app.localization.localized_widget(Static("待解析", id="download-estimate", markup=False))
|
|
411
|
+
yield app.localization.localized_widget(Static("下载策略:自动。使用系统网络环境。", markup=False))
|
|
412
|
+
with Collapsible(title=app.tr(message_id('ui.0063')), collapsed=True):
|
|
413
|
+
yield app.localization.localized_widget(Label("Model Store 容量上限"))
|
|
414
|
+
yield ConfigField(app.localization.localized_widget(Input(value=app.configuration.initial_config.model_store_max,
|
|
415
|
+
placeholder="100GB;留空不设上限", id="model-store-max", classes="config-control")), field_id="model-store-max")
|
|
416
|
+
yield Static("", id="network-download-summary", markup=False)
|
|
417
|
+
yield app.localization.localized_widget(Button("Model Store 占用与清理", id="open-model-store", classes="config-control"))
|
|
418
|
+
|
|
419
|
+
with Horizontal(classes="checkbox-row"):
|
|
420
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
421
|
+
"启动 OOM 剪枝",
|
|
422
|
+
value=app.configuration.initial_config.prune_startup_oom,
|
|
423
|
+
id="prune-startup-oom",
|
|
424
|
+
classes="config-control option-checkbox",
|
|
425
|
+
))
|
|
426
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
427
|
+
"Idle 诊断",
|
|
428
|
+
value=app.configuration.initial_config.idle_debug,
|
|
429
|
+
id="idle-debug",
|
|
430
|
+
classes="config-control option-checkbox",
|
|
431
|
+
))
|
|
432
|
+
with Horizontal(classes="button-row"):
|
|
433
|
+
yield app.localization.localized_widget(Button("记住实验配置", id="save-run-default"))
|
|
434
|
+
with Collapsible(title=app.tr(message_id('ui.0680')), collapsed=True, id="image-build-options"):
|
|
435
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
436
|
+
"重新构建镜像(仅本次)",
|
|
437
|
+
value=app.configuration.initial_config.rebuild_image,
|
|
438
|
+
id="rebuild-image",
|
|
439
|
+
classes="config-control option-checkbox",
|
|
440
|
+
tooltip="仅用于下一次采集或探测,不保存为默认配置;仍可使用 Docker 构建缓存。",
|
|
441
|
+
))
|
|
442
|
+
|
|
443
|
+
with Vertical(id="run-footer"):
|
|
444
|
+
yield app.localization.localized_widget(Static("", id="run-plan-summary", markup=False))
|
|
445
|
+
with Horizontal(id="run-actions", classes="action-bar"):
|
|
446
|
+
with Horizontal(classes="action-secondary"):
|
|
447
|
+
yield app.localization.localized_widget(Button("高级参数", id="open-run-settings"))
|
|
448
|
+
yield app.localization.localized_widget(Button("探测最大输入", id="probe-largest"))
|
|
449
|
+
with Horizontal(classes="action-primary"):
|
|
450
|
+
yield app.localization.localized_widget(Button("开始采集", id="start-run", variant="primary"))
|
|
451
|
+
|
|
452
|
+
|
|
453
|
+
def compose_monitor_tab(app: AcprofTui) -> ComposeResult:
|
|
454
|
+
with TabPane("运行监控", id="monitor-tab"):
|
|
455
|
+
with Vertical(id="monitor-panel"):
|
|
456
|
+
with Grid(id="status-grid", classes="page-header"):
|
|
457
|
+
yield app.localization.localized_widget(Static("阶段", classes="status-label"))
|
|
458
|
+
yield app.localization.localized_widget(Static("等待", id="status-stage", markup=False))
|
|
459
|
+
yield app.localization.localized_widget(Static("运行时间", classes="status-label"))
|
|
460
|
+
yield app.localization.localized_widget(Static(NOT_APPLICABLE, id="status-elapsed", markup=False))
|
|
461
|
+
|
|
462
|
+
yield app.localization.localized_widget(Static("Case", classes="status-label"))
|
|
463
|
+
yield app.localization.localized_widget(Static("0/0", id="status-case", markup=False))
|
|
464
|
+
yield app.localization.localized_widget(Static("资源", classes="status-label"))
|
|
465
|
+
yield app.localization.localized_widget(Static("CPU=— MEM=— GPU=—", id="status-resource", markup=False))
|
|
466
|
+
|
|
467
|
+
yield app.localization.localized_widget(Static("警告 / 错误", classes="status-label"))
|
|
468
|
+
yield app.localization.localized_widget(Static("0 / 0", id="status-errors", markup=False))
|
|
469
|
+
yield app.localization.localized_widget(Static("详情", classes="status-label"))
|
|
470
|
+
yield app.localization.localized_widget(Static("尚未启动", id="status-detail", markup=False))
|
|
471
|
+
|
|
472
|
+
yield Static("", id="status-preparation", markup=False)
|
|
473
|
+
with LogPanel(id="log-panel"):
|
|
474
|
+
with Horizontal(id="log-toolbar", classes="action-bar"):
|
|
475
|
+
with Horizontal(classes="action-secondary"):
|
|
476
|
+
yield app.localization.localized_widget(Button("复制选区", id="copy-log", classes="log-tool"))
|
|
477
|
+
yield app.localization.localized_widget(Button("回到底部", id="follow-log", classes="log-tool"))
|
|
478
|
+
yield app.localization.localized_widget(Button("放大日志", id="expand-log", classes="log-tool"))
|
|
479
|
+
yield app.localization.localized_widget(Button("返回监控", id="restore-log", classes="log-tool"))
|
|
480
|
+
yield app.localization.localized_widget(Button("清空日志", id="clear-log", classes="log-tool"))
|
|
481
|
+
with Horizontal(classes="action-primary"):
|
|
482
|
+
yield app.localization.localized_widget(Button(
|
|
483
|
+
"终止任务", id="stop-run", classes="log-tool",
|
|
484
|
+
variant="error", disabled=True,
|
|
485
|
+
))
|
|
486
|
+
yield SelectableLog(
|
|
487
|
+
id="run-log",
|
|
488
|
+
max_lines=app.configuration.preferences.log_max_lines,
|
|
489
|
+
wrap=app.configuration.preferences.log_wrap,
|
|
490
|
+
)
|
|
491
|
+
with Horizontal(id="run-recovery-actions"):
|
|
492
|
+
yield app.localization.localized_widget(Button("恢复 / 重试", id="review-run-recovery"))
|
|
493
|
+
|
|
494
|
+
|
|
495
|
+
def compose_plot_tab(app: AcprofTui) -> ComposeResult:
|
|
496
|
+
with TabPane("绘图工具", id="plot-tab"):
|
|
497
|
+
with Vertical(classes="page-header"):
|
|
498
|
+
yield app.localization.localized_widget(Static(
|
|
499
|
+
"读取结果 CSV,查看摘要或生成图表。", classes="page-summary", markup=False,
|
|
500
|
+
))
|
|
501
|
+
with VerticalScroll(id="plot-body", classes="pane-scroll"):
|
|
502
|
+
with Grid(classes="form-grid tool-form-grid"):
|
|
503
|
+
yield app.localization.localized_widget(Label("结果 CSV"))
|
|
504
|
+
with Horizontal(classes="path-picker-row"):
|
|
505
|
+
yield app.localization.localized_widget(Input(app.configuration.saved_settings.last_result_csv, id="result-csv"))
|
|
506
|
+
yield app.localization.localized_widget(Button("选择实验", name="result-csv", id="choose-result-csv", classes="experiment-picker"))
|
|
507
|
+
yield app.localization.localized_widget(Static(
|
|
508
|
+
"选择或完成一次实验后,这里会显示结果摘要。",
|
|
509
|
+
id="result-summary",
|
|
510
|
+
markup=False,
|
|
511
|
+
))
|
|
512
|
+
with Horizontal(id="plot-actions", classes="action-bar"):
|
|
513
|
+
with Horizontal(classes="action-secondary"):
|
|
514
|
+
yield app.localization.localized_widget(Button("读取摘要", id="summarize-results"))
|
|
515
|
+
with Horizontal(classes="action-primary"):
|
|
516
|
+
yield app.localization.localized_widget(Button("生成图表", id="plot-results", variant="primary"))
|
|
517
|
+
|
|
518
|
+
|
|
519
|
+
def compose_reports_tab(app: AcprofTui) -> ComposeResult:
|
|
520
|
+
with TabPane("统计报告", id="reports-tab"):
|
|
521
|
+
with Vertical(classes="page-header"):
|
|
522
|
+
yield app.localization.localized_widget(Static(
|
|
523
|
+
"CSV / 目录:计算统计;JSON:查看报告。采集结束后操作。",
|
|
524
|
+
id="report-status", classes="page-summary", markup=False,
|
|
525
|
+
))
|
|
526
|
+
with Vertical(id="report-panel"):
|
|
527
|
+
with app.localization.localized_widget(Collapsible(title="独立实验比较", collapsed=True, id="comparison-options")):
|
|
528
|
+
with Grid(classes="form-grid tool-form-grid"):
|
|
529
|
+
for side, label in (("left", "左侧实验"), ("right", "右侧实验")):
|
|
530
|
+
yield app.localization.localized_widget(Label(label))
|
|
531
|
+
with Horizontal(classes="path-picker-row"):
|
|
532
|
+
yield app.localization.localized_widget(Input(id=f"comparison-{side}", classes="report-control",
|
|
533
|
+
placeholder="实验目录;同组多个目录用分号分隔"))
|
|
534
|
+
yield app.localization.localized_widget(Button("选择实验", name=f"comparison-{side}", id=f"choose-comparison-{side}", classes="experiment-picker"))
|
|
535
|
+
yield app.localization.localized_widget(Label("基线"))
|
|
536
|
+
yield app.localization.localized_select((("左侧实验", "left"), ("右侧实验", "right")),
|
|
537
|
+
value="left", allow_blank=False, id="comparison-baseline", classes="report-control")
|
|
538
|
+
yield app.localization.localized_widget(Label("比较用途"))
|
|
539
|
+
yield app.localization.localized_select((("相同硬件", "same-hardware"), ("跨硬件", "cross-hardware"), ("资源配置扩展", "resource-scaling")),
|
|
540
|
+
value="same-hardware", allow_blank=False, id="comparison-purpose", classes="report-control")
|
|
541
|
+
yield app.localization.localized_widget(Button("比较实验", id="report-compare", classes="report-control"))
|
|
542
|
+
with Horizontal(classes="path-picker-row"):
|
|
543
|
+
yield app.localization.localized_widget(Input(
|
|
544
|
+
app.configuration.saved_settings.last_result_csv, id="report-source", classes="report-control",
|
|
545
|
+
placeholder="实验目录、结果 CSV 或报告 JSON 路径",
|
|
546
|
+
))
|
|
547
|
+
yield app.localization.localized_widget(Button("选择实验", name="report-source", id="choose-report-source", classes="experiment-picker"))
|
|
548
|
+
yield Rule(classes="content-divider")
|
|
549
|
+
yield app.localization.localized_widget(ResizableDataTable(
|
|
550
|
+
id="report-table", cursor_type="row", zebra_stripes=True, fixed_columns=1))
|
|
551
|
+
yield app.localization.localized_widget(Static(
|
|
552
|
+
"表格可滚动;选择一行查看口径与数据来源。",
|
|
553
|
+
id="report-detail", markup=False,
|
|
554
|
+
))
|
|
555
|
+
with Horizontal(id="report-actions", classes="action-bar"):
|
|
556
|
+
with Horizontal(classes="action-secondary"):
|
|
557
|
+
yield app.localization.localized_widget(Button("查看报告", id="report-open", classes="report-control"))
|
|
558
|
+
with Horizontal(classes="action-primary"):
|
|
559
|
+
yield app.localization.localized_widget(Button("计算统计", id="report-calculate", classes="report-control", variant="primary"))
|
|
560
|
+
|
|
561
|
+
|
|
562
|
+
def compose_profile_tab(app: AcprofTui) -> ComposeResult:
|
|
563
|
+
with TabPane("补采工具", id="profile-tab"):
|
|
564
|
+
with VerticalScroll(id="profile-body", classes="pane-scroll"):
|
|
565
|
+
with Grid(classes="form-grid tool-form-grid"):
|
|
566
|
+
yield app.localization.localized_widget(Label("结果目录"))
|
|
567
|
+
with Horizontal(classes="path-picker-row"):
|
|
568
|
+
yield app.localization.localized_widget(Input(app.configuration.saved_settings.last_result_dir, id="result-dir"))
|
|
569
|
+
yield app.localization.localized_widget(Button("选择实验", name="result-dir", id="choose-result-dir", classes="experiment-picker"))
|
|
570
|
+
yield app.localization.localized_widget(Label("补采工具"))
|
|
571
|
+
with Grid(id="profile-tools"):
|
|
572
|
+
for tool, label, tooltip in (
|
|
573
|
+
("torch", "torch · CPU / GPU", "逻辑 FLOP;点击或按空格切换。"),
|
|
574
|
+
("ncu", "ncu · GPU", "GPU 实际执行 FLOP;点击或按空格切换。"),
|
|
575
|
+
("nsys", "nsys · GPU", "CUDA API、kernel 和 memcpy 时间线;点击或按空格切换。"),
|
|
576
|
+
("massif", "massif · CPU", "CPU-only 进程生命周期内存峰值;点击或按空格切换。"),
|
|
577
|
+
):
|
|
578
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
579
|
+
label,
|
|
580
|
+
value=tool in {"torch", "ncu"},
|
|
581
|
+
name=tool,
|
|
582
|
+
id=f"profile-tool-{tool}",
|
|
583
|
+
classes="option-checkbox profile-tool",
|
|
584
|
+
tooltip=tooltip,
|
|
585
|
+
))
|
|
586
|
+
with Horizontal(id="profile-actions", classes="action-bar"):
|
|
587
|
+
with Horizontal(classes="action-secondary"):
|
|
588
|
+
yield app.localization.localized_widget(Button("补采计划(dry-run)", id="profile-dry-run"))
|
|
589
|
+
with Horizontal(classes="action-primary"):
|
|
590
|
+
yield app.localization.localized_widget(Button("执行补采", id="profile-run", variant="warning"))
|
|
591
|
+
|
|
592
|
+
|
|
593
|
+
def compose_settings_tab(app: AcprofTui) -> ComposeResult:
|
|
594
|
+
with TabPane("应用设置", id="settings-tab"):
|
|
595
|
+
with Vertical(classes="page-header"):
|
|
596
|
+
yield app.localization.localized_widget(Static("应用设置", classes="page-title"))
|
|
597
|
+
yield app.localization.localized_widget(Static(
|
|
598
|
+
"修改立即生效,点击保存后下次启动沿用。",
|
|
599
|
+
id="settings-status", classes="page-summary", markup=False,
|
|
600
|
+
))
|
|
601
|
+
with VerticalScroll(id="settings-body", classes="pane-scroll"):
|
|
602
|
+
with Vertical(id="settings-interface", classes="settings-section") as section:
|
|
603
|
+
app.localization.set_text(section, "界面与交互", "border_title")
|
|
604
|
+
with Grid(classes="form-grid"):
|
|
605
|
+
yield app.localization.localized_widget(Label("界面语言"))
|
|
606
|
+
yield app.localization.localized_select(
|
|
607
|
+
LANGUAGE_OPTIONS,
|
|
608
|
+
value=app.configuration.preferences.language, allow_blank=False,
|
|
609
|
+
id="ui-language", classes="ui-preference",
|
|
610
|
+
)
|
|
611
|
+
yield app.localization.localized_widget(Label("界面主题"))
|
|
612
|
+
yield app.localization.localized_select(
|
|
613
|
+
THEME_OPTIONS,
|
|
614
|
+
value=app.configuration.preferences.theme, allow_blank=False,
|
|
615
|
+
id="ui-theme", classes="ui-preference",
|
|
616
|
+
)
|
|
617
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
618
|
+
"显示底部快捷命令框",
|
|
619
|
+
value=app.configuration.preferences.show_command_bar,
|
|
620
|
+
id="ui-command-bar", classes="ui-preference option-checkbox",
|
|
621
|
+
))
|
|
622
|
+
with Vertical(id="settings-logs", classes="settings-section") as section:
|
|
623
|
+
app.localization.set_text(section, "日志", "border_title")
|
|
624
|
+
with Grid(classes="form-grid"):
|
|
625
|
+
yield app.localization.localized_widget(Label("保留日志行数"))
|
|
626
|
+
yield app.localization.localized_select(
|
|
627
|
+
((str(n), n) for n in (500, 1000, 3000, 10000)),
|
|
628
|
+
value=app.configuration.preferences.log_max_lines, allow_blank=False,
|
|
629
|
+
id="ui-log-lines", classes="ui-preference",
|
|
630
|
+
)
|
|
631
|
+
yield app.localization.localized_widget(StatusCheckbox(
|
|
632
|
+
"日志自动换行", value=app.configuration.preferences.log_wrap,
|
|
633
|
+
id="ui-log-wrap", classes="ui-preference option-checkbox",
|
|
634
|
+
))
|
|
635
|
+
with Vertical(id="settings-connections", classes="settings-section") as section:
|
|
636
|
+
app.localization.set_text(section, "连接与权限", "border_title")
|
|
637
|
+
yield app.localization.localized_widget(Static(
|
|
638
|
+
"配置 Hugging Face、代理、企业微信通知和采集权限。",
|
|
639
|
+
classes="page-hint", markup=False,
|
|
640
|
+
))
|
|
641
|
+
yield app.localization.localized_widget(Button("管理连接与权限", id="open-environment-settings"))
|
|
642
|
+
yield app.localization.localized_widget(Static("", id="settings-location", classes="page-hint", markup=False))
|
|
643
|
+
with Horizontal(id="settings-actions", classes="action-bar"):
|
|
644
|
+
with Horizontal(classes="action-secondary"):
|
|
645
|
+
yield app.localization.localized_widget(Button("恢复界面默认", id="restore-ui-defaults"))
|
|
646
|
+
with Horizontal(classes="action-primary"):
|
|
647
|
+
yield app.localization.localized_widget(Button("保存设置", id="save-ui-settings", variant="primary"))
|
|
648
|
+
|
|
649
|
+
|
|
650
|
+
def compose_images_tab(app: AcprofTui) -> ComposeResult:
|
|
651
|
+
from acprof.tui.images import (
|
|
652
|
+
IMAGE_HINT,
|
|
653
|
+
IMAGE_PLATFORMS,
|
|
654
|
+
ImageDetailPanel,
|
|
655
|
+
ImageDetailResizeHandle,
|
|
656
|
+
ImageTable,
|
|
657
|
+
ImageTree,
|
|
658
|
+
ImageTreeHeader,
|
|
659
|
+
ImageWorkspace,
|
|
660
|
+
)
|
|
661
|
+
|
|
662
|
+
with TabPane("镜像管理", id="images-tab"):
|
|
663
|
+
with Horizontal(id="image-header", classes="page-header"):
|
|
664
|
+
with Vertical(id="image-heading"):
|
|
665
|
+
yield app.localization.localized_widget(Static(IMAGE_HINT, id="image-status", classes="page-summary", markup=False))
|
|
666
|
+
with Vertical(id="image-panel"):
|
|
667
|
+
with Horizontal(id="image-filters"):
|
|
668
|
+
yield app.localization.localized_select(
|
|
669
|
+
(("AC-Prof 镜像", "acprof"), ("全部镜像", "all"), ("模型相关", "models"),
|
|
670
|
+
("公共依赖", "runtime"), ("公共基础", "base"),
|
|
671
|
+
*((IMAGE_PLATFORMS[key], key) for key in ("cpu", "cu124", "cu128")),
|
|
672
|
+
("无标签", "untagged")),
|
|
673
|
+
value="acprof", allow_blank=False, id="image-scope", classes="image-control",
|
|
674
|
+
)
|
|
675
|
+
yield app.localization.localized_widget(Input(
|
|
676
|
+
placeholder="搜索模型、依赖、标签或镜像 ID", id="image-search", classes="image-control",
|
|
677
|
+
))
|
|
678
|
+
for label, view in (("镜像树", "tree"), ("镜像列表", "list"), ("层共享", "layers")):
|
|
679
|
+
yield app.localization.localized_widget(Button(
|
|
680
|
+
label, id="image-view-" + view, classes="image-control image-view-button",
|
|
681
|
+
variant="primary" if view == "tree" else "default",
|
|
682
|
+
))
|
|
683
|
+
yield app.localization.localized_widget(Button("存储空间", id="image-storage", classes="image-control"))
|
|
684
|
+
with ImageWorkspace(id="image-workspace"):
|
|
685
|
+
with ContentSwitcher(initial="image-tree-view", id="image-browser"):
|
|
686
|
+
with Vertical(id="image-tree-view"):
|
|
687
|
+
yield app.localization.localized_widget(ImageTreeHeader(
|
|
688
|
+
id="image-tree-header", classes="image-control", show_cursor=False))
|
|
689
|
+
yield ImageTree("", id="image-tree", classes="image-control")
|
|
690
|
+
for table in (
|
|
691
|
+
ImageTable(id="image-table", classes="image-control", cursor_type="row",
|
|
692
|
+
zebra_stripes=True, fixed_columns=1),
|
|
693
|
+
ResizableDataTable(id="image-layer-table", classes="image-control", cursor_type="row", zebra_stripes=True),
|
|
694
|
+
):
|
|
695
|
+
yield app.localization.localized_widget(table)
|
|
696
|
+
yield app.localization.localized_widget(ImageDetailResizeHandle(id="image-detail-resize", classes="image-control"))
|
|
697
|
+
yield ImageDetailPanel(id="image-detail-scroll")
|
|
698
|
+
with Horizontal(id="image-actions", classes="action-bar"):
|
|
699
|
+
with Horizontal(classes="action-secondary"):
|
|
700
|
+
for label, widget_id in (("勾选/取消", "image-toggle"),
|
|
701
|
+
("选择同模型", "image-model"), ("清空选择", "image-clear")):
|
|
702
|
+
yield app.localization.localized_widget(Button(label, id=widget_id, classes="image-control", disabled=True))
|
|
703
|
+
with Horizontal(classes="action-primary"):
|
|
704
|
+
yield app.localization.localized_widget(Button(
|
|
705
|
+
"删除所选", id="image-delete", classes="image-control", variant="error", disabled=True,
|
|
706
|
+
))
|