NVIDIA / TransformerEngine

A library for accelerating Transformer models on NVIDIA GPUs, including using 8-bit floating point (FP8) precision on Hopper and Ada GPUs, to provide better performance with lower memory utilization in both training and inference.
https://docs.nvidia.com/deeplearning/transformer-engine/user-guide/index.html
Apache License 2.0
1.61k stars 256 forks source link

[JAX] Rewrite the Format of FP8 Meta and Remove unused ShardingTypes. #842

Closed mingxu1067 closed 3 weeks ago

mingxu1067 commented 1 month ago

Description

Reformatted FP8 meta to one set per tensor, removed fp8_max and scale_inv from the set of FP8 meta, and deleted unused functions and types.

Fixes # (issue) To avoid unnecessary slice of FP8 meta then unblock pipeliner to re-schedule the collectives.

Type of change

Changes

Please list the changes introduced in this PR:

  1. Reformat FP8 meta to be one-set-per-tensor.
  2. Remove fp8_max and scale_inv from FP8 meta set.
  3. Remove unused functions in fp8.py, like update_fp8_metas.
  4. Remove unused ShardingType and MajorShardingType.

Checklist:

mingxu1067 commented 1 month ago

/te-ci jax

mingxu1067 commented 1 month ago

/te-ci jax

nouiz commented 1 month ago

Can you tell what speed up you see with this PR?

mingxu1067 commented 1 month ago

/te-ci jax

nouiz commented 1 month ago

@denera As this PR is removed some old API not used, we need to have that documented in the next release. Is there a place we need to add them to be sure to be included in the next releases?

mingxu1067 commented 1 month ago

/te-ci jax

mingxu1067 commented 1 month ago

/te-ci jax

phu0ngng commented 1 month ago

LGTM 👍. Would be interesting to see the diff in performance if any.

mingxu1067 commented 1 month ago

Change to Draft for waiting internal verifiy

mingxu1067 commented 3 weeks ago

/te-ci jax