Fix start_profile does not support with_stack and record_shapes (#6043)
This commit is contained in:
@@ -338,7 +338,11 @@ async def start_profile_async(obj: Optional[ProfileReqInput] = None):
|
|||||||
obj = ProfileReqInput()
|
obj = ProfileReqInput()
|
||||||
|
|
||||||
await _global_state.tokenizer_manager.start_profile(
|
await _global_state.tokenizer_manager.start_profile(
|
||||||
obj.output_dir, obj.num_steps, obj.activities
|
output_dir=obj.output_dir,
|
||||||
|
num_steps=obj.num_steps,
|
||||||
|
activities=obj.activities,
|
||||||
|
with_stack=obj.with_stack,
|
||||||
|
record_shapes=obj.record_shapes,
|
||||||
)
|
)
|
||||||
return Response(
|
return Response(
|
||||||
content="Start profiling.\n",
|
content="Start profiling.\n",
|
||||||
|
|||||||
@@ -836,6 +836,8 @@ class ProfileReqInput:
|
|||||||
# the caller doesn't need to run stop_profile.
|
# the caller doesn't need to run stop_profile.
|
||||||
num_steps: Optional[int] = None
|
num_steps: Optional[int] = None
|
||||||
activities: Optional[List[Literal["CPU", "GPU", "MEM", "CUDA_PROFILER"]]] = None
|
activities: Optional[List[Literal["CPU", "GPU", "MEM", "CUDA_PROFILER"]]] = None
|
||||||
|
with_stack: Optional[bool] = None
|
||||||
|
record_shapes: Optional[bool] = None
|
||||||
|
|
||||||
|
|
||||||
class ProfileReqType(Enum):
|
class ProfileReqType(Enum):
|
||||||
|
|||||||
@@ -747,12 +747,16 @@ class TokenizerManager:
|
|||||||
output_dir: Optional[str] = None,
|
output_dir: Optional[str] = None,
|
||||||
num_steps: Optional[int] = None,
|
num_steps: Optional[int] = None,
|
||||||
activities: Optional[List[str]] = None,
|
activities: Optional[List[str]] = None,
|
||||||
|
with_stack: Optional[bool] = None,
|
||||||
|
record_shapes: Optional[bool] = None,
|
||||||
):
|
):
|
||||||
req = ProfileReq(
|
req = ProfileReq(
|
||||||
type=ProfileReqType.START_PROFILE,
|
type=ProfileReqType.START_PROFILE,
|
||||||
output_dir=output_dir,
|
output_dir=output_dir,
|
||||||
num_steps=num_steps,
|
num_steps=num_steps,
|
||||||
activities=activities,
|
activities=activities,
|
||||||
|
with_stack=with_stack,
|
||||||
|
record_shapes=record_shapes,
|
||||||
profile_id=str(time.time()),
|
profile_id=str(time.time()),
|
||||||
)
|
)
|
||||||
result = (await self.start_profile_communicator(req))[0]
|
result = (await self.start_profile_communicator(req))[0]
|
||||||
|
|||||||
Reference in New Issue
Block a user