Skip to content

Commit 9da3d4f

Browse files
authored
add sharding notes (#197)
1 parent 5e64c8b commit 9da3d4f

3 files changed

Lines changed: 22 additions & 0 deletions

File tree

cuequivariance_jax/cuequivariance_jax/segmented_polynomials/segmented_polynomial.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,14 @@ def segmented_polynomial(
146146
... )
147147
>>> y.shape
148148
(10, 80)
149+
150+
151+
.. note::
152+
This operation uses a custom CUDA kernel for performance. When using this function
153+
on multiple devices, manual sharding is required to achieve proper performance.
154+
Without explicit sharding, performance will be significantly degraded. See
155+
`JAX shard_map documentation <https://docs.jax.dev/en/latest/notebooks/shard_map.html>`_
156+
for details on manual parallelism.
149157
"""
150158

151159
if method == "":

cuequivariance_jax/cuequivariance_jax/triangle/_triangle_attention.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,13 @@ def triangle_attention(
6161
6262
where :math:`Q`, :math:`K`, and :math:`V` are the query, key, and value tensors,
6363
:math:`M` is the mask bias, and :math:`T` is the triangle bias.
64+
65+
.. note::
66+
This operation uses a custom CUDA kernel for performance. When using this function
67+
on multiple devices, manual sharding is required to achieve proper performance.
68+
Without explicit sharding, performance will be significantly degraded. See
69+
`JAX shard_map documentation <https://docs.jax.dev/en/latest/notebooks/shard_map.html>`_
70+
for details on manual parallelism.
6471
"""
6572
return triangle_attention_custom_vjp(
6673
q, k, v, bias, mask, scale=scale, precision=precision

cuequivariance_jax/cuequivariance_jax/triangle/_triangle_multiplicative_update.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,13 @@ def triangle_multiplicative_update(
239239
... )
240240
>>> print(output_256.shape)
241241
(2, 3, 128, 128, 256)
242+
243+
.. note::
244+
This operation uses a custom CUDA kernel for performance. When using this function
245+
on multiple devices, manual sharding is required to achieve proper performance.
246+
Without explicit sharding, performance will be significantly degraded. See
247+
`JAX shard_map documentation <https://docs.jax.dev/en/latest/notebooks/shard_map.html>`_
248+
for details on manual parallelism.
242249
"""
243250
# Input validation
244251
if direction not in ["outgoing", "incoming"]:

0 commit comments

Comments
 (0)