Add pydocstyle to the ruff rules (#52136)

Signed-off-by: Harry Mellor <19981378+hmellor@users.noreply.github.com>
Signed-off-by: Harry Mellor <hej.mellor@gmail.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Harry Mellor
2026-09-16 16:44:29 +00:00
committed by GitHub
co-authored by Claude Opus 5
parent 804e5377aa
commit 8c1557a79c
2002 changed files with 15024 additions and 14269 deletions
+3 -3
View File
@@ -224,7 +224,7 @@ class LayerwiseProfileResults(profile):
return next(iterator, None)
def _cumulative_cuda_time(self, node: _ModuleTreeNode):
"Return cuda time in microseconds"
"""Return cuda time in microseconds."""
def _cumulative_cuda_time_recursive(node: _ModuleTreeNode):
if node.is_leaf and (gpu_kineto_event := self._get_kineto_gpu_event(node)):
@@ -372,13 +372,13 @@ class LayerwiseProfileResults(profile):
class layerwise_profile(profile):
def __init__(self, num_running_seqs: int | None = None):
"""
layerwise profile constructor.
"""Layerwise profile constructor.
Args:
num_running_seqs (Optional[int], optional): When given,
num_running_seqs will be passed to LayerProfileResults
for metadata update. Defaults to None.
"""
super().__init__(
activities=[ProfilerActivity.CPU, ProfilerActivity.CUDA],
+4 -1
View File
@@ -98,7 +98,8 @@ class WorkerProfiler(ABC):
def step(self) -> None:
"""Update the profiler state at each worker step,
to handle delayed starts and max iteration limits."""
to handle delayed starts and max iteration limits.
"""
if not self._active:
return
@@ -138,6 +139,7 @@ class WorkerProfiler(ABC):
Returns:
True if the step was an active profiling step (data recorded),
False if the step was a warmup step (data discarded).
"""
return True
@@ -354,6 +356,7 @@ class TorchProfilerWrapper(WorkerProfiler):
Returns:
True if the step was an active profiling step (data recorded),
False if the step was a warmup step (data discarded).
"""
if self._uses_schedule:
self.profiler.step()