Comments (4)
Thanks @spzala. I upgraded PyTorch from 2.2.1+cu121
to 2.3.0
, then torch.get_default_device() works as shown below:
import torch
torch.set_default_device(device='cuda:0')
torch.get_default_device() # device(type='cuda', index=0)
torch.__version__ # 2.3.0
from pytorch.
I am going to close this since it looks like it was solved on newer versions of pytorch
from pytorch.
@hyperkai hello, with the latest main
(torch.__version__
2.4.0a0+git7899034), I couldn't reproduce the error. I get the output cuda:0
when print(torch.get_default_device())
Please verify and if you are okay, we can close this issue. Thanks!
from pytorch.
Thanks for the quick reply and verifying with the newer version @hyperkai !! @drisspg sounds good to me, thank you!!
from pytorch.
Related Issues (20)
- [ONNX] metadata
- ERROR: Could not find a version that satisfies the requirement torch (from versions: none) HOT 1
- fatal: not a git repository: '.git' HOT 1
- `store_param_remainders` from Apex DistributedFusedAdam
- Unify async_save and sync_save in state_dict_saver from distributed checkpointing
- Segmentation fault when importing `sklearn.model_selection` HOT 2
- Should `torch.Size` convert np.ndarrays to lists of ints? HOT 1
- torch.topk results differ on CPU and CUDA
- Tensors of the same index must be on the same device and the same dtype except step tensors that can be CPU and float32 notwithstanding. HOT 4
- A UserWarning occurs after CBAM attention is added HOT 2
- DISABLED test_large_mmaped_weights_non_abi_compatible_cuda (__main__.AOTInductorTestNonABICompatibleCuda) HOT 1
- Tensor Parallel cannot work when tp mesh size is 1 HOT 2
- No way to config profiling scope in torch.autograd.profile
- Comparing dynamic shapes fails with KeyError HOT 1
- lacking checking for ConvTranspose's parameters when running with GPUs
- Migrate `CalculateSmallVectorDefaultInlinedElements` to constexpr Function for SmallVector HOT 1
- [BUG] torch.linalg.lstsq returning wrong result. HOT 3
- RuntimeError: grid_sampler_2d_cpu not implemented for Half HOT 3
- make_graphed_callables don't work with FSDP at all even on a simple network HOT 3
- Inconsistent gradients of Conv2d layers when training the same model using CPU and GPU HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch.