feat: support customizable and per-input absolute/relative tolerances for kernel evaluation - #79
Merged
Merged
Conversation
|
Caution The consumer version of Gemini Code Assist on GitHub has been sunset. All code review activity has officially ceased. |
NinaCai
approved these changes
Jul 31, 2026
NinaCai
left a comment
Collaborator
There was a problem hiding this comment.
We should later add multiple configs later, and have separate tolerance for each set of config.
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.
This PR enhances the JAX kernel evaluation framework by introducing support for customizable and per-input absolute (
atol) and relative (rtol) tolerances. Previously, evaluation tolerances were hardcoded or limited to single scalar float values (defaulting to1e-3) via string replacement in the harness template.With this change, tolerances can be specified:
kernel_task.yaml).--atol,--rtol) as single scalars or lists of floats (this will override values from the yaml file).JAXKernelEvaluatorandbenchmark.py.Key Changes
Core Harness & Per-Input Tolerance Resolution (harness_code.py)
{atol}/{rtol}template string substitution with JSON-driven configuration loading (task_info["atol"]/task_info["rtol"]).Evaluator & Benchmark Pipeline (jax_kernel_evaluator.py, benchmark.py)
atolandrtoltype annotations acrossevaluate(),_evaluate_local(), and_evaluate_remote()fromfloattoOptional[Union[float, List[float]]].Task Data Model & Code Adapter (kernel_task.py, evaluation_utils.py, code_adapter.py)
KernelTaskdataclass to include optionalatolandrtolfields (Optional[Union[float, List[float]]] = None).load_kernel_task_from_yamlandCodeAdapter.generate_kernel_taskto parse and propagate task-level tolerance configurations.Benchmark Dataset Updates (
kernel_task.yamlfiles)atolandrtolthresholds across all 50 evaluation task YAMLs inMaxKernel/evaluation/jaxbench_adapted_dataset/andMaxKernel/evaluation/examples/dsv4/, tailored to each task's numerical stability requirements