- 22 Jun, 2022 1 commit
-
-
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 4 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
-
Yanghan Wang authored
Summary: X-link: https://github.com/facebookresearch/mobile-vision/pull/83 Pull Request resolved: https://github.com/facebookresearch/d2go/pull/292 Reviewed By: tglik, newstzpz Differential Revision: D37116726 fbshipit-source-id: 9956fe19916521b4fb512207512861afe4f09148
-
- 13 Jun, 2022 2 commits
-
-
Peizhao Zhang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/291 Allow AUTO_SCALING_METHODS to be empty. Reviewed By: tglik, wat3rBro Differential Revision: D36887643 fbshipit-source-id: 1391ddccfc46389b3f412295fa6540f81bf76368
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/287 In previous D36798327 (https://github.com/facebookresearch/d2go/commit/1f45cf04c69c63f51387b073ae931832b7a9510f), we still have 7 files which have exception during bootstrap. Instead of tweaking the the mock logic to support those scenarios, since they're all related to import-time computation, I think it's reasonable to "delay" those computations, therefore this diff introduces the `lazy_func` decorator, which delays it for bootstrap. After this change, now all files are be bootstrapped without exception, next step we'll change `catch_exception` to False and put a unit test on this to prevent committing code that is not bootstrap-able. Reviewed By: tglik Differential Revision: D36814147 fbshipit-source-id: e344a5ccee76b1d9962117d300926a88c066e051
-
- 10 Jun, 2022 3 commits
-
-
John Reese authored
Summary: pyfmt now specifies a target Python version of 3.8 when formatting with black. With this new config, black adds trailing commas to all multiline function calls. This applies the new formatting as part of rolling out the linttool-integration for pyfmt. paintitblack Reviewed By: zertosh, lisroach Differential Revision: D37084377 fbshipit-source-id: 781a1b883a381a172e54d6e447137657977876b4
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/286 Support cache for registry bootstrap. Reviewed By: tglik Differential Revision: D36798475 fbshipit-source-id: 5f32093d6d8d1d1db896d6b2567ddd0187d66248
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/284 X-link: https://github.com/facebookresearch/mobile-vision/pull/78 Support setting global timeout and helper function to custom timeout locally. Reviewed By: newstzpz, Cysu Differential Revision: D36797768 fbshipit-source-id: cbf6d52b6b5296f3ee3f6512c467b957c440b025
-
- 09 Jun, 2022 1 commit
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/274 X-link: https://github.com/facebookresearch/mobile-vision/pull/76 TLDR: this diff consolidate the `distributed_helper` of `mobile_cv`, it (together with `mobile_cv`'s `comm` module) should be the TOGO library for dealing with DDP. D2 (https://github.com/facebookresearch/d2go/commit/87374efb134e539090e0b5c476809dc35bf6aedb)Go's `distributed` is now built on-top of `mobile_cv`'s `distributed_helper`. Reviewed By: newstzpz Differential Revision: D36787336 fbshipit-source-id: 640c9dcff5eec534e7894c75cfdf0a12d21c297e
-
- 08 Jun, 2022 1 commit
-
-
Yanghan Wang authored
Summary: X-link: https://github.com/facebookresearch/mobile-vision/pull/81 Pull Request resolved: https://github.com/facebookresearch/d2go/pull/283 - add `MoreMagicMock`, which handles inheritance and comparison. - also support lazy registering mocked objects (has to be `MoreMagicMock`). - don't need to skip `skip files that doesn't contain ".register()" call` since we can handle most files pretty well now. - also mock the open - delay the import for `from detectron2.utils.testing import assert_instances_allclose`; for some reason python is doing magic things if you import anything starting with `assert`, so the mocked import doesn't work. - makes log function nicer. Reviewed By: tglik Differential Revision: D36798327 fbshipit-source-id: ccda7e7583b95a24f3dde1bbe0468593dacb8663
-
- 07 Jun, 2022 1 commit
-
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/281 Reviewed By: tglik Differential Revision: D36414433 fbshipit-source-id: fc9aa5ff23b0a8cdc4ff3acdc8438a0577bf65ec
-
- 06 Jun, 2022 3 commits
-
-
Anthony Dito authored
Summary: Looks like an import changed, this changes it in the ipynb notebook example. > Attached screenshot of this working now in collab.  Pull Request resolved: https://github.com/facebookresearch/d2go/pull/276 Reviewed By: zhanghang1989 Differential Revision: D36921926 fbshipit-source-id: e623b61633fb09fc25fa91d23555c62002045933
-
Yanghan Wang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/280 T122435829 Reviewed By: zhanghang1989 Differential Revision: D36904298 fbshipit-source-id: 335c4cce199426b5f3b37cb2bfac04106e36ecd6
-
Facebook Community Bot authored
Co-authored-by:Facebook Community Bot <6422482+facebook-github-bot@users.noreply.github.com>
-
- 05 Jun, 2022 2 commits
-
-
Peizhao Zhang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/277 Support cfg_diff for mismatched keys. Reviewed By: wat3rBro Differential Revision: D36737254 fbshipit-source-id: a1c189c92a24f3c109d9a427f135e53876b91624
-
Peizhao Zhang authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/259 Added randaug and trivialaug to d2go. * Only apply to images. Reviewed By: wat3rBro Differential Revision: D36605753 fbshipit-source-id: f72ea6f3de65ab115e4c6612343e93a092cbd7ea
-
- 03 Jun, 2022 2 commits
-
-
Zecheng He authored
Summary: Pull Request resolved: https://github.com/facebookresearch/d2go/pull/269 Add deterministic instance option in RandomInstanceCrop. This feature can be useful for two-step model evaluation as every time we make the cropped instance deterministic. Reviewed By: wat3rBro Differential Revision: D36850404 fbshipit-source-id: ba6c0d9df0849e0110037f9d839b1c48f48096ad
-
snowytiger authored
-