-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add ignored_dims config for single factor matrix enablement
Summary: This diff adds a new configuration option called `ignored_dims` to `PreconditionerConfig`; this option allows the user to specify which dimensions of the matrix should be ignored when computing the preconditioner. Note that `PreconditionerConfig.ignored_dims` is not compatible with `inv_root_override`, and we plan to merge `inv_root_override` into `PreconditionerConfig.amortized_computation_config.exponent_multiplier` as `Preconditioner.exponent_override`, a list of float, representing that exponent overrides for each order of tensors. Given `Preconditioner.exponent_override=[e1, e2, ..., ep]`, then we will use ^e1 for 1-D tensors (vectors), ^e2 for 2-D tensors (matrices), and so on; when `ei=0` as the exponent for i-dimensional tensors which should result in no preconditioning for all i-dimensional tensors. On the other hands, setting `i in Preconditioner.ignored_dims` only results no preconditioning for i-th dimension for all tensors (if their orders are >= i). For example, if `Preconditioner.exponent_override=[0.5, 0.0, 0.25]` and `Preconditioner.ignored_dims=[0, 2]`, this means no preconditioning 1-D tensors (due to `0 in Preconditioner.ignored_dims` even though setting `Preconditioner.exponent_override[0]=0.5` is redundant), no preconditioning for 2-D tensors (due to `Preconditioner.exponent_override[1]=0.0`), and precondition the first and the second dimensions with ^0.25 (due to `Preconditioner.exponent_override[2]=0.25`) and no preconditioning the third dimension (due to `2 in Preconditioner.ignored_dims`) for 3-D tensors. Pair-programmed with runame. Reviewed By: anana10c Differential Revision: D70198403 fbshipit-source-id: 6ba4f84461cc32c185cac949b74c6cd51b33e795
- Loading branch information
1 parent
947ceec
commit 66f348c
Showing
7 changed files
with
341 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.