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

Keep track of ViewMeta with symbolic inputs. #125876

Closed
wants to merge 6 commits into from

Commits on May 9, 2024

  1. Keep track of ViewMeta with symbolic inputs.

    Fix: #125387
    
    This PR helps keep track of whether an instantiated `ViewMeta` has symbolic values as
    input or not. This is used for checking whether we use the AOTAutograd `ViewMeta`-replay
    execution path, e.g. it doesn't support tensors that have `ViewMeta` with symbolic inputs.
    
    In summary, the changes are:
    
    - Add the field `ViewMeta::has_symbolic_inputs` and make it a required constructor
    parameter
    - Add the field `FunctionalTensorWrapper::is_symbolic_` and the method
    `FunctionalTensorWrapper::maybe_mark_symbolic`
        - Marks a `FunctionalTensorWrapper` as symbolic iff any of its `ViewMeta` have
        symbolic inputs
    - Add the plumbing of `FunctionalTensorWrapper::is_symbolic` to the Python API
    - Codegen the computation of `ViewMeta::has_symbolic_inputs` for each view operation
    - Use the AOTAutograd `ViewMeta`-replay path if:
        - `target_functional_tensor` is not `None`; and
        - `target_functional_tensor` is not symbolic (instead of using a functorch config)
    
    [ghstack-poisoned]
    ysiraichi committed May 9, 2024
    Configuration menu
    Copy the full SHA
    acf4187 View commit details
    Browse the repository at this point in the history
  2. Update on "Keep track of ViewMeta with symbolic inputs."

    Fix: #125387
    
    This PR helps keep track of whether an instantiated `ViewMeta` has symbolic values as
    input or not. This is used for checking whether we use the AOTAutograd `ViewMeta`-replay
    execution path, e.g. it doesn't support tensors that have `ViewMeta` with symbolic inputs.
    
    In summary, the changes are:
    
    - Add the field `ViewMeta::has_symbolic_inputs` and make it a required constructor
    parameter
    - Add the field `FunctionalTensorWrapper::is_symbolic_` and the method
    `FunctionalTensorWrapper::maybe_mark_symbolic`
        - Marks a `FunctionalTensorWrapper` as symbolic iff any of its `ViewMeta` have
        symbolic inputs
    - Add the plumbing of `FunctionalTensorWrapper::is_symbolic` to the Python API
    - Codegen the computation of `ViewMeta::has_symbolic_inputs` for each view operation
    - Use the AOTAutograd `ViewMeta`-replay path if:
        - `target_functional_tensor` is not `None`; and
        - `target_functional_tensor` is not symbolic (instead of using a functorch config)
    
    cc bdhirsh miladm lezcano 
    
    [ghstack-poisoned]
    ysiraichi committed May 9, 2024
    Configuration menu
    Copy the full SHA
    0334f6c View commit details
    Browse the repository at this point in the history

