Add matmul_supported, UnsupportedConfigError, and negative plan caching - #11
Merged
Merged
Conversation
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
AntonOresten
force-pushed
the
matmul-supported
branch
from
August 7, 2026 22:37
9238a44 to
31200dc
Compare
The routing surface: let a caller ask whether cuBLASLt can serve a matmul before committing to it, cheaply and repeatedly. - `UnsupportedConfigError`: typed replacement for the string-matched ArgumentError when the heuristic finds no algorithm. Both spellings of "no algorithm" (empty heuristic result, NOT_SUPPORTED from the call itself) now become this one exception. - `matmul_supported(D, A, B; kws...) -> Bool`: same signature as matmul!, no launch. Builds the plan and leaves it in the cache, so a `true` answer makes the following matmul! free of heuristic cost. Malformed arguments still throw — `false` strictly means "no algorithm exists". - Plan cache reworked: negative results (UnsupportedConfigError) are memoized alongside plans — "no algorithm" is a stable fact reached only after a full heuristic query. The 256-entry bound with wholesale eviction is gone; a workload with 257 live configurations previously thrashed permanently. - Workspace docs: spell out the caller-supplied-workspace contract as the graph-capture seam (plan.workspace_size known before any launch, apply becomes allocation-free). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
AntonOresten
force-pushed
the
matmul-supported
branch
from
August 7, 2026 22:58
31200dc to
fb6be43
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.
The routing surface: let a caller ask whether cuBLASLt can serve a matmul before committing to it, cheaply and repeatedly.
UnsupportedConfigError— typed replacement for the string-matchedArgumentErrorwhen the heuristic finds no algorithm. cuBLASLt reports "no algorithm" in two spellings (an empty heuristic result, orNOT_SUPPORTEDthrown by the heuristic call itself, depending on configuration and architecture); both now become this one exception.matmul_supported(D, A, B; kws...) -> Bool— same signature asmatmul!, no launch. A router can pick between cuBLASLt and a fallback withouttry/catch. The probe builds the plan and leaves it in the cache, so atrueanswer makes the followingmatmul!free of heuristic cost. Malformed arguments still throw:falsestrictly means cuBLASLt has no algorithm, never you called this wrong.UnsupportedConfigErroris memoized alongside plans: it's a stable fact about this device and this library, reached only after a full (not cheap) heuristic query. Argument errors are not cached.empty_plan_cache!remains.plan.workspace_sizeis known before any launch, so a caller carves bytes from its own arena and the apply is allocation-free.New
test/cache.jlcovers the probe, the negative cache (on devices below CC 10.0, via an MXFP8 request), and the caller-supplied-workspace contract (reuse across applies, slab views, too-small rejection). Verified locally on RTX 6000 Ada (CC 8.9): new tests 19/19, existing plan/matmul/compute_types suites clean.🤖 Generated with Claude Code