mirror of
https://github.com/ggml-org/llama.cpp.git
synced 2026-09-07 20:47:30 +02:00
Add an optional per-op / per-copy profiler to the ggml scheduler that records timed events across all backends of a split graph, so a single run can be inspected end to end (compute kernels, host<->device copies, fusion names, tensor shapes/strides/types, op params). - ggml-profiler.h/.cpp: ggml_profile_record, per-backend profiler interface (enable/reset/get_records), JSON export - ggml-backend.cpp: scheduler-level collection, copy events, backend attribution, mul_mat_id stats, throughput stat, concurrent-mode fix, auto-export via GGML_PROFILE env var - Backend profilers: CPU, CUDA/HIP/MUSA (event-based timing), Vulkan (timestamp queries), BLAS, Metal (tentative); stubs for the remaining backends - llama: expose profiler enable/export; --profile, --profile-output, --with-backends args in common; hooks in server, completion and the debug example - tools/profiler/profiler.py: analysis tool (per-op / per-backend summaries, Chrome trace export) - test-backend-ops / test-export-graph-ops: run perf tests with exactly the tensor shapes recorded in a profile (converged with export-graph-ops) - docs/cross-profiler.md - ggml-cuda: avoid ROCm_Host compute on HIP integrated GPUs Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Ney1sm8n1bSjeA3DrrW5ah