Samsung Exynos AI LiteCore - Support yolo26 - #22960
Jiseong-oh wants to merge 9 commits into
Conversation
🔗 Helpful Links🧪 See artifacts and rendered test results at hud.pytorch.org/pr/pytorch/executorch/22960
Note: Links to docs will display an error until the docs builds have been completed. ✅ No FailuresAs of commit 0e1184c with merge base 2c85103 ( This comment was automatically generated by Dr. CI and updates every 15 minutes. |
This PR needs a
|
c9195e5 to
9d35e34
Compare
psiddh
left a comment
There was a problem hiding this comment.
Automated review of the yolo26 enablement changes. I checked the branch out into a worktree and verified several of these by execution rather than inspection (noted inline).
Highest priority: the op_upsample_nearest2d.py scale-factor change reads out_shape[0]/out_shape[1] (N and C) instead of [-2]/[-1]; I reproduced [0.0625, 0.25] instead of [2.0, 2.0] using the module already in test_upsample_nearest2d.py. Close behind: op_max_dim.py's guard is and-chained and drops the indices output in the only state RemoveGetItemPass can leave it in, and op_split_with_sizes_copy.py's copied_indices bookkeeping only lines up when getitem users happen to be in ascending order.
Worth noting on the positive side: removing DecomposeScaledDotProductAttention from quantize_module is correct — prepare_pt2e already runs it via EnnQuantizer.transform_for_annotation → transform_for_annotation_pass. And routing transform_for_export_pass through to_edge_transform_and_lower_to_enn fixes a real inconsistency with samsung_tester.py.
One process note: this adds five op builders and a new pass with no new tests under backends/samsung/test/ops/. An op-level test would have caught the upsample bug directly.
This review was generated by an AI reviewer (Claude Code). Findings are offered as starting points — please verify each one against your own understanding of the ENN backend before acting.
9d35e34 to
42b8a63
Compare
42b8a63 to
462c341
Compare
|
@psiddh @mergennachin Could you let me know if you have any comments? I am waiting for this pr to approval. |
Updated saven_tensors code. this code will be merged in #22960 Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
| _impl(user, res_list) | ||
| return res_list | ||
|
|
||
| def _walk_qdq_chain_to_terminals(self, cur: Node) -> List[Node]: |
There was a problem hiding this comment.
Could we add focused graph-level tests for _walk_qdq_chain_to_terminals and the backward qparam propagation path? In particular: silu -> split/chunk, Q/DQ fanout, clone/contiguous, and a negative case where multi-input ops are not backward-propagated. If not in this PR, please track it as follow-up since any issues here could become silent accuracy regressions.
| return False | ||
|
|
||
| axis = len(indices) - 1 | ||
| target_indices_node = indices[axis] |
There was a problem hiding this comment.
This still appears to assume the single non-None index is the last entry in indices. For a case like x[index, None], target_indices_node = indices[-1]would beNone. Could we find the actual non-None index and use its position as axis`, while still rejecting multiple non-None indices?
silu which is followed by split operator is not properly annotated to have qparam. detect activation function by backward propagation search Co-Authored-By: Jintech Noh <jintech.noh@samsung.com> Co-Authored-By: Jingya Zhang <jingya.zhang@samsung.com> Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
split_with_sizes_copy's getitem users may only consume part of the op's output, so propagate quantization parameters per-output instead of assuming every output is used, and support having output branches with differing quant params. Co-Authored-By: Jintech Noh <jintech.noh@samsung.com> Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
Regarding remainder op, decompose it into the equivalent div/floor/mul/sub sequence before lowering and Wire the new pass into EnnPassManager. Co-Authored-By: Jingya Zhang <jingya.zhang@samsung.com> Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
Register the four new NodeVisitors in builders/__init__.py, and add aten.floor_divide.default to EnnPartitioner.ops_to_not_decompose so the new op_floor_divide visitor actually sees the op instead of its decomposition. Co-Authored-By: Jingya Zhang <jingya.zhang@samsung.com> Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
Refactor op_topk.py's output/dim handling and simplify op_index.py. Co-Authored-By: Jingya Zhang <jingya.zhang@samsung.com> Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
Wire EnnPassManager's transform_for_export_pass into to_edge_transform_and_lower_to_enn, drop the now-redundant DecomposeScaledDotProductAttention call from quantize_module, and rewrite examples/samsung/utils.py's save_tensors to recursively walk arbitrary nested tensor structures instead of a flat list. Add the yolo26 model test and validation example script, and loosen test_add's atol for the new coverage. Co-Authored-By: Jingya Zhang <jingya.zhang@samsung.com> Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
- op_upsample_nearest2d: Replaced the 2-element output_size argument with get_shape(node) - op_max_dim : The guard was and-chained, so len(users) == 1 short-circuited it to False and it never rejected anything - op_split_with_sizes_copy : Copied_indices was appended for every (output_idx, user) pair scanned rather than only on a match - op_topk : output tensors were appended in node.users iteration order rather than by getitem index - yolo26_validate : Updated according to review comments Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
Signed-off-by: Jiseong Oh <jiseong.oh@samsung.com>
- locate the index tensor by position in aten.index.Tensor - Save nested tensor structures when dumping LLM inputs and outputs Signed-off-by: jiseong.oh <jiseong.oh@samsung.com>
462c341 to
0e1184c
Compare
|
lgtm, only thing can we have qparam propagation tests as a follow-up if they are not landing in this PR? |
Summary
Test plan
python test_yolo26.py -c E9955 -m yolo26s -d /path/to/images -p A8W8 --validate coco128.yaml
cc @SS-JIA @digantdesai @kimishpatel