Repository navigation
engine: refuse any blob the kernels cannot run safely - #3
Merged
Merged
Conversation
From the review of majestic's copy. The model is a file on the camera, so a malformed one must be refused at open, not trusted into a kernel. parse() now requires: - an even input (NV21 reads chroma in pairs) and int8 zero points; - a 1x1 convolution with stride 1 and no padding, as its kernel assumes, and padding below the kernel size; - requant shifts in range for the add as well as the convolution; - every op to read a tensor an earlier op produced as int8 and write a new one, so execution order and storage are known; - float detection heads on matching grids; - all activations together within 8 MiB, counted in 64 bits. The decode bounds every box distance before it becomes an int, and the lab-only profiling code is gone. The release outputs are unchanged: a full build gives the same person.pdnet, person.json and points.md, with the host and ARM NEON builds still identical to the reference.
PR Summary by QodoReject unsafe model blobs before running detector kernels
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Code Review by Qodo
1.
|
From review: a 1024-stride cap could shorten a box that still fits an int. 1e6 strides at a stride of at most 64 keeps every edge inside an int and changes no box that fits one.
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.
From the review of majestic's copy of this engine (widgetii/majestic#1030): the model is a file on the camera, so a malformed one must be refused when it is opened, not trusted into a kernel.
parse()now requires:The decode bounds each box distance before it becomes an int. The lab-only profiling code is removed.
Unchanged outputs: a full
scripts/build.shproduces the sameperson.pdnetandperson.json(identicalSHA256SUMS) and the samepoints.md. The host and ARMv7 NEON builds are still bit-identical to the reference, and the ARM build finds exactly the host's boxes on all 3000 crops. majestic'stests/detect/pdnet.cexercises each rejection.