[autotune] Add observed heuristic seeds#2378
Draft
choijon5 wants to merge 2 commits into
Draft
Conversation
Extends observed-heuristics with:
1. Three quantized-matmul kernel classes: matmul_int4, matmul_int16,
matmul_fp4. classify_runtime_kernel now takes an optional kernel
arg to fingerprint int4 vs fp4 from kernel source (their tensor
shapes and dtypes are identical). Quantized kernels lack the
"matmul" workload trait (manual outer-product + sum instead of
hl.dot), so a secondary classification branch triggers on
{"reduction","sum_reduction"} + packed-int8 signature.
2. Top-level `fallbacks` block in observed_heuristics_b200.json used
when exact-bucket rule lookup misses. Shape-groups per family
are returned by _fallback_group_for_class:
- matmul: small_m / small_n / small_k / balanced / rect
- row_*: short / narrow / wide / square
- elementwise: tiny / mid / huge
- attention: short_seq / long_seq / small_head / mid_seq
3. JSON now has 30 rules (9 existing attention/matmul/row_softmax
+ 21 new quantized-GEMM) and 15 fallback entries (5 groups * 3
quantized kernels). Quantized rules are keyed on the matmul
bucketing scheme already used for regular matmul, with the
dtype slot separating the kernels (int4/fp4/int16 weight
operand all produce arg0_dtype=bf16 -> dtype_family=fp16_bf16).
Pre-existing attention/matmul/row_softmax rules resolve identically.
test_observed_heuristics.py: all 4 tests pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
871d0a3 to
bf16ebc
Compare
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.
No description provided.