Summary
Convert test/optim/test_swa_utils.py from manual torch.cuda.is_available() guards to instantiate_device_type_tests so SWA utility tests run on all registered device backends (CPU, CUDA, MPS, OpenReg, XPU).
- Split
test_averaged_model_all_devicesintotest_averaged_model_same_device(device-generic) andtest_averaged_model_cross_device(@onlyAccelerator) - Gate
test_averaged_model_mixed_devicewith@onlyAccelerator, replace.cuda()with.to(device) - Refactor
_test_update_bnhelper: replacecudaboolean withdeviceparameter - Make
test_update_bn_dnn/test_update_bn_cnnacceptdevice, use.to(device)for model placement - Add
@onlyCPUto 4 tests that don't need multi-device coverage (state_dict, picklable, exponential, eval_momentum) - Add
instantiate_device_type_tests(TestSWAUtils, globals(), allow_mps=True)intest_optim.py
Test plan
- Full SWA test suite passed on CUDA: 25 passed, 11 skipped, 0 failed
test_averaged_model_same_deviceruns and passes on both CPU and CUDAtest_averaged_model_cross_deviceruns on CUDA, correctly skips on CPUtest_averaged_model_mixed_deviceruns on CUDA, correctly skips on CPUtest_update_bn_dnn/test_update_bn_cnnrun on both CPU and CUDA- CPU-only tests (
@onlyCPU) correctly skip on CUDA
Pull Request resolved: , https://github.com/jbschlosser
Community-Analysen & Experten-Meinungen 0
Verwandte Story-Cluster & Quellen (Vektor-KI)
Ähnliche Beiträge
Auch interessante Nachrichten trunk/3a96a1cabff36a3fd760468c7ac7ed095ca6561e: [Test] Make TestSWAUtils device-generic in test_swa_utils.py (#183874)
Thematisch verwandte Begriffe: trunk3a96a1cabff36a3fd760468c7ac7ed095ca6561e, Test, Make, TestSWAUtils · 6 Treffer
🚨 Typosquatting packages on PyPI are targeting 𝗿𝗲𝗾𝘂𝗲𝘀𝘁𝘀, one of the most widely used Python packages. Catch them before compromise.
iOS app intermittently fails with “An SSL error has occurred” for some users — AWS backend with only an A record
[webapps] Langflow 1.10.0 - RCE
How I Turned Self-XSS into Reflected XSS (and Bypassed the WAF)
[webapps] C-MOR 6.0104 - Cross-Site Scripting (XSS)
[webapps] PodcastGenerator 3.2.9 - Stored XSS
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
Beiträge werden geladen ...
Videos werden geladen ...
SOCIAL SHARE CARD GENERATOR