Skip to content

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
feat/props-weight-residencyfrom
continuum/out-prod-perf-cases
Closed

joelteply wants to merge 1 commit into
feat/props-weight-residencyfrom
continuum/out-prod-perf-cases

Conversation

@joelteply

Copy link
Copy Markdown

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

…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
@joelteply

Copy link
Copy Markdown
Author

Folded into #11 (its perf cases are the first commit there, the before of the BF16 cut).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant