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:
co-authored by
Claude Opus 5
parent
804e5377aa
commit
8c1557a79c
@@ -261,8 +261,7 @@ def memory_plan_reuse_patched(self):
|
||||
def get_graph_partition_signature_patched(
|
||||
self, partitions, skip_cudagraphs: list[bool]
|
||||
):
|
||||
"""
|
||||
Gets signature for each graph partition, including input nodes, output nodes, and
|
||||
"""Gets signature for each graph partition, including input nodes, output nodes, and
|
||||
whether deallocating an input within graph partition.
|
||||
"""
|
||||
from torch._inductor import dependencies
|
||||
@@ -276,8 +275,7 @@ def get_graph_partition_signature_patched(
|
||||
name_to_node = self.get_name_to_nodes()
|
||||
|
||||
def is_none_layout(buf_name: str) -> bool:
|
||||
"""
|
||||
Checks if buf_name is NoneLayout. Buffers with NoneLayout is not allocated
|
||||
"""Checks if buf_name is NoneLayout. Buffers with NoneLayout is not allocated
|
||||
so graph partition should not take it as inputs or outputs.
|
||||
"""
|
||||
buf = self.name_to_buf.get(buf_name, None)
|
||||
@@ -425,8 +423,7 @@ def should_partition_patched(self, node, should_log: bool = False) -> bool:
|
||||
# torch._inductor.scheduler.Scheduler.should_partition that modifies
|
||||
# the following piece of code so that we always return True:
|
||||
# https://github.com/pytorch/pytorch/blob/ecb53078faf86ca1b33277df33b82985675bb011/torch/_inductor/scheduler.py#L4712-L4724
|
||||
"""Return True if we should partition the inductor graph on this node"""
|
||||
|
||||
"""Return True if we should partition the inductor graph on this node."""
|
||||
import torch._inductor.ir as ir
|
||||
from torch._inductor.scheduler import (
|
||||
BaseSchedulerNode,
|
||||
@@ -507,8 +504,7 @@ def _update_scheduler_patched(self) -> None:
|
||||
# Copied from torch._inductor.graph.GrahLowering._update_scheduler. Patches
|
||||
# this method so that we can patch Scheduler.should_partition with the
|
||||
# function above
|
||||
"""
|
||||
(Re)initializes the scheduler member. When initializing the scheduler, no CUBIN
|
||||
"""(Re)initializes the scheduler member. When initializing the scheduler, no CUBIN
|
||||
files should be generated (to avoid biasing any benchmarks and pessimizing
|
||||
fusion decisions).
|
||||
"""
|
||||
@@ -585,7 +581,8 @@ _constrain_to_fx_strides_patched = False
|
||||
def _apply_constrain_to_fx_strides_patch():
|
||||
"""Patch lowering.constrain_to_fx_strides globally. Safe to call
|
||||
multiple times; only the first call does anything.
|
||||
Only applies for torch >= 2.11 and < 2.12."""
|
||||
Only applies for torch >= 2.11 and < 2.12.
|
||||
"""
|
||||
global _constrain_to_fx_strides_patched
|
||||
if _constrain_to_fx_strides_patched:
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user