Files
pytorch/docs/source
angelayi c48c6913b5 [torch.compile] Add torch.compiler.set_default_backend (#178944)
Addresses https://github.com/pytorch/pytorch/issues/178930

Allow overriding the default torch.compile backend globally so that out-of-tree backend authors don't need to pass `backend=` at every call site. Follows the same pattern as `torch.set_default_dtype` and `torch.set_default_device`. Explicit `backend= arguments to torch.compile still take precedence.

Usage:

```python
import torch

torch.compiler.set_default_backend("my_custom_backend")
compiled_model = torch.compile(model)  # uses "my_custom_backend"

torch.compiler.set_default_backend(None)
```

Pull Request resolved: https://github.com/pytorch/pytorch/pull/178944
Approved by: https://github.com/anijain2305, https://github.com/williamwen42, https://github.com/mlazos
2026-04-20 21:45:18 +00:00
..
…
2025-06-11 23:00:52 +00:00
2025-06-11 23:00:52 +00:00
2025-06-11 23:00:52 +00:00
2025-06-13 04:39:55 +00:00
2025-09-12 05:56:25 +00:00
…
2025-08-14 01:49:35 +00:00