-
Notifications
You must be signed in to change notification settings - Fork 29
Align DeepSeek V4 per-output compare with reference tolerance #277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -427,7 +427,7 @@ def init_kv_cache(): | |||||
|
|
||||||
| if __name__ == "__main__": | ||||||
| import argparse | ||||||
| from golden import RunConfig, bf16_allclose_or_ulp, run_jit | ||||||
| from golden import RunConfig, bf16_allclose_or_ulp, ratio_allclose, run_jit | ||||||
|
|
||||||
| parser = argparse.ArgumentParser() | ||||||
| parser.add_argument("-p", "--platform", type=str, default="a2a3", | ||||||
|
|
@@ -449,7 +449,12 @@ def init_kv_cache(): | |||||
| device_id=args.device, | ||||||
| enable_l2_swimlane=args.enable_l2_swimlane, | ||||||
| ), | ||||||
| compare_fn={"kv_cache": bf16_allclose_or_ulp()}, | ||||||
| compare_fn={ | ||||||
| "kv": ratio_allclose(atol=1e-4, rtol=1.0 / 128, max_error_ratio=0.0), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR summary states that the
Suggested change
|
||||||
| "kv_state": ratio_allclose(atol=1e-3, rtol=1e-3, max_error_ratio=0.0), | ||||||
| "score_state": ratio_allclose(atol=1e-3, rtol=1e-3, max_error_ratio=0.0), | ||||||
| "kv_cache": bf16_allclose_or_ulp(), | ||||||
| }, | ||||||
| ), | ||||||
| ) | ||||||
| if not result.passed: | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -427,7 +427,7 @@ def init_kv_cache(): | |||||
|
|
||||||
| if __name__ == "__main__": | ||||||
| import argparse | ||||||
| from golden import RunConfig, bf16_allclose_or_ulp, run_jit | ||||||
| from golden import RunConfig, bf16_allclose_or_ulp, ratio_allclose, run_jit | ||||||
|
|
||||||
| parser = argparse.ArgumentParser() | ||||||
| parser.add_argument("-p", "--platform", type=str, default="a2a3", | ||||||
|
|
@@ -449,7 +449,12 @@ def init_kv_cache(): | |||||
| device_id=args.device, | ||||||
| enable_l2_swimlane=args.enable_l2_swimlane, | ||||||
| ), | ||||||
| compare_fn={"kv_cache": bf16_allclose_or_ulp()}, | ||||||
| compare_fn={ | ||||||
| "kv": ratio_allclose(atol=1e-4, rtol=1.0 / 128, max_error_ratio=0.0), | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The PR summary states that the
Suggested change
|
||||||
| "kv_state": ratio_allclose(atol=1e-3, rtol=1e-3, max_error_ratio=0.0), | ||||||
| "score_state": ratio_allclose(atol=1e-3, rtol=1e-3, max_error_ratio=0.0), | ||||||
| "kv_cache": bf16_allclose_or_ulp(), | ||||||
| }, | ||||||
| ), | ||||||
| ) | ||||||
| if not result.passed: | ||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR summary states that the
kvoutputs for ratio 4/128 fall just outside strict allclose (~0.085% and ~0.39% bad points) but are within the 0.5% outlier allowance. However, the code here explicitly setsmax_error_ratio=0.0, which enforces strict allclose and will cause the validation to fail for these kernels. You should remove themax_error_ratio=0.0argument for thekvoutput to allow the default 0.5% outlier escape.