Repository navigation
Conversation
Author
|
There is also a known bug in |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Major speedup for
LayerNormon small feature shapes via tiling compute. Origin is in my own application ofliger_kerneltraining very small (edge) networks. Working well for me on H100, and appears to be a general win, though open to redesign or scope limitation if needed.BLOCK_SIZE <= 256,n_rows >= 4096) now process up to 64 rows per 4,096-element tile (_block_layer_norm_forward_kernel/_block_layer_norm_backward_kernel), and the backward kernel runs up to four persistent programs per SM on that path.> 256columns) and small row counts (< 4,096rows) keep the existing single-row path unchanged, androw_mode=Trueforces the single-row path (matchingops/rms_norm.py).Benchmark (NVIDIA H100 80GB HBM3,
7,864,320rows,bfloat16,triton.testing.do_benchmedian ms)Testing Done
make testto ensure correctness (5325 passed, 1146 skipped, 21 xfailed, includingtest_liger_layer_norm_block_rowacross ragged row counts and odd hidden sizes)make checkstyleto ensure code stylemake test-convergenceto ensure convergence