Commit b61edcc
fix: add backward compatibility for torch.distributed use_batch param… (#64)
* fix: add backward compatibility for torch.distributed use_batch parameter
The `use_batch` kwarg for `send_object_list` and `recv_object_list` was
added in PyTorch 2.9. This change adds compatibility wrappers that detect
PyTorch version via function signature inspection and conditionally pass
the parameter, allowing the code to work with both older and newer versions.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* use torch version
* fix: use stdlib version parsing instead of packaging dependency
Replace packaging.version with manual version parsing to avoid
adding an external dependency. Handles version suffixes like
+cu121, a0, b1, rc1, etc.
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* formatting
* fix: improve use_batch detection and align defaults with PyTorch
- Use signature probe first for accurate detection on nightly/backported builds
- Fall back to version parsing if signature probe fails
- Change use_batch default to False to match PyTorch's defaults
Co-Authored-By: Claude Opus 4.5 <[email protected]>
---------
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent 189b197 commit b61edcc
1 file changed
+71
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
35 | 102 | | |
36 | 103 | | |
37 | 104 | | |
| |||
1265 | 1332 | | |
1266 | 1333 | | |
1267 | 1334 | | |
1268 | | - | |
| 1335 | + | |
1269 | 1336 | | |
1270 | 1337 | | |
1271 | 1338 | | |
| |||
1286 | 1353 | | |
1287 | 1354 | | |
1288 | 1355 | | |
1289 | | - | |
| 1356 | + | |
1290 | 1357 | | |
1291 | 1358 | | |
1292 | 1359 | | |
| |||
1331 | 1398 | | |
1332 | 1399 | | |
1333 | 1400 | | |
1334 | | - | |
| 1401 | + | |
1335 | 1402 | | |
1336 | 1403 | | |
1337 | 1404 | | |
| |||
1348 | 1415 | | |
1349 | 1416 | | |
1350 | 1417 | | |
1351 | | - | |
| 1418 | + | |
1352 | 1419 | | |
1353 | 1420 | | |
1354 | 1421 | | |
| |||
0 commit comments