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

[Common] Added JIT-compiled fused cast transpose kernels #903

Closed Oleg-Goncharov closed 3 weeks ago

Oleg-Goncharov commented 3 weeks ago

Description

This PR extends the JIT-compilation on the fused cast transpose kernels using CUDA Driver API (nvrtc), which enables performance optimizations otherwise not available during runtime, and reduces the size of the TE binary libtransformer_engine.so by 4.5% (from 292M to 279M). The performance was benchmarked for the cast_transpose_dbias and cast_transpose_dbias_dgelu kernels for the matrix size 2048x12288 and different combinations of input types. The results are provided in the table below: JIT-kernels

NOTES:

Performance of the kernels remains the same, with some marginal changes (~2-6%) of nvte functions runtime.

Type of change

Changes

Checklist:

Oleg-Goncharov commented 3 weeks ago

/te-ci

Oleg-Goncharov commented 3 weeks ago

/te-ci

Oleg-Goncharov commented 3 weeks ago

/te-ci

Oleg-Goncharov commented 3 weeks ago

/te-ci

Oleg-Goncharov commented 3 weeks ago

/te-ci

Oleg-Goncharov commented 3 weeks ago

/te-ci