Skip to content

Samsung Exynos AI LiteCore - Support yolo26 - #22960

Open
Jiseong-oh wants to merge 9 commits into
mainfrom
support-yolo26
Open

Jiseong-oh wants to merge 9 commits into
mainfrom
support-yolo26

Conversation

@Jiseong-oh

@Jiseong-oh Jiseong-oh commented Sep 20, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • Decompose remainder to floor_div+mul+sub
  • add op builder for amax, floor, floor_div, gather, max_dim
  • Refactor op builder for div, index, aplit, topk, upsample_nearest2d
  • add test and validate for yolo26
  • update annotation algorithm to cover graph topology from yolo26 model

Test plan

python test_yolo26.py -c E9955 -m yolo26s -d /path/to/images -p A8W8 --validate coco128.yaml

cc @SS-JIA @digantdesai @kimishpatel

@pytorch-bot

pytorch-bot Bot commented Sep 20, 2026 •

Copy link
Copy Markdown

🔗 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 Failures

As of commit 0e1184c with merge base 2c85103 (image):
💚 Looks good so far! There are no failures yet. 💚

This comment was automatically generated by Dr. CI and updates every 15 minutes.

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Sep 20, 2026
@github-actions

Copy link
Copy Markdown

This PR needs a release notes: label

If your change should be included in the release notes (i.e. would users of this library care about this change?), please use a label starting with release notes:. This helps us keep track and include your important work in the next release notes.

To add a label, you can comment to pytorchbot, for example
@pytorchbot label "release notes: none"

For more information, see
https://github.com/pytorch/pytorch/wiki/PyTorch-AutoLabel-Bot#why-categorize-for-release-notes-and-how-does-it-work.

@Jiseong-oh Jiseong-oh added partner: samsung For backend delegation, kernels, demo, etc. from the 3rd-party partner, Samsung module: samsung labels Sep 21, 2026
@Jiseong-oh
Jiseong-oh requested a review from psiddh September 21, 2026 00:48

@psiddh psiddh 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.

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.

Comment thread backends/samsung/builders/op_upsample_nearest2d.py Outdated
Comment thread backends/samsung/builders/op_max_dim.py
Comment thread backends/samsung/builders/op_split_with_sizes_copy.py Outdated
Comment thread backends/samsung/builders/op_split_with_sizes_copy.py Outdated
Comment thread backends/samsung/builders/op_topk.py Outdated
Comment thread examples/samsung/scripts/yolo26_validate.py Outdated
Comment thread examples/samsung/scripts/yolo26_validate.py
Comment thread examples/samsung/scripts/yolo26_validate.py
Comment thread backends/samsung/_passes/decompose_remainder.py
Comment thread backends/samsung/test/ops/test_add.py

@mergennachin mergennachin 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.

Checked this commit with Python reproductions and captured builder output. Device execution was unavailable because the ENN SDK bindings are missing on my machine.

Comment thread backends/samsung/builders/op_split_with_sizes_copy.py Outdated
Comment thread backends/samsung/builders/op_index.py Outdated
Comment thread backends/samsung/_passes/annotate_qparams.py Outdated
Comment thread backends/samsung/_passes/decompose_remainder.py
Comment thread examples/samsung/scripts/yolo26_validate.py Outdated
@Jiseong-oh

Copy link
Copy Markdown
Collaborator Author

@psiddh @mergennachin Could you let me know if you have any comments? I am waiting for this pr to approval.

Jiseong-oh added a commit that referenced this pull request Oct 2, 2026
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]:

@psiddh psiddh Oct 2, 2026 •

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.

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]

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.

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?

Jiseong-oh and others added 5 commits October 3, 2026 04:23
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>
Jiseong-oh and others added 4 commits October 3, 2026 04:23
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>
@psiddh

psiddh commented Oct 3, 2026

Copy link
Copy Markdown
Contributor

lgtm, only thing can we have qparam propagation tests as a follow-up if they are not landing in this PR?

This branch was successfully deployed

1 active deployment
cadence — 0e1184c1 Deployed Oct 3, 2026 by Jiseong-oh via hifi-op-test / hifi4 #31404
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. module: samsung partner: samsung For backend delegation, kernels, demo, etc. from the 3rd-party partner, Samsung

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants