Skip to content

v1.10.1: CUDA Compile Fixes & Memory Reduction

Latest

Choose a tag to compare

@Borda Borda released this 07 Sep 11:50

RF-DETR 1.10.1 is a patch release: compile=True now actually reaches CUDA's torch.compile path under the default multi_scale=True recipe, and peak CUDA memory in segmentation loss drops by sampling ground-truth masks one image at a time. It also carries several device-sync and strategy-selection fixes for the still-experimental, undocumented TPU/XLA training path (tracked under issue #1058) — see Notable Changes below. No breaking changes in this release.

✨ Spotlights

compile=True now actually compiles on CUDA with the default multi_scale=True

The compile gate previously excluded multi-scale training, but the exclusion sat behind checks that already required a CUDA device and CUDA accelerator — so it only ever blocked the CUDA path, where dynamic=True already handles the varying input size. Setting compile=True on a default recipe previously logged a notice and trained eagerly instead. (#1436; #1411, shipped in 1.10.0, made compilation reachable in the first place)

from rfdetr import RFDETRSmall

model = RFDETRSmall()
model.train(dataset_dir="...", compile=True)  # multi_scale=True by default — now actually compiles on CUDA

💾 Reduced peak CUDA memory in segmentation loss

For multi-image CUDA batches with boolean ground-truth masks, sampling now happens one image at a time, releasing each image's float masks before the next, instead of concatenating a batch-wide float mask tensor. Narrower inputs (single-image batches, non-CUDA, non-bool masks) keep the prior concat path unchanged. (#1437)

🔄 Migration guide

No breaking changes in this release. One thing to know: if you call dice_loss_jit / sigmoid_ce_loss_jit directly — not part of the public API, only reachable through rfdetr.models.lwdetr's backward-compat re-exports — most NumPy scalar denominators now need casting to float first. See MIGRATION.md for details.

📝 Notable changes

🔧 Fixed

  • compile=True now takes effect on CUDA with the default multi_scale=True, instead of previously logging a notice and training eagerly. Also fixes the now-stale multi_scale=False claim in the COCO2017 training cookbook. (#1436; #1411, shipped in 1.10.0, made compilation reachable in the first place)
  • Reduced peak CUDA memory in segmentation loss by sampling matched ground-truth masks one image at a time, for multi-image CUDA batches with boolean masks. (#1437)
  • Docs site: the version banner no longer flags the current release as outdated. (#1429)
  • TPU/XLA training (experimental, undocumented): point_sample(mode="nearest") no longer leaves the device on MPS/XLA (#1432, issue #1058); SetCriterion.loss_masks no longer syncs its normalizing denominator to the host, with a side effect that dice_loss_jit/sigmoid_ce_loss_jit — reachable only through lwdetr.py's backward-compat re-exports, not the public API — now reject most NumPy scalar denominators (#1428, issue #1058); build_trainer now selects XLAStrategy for multi-device XLA/TPU training when strategy="auto", previously a crash at Trainer construction, and changes the precision-plugin path for single-device accelerator="auto" XLA runs too (#1427, issue #1058); XLA-marked tests pass on real TPU silicon (#1426, issue #1058).

🏆 Contributors

  • Jesús Royeth (@JESUSROYETH): all six code/test fixes in this release — the compile=True/CUDA multi-scale fix, reduced peak CUDA memory in segmentation loss, and the experimental TPU/XLA device-sync, strategy-selection, and test-suite fixes.
  • Jirka Borovec (@Borda, LinkedIn): fixed the docs-site version banner falsely flagging the current release as outdated, and this release's own prep.

Full changelog: 1.10.0...1.10.1