mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Migrate Inductor scheduler, dependencies, ir, and codegen/common to use OrderedSet (#130004)
Python's set is non deterministic. There is an internal failure which we recently ran into which did not consistently fail. See, repro here: P1453035092. Now, with these changes, it does consistently fail. In follow ups we could also consider adding a lintrule for uses of either set() or set literals. Pull Request resolved: https://github.com/pytorch/pytorch/pull/130004 Approved by: https://github.com/oulgen
This commit is contained in:
committed by
PyTorch MergeBot
parent
bcd1d2e832
commit
f32ab3b9e3
@ -5,6 +5,7 @@ import pathlib
|
||||
from typing import Any, List
|
||||
|
||||
from torch._inductor.metrics import get_metric_table, is_metric_table_enabled
|
||||
from torch.utils._ordered_set import OrderedSet
|
||||
|
||||
from .. import config
|
||||
from ..codecache import get_path, TritonFuture
|
||||
@ -219,11 +220,11 @@ class MultiKernel:
|
||||
|
||||
@property
|
||||
def removed_buffers(self):
|
||||
return set.intersection(*[k.removed_buffers for k in self.kernels])
|
||||
return OrderedSet.intersection(*[k.removed_buffers for k in self.kernels])
|
||||
|
||||
@property
|
||||
def inplaced_to_remove(self):
|
||||
return set.intersection(*[k.inplaced_to_remove for k in self.kernels])
|
||||
return OrderedSet.intersection(*[k.inplaced_to_remove for k in self.kernels])
|
||||
|
||||
@property
|
||||
@cache_on_self
|
||||
|
Reference in New Issue
Block a user