- 
                Notifications
    You must be signed in to change notification settings 
- Fork 146
Allow aliases for run_opt #1141
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
          
     Merged
      
      
    
                
     Merged
            
            
          Conversation
  
    
      This file contains hidden or 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
    
  
  
    
    | Codecov Report❌ Patch coverage is  
 Additional details and impacted files@@           Coverage Diff           @@
##             main    #1141   +/-   ##
=======================================
  Coverage   91.64%   91.65%           
=======================================
  Files          83       83           
  Lines        6440     6481   +41     
=======================================
+ Hits         5902     5940   +38     
- Misses        538      541    +3     
 Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
 | 
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 8, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 1. Modify add() to accept this and add a new optional aliases List[str] that will store this. 2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg. Differential Revision: D84157870
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 8, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 1. Modify add() to accept this and add a new optional aliases List[str] that will store this. 2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg. Differential Revision: D84157870
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 9, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 1. Modify add() to accept this and add a new optional aliases List[str] that will store this. 2. Modify resolve() to check if a different alias is already used in cfg i.e if the "run_as" and "Run_As" are aliases for the same one, we dont allow for both to be present in the cfg. Differential Revision: D84157870
a5a9be2    to
    3f66cd6      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 9, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. 1. Add a new dict to maintain alias to key values that can be used by `opt.get(name)` 2. Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. 3. Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. 4. Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
3f66cd6    to
    8056935      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 9, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
8056935    to
    d4bcff2      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
d4bcff2    to
    56a3ed7      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
56a3ed7    to
    b688071      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `RunOptAlias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
b688071    to
    d60c13c      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
d60c13c    to
    c197595      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
c197595    to
    809006f      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
4761f4b    to
    3514284      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 10, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Differential Revision: D84157870
3159f21    to
    e8b0ada      
    Compare
  
    Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Reviewed By: kiukchung Differential Revision: D84157870
e8b0ada    to
    ab7048c      
    Compare
  
    
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 13, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Reviewed By: kiukchung Differential Revision: D84157870
    
  AbishekS 
      added a commit
        to AbishekS/torchx
      that referenced
      this pull request
    
      Oct 13, 2025 
    
    
      
  
    
      
    
  
Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Reviewed By: kiukchung Differential Revision: D84157870
    
  kiukchung 
      pushed a commit
      that referenced
      this pull request
    
      Oct 16, 2025 
    
    
      
  
    
      
    
  
* Allow aliases for run_opt (#1141) Summary: Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt. * Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt. * Add a new dict to maintain alias to key values that can be used by `opt.get(name)` * Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values. * Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg. * Modify get to look at the alias to primary_key dict as well. Reviewed By: kiukchung Differential Revision: D84157870 * Add deprecated_aliases to runopt and add warning (#1142) Summary: Similar to `runopt.alias` lets introduce and use `runopt.deprecated`. This will warn the user with a`UserWarning` when the user uses that specific name and suggests the primary one instead. Reviewed By: kiukchung Differential Revision: D84180061 * Use auto aliasing for cases for the runopt (#1143) Summary: Introduces enum for auto aliasing based on casing for the runopt nam ``` class AutoAlias(IntEnum): snake_case = 0x1 SNAKE_CASE = 0x2 camelCase = 0x4 ``` So user can extend name to be used as ``` opts.add( ["job_priority", runopt.AutoAlias.camelCase], type_=str, help="run as user", ) opts.add( [ "model_type_name", runopt.AutoAlias.camelCase | runopt.AutoAlias.SNAKE_CASE, ], type_=str, help="run as user", ) ``` This should automatically produce additional aliases of `jobPriority` to `job_priority` and produce `modelTypeName` and `MODEL_TYPE_NAME` for `model_type_name` Reviewed By: kiukchung Differential Revision: D84192560
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      Labels
      
    CLA Signed
  This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. 
  
    fb-exported
  
    meta-exported
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Summary:
Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt.
Differential Revision: D84157870