Tom Hennigan
1becb57ac9
Add jax.copy_to_host_async(tree)
.
...
A relatively common pattern I've observed is the following:
```python
_, metrics = some_jax_function()
with profiler.Trace('compute_metrics'):
jax.block_until_ready(metrics)
with profiler.Trace('copy_to_host'):
metrics = jax.device_get(metrics)
```
We are missing an opportunity here to more eagerly begin the h2d copy of
the metrics (e.g. overlap it with closing the "compute_metrics" context
manager etc. The intention of `jax.copy_to_host_async(x)` is to make it
simple to begin h2d transfers as early as possible. Adapting the above code:
```python
_, metrics = some_jax_function()
# Begin D2H copies as early as we can.
jax.copy_to_host_async(metrics)
with profiler.Trace('compute_metrics'):
jax.block_until_ready(metrics)
with profiler.Trace('copy_to_host'):
metrics = jax.device_get(metrics)
```
PiperOrigin-RevId: 731626446
2025-02-27 01:22:15 -08:00
..
2024-12-06 10:59:11 -08:00
2019-08-05 12:34:29 -07:00
2025-02-06 21:04:30 -05:00
2024-08-28 11:04:14 -07:00
2025-02-23 08:27:56 +02:00
2025-02-18 17:01:29 +05:30
2025-01-22 15:44:11 -08:00
2025-02-24 18:52:38 -08:00
2025-02-10 09:32:07 -08:00
2024-09-20 07:52:33 -07:00
2024-11-07 21:47:50 -08:00
2024-09-05 09:27:32 +00:00
2025-01-07 15:56:23 +01:00
2025-02-23 08:27:56 +02:00
2024-12-19 11:23:43 -08:00
2024-03-07 12:40:09 -08:00
2025-02-12 15:23:06 -05:00
2025-02-12 15:23:06 -05:00
2025-02-12 15:23:06 -05:00
2025-02-03 19:09:00 -05:00
2025-02-03 19:09:00 -05:00
2025-02-03 19:09:00 -05:00
2024-08-27 15:23:13 -07:00
2024-08-27 15:23:13 -07:00
2024-09-20 07:52:33 -07:00
2024-04-08 04:48:28 -07:00
2024-08-12 18:12:17 -07:00
2021-03-08 10:44:52 -08:00
2021-04-21 11:12:41 -04:00
2025-02-20 13:14:59 -08:00
2024-09-20 07:52:33 -07:00
2025-02-12 15:23:06 -05:00
2024-11-15 12:40:41 -08:00
2024-08-28 11:22:06 -07:00
2025-02-06 15:18:11 -08:00
2025-01-06 15:19:02 -08:00
2024-08-13 11:53:57 -07:00
2024-09-23 16:03:34 -07:00
2024-09-26 08:39:30 -07:00
2025-02-06 21:04:30 -05:00
2025-01-29 11:12:32 -05:00
2024-11-14 11:07:52 -08:00
2025-01-09 11:24:40 -05:00
2025-01-09 11:24:40 -05:00
2024-09-20 23:06:54 +00:00
2024-12-06 13:41:35 -05:00
2024-12-13 11:05:31 -08:00
2024-12-19 14:47:29 -08:00
2024-11-15 13:44:31 -08:00
2024-11-15 13:44:31 -08:00
2025-02-24 17:50:29 -05:00
2024-09-20 07:52:33 -07:00
2024-06-21 14:50:49 -07:00
2024-09-20 23:06:54 +00:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2023-07-21 12:27:32 -07:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2024-01-12 22:44:48 -08:00
2025-01-27 13:03:34 -05:00
2023-01-20 11:34:29 -08:00
2023-01-18 10:59:42 -08:00
2024-03-08 10:59:06 -08:00
2024-02-13 00:56:21 +00:00
2023-05-05 11:08:18 -07:00
2024-10-31 02:21:10 -07:00
2024-10-10 12:27:53 +01:00
2024-10-10 12:27:53 +01:00
2024-10-10 12:27:53 +01:00
2023-01-18 10:59:42 -08:00
2025-01-27 13:03:34 -05:00
2024-05-14 19:11:37 -04:00
2024-05-13 13:04:15 -07:00
2025-01-17 10:17:16 -08:00
2024-12-08 17:39:24 +01:00
2024-12-10 11:11:32 -08:00
2023-12-06 09:16:43 -08:00
2023-12-06 09:16:43 -08:00
2023-12-06 09:16:43 -08:00
2024-12-29 13:06:19 +00:00
2025-01-07 07:29:38 -08:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2025-02-13 12:57:55 -08:00
2024-12-11 09:50:33 -08:00
2024-03-07 12:40:09 -08:00
2024-07-15 17:30:54 +00:00
2025-01-06 15:19:02 -08:00
2023-01-18 10:59:42 -08:00
2023-01-18 10:59:42 -08:00
2025-02-05 09:13:56 -08:00
2025-02-27 01:22:15 -08:00
2025-02-01 12:55:49 +05:00
2024-06-05 09:07:27 -07:00
2025-02-11 22:30:50 -08:00
2025-01-23 17:31:13 -08:00
2024-07-31 06:41:33 -07:00
2024-12-12 15:13:32 -08:00
2023-10-10 08:46:36 -07:00
2024-09-20 23:06:54 +00:00
2024-11-14 11:07:52 -08:00
2024-11-15 14:44:57 -08:00
2024-08-28 11:22:06 -07:00
2023-01-30 11:57:06 -08:00
2024-12-13 15:29:56 +00:00
2025-01-02 09:49:31 +01:00
2024-06-21 14:50:49 -07:00
2024-09-25 21:26:05 +05:30
2024-11-15 14:44:57 -08:00
2024-04-11 13:23:27 -07:00
2019-10-09 17:45:09 +02:00
2025-01-06 12:00:02 -08:00
2025-02-06 14:55:57 +00:00
2025-02-06 14:55:57 +00:00
2024-11-14 11:07:52 -08:00
2022-03-25 19:50:12 +00:00
2024-11-14 11:07:52 -08:00
2024-09-05 20:47:40 +02:00
2024-09-20 23:06:54 +00:00
2024-12-26 01:18:10 +00:00
2025-01-14 12:50:59 -08:00