Commits on May 10, 2024

  1. Update on "Keep track of ViewMeta with symbolic inputs."

    Fix: #125387
    
    This PR helps keep track of whether an instantiated `ViewMeta` has symbolic values as
    input or not. This is used for checking whether we use the AOTAutograd `ViewMeta`-replay
    execution path, e.g. it doesn't support tensors that have `ViewMeta` with symbolic inputs.
    
    In summary, the changes are:
    
    - Add the field `ViewMeta::has_symbolic_inputs` and make it a required constructor
    parameter
    - Add the field `FunctionalTensorWrapper::is_symbolic_` and the method
    `FunctionalTensorWrapper::maybe_mark_symbolic`
        - Marks a `FunctionalTensorWrapper` as symbolic iff any of its `ViewMeta` have
        symbolic inputs
    - Add the plumbing of `FunctionalTensorWrapper::is_symbolic` to the Python API
    - Codegen the computation of `ViewMeta::has_symbolic_inputs` for each view operation
    - Use the AOTAutograd `ViewMeta`-replay path if:
        - `target_functional_tensor` is not `None`; and
        - `target_functional_tensor` is not symbolic (instead of using a functorch config)
    
    cc bdhirsh miladm lezcano 
    
    [ghstack-poisoned]
    ysiraichi committed May 10, 2024
    Configuration menu
    Copy the full SHA
    c84eaf6 View commit details
    Browse the repository at this point in the history
  2. Update on "Keep track of ViewMeta with symbolic inputs."

    Fix: #125387
    
    This PR helps keep track of whether an instantiated `ViewMeta` has symbolic values as
    input or not. This is used for checking whether we use the AOTAutograd `ViewMeta`-replay
    execution path, e.g. it doesn't support tensors that have `ViewMeta` with symbolic inputs.
    
    In summary, the changes are:
    
    - Add the field `ViewMeta::has_symbolic_inputs` and make it a required constructor
    parameter
    - Add the field `FunctionalTensorWrapper::is_symbolic_` and the method
    `FunctionalTensorWrapper::maybe_mark_symbolic`
        - Marks a `FunctionalTensorWrapper` as symbolic iff any of its `ViewMeta` have
        symbolic inputs
    - Add the plumbing of `FunctionalTensorWrapper::is_symbolic` to the Python API
    - Codegen the computation of `ViewMeta::has_symbolic_inputs` for each view operation
    - Use the AOTAutograd `ViewMeta`-replay path if:
        - `target_functional_tensor` is not `None`; and
        - `target_functional_tensor` is not symbolic (instead of using a functorch config)
    
    cc bdhirsh miladm lezcano 
    
    [ghstack-poisoned]
    ysiraichi committed May 10, 2024
    Configuration menu
    Copy the full SHA
    d17ebeb View commit details
    Browse the repository at this point in the history
  3. Rebase. on "Keep track of ViewMeta with symbolic inputs."

    Fix: #125387
    
    This PR helps keep track of whether an instantiated `ViewMeta` has symbolic values as
    input or not. This is used for checking whether we use the AOTAutograd `ViewMeta`-replay
    execution path, e.g. it doesn't support tensors that have `ViewMeta` with symbolic inputs.
    
    In summary, the changes are:
    
    - Add the field `ViewMeta::has_symbolic_inputs` and make it a required constructor
    parameter
    - Add the field `FunctionalTensorWrapper::is_symbolic_` and the method
    `FunctionalTensorWrapper::maybe_mark_symbolic`
        - Marks a `FunctionalTensorWrapper` as symbolic iff any of its `ViewMeta` have
        symbolic inputs
    - Add the plumbing of `FunctionalTensorWrapper::is_symbolic` to the Python API
    - Codegen the computation of `ViewMeta::has_symbolic_inputs` for each view operation
    - Use the AOTAutograd `ViewMeta`-replay path if:
        - `target_functional_tensor` is not `None`; and
        - `target_functional_tensor` is not symbolic (instead of using a functorch config)
    
    cc bdhirsh miladm lezcano 
    
    [ghstack-poisoned]
    ysiraichi committed May 10, 2024
    Configuration menu
    Copy the full SHA
    c05d19d View commit details
    Browse the repository at this point in the history
  4. Fix lint issues. on "Keep track of ViewMeta with symbolic inputs."

    Fix: #125387
    
    This PR helps keep track of whether an instantiated `ViewMeta` has symbolic values as
    input or not. This is used for checking whether we use the AOTAutograd `ViewMeta`-replay
    execution path, e.g. it doesn't support tensors that have `ViewMeta` with symbolic inputs.
    
    In summary, the changes are:
    
    - Add the field `ViewMeta::has_symbolic_inputs` and make it a required constructor
    parameter
    - Add the field `FunctionalTensorWrapper::is_symbolic_` and the method
    `FunctionalTensorWrapper::maybe_mark_symbolic`
        - Marks a `FunctionalTensorWrapper` as symbolic iff any of its `ViewMeta` have
        symbolic inputs
    - Add the plumbing of `FunctionalTensorWrapper::is_symbolic` to the Python API
    - Codegen the computation of `ViewMeta::has_symbolic_inputs` for each view operation
    - Use the AOTAutograd `ViewMeta`-replay path if:
        - `target_functional_tensor` is not `None`; and
        - `target_functional_tensor` is not symbolic (instead of using a functorch config)
    
    cc bdhirsh miladm lezcano 
    
    [ghstack-poisoned]
    ysiraichi committed May 10, 2024
    Configuration menu
    Copy the full SHA
    143ded4 View commit details
    Browse the repository at this point in the history