Skip to content

Uses torch.version.cuda to compile CUDA extensions #2163

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 2 commits into from
May 2, 2025

Conversation

syed-ahmed
Copy link
Contributor

@syed-ahmed syed-ahmed commented May 2, 2025

Fixes: #2152

Tested this by installing a cpu only version of PyTorch and then running pip install -e . -vvv. "PyTorch GPU support is not available. Skipping compilation of CUDA extensions" is in the logs, confirming that the previous behavior is preserved.

Using pip 25.1 from /usr/local/lib/python3.12/dist-packages/pip (python 3.12)                 
Non-user install because site-packages writeable                                              
Created temporary directory: /tmp/pip-build-tracker-a0n8qmb2                                  
Initialized build tracking at /tmp/pip-build-tracker-a0n8qmb2                                 
Created build tracker: /tmp/pip-build-tracker-a0n8qmb2                                        
Entered build tracker: /tmp/pip-build-tracker-a0n8qmb2                                        
Created temporary directory: /tmp/pip-install-tn_td1mv                                        
Created temporary directory: /tmp/pip-ephem-wheel-cache-iflb4k6r                              
Obtaining file:///workspace/ao                                                                
  Added file:///workspace/ao to build tracker '/tmp/pip-build-tracker-a0n8qmb2'               
  Running setup.py (path:/workspace/ao/setup.py) egg_info for package from file:///workspace/a
o                                                                                             
  Created temporary directory: /tmp/pip-pip-egg-info-j4p5drqz                                 
  Running command python setup.py egg_info                                                    
  INFO:root:running egg_info                                                                  
  INFO:root:creating /tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info                          
  INFO:root:writing /tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/PKG-INFO                  
  INFO:root:writing dependency_links to /tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/depend
ency_links.txt                                                                                
  INFO:root:writing requirements to /tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/requires.t
xt                                                                                            
  INFO:root:writing top-level names to /tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/top_lev
el.txt                                                                                        
  INFO:root:writing manifest file '/tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/SOURCES.txt
'                                                                                             
  INFO:root:reading manifest file '/tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/SOURCES.txt
'                                                                                             
  INFO:root:adding license file 'LICENSE'                                                     
  INFO:root:writing manifest file '/tmp/pip-pip-egg-info-j4p5drqz/torchao.egg-info/SOURCES.txt
'                                                                                             
  PyTorch GPU support is not available. Skipping compilation of CUDA extensions

Copy link

pytorch-bot bot commented May 2, 2025

🔗 Helpful Links

🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/ao/2163

Note: Links to docs will display an error until the docs builds have been completed.

❗ 1 Active SEVs

There are 1 currently active SEVs. If your PR is affected, please view them below:

✅ No Failures

As of commit 18ad551 with merge base 43a65e2 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label May 2, 2025
@msaroufim msaroufim added the topic: not user facing Use this tag if you don't want this PR to show up in release notes label May 2, 2025
@msaroufim
Copy link
Member

Should be fine to merge if CI is green, in the meantime there does seem to be a lint issue, we use ruff

@syed-ahmed
Copy link
Contributor Author

Thanks @msaroufim for the lint!

@msaroufim msaroufim merged commit cc790b8 into pytorch:main May 2, 2025
30 checks passed
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. topic: not user facing Use this tag if you don't want this PR to show up in release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUILD][RFE] Remove torch.cuda.is_available in setup.py allowing to build CUDA extensions on CPU-only build nodes
3 participants