"examples/vscode:/vscode.git/clone" did not exist on "ba2ca4be6d20f9e661d396a8b3b76182b960cfc5"
- 08 Jul, 2022 2 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/325 `prepare_for_quant_convert` is a confusing name because it only does `convert`, there's no "prepare" in it. It's actually for fx only, because eager mode always calls `torch.quantization.convert`, there's no way to customize it. So just call this `custom_convert_fx`. The new name is also unique in fbcode, so easy to do codemod later on. This diff simply does the renaming by biggrep + replace. Reviewed By: jerryzh168 Differential Revision: D37676717 fbshipit-source-id: e7d05eaafddc383dd432986267c945c8ebf94df4
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/327 Fix the bug for not leaving avgpool quantized when its input is quantized. This is not captured by CI because currently we set `small_pooler_resolution` to True to make test running faster, but this skips the `avgpool` everytime. Reviewed By: jerryzh168 Differential Revision: D37706151 fbshipit-source-id: fde9a190324a23b97ba803e000f4caa54f6f3738
-
- 06 Jul, 2022 2 commits
-
-
Mircea Cimpoi authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/324 Fixes bug introduced in D37600026 (https://github.com/facebookresearch/d2go/commit/1a18ba3420e3c823accf731a11c0a91dc3babd85) -- forgot to fix imports after moving modelinghook to registry/builtin.py Differential Revision: D37646330 fbshipit-source-id: cb763d65e7bbfd07eea6eff61727a42a6fcfbc88
-
Mircea Cimpoi authored
Summary: Moving MODELING_HOOK_REGISTRY to `d2go/registry/builtin.py`, so that bootstrap works with modeling hook registry. This fixes the detectron2 vs mobile_cv registry. Reviewed By: wat3rBro Differential Revision: D37600026 fbshipit-source-id: 7aa8cdec3b5eaea89d9db6fc35c7389cc9fb3193
-
- 02 Jul, 2022 1 commit
-
-
Jerry Zhang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/321 Following up the bc-breaking change from fx graph mode quantization: https://github.com/pytorch/pytorch/pull/76496 that added example_inputs to prepare_fx and prepare_qat_fx, we fixes the callsite related to mobile-vision and exposed extra example_inputs in some apis Reviewed By: wat3rBro Differential Revision: D37163018 fbshipit-source-id: 9f0bb56659345d174a39b6d3bb4408caa553b88d
-
- 30 Jun, 2022 2 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/320 MCV/D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go's `launch` now supports `kwargs`, which matches elastic launch. Let's always use `args=(cfg, output_dir, runner_name)` for all the binaries, and use `kwargs` for remaining binary arguments (which matches the `extra_args` in FBL's OperatorArgument). Reviewed By: sstsai-adl Differential Revision: D37535145 fbshipit-source-id: 9767e8d71421d2262aee1fd4b9019758aa4a6bbd
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/319 follow up on D37500599 (https://github.com/facebookresearch/d2go/commit/668b7ac29b0afb55d5923e72fe4f6428e5c85cbd), move lightning_train_net part of D37367360 to this diff. Reviewed By: sstsai-adl Differential Revision: D37534370 fbshipit-source-id: 7f48942a14ce16a9a9540b189441b540ce4f4b25
-
- 29 Jun, 2022 2 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/318 Reviewed By: mcimpoi Differential Revision: D37501246 fbshipit-source-id: 6dbe5dcbaf7454f451d4a3bb3fa2d856cc87d5cc
-
Sam Tsai authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/317 1. Add eval-only only option in similar fashion with train_net 2. Use output_dir from config is not specified via command line Reviewed By: wenliangzhao2018 Differential Revision: D37500599 fbshipit-source-id: 00c5804d08a449def3cc15fff49e27066d01f229
-
- 28 Jun, 2022 2 commits
-
-
Bo (YANG, Bo) Yang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/316 As title. Reviewed By: wenliangzhao2018 Differential Revision: D37259150 fbshipit-source-id: 6b69d4bcc8706bf50dbbe3655b306d1d9cbfbdca
-
Yanghan Wang authored
Summary: X-link: https://github.com/facebookresearch/mobile-vision/pull/92 Pull Request resolved: https://github.com/facebookresearch/d2go/pull/314 We may import d2go first, which populates some builtin meta archs in registry, then do the bootstrap. Reviewed By: mcimpoi Differential Revision: D37427101 fbshipit-source-id: 00e53bf0d2e327a90d5dfbc23ef2f4daa6ddfc63
-
- 27 Jun, 2022 1 commit
-
-
Mik Vyatskov authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/315 This method is no longer needed given the there's a better alternative: save/load_binary_output. Reviewed By: tglik, wat3rBro Differential Revision: D37307668 fbshipit-source-id: 598a6d7aeb68f65fa6b42a230175c37d19fd7798
-
- 24 Jun, 2022 3 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/313 It's not natural to put runner's default config functions under `d2go/utils/`, move them to `d2go/runner/config_defaults.py` and clean things up. This also reduce the inter-sub-package dependencies. Reviewed By: mattcyu1 Differential Revision: D37407078 fbshipit-source-id: 432644bee4f12306a14bac3dba76ced08b3683aa
-
Mik Vyatskov authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/309 Right now multiple machines can try to write to the same output file, since they get the same argument. Additionally, on the same machine, several outputs can be saved which requires unncessary unpacking. This change makes train_net only write output of the rank 0 trainer. Reviewed By: wat3rBro Differential Revision: D37310084 fbshipit-source-id: 9d5352a274e8fb1d2043393b12896d402333c17b
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/312 As discussed, we decided to not use runner instance outside of `main`, previous diffs already solved the prerequisites, this diff mainly does the renaming. - Use runner name (str) in the fblearner, ML pipeline. - Use runner name (str) in FBL operator, MAST and binary operator. - Use runner class as the interface of main, it can be either the name of class (str) or actual class. The main usage should be using `str`, so that the importing of class happens inside `main`. But it's also a common use case to import runner class and call `main` for things like ad-hoc scripts or tests, supporting actual class makes it easier modify code for those cases (eg. some local test class doesn't have a name, so it's not feasible to use runner name). Reviewed By: newstzpz Differential Revision: D37060338 fbshipit-source-id: 879852d41902b87d6db6cb9d7b3e8dc55dc4b976
-
- 22 Jun, 2022 2 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/310 One step towards using runner class across board. This is also need for supporting LazyConfig (which is runner-less) Reviewed By: mcimpoi Differential Revision: D37294926 fbshipit-source-id: f6dfc0a1103bac328ac7b337ce3aaefd5d8d85b4
-
Matthew Yu authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/311 Update d2go default configs to load the distillation configs. Reviewed By: newstzpz Differential Revision: D36820131 fbshipit-source-id: 010c4f64547fa66b97cb83637a0f20d3d841738a
-
- 21 Jun, 2022 2 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/303 Reviewed By: mcimpoi Differential Revision: D37220449 fbshipit-source-id: 04985a4b0129ef37aa42534cdb5f3f8d3f6abf00
-
Andrew Or authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/308 D37088095 made BC breaking changes in PyTorch, but missed fixing a few callsites. This is the second diff to fix the affected tests. Reviewed By: jerryzh168, wat3rBro Differential Revision: D37282853 fbshipit-source-id: 945c3628f53cefd2fbc2526630d1567a2b1cee25
-
- 20 Jun, 2022 1 commit
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/305 One benefit of having separate registries for D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb) and D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go's meta-arch is that there's no need to patch original D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)'s meta arch because we can just register new meta arch in D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go directly. This diff removes the `patch_d2_meta_arch` and makes things simpler. Reviewed By: mcimpoi Differential Revision: D37246483 fbshipit-source-id: c8b7adef1fa7a5ff2f89c376c7e3b39bec8f19ee
-
- 18 Jun, 2022 2 commits
-
-
Tsahi Glik authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/297 X-link: https://github.com/facebookresearch/mobile-vision/pull/84 Add command line arg to specify whether and where to save results. This is useful where binaries are being launched from another process, or remotely on another machine. Reviewed By: wat3rBro Differential Revision: D37157955 fbshipit-source-id: 2a48cf967f6cf928049f2be41952834e1dd2a04d
-
Tsahi Glik authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/302 Fixing issue introduced in D35035813 (https://github.com/facebookresearch/d2go/commit/744d72d73b7103b8dd9ca69372a179b44ad7d733) that break the OSS cli tools defined in https://github.com/facebookresearch/d2go/blob/8098d160c0b38b796a2c164719650a50238a0f89/setup.py#L87-L92. The cli alias in setup need a function without any args to call. So creating a new main_cli function Reviewed By: wat3rBro Differential Revision: D37210948 fbshipit-source-id: efb3df15e9933c617414a727e5b53553db170622
-
- 17 Jun, 2022 3 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/298 Reviewed By: tglik, newstzpz Differential Revision: D37152248 fbshipit-source-id: 58a6899c5f6465f36961a2ebf60a64f20509cec2
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/294 Reviewed By: newstzpz Differential Revision: D37083291 fbshipit-source-id: 2dcf7952021f3b905d2558228862e83afe839675
-
Andrew Or authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/304 D37088095 made BC breaking changes in PyTorch, but missed fixing a few callsites. Reviewed By: jerryzh168 Differential Revision: D37223157 fbshipit-source-id: 5ca806253f880c49f77ce583fac5b3407eb422b1
-
- 16 Jun, 2022 8 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/271 - set `get_default_cfg = None` to opt-in this new feature. - support config with `_DEFAULTS_` when loading config file. Note that we don't check explicitly `"_DEFAULTS_" in config file` but check `runner.get_default_cfg == None`, this is because runner having `get_default_cfg` and config having `_DEFAULTS_` should be mutually exclusive, and `load_full_config_from_file` can raise proper error if `_DEFAULTS_` is missing. - we also need to save `_DEFAULTS_` in the diff config. Reviewed By: tglik Differential Revision: D36868581 fbshipit-source-id: e0e19309c3df5a85383ce1454b321a68d0868dc4
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/237 Reviewed By: tglik Differential Revision: D35954531 fbshipit-source-id: b69c8065928fe385d29f20f2c2460d60d63fca00
-
Matthew Yu authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/299 This implements the first iteration of generalized distillation in D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go. The functionality is separated into the following: => Adding distillation functionality without user changing their meta architecture: class DistillationModelingHook * This is an implementation detail that we hide from the user. * We use dynamic mixin to specify additional functionality to the user's model. In this way, the original (student) model retains all attributes but the mixin class will override the forward (and provide more functionality like teacher updates). * Teacher build currently only supports loading a torchscript model, pytorch compatiblity in later diffs => Implementing distillation methods class DistillationAlgorithm * The user can use some default algorithm (e.g., LabelDistillation) or create their own. This is where we specify the overrided forward func of the model and any other distillation requirements (updating the weights of the teacher model). * The basic LabelDistillation allows a user to use a teacher model during training to relabel the gt => User customization class DistillationHelper * This is what we expect the user to customize. As an example the user probably needs to write their own pseudo_labeler to take batched_inputs and relabel this with the teacher Both DistillationHelper and DistillationAlgorithm use a registry so that users can add their customization in their own code and use these customizations by specifying in the config Reviewed By: newstzpz Differential Revision: D36708227 fbshipit-source-id: bc427c5d42d0c7ff4d839bf10782efac24dea107
-
Miquel Jubert Hermoso authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/229 *This diff is part of a stack which has the goal of "buckifying" D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go core and enabling autodeps and other tooling. The last diff in the stack introduces the TARGETS. The diffs earlier in the stack are resolving circular dependencies and other issues which prevent the buckification from occurring.* This diff changes the import paths being rerouted in the d2go package. Instead of local-importing the package, which creates a buck circular dependency, we can hardcode the top-level path. We know it is fixed because we are defining it with base_module. For the other packages it can remain as-is. Also add some dependencies annotations in preparation for the buckification, with manual. Reviewed By: wat3rBro Differential Revision: D35928513 fbshipit-source-id: 756c95740bab519e8093d254bcee64692e1a1b98
-
Mik Vyatskov authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/301 This is a follow-up of earlier work to extract part responsible for the centrally defined parameters from the helper in train_net closer to where the parameters are defined. Reviewed By: tglik Differential Revision: D37176212 fbshipit-source-id: 226415f36f4872ac3d9ba41541b4389a18cc11e6
-
Mircea Cimpoi authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/296 Extract the model quantization logic to separate function. +minor cleanup (remove unused imports, f-strings) Reviewed By: wat3rBro Differential Revision: D36999434 fbshipit-source-id: 7aad64921b8cdf8779527c19b077ee788403c6b8
-
Yanghan Wang authored
Summary: X-link: https://github.com/facebookresearch/mobile-vision/pull/86 Pull Request resolved: https://github.com/facebookresearch/d2go/pull/300 Similar to `elastic_launch`, make `launch` return results for all ranks, this is beneficial for cases where each rank having different return value`. There'll be some test failing for V1, it'll help finding related callsites. Reviewed By: tglik Differential Revision: D37016935 fbshipit-source-id: eb989342c0ddd642c8369b5dddfa8aac8cb38917
-
Shiyu Dong authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/288 Add a new call function to handle adhoc datasets that needs to be called with dataset_name. This is mainly to handle the incompatibility of `extend_coco_load` function with AdhocDataset For example, * if we choose to register `extend_coco_load` function as CallFuncWithJsonFile, AdhocDataset will register the same function, while failed to update the `dataset_name` argument passed to `extended_coco_load`. * If we choose to register `extend_coco_load` function normally, we couldn't use the `LOAD_KWARGS` that specifies additional fields like `image_direct_copy_keys` when register AdhocDatasets Therefore adding the new function allows to update register function with specifying new json as well as new dataset_name in the same time. Reviewed By: sstsai-adl Differential Revision: D37100742 fbshipit-source-id: 93f4a7ac23f95812aca80c40872b15f92d449da0
-
- 15 Jun, 2022 4 commits
-
-
Mik Vyatskov authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/290 When running through torchx, converting from arguments to CLI arguments is necessary. Reviewed By: wat3rBro Differential Revision: D37086938 fbshipit-source-id: d17c4e36bece8eb02955263181789b71e3483a40
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/295 `requires_config_file=False` is only used for `caffe2_int8_converter.py` and `caffe2_evaluator.py`. Both are deprecated, therefore drop the support. Reviewed By: tglik Differential Revision: D37120584 fbshipit-source-id: 477a1c4d3be813c678f1e2a772211d1742f5ad3c
-
Mik Vyatskov authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/289 Right now configs are written to a dedicated folder after training, one file per model config. This PR introduces a new function that allows to read model configs in the same format, for the situations where the configs cannot be passed back directly, e.g. when running through torchx. Reviewed By: wat3rBro Differential Revision: D37086940 fbshipit-source-id: 3938381bcf48a8069fb4b840fd2c2d052e983c6c
-
Bo (YANG, Bo) Yang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/275 As title. Reviewed By: wenliangzhao2018 Differential Revision: D35381566 fbshipit-source-id: 6da3346428fa6692748dc39653aff79f45ad3497
-
- 14 Jun, 2022 3 commits
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/293 In order to pass runner during the workflow using "runner name" instead of runner instance, we need to make sure the `get_default_cfg` is not instance method. It can be either staticmethod or classmethod, but I choose classmethod for better inheritance. code mode using following script: ``` #!/usr/bin/env python3 import json import os import subprocess result = subprocess.check_output("fbgs --json 'def get_default_cfg('", shell=True) fbgs = json.loads(result) fbsource_root = os.path.expanduser("~") def _indent(s): return len(s) - len(s.lstrip()) def resolve_instance_method(content): lines = content.split("\n") for idx, line in enumerate(lines): if "def get_default_cfg(self" in line: indent = _indent(line) # find the class for j in range(idx, 0, -1): if lines[j].startswith(" " * (indent - 4) + "class "): class_line = lines[j] break else: raise RuntimeError("Can't find class") print("class_line: ", class_line) if "Runner" in class_line: # check self if not used for j in range(idx + 1, len(lines)): if _indent(lines[j]) < indent: break assert "self" not in lines[j], (j, lines[j]) # update the content assert "def get_default_cfg(self)" in line lines[idx] = lines[idx].replace( "def get_default_cfg(self)", "def get_default_cfg(cls)" ) lines.insert(idx, " " * indent + "classmethod") return "\n".join(lines) return content def resolve_static_method(content): lines = content.split("\n") for idx, line in enumerate(lines): if "def get_default_cfg()" in line: indent = _indent(line) # find the class for j in range(idx, 0, -1): if "class " in lines[j]: class_line = lines[j] break else: print("[WARNING] Can't find class!!!") continue if "Runner" in class_line: # check staticmethod is used for j in range(idx, 0, -1): if lines[j] == " " * indent + "staticmethod": staticmethod_line_idx = j break else: raise RuntimeError("Can't find staticmethod") # update the content lines[idx] = lines[idx].replace( "def get_default_cfg()", "def get_default_cfg(cls)" ) lines[staticmethod_line_idx] = " " * indent + "classmethod" return "\n".join(lines) return content for result in fbgs["results"]: filename = os.path.join(fbsource_root, result["file_name"]) print(f"processing: {filename}") with open(filename) as f: content = f.read() orig_content = content while True: old_content = content content = resolve_instance_method(content) content = resolve_static_method(content) if content == old_content: break if content != orig_content: print("Updating ...") with open(filename, "w") as f: f.write(content) ``` Reviewed By: tglik Differential Revision: D37059264 fbshipit-source-id: b09d5518f4232de95d8313621468905cf10a731c
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/285 `setup_after_launch` can now take `DefaultTask` as well (the `runner_or_task` can still be `None`, for runner-less train_net). Reviewed By: tglik Differential Revision: D37011560 fbshipit-source-id: ce8a88242df0a16de8da97d94e8eb7def524c69c
-
Sam Tsai authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/282 Writing the of the converted coco file needs to be synced since the file is used by COCOEval. The whole function could be called multiple times by main thread so need to add additional checks to see if dataset has been previous called. Reviewed By: wat3rBro Differential Revision: D36957778 fbshipit-source-id: 5f9c5c038c13cbe24132ef1b44f6e94d5a26b66a
-