(process_id)
| 47 | |
| 48 | |
| 49 | def test_lax_workflow(process_id): |
| 50 | array_from_dali = dax.integration._to_jax_array(get_dali_tensor_gpu(1, (1), np.int32), False) |
| 51 | |
| 52 | assert ( |
| 53 | dax.integration._jax_device(array_from_dali) == jax.local_devices()[0] |
| 54 | ), "Array should be backed by the device local to current process." |
| 55 | |
| 56 | sum_across_devices = jax.pmap(lambda x: jax.lax.psum(x, "i"), axis_name="i")(array_from_dali) |
| 57 | |
| 58 | assert sum_across_devices[0] == len( |
| 59 | jax.devices() |
| 60 | ), "Sum across devices should be equal to the number of devices as data per device = [1]" |
| 61 | |
| 62 | log.info("Passed lax workflow test") |
| 63 | |
| 64 | |
| 65 | def run_distributed_sharing_test(sharding, process_id): |
no test coverage detected