[ROCm] Optimize AMD normalization backward kernel by using tiled and two pass implementations where they are most efficient. - #3424
Conversation
… it accordingly with tiled one where performance is better.
|
Jenkins build for 20a3ce6fac4bcf46d9846f98270b85ce3346efc5 commit finished as FAILURE |
|
Results of related unit tests run: Ran 6 tests in 6.364s OK Ran 1 test in 3.070s OK ok ok ok ok Ran 218 tests in 15.669s OK (skipped=31) |
Total: 4/4 tests passed, 0 failed. |
Hugging Face model dropped 5-10% after switching to tiled kernel (10+ model and tests).
Implemented mixed approach, using combination of Tiled and Two Pass:
Hugging Face (huggingface_bart) performance is back:
Legacy Two pass performance=1652, 1644
Tiled performance =1574, 1568
Mixed performance =1649, 1652
Synthetic reproducer where performance from chess board like became uniform, keeping benefits from both implementation:
Layer Norm Backward Benchmark: Tiled only vs Tiled+Two pass
Device: AMD Instinct MI350X | Warmup: 20 | Iters: 100 | Runs averaged: 3
Tiled only: PID 3151521 (built from PID 3155055)
Tiled+Two pass: PID 3160321
Summary (avg µs over 3 runs)
Δ = Tiled only − Tiled+Two pass (negative = Two pass faster). Speedup = Tiled only / Tiled+Two pass.
cc @jeffdaily @sunway513 @jithunnair-amd @pruthvistony @ROCmSupport @jataylo @hongxiayang @naromero77amd @pragupta @jerrymannil @xinyazhang
Submission Checklist