Skip to content

preserve compilation failures through evaluation and cleanup - #182

Open
ZenAlexa wants to merge 1 commit into
ScalingIntelligence:mainfrom
ZenAlexa:contrib/181-compilation-result
Open

ZenAlexa wants to merge 1 commit into
ScalingIntelligence:mainfrom
ZenAlexa:contrib/181-compilation-result

Conversation

@ZenAlexa

@ZenAlexa ZenAlexa commented Nov 14, 2026 •

Copy link
Copy Markdown

Why

Compilation failures containing lock or No such file or directory currently return None, including an undefined block_size variable and a missing source file. The batch evaluator forwards that result to its JSON writer, which raises AttributeError and stops before later samples run. This path has no retry owner.

What changed

Return the existing KernelExecResult(compiled=False) for exceptions caught by the compilation/loading guard, retaining their original exception type and diagnostic. Failed samples follow the existing persistence path and the next sample can execute.

Also remove the temporary module source when a file-backed import fails before transferring ownership to the evaluator. Source and import bytecode share the same cleanup helper on failure and normal completion. The profiling consumer continues to use that existing cleanup path.

Fixes #181. #134 also changes the None branch to a structured failure result and labels those errors LockFileError. This patch removes the substring classification, preserves the actual NameError or FileNotFoundError, and covers temporary-module cleanup and the complete batch lifecycle. The subsequent model-constructor exception handling discussed in #159 and #160 stays unchanged.

Verification

  • Added two pytest-discovered lifecycle scenarios using a real GPU, the local dataset loader, generated source files, spawned batch workers and the actual JSON writer. The cuda and triton loader paths each process undefined tile_size, undefined block_size, a missing file, invalid syntax and a valid tensor-addition sample in that order.
  • On main at 423217d9fda91e0c2d67e4a43bf62f96f6d104f1, both scenarios stop at the block_size result with AttributeError, and only the first sample is persisted. The temporary-file path also leaves both imported source files and their bytecode behind.
  • The candidate gives 2 passed. Each loader persists four compilation failures with their diagnostics and then a compiled, correct fifth sample, checked on two randomized CUDA inputs. No temporary module source or bytecode remains.
  • Execution used Linux, Python 3.10.20, PyTorch 2.9.0+cu128, CUDA 12.8 and one H200. Packages required by the batch entry were installed into an isolated run directory. No hosted model calls or Modal jobs were used.
  • The new scenario passes Ruff and formatting checks, and Python compilation and git diff --check pass. The selected fatal checks on eval.py report the same pre-existing unresolved BaseDataset annotation on the original and candidate revisions.

These runs exercise the CUDA runtime and both source-loading mechanisms with a PyTorch addition model. Native CUDA compiler failures, actual Triton JIT kernels, other DSLs, ROCm and Nsight profiling remain unrun.

Copilot AI balanced review requested due to automatic review settings November 14, 2026 08:05

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

eval_kernel_against_ref returns None for compile errors whose text contains "lock" (such as block_size), which crashes eval_from_generations.py

2 participants