fix: use module attributes to check if cuda is available.#13731
fix: use module attributes to check if cuda is available.#13731lalala-233 wants to merge 1 commit into
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe pull request modifies the CUDA memory allocation configuration logic in 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. Tip 💬 Introducing Slack Agent: The best way for teams to turn conversations into code.Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.
Built for teams:
One agent for your entire SDLC. Right inside Slack. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Current cuda check relies on
"+cu"in__version__, which intorch/version.pyComfyUI/cuda_malloc.py
Lines 66 to 82 in 9c34f5f
However, some
PyTorchbuilds don't have"+cu+"in__version__though cuda is available. Here is myversion.pyI don't know if it is caused by Arch Linux's re-packaging or
torchupdate its__version__logic. But it seems better to use module attributes to directly check if cuda is available.But I'm only test on my machine. I don't know if others'
version.pyare like us, so please check it before merging.This same fix was first submitted to comfy-aimdo (see Comfy-Org/comfy-aimdo#44).