CI: test the generated Arduino library on pull requests - #3
Open
psiddh wants to merge 1 commit into
Open
Conversation
The library is generated from this repository, so an ExecuTorch change can break it without touching examples/arduino at all. Nothing checked that. The job builds the library, verifies the shipped models against it, compiles every example for arduino:zephyr:unoq, and runs arduino-lint in Library Manager submission mode. It runs on changes under examples/arduino, backends/cortex_m, kernels/portable, runtime, and schema, which is the set that can break any of the four. verify_models.py is the part worth having. A .pte records how many values each operator call puts on the stack, and the generated kernel wrappers reject anything else; the two only agree when the model and the library came from the same commit. Cortex-M schemas change - scratch was added to the conv operators in pytorch#19636 and pytorch#19825 - and a mismatch is invisible until far too late, because the program loads, every operator resolves, and then execute returns InvalidProgram naming nothing useful. Tracking that down by hand took the better part of a day. The check compares the two directly in about a second, needs no board, and reports: FAIL KeywordSpotting cortex_m::quantized_avg_pool2d.out: model supplies 10, library expects 11 Compiling is deliberately not the whole job. Every failure worth finding in this library compiled cleanly first, so the model check runs before the sketches and arduino-lint guards the thing users actually install. Authored with Claude Code (Opus 5).
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 freeto 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.
Summary
The library is generated from this repository, so an ExecuTorch change can break it without touching examples/arduino at all. Nothing checked that.
The job builds the library, verifies the shipped models against it, compiles every example for arduino:zephyr:unoq, and runs arduino-lint in Library Manager submission mode. It runs on changes under examples/arduino, backends/cortex_m, kernels/portable, runtime, and schema, which is the set that can break any of the four.
verify_models.py is the part worth having. A .pte records how many values each operator call puts on the stack, and the generated kernel wrappers reject anything else; the two only agree when the model and the library came from the same commit. Cortex-M schemas change - scratch was added to the conv operators in pytorch#19636 and pytorch#19825 - and a mismatch is invisible until far too late, because the program loads, every operator resolves, and then execute returns InvalidProgram naming nothing useful. Tracking that down by hand took the better part of a day. The check compares the two directly in about a second, needs no board, and reports:
FAIL KeywordSpotting
cortex_m::quantized_avg_pool2d.out: model supplies 10, library expects 11
Compiling is deliberately not the whole job. Every failure worth finding in this library compiled cleanly first, so the model check runs before the sketches and arduino-lint guards the thing users actually install.