Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add jit.ignore to prototype optimizers #2958

Closed
wants to merge 1 commit into from
Closed

Commits on Aug 9, 2024

  1. Add jit.ignore to prototype optimizers

    Summary:
    `torch.compile` doesn't seem to cause errors if we deprecate an optimizer that is no longer used, but `torch.jit.script` will. `torch.jit.script` seems to check and ensure all decision branches are alive. See [simplified Bento example](https://fburl.com/anp/rbktkl08)
    
    To make prototype optimizers easily deprecated once included in production, we wrap the invoker function with `torch.jit.ignore`. This means that we need to always keep auto-generating the `lookup_{}.py` even the optimizers are deprecated and their backends are removed.
    
    **Usage**
    Add  `"is_prototype_optimizer": True` for the optimizer in `/codegen/genscript/optimizers.py`
    Example:
    ```
    def ensemble_rowwise_adagrad_optimizer:
       return {
          "optimizer": "ensemble_rowwise_adagrad",
          "is_prototype_optimizer": True,
       }
    ```
    
    Reviewed By: q10
    
    Differential Revision: D60943180
    spcyppt authored and facebook-github-bot committed Aug 9, 2024
    Configuration menu
    Copy the full SHA
    bf2ea1e View commit details
    Browse the repository at this point in the history