Validate the independent FLA 0.5 compatibility path - #18
Open
morluto wants to merge 1 commit into
Open
Conversation
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.
TL;DR
Test FlashKDA directly against FLA's independent Triton
chunk_kdaimplementation using the matching raw-gate, raw-beta, and state-layout contract.Motivation
The existing FLA comparison does not directly assert FlashKDA against FLA's chunked implementation:
chunk_kdaoutput without asserting it.chunk_kdaback into FlashKDA, producing a self-comparison.FLA 0.5.1 provides the interface required to exercise the intended compatibility path.
Comparison path
Changes
flash-linear-attention>=0.5.1,<0.6.use_gate_in_kernel=Trueuse_beta_sigmoid_in_kernel=Truesafe_gate=Truestate_v_first=TrueFLA_FLASH_KDAfor the independent reference and benchmark.Recurrence scope
This PR does not change the FlashKDA recurrence.
FLA's KDA path applies beta while forming its triangularly transformed
uandwterms. The resulting update is algebraically equivalent to FlashKDA's beta-scaled residual followed by the triangular inverse.Suggested review order
tests/test_fwd.py— independent reference selection and direct assertions.README.mdandtests/test.sh— declared FLA compatibility contract.benchmarks/bench_fwd.py— independent baseline configuration.benchmarks/generate_benchmark_md.py— synchronized benchmark metadata.The main risk to inspect is accidental redispatch from FLA back into FlashKDA.
Validation
python -m py_compile benchmarks/bench_fwd.py benchmarks/generate_benchmark_md.py tests/test_fwd.pybash -n tests/test.shgit diff --check origin/master...HEAD