MCPcopy Create free account
hub / github.com/NVIDIA/DALI / test_lax_workflow

Function test_lax_workflow

dali/test/python/jax_plugin/jax_server.py:49–62  ·  view source on GitHub ↗
(process_id)

Source from the content-addressed store, hash-verified

47
48
49def 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
65def run_distributed_sharing_test(sharding, process_id):

Callers 1

Calls 2

get_dali_tensor_gpuFunction · 0.70
infoMethod · 0.45

Tested by

no test coverage detected