Uh oh!
There was an error while loading. Please reload this page.
Add TE/JAX high-level modules, unittests and examples - #54
Conversation
969d306 to
1277484Compare1277484 to
57d51a3Comparejeng1220
commented
Feb 25, 2023
@timmoon10 , |
jeng1220
commented
Feb 25, 2023
The internal pipeline is #7424183 |
timmoon10
commented
Mar 1, 2023
/te-ci |
timmoon10
left a comment
There was a problem hiding this comment.
Overall looks good. I see that Pylint is complaining about "Too few public methods", but I think it just doesn't understand that Flax modules are dataclasses. We can just suppress those warnings.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com>
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
nouiz
commented
Mar 6, 2023
The README should be updated to talk about JAX (or point to a JAX subpage). |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
@nouiz , |
…_bs. Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
timmoon10
commented
Mar 7, 2023
/te-ci |
There was a problem hiding this comment.
Looks good. I'm happy with merging once we fix the failing tests.
Running with #86, I don't see any more Pylint errors if we add # pylint: disable=too-many-function-args:
TransformerEngine/transformer_engine/jax/transformer.py
Lines 283 to 284 in 5d1c687
TransformerEngine/transformer_engine/jax/transformer.py
Lines 297 to 298 in 5d1c687
Uh oh!
There was an error while loading. Please reload this page.
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Two decoder unittests can pass in old JAX container(e.g., 23.02) but can't in latest container (devel). 1. The actual(-0.020264) and desired(-0.020386) are very close. 2. The TE kernels are not changed, the diff should come from new codegen behavior of XLA. Thus, it is a common floating-point accumulated error. Enlarge atol to avoid unittest failures. Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
1. hide amax update in custom_vjp 2. replace amax indexing with roll(using circular buffer) Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
@timmoon10 , |
timmoon10
commented
Mar 8, 2023
/te-ci |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
timmoon10
commented
Mar 8, 2023
Pylint passes for me when I run manually on this branch. The only thing remaining thing before merging is to iron out a possible correctness issue. |
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com>
Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com>
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
ksivaman
commented
Mar 9, 2023
/te-ci |
Signed-off-by: Ryan Jeng <rjeng@nvidia.com>
ksivaman
commented
Mar 9, 2023
/te-ci |
nouiz
left a comment
There was a problem hiding this comment.
In fact, can you add the make_jaxpr assert in all the tests?
| features = [256, 256, 128] | ||
| for feature in features: | ||
| x = DenseGeneral(features=feature, transpose_batch_sequence=False, | ||
| dtype=jnp.bfloat16, use_bias=True)(x) \ |
There was a problem hiding this comment.
should the dtype be fp8? What trigger the fp8 computation here?
| idx = idx + 1 | ||
| batch = {k: v[perm, ...] for k, v in train_ds.items()} | ||
| state, metrics, grads = train_step(state, variables, batch, use_fp8_dense) | ||
There was a problem hiding this comment.
Can you add an assert based on make_jaxpr and fp8 here? I'm not sure it is being used by the test.
* add transformer module , unittests and examples Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * Update tests/jax/test_sharding.py Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com> * Update transformer_engine/jax/transformer.py Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com> * remove pylint: disable=line-too-long Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * remove pylint: disable=too-many-func-args Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * Fix the wrong broadcasting dim to dropout masks when enable transpose_bs. Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * Enable 2xACC for WGRAD and DGRAD by default Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * rename LayerNormMlpBlock as LayerNormMLP Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * refactor to avoid line-too-long Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * rename amax_history_size to amax_history_len Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * align dropout mask to TE/PyTorch as default Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * enlarge atol for decoder unittests Two decoder unittests can pass in old JAX container(e.g., 23.02) but can't in latest container (devel). 1. The actual(-0.020264) and desired(-0.020386) are very close. 2. The TE kernels are not changed, the diff should come from new codegen behavior of XLA. Thus, it is a common floating-point accumulated error. Enlarge atol to avoid unittest failures. Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * Adding Amax History Support 1. hide amax update in custom_vjp 2. replace amax indexing with roll(using circular buffer) Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * move kernel_init to __post_init__ Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * refactor encoder examples Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * Update transformer_engine/jax/fp8.py Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com> * Update transformer_engine/jax/fp8.py Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com> * remove envvar regarding 2xACC Signed-off-by: Ryan Jeng <rjeng@nvidia.com> * remove unused import Signed-off-by: Ryan Jeng <rjeng@nvidia.com> --------- Signed-off-by: Ryan Jeng <rjeng@nvidia.com> Signed-off-by: Jeng Bai-Cheng <jeng1220@users.noreply.github.com> Co-authored-by: Tim Moon <4406448+timmoon10@users.noreply.github.com> Co-authored-by: Ming-Xu Huang <mingh@nvidia.com> Co-authored-by: Kirthi Shankar Sivamani <ksivamani@nvidia.com> Signed-off-by: Charlene Yang <charleney@nvidia.com>
[Header change] Remove the `cudnn_backend.h` dependency, since the correct header is already included in cudnn.h
Add TE/JAX high-level modules and API
Add TE/JAX unittests to cover high-level API
Add TE/JAX exampels
TE/JAX bugfix