Migrating to PyTorch v2.10.0
Version v2.10.0 introduces 6 breaking changes. This guide details how to update your code.
Released: 1/21/2026
⚠️ Check Your Code
If you use any of these symbols, you need to read this guide:
torch.compiletorch.utils.data.datapipes.iter.groupingtorch.utils.data.datapipes.iter.shardingnn.attention.flex_attentiontorch.onnx.exporttorch.distributed.device_meshtorch.jittorch.profiler.export_memory_timelinetorch.cuda.memory._record_memory_historytorch.cuda.memory._export_memory_snapshottorch.condtorch.distributed._local_tensorLocalTensorMode@maybe_run_for_local_tensorBreaking Changes
●Issue #1
Removed unused `data_source` argument from Sampler. If you have a custom sampler using this argument, please update it.
●Issue #2
Removed deprecated imports for `torch.utils.data.datapipes.iter.grouping`. Import `SHARDING_PRIORITIES`, `ShardingFilterIterDataPipe` from `torch.utils.data.datapipes.iter.sharding` instead.
●Issue #3
Removed Nested Jagged Tensor support from `nn.attention.flex_attention`.
●Issue #4
`fallback=False` is now the default in `torch.onnx.export`. To preserve 2.9 behavior, manually set `fallback=True` in the `torch.onnx.export` call.
●Issue #5
The ONNX exporter now uses the `dynamo=True` option without fallback by default. This is the recommended usage.
●Issue #6
Renamed `pytorch-triton` package to `triton`.
Migration Steps
- 1If using a custom sampler that utilizes the `data_source` argument, remove its usage.
- 2Update imports for grouping datapipes: change `from torch.utils.data.datapipes.iter.grouping import ...` to import from `torch.utils.data.datapipes.iter.sharding`.
- 3If using `torch.onnx.export`, replace usage of `dynamic_axes` with the `dynamic_shapes` argument.
- 4If using `torch.profiler.export_memory_timeline`, migrate to using `torch.cuda.memory._record_memory_history` and `torch.cuda.memory._export_memory_snapshot`.
- 5If relying on implicit device mesh slicing behavior that generated a warning, update code to explicitly manage flattened mesh bookkeeping.
- 6Replace usage of `torch.jit` APIs with `torch.compile` or `torch.export`.
Release Summary
PyTorch 2.10 introduces Python 3.14 support for torch.compile, new features like combo-kernels fusion and LocalTensor for distributed debugging, and removes several deprecated or legacy functionalities across ONNX, Dataloader, and nn modules.
Need More Details?
View the full release notes and all changes for PyTorch v2.10.0.
View Full Changelog