- 
                Notifications
    You must be signed in to change notification settings 
- Fork 706
Use pinned commit PyTorch on CI instead of nightly #6564
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
                    Changes from 6 commits
      Commits
    
    
            Show all changes
          
          
            9 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      38bf48e
              
                Use pinned commit PyTorch on CI instead of nightly
              
              
                huydhn 364d3be
              
                Need to use a default value
              
              
                huydhn d45886d
              
                Fix CI failures
              
              
                huydhn 3260158
              
                Update PT pin
              
              
                huydhn a4c3188
              
                Fix libstdc++ installation
              
              
                huydhn 6a1753e
              
                Use a higher timeout for some jobs
              
              
                huydhn 2a8b480
              
                Fix review comments
              
              
                huydhn 3d41e75
              
                Minor format fix
              
              
                huydhn f3ce7ef
              
                Add back the comment
              
              
                huydhn File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -1 +1 @@ | ||
| bd5482c7c3e1197e10c46ff739027f917d9c1fcc | ||
| 23d590e518688f96e1d1947a08e9ca27df3e67e4 | 
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
  
    
      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
    
  
  
    
              
              
  
    
      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
    
  
  
    
              | Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|  | @@ -69,6 +69,7 @@ def python_is_compatible(): | |||||
| EXECUTORCH_BUILD_PYBIND = "OFF" | ||||||
| CMAKE_ARGS = os.getenv("CMAKE_ARGS", "") | ||||||
| CMAKE_BUILD_ARGS = os.getenv("CMAKE_BUILD_ARGS", "") | ||||||
| USE_PYTORCH_NIGHTLY = True | ||||||
|  | ||||||
| for arg in sys.argv[1:]: | ||||||
| if arg == "--pybind": | ||||||
|  | @@ -90,6 +91,11 @@ def python_is_compatible(): | |||||
| shutil.rmtree(d, ignore_errors=True) | ||||||
| print("Done cleaning build artifacts.") | ||||||
| sys.exit(0) | ||||||
| elif arg == "--use-pt-pinned-commit": | ||||||
| # This option is used in CI to make sure that PyTorch build from the pinned commit | ||||||
| # is used instead of nightly. CI jobs wouldn't be able to catch regression from the | ||||||
| # latest PT commit otherwise | ||||||
| USE_PYTORCH_NIGHTLY = False | ||||||
| else: | ||||||
| print(f"Error: Unknown option {arg}") | ||||||
| sys.exit(1) | ||||||
|  | @@ -111,12 +117,22 @@ def python_is_compatible(): | |||||
| # The pip repository that hosts nightly torch packages. | ||||||
| TORCH_NIGHTLY_URL = "https://download.pytorch.org/whl/nightly/cpu" | ||||||
|  | ||||||
| # pip packages needed by exir. | ||||||
| EXIR_REQUIREMENTS = [ | ||||||
| f"torch==2.6.0.{NIGHTLY_VERSION}", | ||||||
| f"torchvision==0.20.0.{NIGHTLY_VERSION}", # For testing. | ||||||
| "typing-extensions", | ||||||
| ] | ||||||
| if USE_PYTORCH_NIGHTLY: | ||||||
| # pip packages needed by exir. | ||||||
| EXIR_REQUIREMENTS = [ | ||||||
| f"torch==2.6.0.{NIGHTLY_VERSION}", | ||||||
|          | ||||||
| f"torch==2.6.0.{NIGHTLY_VERSION}", | |
| f"torch==2.6.0.{NIGHTLY_VERSION}" if USE_PYTORCH_NIGHTLY else "torch", | 
Maybe this is cleaner, so you don't have to specify other packages in both branches?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, good idea, that looks nicer indeed
        
          
              
                  huydhn marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
                  huydhn marked this conversation as resolved.
              
              
                Outdated
          
            Show resolved
            Hide resolved
        
      
      Oops, something went wrong.
        
    
  
  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.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch. Thanks for making it match pyproject.toml https://github.com/pytorch/executorch/blob/main/pyproject.toml#L58-L60