1. 20 Oct, 2022 1 commit
  2. 06 Oct, 2022 1 commit
  3. 03 Oct, 2022 1 commit
  4. 01 Oct, 2022 1 commit
  5. 28 Sep, 2022 1 commit
    • Matthew Yu's avatar
      support pytorch checkpoint as teacher model using config · dc176d58
      Matthew Yu authored
      Summary:
      Pull Request resolved: https://github.com/facebookresearch/d2go/pull/371
      
      In a previous iteration of this diff, we were specifying the teacher model in the same config as the student model, something like:
      ```
      # config.py
      MODEL:
        FBNET_V2:
        ...
      DISTILLATION:
        TEACHER:
          MODEL:
            FBNET_V2:
            ...
            WEIGHTS: /path/to/teacher/weights
      ...
      ```
      
      This leads to some oddities in the code, like we have to have a default config that adds all the required keys in the distillation teacher model.
      
      In this diff, we just let the user supply a teacher config (and optionally runner_name and overwrite opts) and use the supplied runner to build the model:
      ```
      # new_config.py
      MODEL:
        FBNET_V2:
      ...
      DISTILLATION:
        TEACHER:
          CONFIG_FNAME: /path/to/teacher/config
          RUNNER_NAME:
      ...
      ```
      
      This should make it very easy to specify the teacher as the user could potentially just reuse the trained_config generated in d2go.
      
      Reviewed By: newstzpz
      
      Differential Revision: D37640041
      
      fbshipit-source-id: 088a636c96f98279c9a04e32d1674f703451aec3
      dc176d58
  6. 31 Aug, 2022 2 commits
  7. 12 Aug, 2022 1 commit
  8. 27 Jul, 2022 2 commits
  9. 26 Jul, 2022 1 commit
  10. 19 Jul, 2022 1 commit
  11. 14 Jul, 2022 1 commit
  12. 13 Jul, 2022 1 commit
  13. 08 Jul, 2022 1 commit
    • Yanghan Wang's avatar
      prepare_for_quant_convert -> custom_covert_fx · 97904ba4
      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
      97904ba4
  14. 06 Jul, 2022 1 commit
  15. 02 Jul, 2022 1 commit
  16. 29 Jun, 2022 1 commit
  17. 24 Jun, 2022 1 commit
    • Yanghan Wang's avatar
      use runner class instead of instance outside of main · 8051775c
      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
      8051775c
  18. 21 Jun, 2022 1 commit
  19. 20 Jun, 2022 1 commit
  20. 17 Jun, 2022 1 commit
  21. 16 Jun, 2022 1 commit
    • Matthew Yu's avatar
      add modeling hook algo and helper · f3fc01aa
      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
      f3fc01aa
  22. 10 Jun, 2022 1 commit
    • John Reese's avatar
      apply new formatting config · 0900aeba
      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
      0900aeba
  23. 09 Jun, 2022 1 commit
  24. 05 Jun, 2022 2 commits
  25. 02 Jun, 2022 2 commits
  26. 28 May, 2022 1 commit
  27. 27 May, 2022 1 commit
  28. 25 May, 2022 1 commit
  29. 21 May, 2022 1 commit
  30. 20 May, 2022 1 commit
  31. 17 May, 2022 3 commits
  32. 15 May, 2022 1 commit
    • John Reese's avatar
      apply import merging for fbcode (7 of 11) · b3a9204c
      John Reese authored
      Summary:
      Applies new import merging and sorting from µsort v1.0.
      
      When merging imports, µsort will make a best-effort to move associated
      comments to match merged elements, but there are known limitations due to
      the diynamic nature of Python and developer tooling. These changes should
      not produce any dangerous runtime changes, but may require touch-ups to
      satisfy linters and other tooling.
      
      Note that µsort uses case-insensitive, lexicographical sorting, which
      results in a different ordering compared to isort. This provides a more
      consistent sorting order, matching the case-insensitive order used when
      sorting import statements by module name, and ensures that "frog", "FROG",
      and "Frog" always sort next to each other.
      
      For details on µsort's sorting and merging semantics, see the user guide:
      https://usort.readthedocs.io/en/stable/guide.html#sorting
      
      Reviewed By: lisroach
      
      Differential Revision: D36402205
      
      fbshipit-source-id: a4efc688d02da80c6e96685aa8eb00411615a366
      b3a9204c
  33. 14 May, 2022 1 commit
  34. 12 May, 2022 1 commit
    • John Reese's avatar
      formatting changes from black 22.3.0 · e1623106
      John Reese authored
      Summary:
      Applies the black-fbsource codemod with the new build of pyfmt.
      
      paintitblack
      
      Reviewed By: lisroach
      
      Differential Revision: D36324783
      
      fbshipit-source-id: 280c09e88257e5e569ab729691165d8dedd767bc
      e1623106