Repository navigation
tests: OUT_PROD perf cases at the shapes a LoRA backward emits (the price of the dequantized copy, measured) - #9
Closed
joelteply wants to merge 1 commit into
Conversation
…and 27B projections, the output head; Q4_K beside F32 and Q8_0) Measured on an RTX 5090 (CUDA 13.2): out_prod(W, dy^T) at 1024 tokens, us/run: 1536x1536 Q4_K 101; 1536x8960 429; 8960x1536 438; 5120x5120 745; 5120x17408 2948 (F32 2229, Q8_0 2698); 17408x5120 3512; the 5120x151936 head 23357. The dequantized copy costs about a third over the F32 GEMM at the ffn shape; the F32 GEMM itself is the bulk, so an F16 tensor-core GEMM on the dequantized block is the next cut. Co-Authored-By: Claude Fable 5.1 <[email protected]> Claude-Session: https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc
Author
|
Folded into #11 (its perf cases are the first commit there, the before of the BF16 cut). |
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.
Adds OUT_PROD perf cases to test-backend-ops at the shapes dx = out_prod(W, dy^T) takes in a LoRA backward at 1024 tokens: the 1.5B (1536, 8960) and 27B (5120, 17408) projections, the 27B output head (5120 x 151936), Q4_K beside F32 and Q8_0 at one shape.
Measured on an RTX 5090 (CUDA 13.2), us/run: 1536x1536 Q4_K 101 · 1536x8960 429 · 8960x1536 438 · 5120x5120 745 · 5120x17408 Q4_K 2948 / F32 2229 / Q8_0 2698 · 17408x5120 3512 · 5120x151936 head 23357.
Reading: the dequantized copy costs ~+32% over the F32 GEMM at the 27B ffn shape; the F32 GEMM is the bulk. Summed over a 27B layer (4 attention + 3 ffn projections) that is ~12 ms per layer per 1024 tokens, ~0.8 s per step across 64 layers plus the head — a ~1.3k tok/s ceiling from the out_prods alone, against a §0 gate of one third of prefill. The next cut is an F16 tensor-core GEMM (cublasGemmEx, F32 accumulate) on the dequantized block instead of Sgemm.
🤖 Generated with Claude Code
https://claude.ai/code/session_01Q4NU4VNiELPQfBpCacDZGc