MCPcopy Create free account
hub / github.com/pytorch/pytorch / key_of

Method key_of

torch/_inductor/select_algorithm.py:960–981  ·  view source on GitHub ↗

Extract the pieces of an ir.Buffer that we should invalidate cached autotuning results on.

(node)

Source from the content-addressed store, hash-verified

958
959 @staticmethod
960 def key_of(node):
961 """
962 Extract the pieces of an ir.Buffer that we should invalidate cached
963 autotuning results on.
964 """
965 sizevars = V.graph.sizevars
966 return (
967 node.get_device().type,
968 str(node.get_dtype()),
969 *sizevars.size_hints(
970 node.get_size(),
971 fallback=config.unbacked_symint_fallback,
972 ),
973 *sizevars.size_hints(
974 node.get_stride(),
975 fallback=config.unbacked_symint_fallback,
976 ),
977 sizevars.size_hint(
978 node.get_layout().offset,
979 fallback=config.unbacked_symint_fallback,
980 ),
981 )
982
983
984_ALGORITHM_SELECTOR_CACHE = None

Callers 1

__call__Method · 0.95

Calls 7

size_hintsMethod · 0.80
get_deviceMethod · 0.45
get_dtypeMethod · 0.45
get_sizeMethod · 0.45
get_strideMethod · 0.45
size_hintMethod · 0.45
get_layoutMethod · 0.45

Tested by

no test coverage detected