Unverified Commit bcf66ef3 authored by fzyzcjy's avatar fzyzcjy Committed by GitHub
Browse files

Tiny allow profiler API to auto create directory (#6865)

parent 0de5e7d4
......@@ -24,6 +24,7 @@ from collections import defaultdict, deque
from concurrent import futures
from dataclasses import dataclass
from http import HTTPStatus
from pathlib import Path
from types import SimpleNamespace
from typing import Dict, List, Optional, Tuple, Union
......@@ -2283,6 +2284,9 @@ class Scheduler(
message="Profiling is not in progress. Call /start_profile first.",
)
if not Path(self.torch_profiler_output_dir).exists():
Path(self.torch_profiler_output_dir).mkdir(parents=True, exist_ok=True)
stage_suffix = f"-{stage.__str__()}" if stage else ""
logger.info("Stop profiling" + stage_suffix + "...")
if self.torch_profiler is not None:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment