From f0cb8953627ebf99ab9542c096293f491d9f35e5 Mon Sep 17 00:00:00 2001 From: generatedunixname89002005307016 Date: Fri, 6 Dec 2024 13:15:29 -0800 Subject: [PATCH] Add missing Pyre mode headers] [batch:28/1458] [shard:22/N] Differential Revision: D66867205 fbshipit-source-id: 872f92d84eb8561a95613d49638f0f6b499285ff --- tb_plugin/torch_tb_profiler/__init__.py | 2 ++ tb_plugin/torch_tb_profiler/consts.py | 2 ++ tb_plugin/torch_tb_profiler/io/__init__.py | 1 + tb_plugin/torch_tb_profiler/io/azureblob.py | 2 ++ tb_plugin/torch_tb_profiler/io/base.py | 2 ++ tb_plugin/torch_tb_profiler/io/cache.py | 2 ++ tb_plugin/torch_tb_profiler/io/file.py | 1 + tb_plugin/torch_tb_profiler/io/gs.py | 2 ++ tb_plugin/torch_tb_profiler/io/hdfs.py | 1 + tb_plugin/torch_tb_profiler/io/utils.py | 1 + tb_plugin/torch_tb_profiler/multiprocessing.py | 2 ++ tb_plugin/torch_tb_profiler/plugin.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/__init__.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/communication.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/data.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/diffrun/__init__.py | 1 + tb_plugin/torch_tb_profiler/profiler/diffrun/contract.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/diffrun/operator.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/diffrun/tree.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/event_parser.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/gpu_metrics_parser.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/kernel_parser.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/loader.py | 1 + tb_plugin/torch_tb_profiler/profiler/memory_parser.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/module_op.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/node.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/op_agg.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/op_tree.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/overall_parser.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/range_utils.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/run_generator.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/tensor_core.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/tensor_cores_parser.py | 2 ++ tb_plugin/torch_tb_profiler/profiler/trace.py | 2 ++ tb_plugin/torch_tb_profiler/run.py | 2 ++ tb_plugin/torch_tb_profiler/utils.py | 2 ++ 36 files changed, 66 insertions(+) diff --git a/tb_plugin/torch_tb_profiler/__init__.py b/tb_plugin/torch_tb_profiler/__init__.py index de4c034aa..897f29611 100644 --- a/tb_plugin/torch_tb_profiler/__init__.py +++ b/tb_plugin/torch_tb_profiler/__init__.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- +# pyre-unsafe + # Entry point for Pytorch TensorBoard plugin package. __version__ = '0.4.3' diff --git a/tb_plugin/torch_tb_profiler/consts.py b/tb_plugin/torch_tb_profiler/consts.py index df881b05a..1bd7bb8c0 100644 --- a/tb_plugin/torch_tb_profiler/consts.py +++ b/tb_plugin/torch_tb_profiler/consts.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe import re from collections import namedtuple diff --git a/tb_plugin/torch_tb_profiler/io/__init__.py b/tb_plugin/torch_tb_profiler/io/__init__.py index a3807634f..479989639 100644 --- a/tb_plugin/torch_tb_profiler/io/__init__.py +++ b/tb_plugin/torch_tb_profiler/io/__init__.py @@ -1,3 +1,4 @@ +# pyre-unsafe from .cache import Cache from .file import (BaseFileSystem, StatData, abspath, basename, download_file, exists, get_filesystem, glob, isdir, join, listdir, diff --git a/tb_plugin/torch_tb_profiler/io/azureblob.py b/tb_plugin/torch_tb_profiler/io/azureblob.py index 6c863cc5f..2f99e80d2 100644 --- a/tb_plugin/torch_tb_profiler/io/azureblob.py +++ b/tb_plugin/torch_tb_profiler/io/azureblob.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import os # pyre-fixme[21]: Could not find module `azure.storage.blob`. diff --git a/tb_plugin/torch_tb_profiler/io/base.py b/tb_plugin/torch_tb_profiler/io/base.py index d6f0a2f92..1b64402b1 100644 --- a/tb_plugin/torch_tb_profiler/io/base.py +++ b/tb_plugin/torch_tb_profiler/io/base.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import os from abc import ABC, abstractmethod from collections import namedtuple diff --git a/tb_plugin/torch_tb_profiler/io/cache.py b/tb_plugin/torch_tb_profiler/io/cache.py index 7c09d9b82..d93cdfd0c 100644 --- a/tb_plugin/torch_tb_profiler/io/cache.py +++ b/tb_plugin/torch_tb_profiler/io/cache.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import tempfile from .. import utils diff --git a/tb_plugin/torch_tb_profiler/io/file.py b/tb_plugin/torch_tb_profiler/io/file.py index 3f9af6386..a67aea21d 100644 --- a/tb_plugin/torch_tb_profiler/io/file.py +++ b/tb_plugin/torch_tb_profiler/io/file.py @@ -1,3 +1,4 @@ +# pyre-unsafe """ This file is forked from https://github.com/tensorflow/tensorboard/blob/master/tensorboard/compat/tensorflow_stub/io/gfile.py. diff --git a/tb_plugin/torch_tb_profiler/io/gs.py b/tb_plugin/torch_tb_profiler/io/gs.py index 972fa2af1..783ac7d4b 100644 --- a/tb_plugin/torch_tb_profiler/io/gs.py +++ b/tb_plugin/torch_tb_profiler/io/gs.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe # pyre-fixme[21]: Could not find module `google.cloud`. from google.cloud import storage # pyre-fixme[21]: Could not find module `google.auth`. diff --git a/tb_plugin/torch_tb_profiler/io/hdfs.py b/tb_plugin/torch_tb_profiler/io/hdfs.py index 33f368450..5ec231cca 100644 --- a/tb_plugin/torch_tb_profiler/io/hdfs.py +++ b/tb_plugin/torch_tb_profiler/io/hdfs.py @@ -1,3 +1,4 @@ +# pyre-unsafe import os # pyre-fixme[21]: Could not find module `fsspec`. diff --git a/tb_plugin/torch_tb_profiler/io/utils.py b/tb_plugin/torch_tb_profiler/io/utils.py index 79e9afc39..fa18a7186 100644 --- a/tb_plugin/torch_tb_profiler/io/utils.py +++ b/tb_plugin/torch_tb_profiler/io/utils.py @@ -1,3 +1,4 @@ +# pyre-unsafe def as_str_any(value): """Converts to `str` as `str(value)`, but use `as_str` for `bytes`. diff --git a/tb_plugin/torch_tb_profiler/multiprocessing.py b/tb_plugin/torch_tb_profiler/multiprocessing.py index b71773505..6e7f716da 100644 --- a/tb_plugin/torch_tb_profiler/multiprocessing.py +++ b/tb_plugin/torch_tb_profiler/multiprocessing.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import multiprocessing as mp import os diff --git a/tb_plugin/torch_tb_profiler/plugin.py b/tb_plugin/torch_tb_profiler/plugin.py index 851bd1442..c9b41e76f 100644 --- a/tb_plugin/torch_tb_profiler/plugin.py +++ b/tb_plugin/torch_tb_profiler/plugin.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe import atexit import gzip import json diff --git a/tb_plugin/torch_tb_profiler/profiler/__init__.py b/tb_plugin/torch_tb_profiler/profiler/__init__.py index 9ca062abf..94a898cb8 100644 --- a/tb_plugin/torch_tb_profiler/profiler/__init__.py +++ b/tb_plugin/torch_tb_profiler/profiler/__init__.py @@ -2,6 +2,8 @@ # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- +# pyre-unsafe + from .loader import RunLoader __all__ = ['RunLoader'] diff --git a/tb_plugin/torch_tb_profiler/profiler/communication.py b/tb_plugin/torch_tb_profiler/profiler/communication.py index bbc33483b..7d8a9f862 100644 --- a/tb_plugin/torch_tb_profiler/profiler/communication.py +++ b/tb_plugin/torch_tb_profiler/profiler/communication.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe from typing import Dict, List, Tuple from .. import utils diff --git a/tb_plugin/torch_tb_profiler/profiler/data.py b/tb_plugin/torch_tb_profiler/profiler/data.py index 7d957b72a..c6aeceae3 100644 --- a/tb_plugin/torch_tb_profiler/profiler/data.py +++ b/tb_plugin/torch_tb_profiler/profiler/data.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe import gzip import io as sysio import json diff --git a/tb_plugin/torch_tb_profiler/profiler/diffrun/__init__.py b/tb_plugin/torch_tb_profiler/profiler/diffrun/__init__.py index 3dae52e35..afd743dbe 100644 --- a/tb_plugin/torch_tb_profiler/profiler/diffrun/__init__.py +++ b/tb_plugin/torch_tb_profiler/profiler/diffrun/__init__.py @@ -1,3 +1,4 @@ +# pyre-unsafe from .contract import DiffStats, OpAgg from .tree import (DiffNode, compare_op_tree, diff_summary, print_node, print_ops) diff --git a/tb_plugin/torch_tb_profiler/profiler/diffrun/contract.py b/tb_plugin/torch_tb_profiler/profiler/diffrun/contract.py index ce0cba35d..b00eeebb7 100644 --- a/tb_plugin/torch_tb_profiler/profiler/diffrun/contract.py +++ b/tb_plugin/torch_tb_profiler/profiler/diffrun/contract.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe from collections import namedtuple from typing import Dict, List diff --git a/tb_plugin/torch_tb_profiler/profiler/diffrun/operator.py b/tb_plugin/torch_tb_profiler/profiler/diffrun/operator.py index cb015e44c..b5acd31c0 100644 --- a/tb_plugin/torch_tb_profiler/profiler/diffrun/operator.py +++ b/tb_plugin/torch_tb_profiler/profiler/diffrun/operator.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe from abc import ABCMeta from typing import List, Tuple, Union diff --git a/tb_plugin/torch_tb_profiler/profiler/diffrun/tree.py b/tb_plugin/torch_tb_profiler/profiler/diffrun/tree.py index 601a40307..1efc69b26 100644 --- a/tb_plugin/torch_tb_profiler/profiler/diffrun/tree.py +++ b/tb_plugin/torch_tb_profiler/profiler/diffrun/tree.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import sys from typing import Generator, List, Union diff --git a/tb_plugin/torch_tb_profiler/profiler/event_parser.py b/tb_plugin/torch_tb_profiler/profiler/event_parser.py index 7b7480f39..c3bc3ebcf 100644 --- a/tb_plugin/torch_tb_profiler/profiler/event_parser.py +++ b/tb_plugin/torch_tb_profiler/profiler/event_parser.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import sys from collections import defaultdict from enum import IntEnum diff --git a/tb_plugin/torch_tb_profiler/profiler/gpu_metrics_parser.py b/tb_plugin/torch_tb_profiler/profiler/gpu_metrics_parser.py index fcd6bfb99..4be6094a6 100644 --- a/tb_plugin/torch_tb_profiler/profiler/gpu_metrics_parser.py +++ b/tb_plugin/torch_tb_profiler/profiler/gpu_metrics_parser.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from typing import Iterable, List from .. import consts, utils diff --git a/tb_plugin/torch_tb_profiler/profiler/kernel_parser.py b/tb_plugin/torch_tb_profiler/profiler/kernel_parser.py index 838fc38ce..89dfb8ac4 100644 --- a/tb_plugin/torch_tb_profiler/profiler/kernel_parser.py +++ b/tb_plugin/torch_tb_profiler/profiler/kernel_parser.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from typing import Optional import numpy as np diff --git a/tb_plugin/torch_tb_profiler/profiler/loader.py b/tb_plugin/torch_tb_profiler/profiler/loader.py index 602cb45a7..c95c86edb 100644 --- a/tb_plugin/torch_tb_profiler/profiler/loader.py +++ b/tb_plugin/torch_tb_profiler/profiler/loader.py @@ -1,3 +1,4 @@ +# pyre-unsafe # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. diff --git a/tb_plugin/torch_tb_profiler/profiler/memory_parser.py b/tb_plugin/torch_tb_profiler/profiler/memory_parser.py index 5af855b69..91d2f578f 100644 --- a/tb_plugin/torch_tb_profiler/profiler/memory_parser.py +++ b/tb_plugin/torch_tb_profiler/profiler/memory_parser.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from collections import defaultdict from enum import IntEnum from typing import Dict, Iterable, List, Optional, Tuple diff --git a/tb_plugin/torch_tb_profiler/profiler/module_op.py b/tb_plugin/torch_tb_profiler/profiler/module_op.py index ff608df36..d790115cf 100644 --- a/tb_plugin/torch_tb_profiler/profiler/module_op.py +++ b/tb_plugin/torch_tb_profiler/profiler/module_op.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe from collections import namedtuple from typing import Dict, Generator, Iterable, List, Optional, Set, Tuple, Union diff --git a/tb_plugin/torch_tb_profiler/profiler/node.py b/tb_plugin/torch_tb_profiler/profiler/node.py index 34b7bbd21..1af74856a 100644 --- a/tb_plugin/torch_tb_profiler/profiler/node.py +++ b/tb_plugin/torch_tb_profiler/profiler/node.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import sys from abc import ABC from typing import List, Optional, Tuple diff --git a/tb_plugin/torch_tb_profiler/profiler/op_agg.py b/tb_plugin/torch_tb_profiler/profiler/op_agg.py index 8a1af502f..88222c32a 100644 --- a/tb_plugin/torch_tb_profiler/profiler/op_agg.py +++ b/tb_plugin/torch_tb_profiler/profiler/op_agg.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe import sys from collections import defaultdict from typing import Callable, Dict, List diff --git a/tb_plugin/torch_tb_profiler/profiler/op_tree.py b/tb_plugin/torch_tb_profiler/profiler/op_tree.py index 6e21f2545..288a57e01 100644 --- a/tb_plugin/torch_tb_profiler/profiler/op_tree.py +++ b/tb_plugin/torch_tb_profiler/profiler/op_tree.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe import sys from collections import defaultdict from typing import Dict, Iterable, List, Optional, Tuple diff --git a/tb_plugin/torch_tb_profiler/profiler/overall_parser.py b/tb_plugin/torch_tb_profiler/profiler/overall_parser.py index e2f30fc85..ad92b90e3 100644 --- a/tb_plugin/torch_tb_profiler/profiler/overall_parser.py +++ b/tb_plugin/torch_tb_profiler/profiler/overall_parser.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from typing import List, Tuple from .. import utils diff --git a/tb_plugin/torch_tb_profiler/profiler/range_utils.py b/tb_plugin/torch_tb_profiler/profiler/range_utils.py index c927d5acb..4299d825c 100644 --- a/tb_plugin/torch_tb_profiler/profiler/range_utils.py +++ b/tb_plugin/torch_tb_profiler/profiler/range_utils.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe from typing import List, Tuple diff --git a/tb_plugin/torch_tb_profiler/profiler/run_generator.py b/tb_plugin/torch_tb_profiler/profiler/run_generator.py index 4193816ed..738e611c6 100644 --- a/tb_plugin/torch_tb_profiler/profiler/run_generator.py +++ b/tb_plugin/torch_tb_profiler/profiler/run_generator.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from collections import OrderedDict from typing import Dict, Iterable, List diff --git a/tb_plugin/torch_tb_profiler/profiler/tensor_core.py b/tb_plugin/torch_tb_profiler/profiler/tensor_core.py index 3a69cf70b..18a7f9499 100644 --- a/tb_plugin/torch_tb_profiler/profiler/tensor_core.py +++ b/tb_plugin/torch_tb_profiler/profiler/tensor_core.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe class TC_Allowlist_Meta(type): # Enable grammar sugar as 'v in TC_Allowlist'. def __contains__(cls, item): diff --git a/tb_plugin/torch_tb_profiler/profiler/tensor_cores_parser.py b/tb_plugin/torch_tb_profiler/profiler/tensor_cores_parser.py index b4246bedc..753d9a59c 100644 --- a/tb_plugin/torch_tb_profiler/profiler/tensor_cores_parser.py +++ b/tb_plugin/torch_tb_profiler/profiler/tensor_cores_parser.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # ------------------------------------------------------------------------- + +# pyre-unsafe from typing import Dict, Iterable, List from .. import consts diff --git a/tb_plugin/torch_tb_profiler/profiler/trace.py b/tb_plugin/torch_tb_profiler/profiler/trace.py index 803e989c8..20bbc169f 100644 --- a/tb_plugin/torch_tb_profiler/profiler/trace.py +++ b/tb_plugin/torch_tb_profiler/profiler/trace.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from enum import IntEnum from typing import Dict, Optional diff --git a/tb_plugin/torch_tb_profiler/run.py b/tb_plugin/torch_tb_profiler/run.py index 72bfdcadb..d54162101 100644 --- a/tb_plugin/torch_tb_profiler/run.py +++ b/tb_plugin/torch_tb_profiler/run.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe from collections import defaultdict from typing import Any, Dict, Iterable, List, Optional, Tuple, Union diff --git a/tb_plugin/torch_tb_profiler/utils.py b/tb_plugin/torch_tb_profiler/utils.py index e75fa4f32..821883d99 100644 --- a/tb_plugin/torch_tb_profiler/utils.py +++ b/tb_plugin/torch_tb_profiler/utils.py @@ -1,6 +1,8 @@ # ------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # -------------------------------------------------------------------------- + +# pyre-unsafe import logging import math import os