Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
device='auto' should select the fastest possible device #576
Comments
|
I think this is from the offical pytorch documentation, maybe it's okay to leave it as is? |
|
Hi @ottonemo & @BenjaminBossan , I would be quite interested in creating a PR for this issue if this is something that you decide you want to have. |
|
I don't see the feature as strictly necessary but would be okay with it being added. @ottonemo @thomasjpfan any opinions on that? If this change is made, I would suggest to keep the default as is. Also, @BenAjayiObe, please have a look at this function we introduced: Lines 128 to 136 in 09be626 The functionality should be added there. However, this function is not used consistently in our codebase each time we cast, this would need to be fixed. What I did wonder: Should we also allow the option to set device to |
|
Thanks for the info @BenjaminBossan , that's very helpful. What would be the use case for preventing casting? |
I can imagine that some people would like to have complete control over it, say run part of the model on cpu and part of it on gpu. If we force the casting, this could be annoying to them. |
Definitely a good idea.
Well I made the suggestion, so I'm in favor (although this is strictly a small convenience feature). Leaving the default as is sounds good to me. As long as the feature doesn't blow up complexity too much it is fine with me. |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.

I see the code
repeated often in user code. Maybe we should introduce
device='auto'exactly for this case?