refactor(profiling): remove cProfile, keep torch profiler only

Remove cProfile wrapping from the training loop and profiling utilities.
The torch profiler already captures fine-grained timing and operator
breakdowns; cProfile added redundant overhead without actionable
insight for GPU-bound models.

- Remove render_cprofile_summary, run_with_cprofile from profiling_utils
- Replace cProfile-wrapped calls in lerobot_train with direct calls
- Remove cprofile_summaries from artifact index in run_model_profiling
- Update tests to match

Made-with: Cursor
This commit is contained in:
Pepijn
2026-04-16 15:32:59 +02:00
parent 4137b5785d
commit e16a95a78e
4 changed files with 15 additions and 95 deletions
-5
View File
@@ -184,14 +184,12 @@ def build_artifact_index(
artifact_paths: dict[str, Any] = {
"row": row_path_in_repo,
"profiling_files": {},
"cprofile_summaries": {},
"torch_tables": {},
"trace_files": {},
}
artifact_urls: dict[str, Any] = {
"row": make_hub_file_url(repo_id, row_path_in_repo),
"profiling_files": {},
"cprofile_summaries": {},
"torch_tables": {},
"trace_files": {},
}
@@ -219,9 +217,6 @@ def build_artifact_index(
if path.name == "step_timing_summary.json":
artifact_paths["step_timing_summary"] = repo_path
artifact_urls["step_timing_summary"] = make_hub_file_url(repo_id, repo_path)
elif "cprofile" in path.parts:
artifact_paths["cprofile_summaries"][path.stem] = repo_path
artifact_urls["cprofile_summaries"][path.stem] = make_hub_file_url(repo_id, repo_path)
elif "torch_tables" in path.parts:
artifact_paths["torch_tables"][path.name] = repo_path
artifact_urls["torch_tables"][path.name] = make_hub_file_url(repo_id, repo_path)